|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <i_bus_channel_section.hpp>
Public Types | |
| using | ChannelBytes = std::array< Byte, kChannelSectionSize > |
Public Member Functions | |
| ChannelSection (const ChannelBytes &bytes) | |
| ChannelSection (const coolSerial::Bytes &bytes) | |
| ChannelData | getChannelData () const |
| uint16_t | calculateChecksum () const |
| bool | isValid (uint16_t checkSum) const |
This stores the bytes of the channel section. It is capable of deserializing the bytes into
| using fang::communication::ibus::ChannelSection::ChannelBytes = std::array<Byte, kChannelSectionSize> |
| fang::communication::ibus::ChannelSection::ChannelSection | ( | const ChannelBytes & | bytes | ) |
| fang::communication::ibus::ChannelSection::ChannelSection | ( | const coolSerial::Bytes & | bytes | ) |
Adapter for bytes
| uint16_t fang::communication::ibus::ChannelSection::calculateChecksum | ( | ) | const |
The IBus checksum is calculated by summing all of the bytes and subtracting them from 0xFFFF https://blog.dsp.id.au/posts/2017/10/22/flysky-ibus-protocol/
| ChannelData fang::communication::ibus::ChannelSection::getChannelData | ( | ) | const |
| bool fang::communication::ibus::ChannelSection::isValid | ( | uint16_t | checkSum | ) | const |
You can feed a checksum from the checksum section to verify