mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-05-04 07:10:16 +00:00
add crcID for accept
This commit is contained in:
parent
909fac5d1a
commit
0166bbfa22
@ -348,11 +348,11 @@ void status(IR_Decoder& dec) {
|
||||
// str += (" CRC CALC: "); str += (dec.gotAccept.getCrcCALC()); str += "\n";
|
||||
str += "\n";
|
||||
|
||||
str += (" Data["); str += (dec.gotAccept.getCustomByte()); str += ("]: \n");
|
||||
str += (" Data: "); str += (dec.gotAccept.getCustomByte());
|
||||
|
||||
|
||||
|
||||
str += ("\n*******ErrAll: "); str += (dec.gotAccept.getErrorCount()); str += "\n";
|
||||
str += ("\n\n*******ErrAll: "); str += (dec.gotAccept.getErrorCount()); str += "\n";
|
||||
str += ("**ErrDistance: "); str += ((int)(dec.gotAccept.getErrorHighSignal() - dec.gotAccept.getErrorLowSignal())); str += "\n";
|
||||
|
||||
str += "\n";
|
||||
|
@ -9,6 +9,7 @@ class IR_Decoder : public IR_DecoderRaw {
|
||||
uint16_t addrAcceptSendTo;
|
||||
|
||||
uint16_t acceptDelay = 75;
|
||||
uint8_t acceptCustomByte;
|
||||
|
||||
public:
|
||||
|
||||
@ -48,11 +49,12 @@ public:
|
||||
if (gotData.isAvailable && (gotData.getMsgType() == IR_MSG_DATA_ACCEPT)) {
|
||||
acceptSendTimer = millis();
|
||||
addrAcceptSendTo = gotData.getAddrFrom();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ msg type:
|
||||
#define IR_MSG_DATA_ACCEPT 7U // | 111..... | = данные требующие подтверждения
|
||||
;/* // ----------
|
||||
|
||||
/```````````````````` подтверждение ```````````````````\ /``````````````````````````````````````` запрос ``````````````````````````````````\
|
||||
/``````````````````````````````` подтверждение `````````````````````````````\ /``````````````````````````````````````` запрос ``````````````````````````````````\
|
||||
|
||||
{``````````} [````````````````````````] [``````````````````] [``````````````] {``````````} [````````````````````````] [````````````````````````] [``````````````]
|
||||
{ msg type } [ addr_from uint16_t ] [=== customByte ===] [ CRC Bytes ] { msg type } [ addr_from uint16_t ] [ addr_to uint16_t ] [ CRC Bytes ]
|
||||
@ -62,6 +62,8 @@ msg type:
|
||||
| | | |
|
||||
\________________________________________________________________________/ \_____________________________________________________________________________/
|
||||
|
||||
customByte - контрольная сумма принятых данных по poly1
|
||||
|
||||
|
||||
|
||||
/`````````````````````` Задний сигнал машинки без адресации ``````````````````````\ В (IR_MASK_MSG_INFO & 15U) содержится количество байт
|
||||
|
Loading…
x
Reference in New Issue
Block a user