MotorControlModuleSDFM_TMS3.../Projects/EFC_Application/UMLibrary/driver/BiSSCDataChannel.hh

56 lines
1.2 KiB
C++
Raw Normal View History

/*
* BiSSCDataChannel.hh
*
* Created on: 31 <EFBFBD><EFBFBD><EFBFBD>. 2021 <EFBFBD>.
* Author: titov
*/
#ifndef UMLIBRARY_DRIVER_BISSCDATACHANNEL_HH_
#define UMLIBRARY_DRIVER_BISSCDATACHANNEL_HH_
#include "../communication/format/BinaryDataPublisher.hh"
#include <memory_resource>
#include <vector>
namespace driver {
class BiSSCDataChannel: public communication::ISubscriberRegistrator,
public communication::IBinaryDataSubscriber {
public:
struct CrcInfo {
typedef uint16_t Bits;
enum CrcPolynom {
//only biss-c compatible
None,
};
Bits crc_value_size = 0;
Bits crc_value_offset = 0;
CrcPolynom crc_polynom = None;
};
BiSSCDataChannel( std::pmr::memory_resource * memory_resource, CrcInfo crc_params = CrcInfo() );
void addSubscriber( std::size_t bit_address, std::size_t bit_len, communication::IBinaryDataSubscriber * subscriber ) override;
void read( const void * data, std::size_t size);
const bool & fault();
private:
communication::format::BinaryDataPublisher fields; //!<<3C><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
//todo: add crc control.
};
}
#endif /* UMLIBRARY_DRIVER_BISSCDATACHANNEL_HH_ */