diff --git a/openrtx/include/core/state.h b/openrtx/include/core/state.h index 4118cc74..b5f237e1 100644 --- a/openrtx/include/core/state.h +++ b/openrtx/include/core/state.h @@ -29,17 +29,6 @@ #include #include -/** - * Data structure representing the settings of the M17 mode. - */ -typedef struct -{ - char dst_addr[10]; // Destination callsign - uint8_t can; // Channel Access Number -} -m17_t; - - /** * Part of this structure has been commented because the corresponding * functionality is not yet implemented. @@ -70,7 +59,7 @@ typedef struct bool gpsDetected; bool backup_eflash; bool restore_eflash; - m17_t m17_data; + char m17_dest[10]; } state_t; diff --git a/openrtx/src/core/threads.c b/openrtx/src/core/threads.c index 7c95b34e..440d4ed3 100644 --- a/openrtx/src/core/threads.c +++ b/openrtx/src/core/threads.c @@ -100,7 +100,7 @@ void *ui_threadFunc(void *arg) // Copy new M17 CAN, source and destination addresses rtx_cfg.can = state.settings.m17_can; strncpy(rtx_cfg.source_address, state.settings.callsign, 10); - strncpy(rtx_cfg.destination_address, state.m17_data.dst_addr, 10); + strncpy(rtx_cfg.destination_address, state.m17_dest, 10); pthread_mutex_unlock(&rtx_mutex); diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index 55f5398d..67556058 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -532,9 +532,9 @@ void vp_announceM17Info(const channel_t* channel, bool isEditing, { vp_queuePrompt(PROMPT_EDIT); } - else if (state.m17_data.dst_addr[0] != '\0') + else if (state.m17_dest[0] != '\0') { - vp_queueString(state.m17_data.dst_addr, vpAnnounceCommonSymbols); + vp_queueString(state.m17_dest, vpAnnounceCommonSymbols); } else if ((channel != NULL) && (channel->m17.contact_index != 0)) { diff --git a/openrtx/src/ui/default/ui.c b/openrtx/src/ui/default/ui.c index 399bdef7..9179efb2 100644 --- a/openrtx/src/ui/default/ui.c +++ b/openrtx/src/ui/default/ui.c @@ -1278,7 +1278,7 @@ void ui_updateFSM(bool *sync_rtx) { _ui_textInputConfirm(ui_state.new_callsign); // Save selected dst ID and disable input mode - strncpy(state.m17_data.dst_addr, ui_state.new_callsign, 10); + strncpy(state.m17_dest, ui_state.new_callsign, 10); ui_state.edit_mode = false; *sync_rtx = true; vp_announceM17Info(NULL, ui_state.edit_mode, @@ -1287,7 +1287,7 @@ void ui_updateFSM(bool *sync_rtx) else if(msg.keys & KEY_HASH) { // Save selected dst ID and disable input mode - strncpy(state.m17_data.dst_addr, "", 1); + strncpy(state.m17_dest, "", 1); ui_state.edit_mode = false; *sync_rtx = true; vp_announceM17Info(NULL, ui_state.edit_mode, @@ -1443,14 +1443,14 @@ void ui_updateFSM(bool *sync_rtx) { _ui_textInputConfirm(ui_state.new_callsign); // Save selected dst ID and disable input mode - strncpy(state.m17_data.dst_addr, ui_state.new_callsign, 10); + strncpy(state.m17_dest, ui_state.new_callsign, 10); ui_state.edit_mode = false; *sync_rtx = true; } else if(msg.keys & KEY_HASH) { // Save selected dst ID and disable input mode - strncpy(state.m17_data.dst_addr, "", 1); + strncpy(state.m17_dest, "", 1); ui_state.edit_mode = false; *sync_rtx = true; }