Change transmition proctocoll to new version
This commit is contained in:
@ -7,24 +7,29 @@
|
||||
class W433DataTransmitter
|
||||
{
|
||||
private:
|
||||
|
||||
static constexpr uint16_t LARGE_TIME = 2000;
|
||||
static constexpr uint16_t SMALL_TIME = 500;
|
||||
static constexpr uint16_t SYNC_TIME = 800;
|
||||
|
||||
static constexpr uint8_t signature = 0xA5;
|
||||
volatile unsigned char * const _port;
|
||||
const unsigned char _pin;
|
||||
|
||||
void sendBit(const bool bit);
|
||||
void sendSyncpulse();
|
||||
void sendRawData(const uint8_t data);
|
||||
void sendEndPulse();
|
||||
static constexpr uint16_t BIT_RATE = 2000;
|
||||
static constexpr int32_t DELAY_US = 1000000/BIT_RATE;
|
||||
static constexpr int16_t LONG_DELAY_MS = 10;
|
||||
static constexpr uint16_t SIGNATURE = 0xb38;
|
||||
volatile unsigned char * const _port;
|
||||
const unsigned char _pin;
|
||||
|
||||
void sendSymbol(const uint8_t data);
|
||||
void sendData(const uint8_t data);
|
||||
|
||||
static constexpr int SYMBOL_TABLE_SIZE = 16;
|
||||
static constexpr uint8_t symbols[SYMBOL_TABLE_SIZE] =
|
||||
{
|
||||
0xd, 0xe, 0x13, 0x15, 0x16, 0x19, 0x1a, 0x1c,
|
||||
0x23, 0x25, 0x26, 0x29, 0x2a, 0x2c, 0x32, 0x34
|
||||
};
|
||||
|
||||
uint16_t calcCrc(const uint32_t data);
|
||||
|
||||
public:
|
||||
|
||||
W433DataTransmitter(volatile unsigned char * const port, const unsigned char pin);
|
||||
void send(const uint8_t* const data, uint16_t length);
|
||||
void send(const uint8_t data);
|
||||
void sendPacket(const uint32_t data);
|
||||
W433DataTransmitter(volatile unsigned char * const port, const unsigned char pin);
|
||||
void send(const uint8_t* const data, uint16_t length);
|
||||
void send(const uint8_t data);
|
||||
void sendPacket(const uint32_t data);
|
||||
};
|
||||
|
Reference in New Issue
Block a user