Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
fang::communication::ibus::ChannelSection Class Reference

#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
 

Detailed Description

This stores the bytes of the channel section. It is capable of deserializing the bytes into

Member Typedef Documentation

◆ ChannelBytes

using fang::communication::ibus::ChannelSection::ChannelBytes = std::array<Byte, kChannelSectionSize>

Constructor & Destructor Documentation

◆ ChannelSection() [1/2]

fang::communication::ibus::ChannelSection::ChannelSection ( const ChannelBytes bytes)

◆ ChannelSection() [2/2]

fang::communication::ibus::ChannelSection::ChannelSection ( const coolSerial::Bytes &  bytes)

Adapter for bytes

Member Function Documentation

◆ calculateChecksum()

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/

◆ getChannelData()

ChannelData fang::communication::ibus::ChannelSection::getChannelData ( ) const

◆ isValid()

bool fang::communication::ibus::ChannelSection::isValid ( uint16_t  checkSum) const

You can feed a checksum from the checksum section to verify


The documentation for this class was generated from the following files: