1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 09:15:38 +03:00

Spec was wrong, update ...

This commit is contained in:
Bertrand Songis 2019-02-12 12:28:11 +01:00
parent 7ccdb0cca1
commit 183e9aeb6b
3 changed files with 9 additions and 2 deletions

View file

@ -787,7 +787,7 @@ enum BluetoothModes {
};
// PXX2 constants
#define PXX2_LEN_REGISTRATION_ID 4
#define PXX2_LEN_REGISTRATION_ID 8
#define PXX2_LEN_RX_ID 8
#define PXX2_MAX_RECEIVERS_PER_MODULE 5

View file

@ -60,6 +60,9 @@ bool Pxx2Pulses::setupRegisterFrame(uint8_t module)
if (reusableBuffer.modelsetup.pxx2_register_or_bind_step == REGISTER_COUNTER_ID_RECEIVED) {
Pxx2Transport::addByte(0x01);
for (uint8_t i=0; i<PXX2_LEN_RX_ID; i++) {
Pxx2Transport::addByte(0x00);
}
for (uint8_t i=0; i<PXX2_LEN_REGISTRATION_ID; i++) {
Pxx2Transport::addByte(g_model.modelRegistrationID[i]);
}

View file

@ -82,8 +82,12 @@ void processRegisterFrame(uint8_t module, uint8_t * frame)
reusableBuffer.modelsetup.pxx2_register_or_bind_step = REGISTER_COUNTER_ID_RECEIVED;
}
else if (frame[3] == 0x01) {
// RX_ID follows, we check it is good
if (1) {
}
// PASSWORD follows, we check it is good
if (memcmp(&frame[4], g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID) == 0) {
if (memcmp(&frame[8], g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID) == 0) {
reusableBuffer.modelsetup.pxx2_register_or_bind_step = REGISTER_OK;
moduleSettings[module].mode = MODULE_MODE_NORMAL;
POPUP_INFORMATION(STR_REG_OK);