supla-device
All Classes Functions Variables Pages
SuplaDeviceClass Class Reference
Inheritance diagram for SuplaDeviceClass:
Collaboration diagram for SuplaDeviceClass:

Public Member Functions

void fillStateData (TDSC_ChannelState *channelState)
 
void addClock (Supla::Clock *clock)
 
Supla::ClockgetClock ()
 
bool begin (const char GUID[SUPLA_GUID_SIZE], const char *Server, const char *email, const char authkey[SUPLA_AUTHKEY_SIZE], unsigned char protoVersion=23)
 
bool begin (unsigned char protoVersion=23)
 
void setName (const char *Name)
 
void setGUID (const char GUID[SUPLA_GUID_SIZE])
 
void setAuthKey (const char authkey[SUPLA_AUTHKEY_SIZE])
 
void setEmail (const char *email)
 
void setServer (const char *server)
 
void setSwVersion (const char *)
 
void setManufacturerId (int16_t)
 
void setProductId (int16_t)
 
void addFlags (int32_t)
 
void removeFlags (int32_t)
 
bool isSleepingDeviceEnabled ()
 
int generateHostname (char *, int macSize=6)
 
void onTimer (void)
 
void onFastTimer (void)
 
void iterate (void)
 
void status (int status, const __FlashStringHelper *msg, bool alwaysLog=false)
 
void setStatusFuncImpl (_impl_arduino_status impl_arduino_status)
 
void setServerPort (int value)
 
int handleCalcfgFromServer (TSD_DeviceCalCfgRequest *request, TDS_DeviceCalCfgResult *result=nullptr)
 
void enterConfigMode ()
 
void leaveConfigModeWithoutRestart ()
 
void enterNormalMode ()
 
void scheduleSoftRestart (int timeout=0)
 
void scheduleProtocolsRestart (int timeout=0)
 
void softRestart ()
 
void saveStateToStorage ()
 
void disableCfgModeTimeout ()
 
void resetToFactorySettings ()
 
void disableLocalActionsIfNeeded ()
 
void requestCfgMode (Supla::Device::RequestConfigModeType)
 
int getCurrentStatus ()
 
bool loadDeviceConfig ()
 
bool prepareLastStateLog ()
 
char * getLastStateLog ()
 
void addLastStateLog (const char *)
 
void enableLastStateLog ()
 
void disableLastStateLog ()
 
void setRsaPublicKeyPtr (const uint8_t *ptr)
 
const uint8_t * getRsaPublicKey ()
 
enum Supla::DeviceMode getDeviceMode () const
 
void setActivityTimeout (_supla_int_t newActivityTimeout)
 
uint32_t getActivityTimeout ()
 
void handleAction (int event, int action) override
 
void setAutomaticResetOnConnectionProblem (unsigned int timeSec)
 
void setLastStateLogger (Supla::Device::LastStateLogger *logger)
 
void setSuplaCACert (const char *)
 
void setSupla3rdPartyCACert (const char *)
 
Supla::Protocol::SuplaSrpcgetSrpcLayer ()
 
void setCustomHostnamePrefix (const char *prefix)
 
void enableNetwork ()
 
void disableNetwork ()
 
bool getStorageInitResult ()
 
bool isSleepingAllowed ()
 
void allowWorkInOfflineMode (int mode=1)
 
bool isRemoteDeviceConfigEnabled () const
 
void setShowUptimeInChannelState (bool value)
 
void setProtoVerboseLog (bool value)
 
bool isOfflineModeDuringConfig () const
 
Supla::MutexgetTimerAccessMutex ()
 
void setChannelConflictResolver (Supla::Device::ChannelConflictResolver *resolver)
 
void setSubdevicePairingHandler (Supla::Device::SubdevicePairingHandler *handler)
 
void setMacLengthInHostname (int value)
 
void setStatusLed (Supla::Device::StatusLed *led)
 
- Public Member Functions inherited from Supla::ActionHandler
virtual void activateAction (int action)
 
virtual bool deleteClient ()
 
virtual ActionHandlergetRealClient ()
 
- Public Member Functions inherited from Supla::LocalAction
virtual void addAction (uint16_t action, ActionHandler &client, uint16_t event, bool alwaysEnabled=false)
 
virtual void addAction (uint16_t action, ActionHandler *client, uint16_t event, bool alwaysEnabled=false)
 
virtual void runAction (uint16_t event) const
 
virtual bool isEventAlreadyUsed (uint16_t event, bool ignoreAlwaysEnabled)
 
virtual ActionHandlerClientgetHandlerForFirstClient (uint16_t event)
 
virtual ActionHandlerClientgetHandlerForClient (ActionHandler *client, uint16_t event)
 
virtual void disableOtherClients (const ActionHandler &client, uint16_t event)
 
virtual void enableOtherClients (const ActionHandler &client, uint16_t event)
 
virtual void disableOtherClients (const ActionHandler *client, uint16_t event)
 
virtual void enableOtherClients (const ActionHandler *client, uint16_t event)
 
virtual void disableAction (int32_t action, ActionHandler *client, int32_t event)
 
virtual void enableAction (int32_t action, ActionHandler *client, int32_t event)
 
virtual bool disableActionsInConfigMode ()
 

Public Attributes

Supla::Uptime uptime
 

Protected Member Functions

void iterateAlwaysElements (uint32_t _millis)
 
bool iterateNetworkSetup ()
 
bool iterateSuplaProtocol (uint32_t _millis)
 
void handleLocalActionTriggers ()
 
void checkIfRestartIsNeeded (uint32_t _millis)
 
void createSrpcLayerIfNeeded ()
 
void setupDeviceMode ()
 

Protected Attributes

int networkIsNotReadyCounter = 0
 
uint32_t deviceRestartTimeoutTimestamp = 0
 
uint32_t protocolRestartTimeoutTimestamp = 0
 
uint32_t waitForIterate = 0
 
uint32_t lastIterateTime = 0
 
uint32_t enterConfigModeTimestamp = 0
 
uint32_t forceRestartTimeMs = 0
 
uint32_t protocolRestartTimeMs = 0
 
uint32_t resetOnConnectionFailTimeoutSec = 0
 
int allowOfflineMode = 0
 
int currentStatus = STATUS_UNKNOWN
 
enum Supla::DeviceMode deviceMode = Supla::DEVICE_MODE_NOT_SET
 
Supla::Device::RequestConfigModeType goToConfigModeAsap = Supla::Device::None
 
bool triggerResetToFactorySettings = false
 
bool triggerStartLocalWebServer = false
 
bool triggerStopLocalWebServer = false
 
bool triggerCheckSwUpdate = false
 
bool requestNetworkLayerRestart = false
 
bool isNetworkSetupOk = false
 
bool skipNetwork = false
 
bool storageInitResult = false
 
bool configEmpty = true
 
bool atLeastOneProtoIsEnabled = false
 
bool showUptimeInChannelState = true
 
bool lastStateLogEnabled = true
 
bool initializationDone = false
 
uint8_t goToOfflineModeTimeout = 0
 
uint8_t macLengthInHostname = 6
 
Supla::Protocol::SuplaSrpcsrpcLayer = nullptr
 
Supla::Device::SwUpdateswUpdate = nullptr
 
const uint8_t * rsaPublicKey = nullptr
 
Supla::ElementiterateConnectedPtr = nullptr
 
_impl_arduino_status impl_arduino_status = nullptr
 
Supla::Device::LastStateLoggerlastStateLogger = nullptr
 
char * customHostnamePrefix = nullptr
 
Supla::MutextimerAccessMutex = nullptr
 
Supla::Device::SubdevicePairingHandlersubdevicePairingHandler = nullptr
 
Supla::Device::StatusLedstatusLed = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from Supla::LocalAction
static void DeleteActionsHandledBy (const ActionHandler *client)
 
static void DeleteActionsTriggeredBy (const LocalAction *action)
 
static void NullifyActionsHandledBy (const ActionHandler *client)
 
static ActionHandlerClientgetClientListPtr ()
 

Member Function Documentation

◆ handleAction()

void SuplaDeviceClass::handleAction ( int event,
int action )
overridevirtual

Implements Supla::ActionHandler.


The documentation for this class was generated from the following files: