Handles CAN Aerospace message header and decodes node services. More...
#include <canaerobusconnector.h>
Public Member Functions | |
CanAeroBusConnector (CanAeroDataManager *manager, NetworkConnector< can_t > *connector, uint8_t own_node_id, uint8_t config_revision) | |
void | doHouseKeeping () |
uint8_t | ownNodeId () const |
void | send (const can_t &msg) |
void | send (const std::vector< can_t > &msg) |
void | sendSTS (uint8_t node_id=BROADCAST_NODE_ID) |
void | sendDRS (can_Id_t can_id, uint8_t node_id=BROADCAST_NODE_ID) |
void | sendIDS (uint8_t node_id=BROADCAST_NODE_ID) |
void | receiveMessage (const can_t &msg) |
void | receiveMessage (const std::vector< can_t > &msg) |
void | requestModule (uint8_t node_id, uint16_t module, uint16_t mode) |
bool | isModuleActive (uint8_t node_id, uint16_t module) |
bool | isClientActive (uint8_t node_id) |
Handles CAN Aerospace message header and decodes node services.
For communicating with CAN Aerospace, various node services must be handled and some book keeping on connected clients must be done. This class handles all this.
SCS::CanAeroBusConnector::CanAeroBusConnector | ( | CanAeroDataManager * | manager, |
NetworkConnector< can_t > * | connector, | ||
uint8_t | own_node_id, | ||
uint8_t | config_revision | ||
) |
manager | instance handling incoming and outgoing data after protocol processing |
connector | the network-accessing instance |
own_node_id | your assigned node id or -1 for auto-configuration |
config_revision | minimum revision of SCS variables file required |
void SCS::CanAeroBusConnector::doHouseKeeping | ( | ) |
Remove all clients from the list that were silent for more than ConnectedClient::time_out seconds.
bool SCS::CanAeroBusConnector::isClientActive | ( | uint8_t | node_id | ) |
node_id | the client in question |
bool SCS::CanAeroBusConnector::isModuleActive | ( | uint8_t | node_id, |
uint16_t | module | ||
) |
node_id | the node that offers various modules |
module | the module to be queried |
uint8_t SCS::CanAeroBusConnector::ownNodeId | ( | ) | const |
void SCS::CanAeroBusConnector::receiveMessage | ( | const can_t & | msg | ) | [virtual] |
Processes service requests and responses, filters normal operation data.
msg | single packet received |
Implements SCS::BusConnector< can_t >.
void SCS::CanAeroBusConnector::receiveMessage | ( | const std::vector< can_t > & | msg | ) | [virtual] |
Processes service requests and responses, filters normal operation data.
msg | array of packets received |
Implements SCS::BusConnector< can_t >.
void SCS::CanAeroBusConnector::requestModule | ( | uint8_t | node_id, |
uint16_t | module, | ||
uint16_t | mode | ||
) |
request a module of a node to be en- or disabled.
void SCS::CanAeroBusConnector::send | ( | const std::vector< can_t > & | msg | ) | [virtual] |
msg | array of messages to send |
Implements SCS::BusConnector< can_t >.
void SCS::CanAeroBusConnector::send | ( | const can_t & | msg | ) | [virtual] |
msg | single message to send |
Implements SCS::BusConnector< can_t >.
void SCS::CanAeroBusConnector::sendDRS | ( | can_Id_t | can_id, |
uint8_t | node_id = BROADCAST_NODE_ID |
||
) |
Send data request service
request_id | the CAN id you want |
whether | identifier is 11 or 29 bit long |
node_id | addressed node, broadcast by default |
void SCS::CanAeroBusConnector::sendIDS | ( | uint8_t | node_id = BROADCAST_NODE_ID | ) |
Send identification service request
node_id | addressed node, broadcast by default |
void SCS::CanAeroBusConnector::sendSTS | ( | uint8_t | node_id = BROADCAST_NODE_ID | ) |
Send state transmission service to a node
node_id | addressed node, broadcast by default |