mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-28 05:09:40 +00:00
upd
This commit is contained in:
@ -76,7 +76,11 @@ void IR_Encoder::sendData(uint16_t addrTo, uint8_t dataByte, bool needAccept)
|
||||
sendData(addrTo, &dataByte, 1, needAccept);
|
||||
}
|
||||
|
||||
void IR_Encoder::sendData(uint16_t addrTo, uint8_t *data, uint8_t len, bool needAccept)
|
||||
void IR_Encoder::sendData(uint16_t addrTo, uint8_t *data = nullptr, uint8_t len = 0, bool needAccept = false){
|
||||
sendData(id, addrTo, data, len, needAccept);
|
||||
}
|
||||
|
||||
void IR_Encoder::sendData(uint16_t addrFrom, uint16_t addrTo, uint8_t *data = nullptr, uint8_t len = 0, bool needAccept = false)
|
||||
{
|
||||
if (len > bytePerPack)
|
||||
{
|
||||
@ -93,8 +97,8 @@ void IR_Encoder::sendData(uint16_t addrTo, uint8_t *data, uint8_t len, bool need
|
||||
sendBuffer[0] = msgType;
|
||||
|
||||
// addr_self
|
||||
sendBuffer[1] = id >> 8 & 0xFF;
|
||||
sendBuffer[2] = id & 0xFF;
|
||||
sendBuffer[1] = addrFrom >> 8 & 0xFF;
|
||||
sendBuffer[2] = addrFrom & 0xFF;
|
||||
|
||||
// addr_to
|
||||
sendBuffer[3] = addrTo >> 8 & 0xFF;
|
||||
|
Reference in New Issue
Block a user