|
VLCB
|
a derived class to extend the base long message class to handle multiple concurrent messages, sending and receiving More...
#include <LongMessageService.h>
Public Member Functions | |
| bool | allocateContexts (byte num_receive_contexts=NUM_EX_CONTEXTS, unsigned int receive_buffer_len=EX_BUFFER_LEN, byte num_send_contexts=NUM_EX_CONTEXTS) |
| allocate memory for receive and send contexts | |
| bool | sendLongMessage (const void *msg, const unsigned int msg_len, const byte stream_id) |
| virtual void | process () override |
| void | subscribe (byte *stream_ids, const byte num_stream_ids, void(*messagehandler)(void *msg, unsigned int msg_len, byte stream_id, byte status)) |
| subscribe to a range of stream IDs | |
| virtual void | processReceivedMessageFragment (const VlcbMessage *frame) |
| handle an incoming long message Controller message fragment | |
| byte | is_sending () |
| void | use_crc (bool use_crc) |
| set whether to calculate and compare a CRC of the message | |
| Public Member Functions inherited from VLCB::Service | |
| void | setController (Controller *ctrl) |
| Set a pointer to the controller object for use in implementing class. | |
| virtual void | begin () |
| This optional method is called at the beginning of the Arduino sketch. Define this method for the service to do any setup required at the beginning. | |
| virtual void | reportDiagnostics (byte serviceIndex, byte diagnosticsCode) |
| Report a given diagnostic value. | |
| virtual int | getDiagnosticCount () |
| report how many diagnostics this service supports. | |
| virtual Data | getServiceData () |
| Return Data bytes specific for the implementing service. The meaning of each data byte is defined in the service specification. | |
Additional Inherited Members | |
| Protected Member Functions inherited from VLCB::Service | |
| bool | isThisNodeNumber (unsigned int nodeNumber) |
| Helper function to decide if a given node number is the same as that assigned to this node. | |
| Protected Attributes inherited from VLCB::Service | |
| Controller * | controller |
| Pointer to the Controller object that can be used by implementing classes. | |
a derived class to extend the base long message class to handle multiple concurrent messages, sending and receiving
| bool VLCB::LongMessageServiceEx::allocateContexts | ( | byte | num_receive_contexts = NUM_EX_CONTEXTS, |
| unsigned int | receive_buffer_len = EX_BUFFER_LEN, | ||
| byte | num_send_contexts = NUM_EX_CONTEXTS ) |
allocate memory for receive and send contexts
| bool VLCB::LongMessageServiceEx::sendLongMessage | ( | const void * | msg, |
| const unsigned int | msg_len, | ||
| const byte | stream_id ) |
initiate sending of a long message this method sends the first message - the header packet the remainder of the message is sent in fragments from the process() method
|
overridevirtual |
the process method is called regularly from the user's loop function we use this to send the individual fragments of any outgoing messages and check the message receive timeouts
Reimplemented from VLCB::LongMessageService.
| void VLCB::LongMessageServiceEx::subscribe | ( | byte * | stream_ids, |
| const byte | num_stream_ids, | ||
| void(* | messagehandler )(void *msg, unsigned int msg_len, byte stream_id, byte status) ) |
subscribe to a range of stream IDs
|
virtual |
handle an incoming long message Controller message fragment
Reimplemented from VLCB::LongMessageService.
| byte VLCB::LongMessageServiceEx::is_sending | ( | ) |
report state of long message sending returns number of streams currently in progress
| void VLCB::LongMessageServiceEx::use_crc | ( | bool | use_crc | ) |
set whether to calculate and compare a CRC of the message