mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-28 05:09:40 +00:00
add crcID for accept
This commit is contained in:
10
IR_Decoder.h
10
IR_Decoder.h
@ -9,6 +9,7 @@ class IR_Decoder : public IR_DecoderRaw {
|
||||
uint16_t addrAcceptSendTo;
|
||||
|
||||
uint16_t acceptDelay = 75;
|
||||
uint8_t acceptCustomByte;
|
||||
|
||||
public:
|
||||
|
||||
@ -48,19 +49,20 @@ public:
|
||||
if (gotData.isAvailable && (gotData.getMsgType() == IR_MSG_DATA_ACCEPT)) {
|
||||
acceptSendTimer = millis();
|
||||
addrAcceptSendTo = gotData.getAddrFrom();
|
||||
if(addrAcceptSendTo && addrAcceptSendTo < IR_Broadcast) isWaitingAcceptSend = true;
|
||||
acceptCustomByte = crc8(gotData.getDataPrt(), 0, gotData.getDataSize(), poly1);
|
||||
if (addrAcceptSendTo && addrAcceptSendTo < IR_Broadcast) isWaitingAcceptSend = true;
|
||||
}
|
||||
}
|
||||
if (isWaitingAcceptSend && millis() - acceptSendTimer > 75) {
|
||||
encoder->sendAccept(addrAcceptSendTo);
|
||||
encoder->sendAccept(addrAcceptSendTo, acceptCustomByte);
|
||||
isWaitingAcceptSend = false;
|
||||
}
|
||||
}
|
||||
|
||||
void setAcceptDelay(uint16_t acceptDelay){
|
||||
void setAcceptDelay(uint16_t acceptDelay) {
|
||||
this->acceptDelay = acceptDelay;
|
||||
}
|
||||
uint16_t getAcceptDelay(){
|
||||
uint16_t getAcceptDelay() {
|
||||
return this->acceptDelay;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user