MySensors Library & Examples  2.3.2
Classes | Macros | Functions
MySensorsCore.h File Reference
#include "Version.h"
#include "MyConfig.h"
#include "MyEepromAddresses.h"
#include "MyMessage.h"
#include <stddef.h>
#include <stdarg.h>
+ Include dependency graph for MySensorsCore.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  controllerConfig_t
 Controller configuration. More...
 
struct  coreConfig_t
 Node core configuration. More...
 

Macros

#define GATEWAY_ADDRESS   ((uint8_t)0)
 Node ID for GW sketch.
 
#define NODE_SENSOR_ID   ((uint8_t)255)
 Node child is always created/presented when a node is started.
 
#define MY_CORE_VERSION   ((uint8_t)2)
 core version
 
#define MY_CORE_MIN_VERSION   ((uint8_t)2)
 min core version required for compatibility
 
#define MY_WAKE_UP_BY_TIMER   ((int8_t)-1)
 Sleeping wake up by timer.
 
#define MY_SLEEP_NOT_POSSIBLE   ((int8_t)-2)
 Sleeping not possible.
 
#define INTERRUPT_NOT_DEFINED   ((uint8_t)255)
 _sleep() param: no interrupt defined
 
#define MODE_NOT_DEFINED   ((uint8_t)255)
 _sleep() param: no mode defined
 
#define VALUE_NOT_DEFINED   ((uint8_t)255)
 Value not defined.
 
#define FUNCTION_NOT_SUPPORTED   ((uint16_t)0)
 Function not supported.
 

Functions

uint8_t getNodeId (void)
 
uint8_t getParentNodeId (void)
 
void presentNode (void)
 
bool present (const uint8_t sensorId, const mysensors_sensor_t sensorType, const char *description="", const bool requestEcho=false)
 
bool sendSketchInfo (const char *name, const char *version, const bool requestEcho=false)
 
bool send (MyMessage &msg, const bool requestEcho=false)
 
bool sendBatteryLevel (const uint8_t level, const bool requestEcho=false)
 
bool sendHeartbeat (const bool requestEcho=false)
 
bool sendSignalStrength (const int16_t level, const bool requestEcho=false)
 
bool sendTXPowerLevel (const uint8_t level, const bool requestEcho=false)
 
bool request (const uint8_t childSensorId, const uint8_t variableType, const uint8_t destination=GATEWAY_ADDRESS)
 
bool requestTime (const bool requestEcho=false)
 
controllerConfig_t getControllerConfig (void)
 
void saveState (const uint8_t pos, const uint8_t value)
 
uint8_t loadState (const uint8_t pos)
 
void wait (const uint32_t waitingMS)
 
bool wait (const uint32_t waitingMS, const mysensors_command_t cmd)
 
bool wait (const uint32_t waitingMS, const mysensors_command_t cmd, const uint8_t msgtype)
 
void doYield (void)
 
int8_t sleep (const uint32_t sleepingMS, const bool smartSleep=false)
 
int8_t sleep (const uint8_t interrupt, const uint8_t mode, const uint32_t sleepingMS=0, const bool smartSleep=false)
 
int8_t sleep (const uint8_t interrupt1, const uint8_t mode1, const uint8_t interrupt2, const uint8_t mode2, const uint32_t sleepingMS=0, const bool smartSleep=false)
 
int8_t smartSleep (const uint32_t sleepingMS)
 
int8_t smartSleep (const uint8_t interrupt, const uint8_t mode, const uint32_t sleepingMS=0)
 
int8_t smartSleep (const uint8_t interrupt1, const uint8_t mode1, const uint8_t interrupt2, const uint8_t mode2, const uint32_t sleepingMS=0)
 
int8_t _sleep (const uint32_t sleepingMS, const bool smartSleep=false, const uint8_t interrupt1=INTERRUPT_NOT_DEFINED, const uint8_t mode1=MODE_NOT_DEFINED, const uint8_t interrupt2=INTERRUPT_NOT_DEFINED, const uint8_t mode2=MODE_NOT_DEFINED)
 
uint32_t getSleepRemaining (void)
 
void _nodeLock (const char *str)
 Lock a node and transmit provided message with 30m intervals. More...
 
void _checkNodeLock (void)
 Check node lock status and prevent node execution if locked.
 
void _begin (void)
 Node initialisation.
 
void _process (void)
 Main framework process.
 
bool _processInternalCoreMessage (void)
 Processes internal core message. More...
 
void _infiniteLoop (void)
 Puts node to a infinite loop if unrecoverable situation detected.
 
void _registerNode (void)
 Handles registration request.
 
bool _sendRoute (MyMessage &message)
 Sends message according to routing table. More...
 
void receive (const MyMessage &) __attribute__((weak))
 Callback for incoming messages. More...
 
void receiveTime (uint32_t) __attribute__((weak))
 Callback for incoming time messages.
 
void presentation (void) __attribute__((weak))
 Node presentation.
 
void before (void) __attribute__((weak))
 Called before node initialises.
 
void preHwInit (void) __attribute__((weak))
 Called before any hardware initialisation is done.
 
void setup (void) __attribute__((weak))
 Called after node initialises but before main loop. More...
 
void loop (void) __attribute__((weak))
 Main loop. More...