Revert "If modelRegistrationID is default it will be kept the same than ownerRegistrationID"
This reverts commit b1ea16c3
This commit is contained in:
@@ -377,10 +377,6 @@ void runPopupRegister(event_t event)
|
|||||||
}
|
}
|
||||||
else if (reusableBuffer.moduleSetup.pxx2.registerStep >= REGISTER_RX_NAME_RECEIVED && menuHorizontalPosition == 0) {
|
else if (reusableBuffer.moduleSetup.pxx2.registerStep >= REGISTER_RX_NAME_RECEIVED && menuHorizontalPosition == 0) {
|
||||||
// [Enter] pressed
|
// [Enter] pressed
|
||||||
if (memcmp(reusableBuffer.moduleSetup.pxx2.registrationId, g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID) == 0)
|
|
||||||
memclear(g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID);
|
|
||||||
else
|
|
||||||
memcpy(g_model.modelRegistrationID, reusableBuffer.moduleSetup.pxx2.registrationId, PXX2_LEN_REGISTRATION_ID);
|
|
||||||
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_RX_NAME_SELECTED;
|
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_RX_NAME_SELECTED;
|
||||||
backupEditMode = EDIT_MODIFY_FIELD; // so that the [Register] button blinks and the REGISTER process can continue
|
backupEditMode = EDIT_MODIFY_FIELD; // so that the [Register] button blinks and the REGISTER process can continue
|
||||||
}
|
}
|
||||||
@@ -405,7 +401,7 @@ void runPopupRegister(event_t event)
|
|||||||
|
|
||||||
// registration password
|
// registration password
|
||||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y - 4, STR_REG_ID);
|
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y - 4, STR_REG_ID);
|
||||||
editName(WARNING_LINE_X + 8*FW, WARNING_LINE_Y - 4, reusableBuffer.moduleSetup.pxx2.registrationId, PXX2_LEN_REGISTRATION_ID, event, menuVerticalPosition == ITEM_REGISTER_PASSWORD);
|
editName(WARNING_LINE_X + 8*FW, WARNING_LINE_Y - 4, g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID, event, menuVerticalPosition == ITEM_REGISTER_PASSWORD);
|
||||||
|
|
||||||
// loop index (will be removed in future)
|
// loop index (will be removed in future)
|
||||||
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y - 4 + FH, "UID");
|
lcdDrawText(WARNING_LINE_X, WARNING_LINE_Y - 4 + FH, "UID");
|
||||||
@@ -440,7 +436,6 @@ void runPopupRegister(event_t event)
|
|||||||
void startRegisterDialog(uint8_t module)
|
void startRegisterDialog(uint8_t module)
|
||||||
{
|
{
|
||||||
memclear(&reusableBuffer.moduleSetup.pxx2, sizeof(reusableBuffer.moduleSetup.pxx2));
|
memclear(&reusableBuffer.moduleSetup.pxx2, sizeof(reusableBuffer.moduleSetup.pxx2));
|
||||||
memcpy(reusableBuffer.moduleSetup.pxx2.registrationId, currentRegistrationID(), PXX2_LEN_REGISTRATION_ID);
|
|
||||||
moduleSettings[module].mode = MODULE_MODE_REGISTER;
|
moduleSettings[module].mode = MODULE_MODE_REGISTER;
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
POPUP_INPUT("", runPopupRegister);
|
POPUP_INPUT("", runPopupRegister);
|
||||||
|
|||||||
@@ -461,6 +461,8 @@ void modelDefault(uint8_t id)
|
|||||||
|
|
||||||
applyDefaultTemplate();
|
applyDefaultTemplate();
|
||||||
|
|
||||||
|
memcpy(g_model.modelRegistrationID, g_eeGeneral.ownerRegistrationID, PXX2_LEN_REGISTRATION_ID);
|
||||||
|
|
||||||
#if defined(LUA) && defined(PCBTARANIS) //Horus uses menuModelWizard() for wizard
|
#if defined(LUA) && defined(PCBTARANIS) //Horus uses menuModelWizard() for wizard
|
||||||
if (isFileAvailable(WIZARD_PATH "/" WIZARD_NAME)) {
|
if (isFileAvailable(WIZARD_PATH "/" WIZARD_NAME)) {
|
||||||
f_chdir(WIZARD_PATH);
|
f_chdir(WIZARD_PATH);
|
||||||
|
|||||||
@@ -1134,7 +1134,6 @@ union ReusableBuffer
|
|||||||
uint8_t bindStep;
|
uint8_t bindStep;
|
||||||
uint8_t resetStep;
|
uint8_t resetStep;
|
||||||
};
|
};
|
||||||
char registrationId[PXX2_LEN_REGISTRATION_ID];
|
|
||||||
uint32_t bindWaitTimeout;
|
uint32_t bindWaitTimeout;
|
||||||
uint8_t registerPopupVerticalPosition;
|
uint8_t registerPopupVerticalPosition;
|
||||||
uint8_t registerPopupHorizontalPosition;
|
uint8_t registerPopupHorizontalPosition;
|
||||||
|
|||||||
@@ -157,9 +157,8 @@ void Pxx2Pulses::setupRegisterFrame(uint8_t module)
|
|||||||
for (uint8_t i=0; i<PXX2_LEN_RX_NAME; i++) {
|
for (uint8_t i=0; i<PXX2_LEN_RX_NAME; i++) {
|
||||||
Pxx2Transport::addByte(zchar2char(reusableBuffer.moduleSetup.pxx2.registerRxName[i]));
|
Pxx2Transport::addByte(zchar2char(reusableBuffer.moduleSetup.pxx2.registerRxName[i]));
|
||||||
}
|
}
|
||||||
const char * registrationID = currentRegistrationID();
|
|
||||||
for (uint8_t i=0; i<PXX2_LEN_REGISTRATION_ID; i++) {
|
for (uint8_t i=0; i<PXX2_LEN_REGISTRATION_ID; i++) {
|
||||||
Pxx2Transport::addByte(zchar2char(registrationID[i]));
|
Pxx2Transport::addByte(zchar2char(g_model.modelRegistrationID[i]));
|
||||||
}
|
}
|
||||||
Pxx2Transport::addByte(reusableBuffer.moduleSetup.pxx2.registerLoopIndex);
|
Pxx2Transport::addByte(reusableBuffer.moduleSetup.pxx2.registerLoopIndex);
|
||||||
}
|
}
|
||||||
@@ -240,9 +239,8 @@ void Pxx2Pulses::setupBindFrame(uint8_t module)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Pxx2Transport::addByte(0x00);
|
Pxx2Transport::addByte(0x00);
|
||||||
const char * registrationID = currentRegistrationID();
|
|
||||||
for (uint8_t i=0; i<PXX2_LEN_REGISTRATION_ID; i++) {
|
for (uint8_t i=0; i<PXX2_LEN_REGISTRATION_ID; i++) {
|
||||||
Pxx2Transport::addByte(zchar2char(registrationID[i]));
|
Pxx2Transport::addByte(zchar2char(g_model.modelRegistrationID[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ void processRegisterFrame(uint8_t module, uint8_t * frame)
|
|||||||
if (reusableBuffer.moduleSetup.pxx2.registerStep == REGISTER_RX_NAME_SELECTED) {
|
if (reusableBuffer.moduleSetup.pxx2.registerStep == REGISTER_RX_NAME_SELECTED) {
|
||||||
// RX_NAME + PASSWORD follow, we check they are good
|
// RX_NAME + PASSWORD follow, we check they are good
|
||||||
if (cmpStrWithZchar((char *)&frame[4], reusableBuffer.moduleSetup.pxx2.registerRxName, PXX2_LEN_RX_NAME) &&
|
if (cmpStrWithZchar((char *)&frame[4], reusableBuffer.moduleSetup.pxx2.registerRxName, PXX2_LEN_RX_NAME) &&
|
||||||
cmpStrWithZchar((char *)&frame[12], currentRegistrationID(), PXX2_LEN_REGISTRATION_ID)) {
|
cmpStrWithZchar((char *)&frame[12], g_model.modelRegistrationID, PXX2_LEN_REGISTRATION_ID)) {
|
||||||
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_OK;
|
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_OK;
|
||||||
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
||||||
POPUP_INFORMATION(STR_REG_OK);
|
POPUP_INFORMATION(STR_REG_OK);
|
||||||
|
|||||||
Reference in New Issue
Block a user