Added more to the channel/vfo summary for M17 and DMR.
1. added contact name, 2. added timeslot and color code. 3. added new voice prompts.
This commit is contained in:
parent
07d971ecfb
commit
62ae110a19
|
|
@ -60,5 +60,9 @@ void announceCTCSS(bool rxToneEnabled, uint8_t rxTone, bool txToneEnabled, uint8
|
|||
void anouncePower(float power, VoicePromptQueueFlags_T flags);
|
||||
void announceBrightness(uint8_t brightness, VoicePromptQueueFlags_T flags);
|
||||
void announceSquelch(uint8_t squelch, VoicePromptQueueFlags_T flags);
|
||||
void announceContact(contact_t* contact, VoicePromptQueueFlags_T flags);
|
||||
void announceContactWithIndex(uint16_t index, VoicePromptQueueFlags_T flags);
|
||||
void announceTimeslot(uint8_t timeslot, VoicePromptQueueFlags_T flags);
|
||||
void announceColorCode(uint8_t rxColorCode, uint8_t txColorCode, VoicePromptQueueFlags_T flags);
|
||||
|
||||
#endif //VOICE_PROMPT_UTILS_H_INCLUDED
|
||||
|
|
@ -120,7 +120,10 @@ PROMPT_SOURCE_ID, // Source ID
|
|||
PROMPT_DEST_ID, // Destination ID
|
||||
PROMPT_DMR_ID, // DMR ID
|
||||
PROMPT_TALKGROUP, // Talk group
|
||||
PROMPT_TIMESLOT, // timeslot
|
||||
PROMPT_COLORCODE, // color code
|
||||
PROMPT_TONE, // tone
|
||||
PROMPT_CONTACT, // contact
|
||||
PROMPT_CHARACTER, // character
|
||||
PROMPT_SPACE, // space
|
||||
PROMPT_PERCENT, // Percent
|
||||
|
|
|
|||
|
|
@ -197,7 +197,18 @@ VoicePromptQueueFlags_T flags)
|
|||
localFlags);
|
||||
}
|
||||
}
|
||||
// Todo M17 and DMR info.
|
||||
else if (channel->mode == OPMODE_M17)
|
||||
{
|
||||
announceContactWithIndex(channel->m17.contact_index, localFlags);
|
||||
}
|
||||
else if (channel->mode == OPMODE_DMR)
|
||||
{
|
||||
announceContactWithIndex(channel->dmr.contact_index, localFlags);
|
||||
// Force announcement of the words timeslot and colorcode to avoid ambiguity.
|
||||
announceTimeslot(channel->dmr.dmr_timeslot, (localFlags | vpqIncludeDescriptions));
|
||||
announceColorCode(channel->dmr.rxColorCode, channel->dmr.txColorCode, (localFlags | vpqIncludeDescriptions));
|
||||
}
|
||||
|
||||
anouncePower(channel->power, localFlags);
|
||||
|
||||
vpPlayIfNeeded(flags);
|
||||
|
|
@ -330,4 +341,67 @@ void announceSquelch(uint8_t squelch, VoicePromptQueueFlags_T flags)
|
|||
vpQueueInteger(squelch);
|
||||
|
||||
vpPlayIfNeeded(flags);
|
||||
}
|
||||
}
|
||||
|
||||
void announceContact(contact_t* contact, VoicePromptQueueFlags_T flags)
|
||||
{
|
||||
if (!contact)
|
||||
return;
|
||||
|
||||
vpInitIfNeeded(flags);
|
||||
|
||||
if (flags & vpqIncludeDescriptions)
|
||||
vpQueuePrompt(PROMPT_CONTACT);
|
||||
|
||||
if (contact->name[0])
|
||||
vpQueueString(contact->name, vpAnnounceCommonSymbols);
|
||||
|
||||
vpPlayIfNeeded(flags);
|
||||
}
|
||||
|
||||
void announceContactWithIndex(uint16_t index, VoicePromptQueueFlags_T flags)
|
||||
{
|
||||
if (index == 0)
|
||||
return;
|
||||
|
||||
contact_t contact;
|
||||
|
||||
if (cps_readContact(&contact, index) == -1)
|
||||
return;
|
||||
|
||||
announceContact(&contact, flags);
|
||||
}
|
||||
|
||||
void announceTimeslot(uint8_t timeslot, VoicePromptQueueFlags_T flags)
|
||||
{
|
||||
vpInitIfNeeded(flags);
|
||||
|
||||
if (flags & vpqIncludeDescriptions)
|
||||
vpQueuePrompt(PROMPT_TIMESLOT);
|
||||
|
||||
vpQueueInteger(timeslot);
|
||||
|
||||
vpPlayIfNeeded(flags);
|
||||
}
|
||||
|
||||
void announceColorCode(uint8_t rxColorCode, uint8_t txColorCode, VoicePromptQueueFlags_T flags)
|
||||
{
|
||||
vpInitIfNeeded(flags);
|
||||
|
||||
if (flags & vpqIncludeDescriptions)
|
||||
vpQueuePrompt(PROMPT_COLORCODE);
|
||||
|
||||
if (rxColorCode == txColorCode)
|
||||
{
|
||||
vpQueueInteger(rxColorCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
vpQueuePrompt(PROMPT_RECEIVE);
|
||||
vpQueueInteger(rxColorCode);
|
||||
vpQueuePrompt(PROMPT_TRANSMIT);
|
||||
vpQueueInteger(txColorCode);
|
||||
}
|
||||
|
||||
vpPlayIfNeeded(flags);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue