MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/driver/BiSSCDataChannel.hh
2024-06-07 11:12:56 +03:00

56 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* BiSSCDataChannel.hh
*
* Created on: 31 окт. 2021 г.
* 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; //!<Поля абонента.
//todo: add crc control.
};
}
#endif /* UMLIBRARY_DRIVER_BISSCDATACHANNEL_HH_ */