modm API documentation
|
#include <modm/communication/sab/slave.hpp>
Public Member Functions | |
Slave (uint8_t address, modm::accessor::Flash< Action > list, uint8_t count) | |
Initialize the slave. More... | |
void | update () |
Receive and process messages. More... | |
Protected Member Functions | |
void | send (bool acknowledge, const void *payload, std::size_t payloadLength) |
Protected Attributes | |
uint8_t | ownAddress |
modm::accessor::Flash< Action > | actionList |
uint8_t | actionCount |
uint8_t | currentCommand |
Response | response |
SAB Slave.
A complete example is available in the example/sab
folder.
modm::sab::Slave< Interface >::Slave | ( | uint8_t | address, |
modm::accessor::Flash< Action > | list, | ||
uint8_t | count | ||
) |
Initialize the slave.
address | Own address |
list | List of all action callbacks, need to be stored in flash-memory |
count | Number of entries in actionList |
void modm::sab::Slave< Interface >::update | ( | ) |
Receive and process messages.
This method will decode the incoming messages and call the corresponding callback methods from the action list. It must be called periodically, best in every main loop cycle.