Main class for implementation of the AskSin protocol stack. Every device needs exactly one instance of this class. More...
#include <AS.h>
Public Member Functions | |
void | init (void) |
Initialize the AS module. More... | |
void | poll (void) |
Poll routine for regular operation. More... | |
void | sendDEVICE_INFO (void) |
void | sendACK (void) |
void | sendACK_STATUS (uint8_t cnl, uint8_t stat, uint8_t dul) |
void | sendNACK (void) |
void | sendNACK_TARGET_INVALID (void) |
void | sendINFO_ACTUATOR_STATUS (uint8_t cnl, uint8_t stat, uint8_t cng) |
void | sendINFO_TEMP (void) |
void | sendHAVE_DATA (void) |
void | sendSWITCH (void) |
void | sendTimeStamp (void) |
void | sendREMOTE (uint8_t cnl, uint8_t burst, uint8_t *pL) |
void | sendSensor_event (uint8_t cnl, uint8_t burst, uint8_t *pL) |
void | sendSensorData (void) |
void | sendClimateEvent (void) |
void | sendSetTeamTemp (void) |
void | sendWeatherEvent (void) |
void | send_generic_event (uint8_t cnl, uint8_t burst, uint8_t mTyp, uint8_t len, uint8_t *pL) |
Send an event with arbitrary payload. More... | |
Public Attributes | |
EE | ee |
eeprom module | |
SN | sn |
send module | |
RG | rg |
user module registrar | |
CB | confButton |
config button | |
LD | ld |
status led | |
PW | pw |
power management | |
CC | cc |
load communication module | |
BT | bt |
Protected Member Functions | |
void | decode (uint8_t *buf) |
void | encode (uint8_t *buf) |
void | explainMessage (uint8_t *buf) |
Friends | |
class | SN |
class | RV |
class | RG |
class | PW |
Main class for implementation of the AskSin protocol stack. Every device needs exactly one instance of this class.
AS is responsible for maintaining the complete infrastructure from device register representation, non-volatile storage of device configuration in the eeprom, to providing interfaces for user modules that implement actual device logic.
This is a very simple, non-working example of the basic API used in the main routines:
All send functions are used by sensor or actor classes like THSensor or Dimmer.
void AS::init | ( | void | ) |
void AS::poll | ( | void | ) |
Poll routine for regular operation.
poll() needs to be called regularily from the main loop(). It takes care of all major tasks like sending and receiving messages, device configuration and message delegation.
void AS::send_generic_event | ( | uint8_t | cnl, |
uint8_t | burst, | ||
uint8_t | mTyp, | ||
uint8_t | len, | ||
uint8_t * | pL | ||
) |
Send an event with arbitrary payload.
Take care when sending generic events, since there are no consistency checks if the specified event type and payload make any sense. Rather use predefined special send methods.
cnl | The channel |
burst | Set to 1 for burst mode, or 0 |
mTyp | Event frame type |
len | Length of payload in bytes, not more than 16 |
pL | pointer to first byte of payload |