ArduinoDumbDisplay v0.9.9-r53
DumbDisplay Arduino Library -- https://github.com/trevorwslee/Arduino-DumbDisplay
 
Loading...
Searching...
No Matches
DDMasterResetPassiveConnectionHelper Class Reference

Helper class to manage passive connection to DumbDisplay. The only method that should be called in void loop() {} is DDPassiveConnectionHelper::loop(), passing to it some callbacks Note that it will call DumbDisplay::masterReset() when reconnected (i.e. lost previous connection) More...

#include <__dd_misc_connect.h>

Public Member Functions

 DDMasterResetPassiveConnectionHelper (DumbDisplay &dumbdisplay, bool saveAndPlaybackWhenInit=false)
 
bool loop (void(*initializeCallback)(), void(*updateCallback)(), void(*disconnectedCallback)()=NULL)
 
bool initialized ()
 
bool firstUpdated ()
 
bool isIdle ()
 
bool justBecameIdle ()
 
void masterReset ()
 

Public Attributes

DumbDisplay & dumbdisplay
 

Detailed Description

Helper class to manage passive connection to DumbDisplay. The only method that should be called in void loop() {} is DDPassiveConnectionHelper::loop(), passing to it some callbacks Note that it will call DumbDisplay::masterReset() when reconnected (i.e. lost previous connection)

Since
v0.9.9

Constructor & Destructor Documentation

◆ DDMasterResetPassiveConnectionHelper()

DDMasterResetPassiveConnectionHelper::DDMasterResetPassiveConnectionHelper ( DumbDisplay &  dumbdisplay,
bool  saveAndPlaybackWhenInit = false 
)
inline
Parameters
saveAndPlaybackWhenInitif true, will call DumbDisplay::recordLayerCommands() / DumbDisplay::playbackLayerCommands() before and after calling initializeCallback

Member Function Documentation

◆ loop()

bool DDMasterResetPassiveConnectionHelper::loop ( void(*)()  initializeCallback,
void(*)()  updateCallback,
void(*)()  disconnectedCallback = NULL 
)
inline
Parameters
initializeCallbackcalled after DumbDisplay is connected (or reconnected)
updateCallbackcalled to update DumbDisplay components
disconnectedCallbackcalled after "master reset" DumbDisplay, i.e. lost previous connection

◆ masterReset()

void DDMasterResetPassiveConnectionHelper::masterReset ( )
inline

normally, "master reset" will be called automatically when lost connection; but can be called explicitly; note that if called explicitly, will not call disconnectedCallback; IMPORTANT: should only call it in updateCallback, and after calling it, should return immediately