This commit is contained in:
2024-02-20 15:00:42 +03:00
parent 27dd448cb0
commit ff7b5dcaa4
3 changed files with 44 additions and 55 deletions

View File

@ -43,17 +43,19 @@ public:
}
void IR_Encoder::setBlindDecoders(IR_Decoder* decoders [], uint8_t count);
// template<typename T>
// void sendData(uint16_t addrTo, T& data, bool needAccept = false);
void rawSend(uint8_t* ptr, uint8_t len);
void sendData(uint16_t addrTo, uint8_t* data, uint8_t len, bool needAccept = false);
void sendACK(uint16_t addrTo, uint8_t addInfo = 0, bool forAll = false);
void sendRequest(uint16_t addrTo, uint8_t addInfo = 0);
void rawSend(uint8_t* ptr, uint8_t len);
void sendBack(uint8_t* data = nullptr, uint8_t len = 0);
void sendBackTo(uint16_t addrTo, uint8_t* data = nullptr, uint8_t len = 0);
void isr();
~IR_Encoder();
volatile bool ir_out_virtual;
private:
void IR_Encoder::_sendBack(bool isAdressed, uint16_t addrTo, uint8_t* data, uint8_t len);
void IR_Encoder::setDecoder_isSending();
void sendByte(uint8_t byte, bool* prev, bool LOW_FIRST);
void addSync(bool* prev, bool* next);
@ -101,24 +103,10 @@ private:
(bitPauseTakts) * 2 - 1
};
uint8_t* currentBitSequence = bitLow;
// uint8_t bitSequence[2];
volatile SignalPart signal;
};
////////////////////////////////////////////////////////////////////////////////////////////////
// template<typename T>
// void IR_Encoder::sendData(uint16_t addrTo, T& data, bool needAccept = false) { // TODO: переделать логику LOW_FIRST
// uint8_t len = sizeof(T);
// uint8_t packSize = msgBytes + addrBytes + addrBytes + len + crcBytes;
// uint8_t msgType =
// ((needAccept ? IR_MSG_DATA_ACCEPT : IR_MSG_DATA_NOACCEPT) << 5) | ((packSize - crcBytes) & IR_MASK_MSG_INFO);
// _sendData(addrTo, data, len, msgType);
// }