Skip to content

Commit

Permalink
Add Rogerbeep Messenger Menu notification
Browse files Browse the repository at this point in the history
  • Loading branch information
spm81 committed Feb 20, 2024
1 parent a2a4e9e commit 04e9cbf
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ENABLE_DTMF_CALLING := 0
ENABLE_DTMF_SIDETONES := 1
ENABLE_TX1750 := 0
# Keep this in stock options, and add option in mods for extra rogers
ENABLE_ROGERBEEP := 1
ENABLE_ROGERBEEP := 0
ENABLE_MDC := 0

#============== MODIFICATIONS =============#
Expand Down Expand Up @@ -56,7 +56,7 @@ ENABLE_MESSENGER_SHOW_RX_TX_FREQ := 1
# 156 bytes
ENABLE_MESSENGER_UART := 1
# 3408 bytes
ENABLE_MESSENGER_ENCRYPTION := 1
ENABLE_MESSENGER_ENCRYPTION := 0
# 140 bytes
ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION := 1

Expand Down
17 changes: 14 additions & 3 deletions app/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax) {
#endif
#ifdef ENABLE_MESSENGER
case MENU_MSG_ACK:
#endif
#endif
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
case MENU_MSG_NOTIFICATION:
#endif
//*pMin = 0;
*pMax = 1;
break;
Expand Down Expand Up @@ -587,7 +590,11 @@ void MENU_AcceptSetting(void) {
#endif

#ifdef ENABLE_MESSENGER

#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
case MENU_MSG_NOTIFICATION:
gEeprom.MESSENGER_CONFIG.data.notification = gSubMenuSelection;
break;
#endif
case MENU_MSG_ACK:
gEeprom.MESSENGER_CONFIG.data.ack = gSubMenuSelection;
break;
Expand Down Expand Up @@ -939,7 +946,11 @@ void MENU_ShowCurrentSetting(void) {
case MENU_MSG_ACK:
gSubMenuSelection = gEeprom.MESSENGER_CONFIG.data.ack;
break;

#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
case MENU_MSG_NOTIFICATION:
gSubMenuSelection = gEeprom.MESSENGER_CONFIG.data.notification;
break;
#endif
case MENU_MSG_MODULATION:
gSubMenuSelection = gEeprom.MESSENGER_CONFIG.data.modulation;
break;
Expand Down
20 changes: 20 additions & 0 deletions app/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,14 +738,34 @@ void MSG_StorePacket(const uint16_t interrupt_bits)
SYSTEM_DelayMs(500);
BK4819_ExitTxMute();
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
if(gEeprom.MESSENGER_CONFIG.data.notification) {
BK4819_PlayRoger(99);
}
#endif
// Transmit a message to the sender that we have received the message (Unless it's a service message)
if (dataPacket.data.payload[2] != 0x1b)
{
MSG_Send("\x1b\x1b\x1bRCVD ", true);
}
}

#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION

if(!gEeprom.MESSENGER_CONFIG.data.ack && gEeprom.MESSENGER_CONFIG.data.notification) {
BK4819_DisableDTMF();
RADIO_SetTxParameters();
SYSTEM_DelayMs(500);
BK4819_ExitTxMute();
BK4819_PlayRoger(99);
}
#endif







}

}
Expand Down
13 changes: 7 additions & 6 deletions app/messenger.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ typedef enum ModemModulation {
typedef union {
struct {
uint8_t
unused0 :1,
ack :1, // determines whether the radio will automatically respond to messages with ACK
encrypt :1, // determines whether outgoing messages will be encrypted
unused1 :1,
modulation :2, // determines FSK modulation type
unused2 :2;
unused0 :1,
ack :1, // determines whether the radio will automatically respond to messages with ACK
notification :1, // determines whether the radio will automatically respond to messages with Roger Notification
encrypt :1, // determines whether outgoing messages will be encrypted
unused1 :1,
modulation :2, // determines FSK modulation type
unused2 :2;
} data;
uint8_t __val;
} MessengerConfig;
Expand Down
3 changes: 3 additions & 0 deletions helper/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
#endif
#ifdef ENABLE_MESSENGER
gMenuListCount += 2;
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
gMenuListCount++;
#endif
#endif
#ifdef ENABLE_MESSENGER_ENCRYPTION
gMenuListCount += 2;
Expand Down
3 changes: 3 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ void Main(void) {
#endif
#ifdef ENABLE_MESSENGER
gMenuListCount += 2;
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
gMenuListCount++;
#endif
#endif
#ifdef ENABLE_MESSENGER_ENCRYPTION
gMenuListCount += 2;
Expand Down
6 changes: 6 additions & 0 deletions ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ static const char MenuList[][8] = {
#endif
#ifdef ENABLE_MESSENGER
"MsgAck",
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
"MsgRBN",
#endif
"MsgMod",
#endif
"Beep",
Expand Down Expand Up @@ -431,6 +434,9 @@ void UI_DisplayMenu(void) {
#endif
#ifdef ENABLE_MESSENGER
case MENU_MSG_ACK:
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
case MENU_MSG_NOTIFICATION:
#endif
#endif
case MENU_BCL:
case MENU_BEEP:
Expand Down
3 changes: 3 additions & 0 deletions ui/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ enum {
#endif
#ifdef ENABLE_MESSENGER
MENU_MSG_ACK,
#ifdef ENABLE_MESSENGER_ROGERBEEP_NOTIFICATION
MENU_MSG_NOTIFICATION,
#endif
MENU_MSG_MODULATION,
#endif
MENU_BEEP,
Expand Down

0 comments on commit 04e9cbf

Please sign in to comment.