If the function does not fit your needs you can simple do it for your own…
I had to do similar for an ‘universal’ UNSO-Routine…
e.g.
enum {
ue_WVMI =0,// 0 voice mail indicator
ue_WDCI, // 1 wavecom diverted call indicator
ue_WBCI, // 2 battery charge indicator
ue_WDIA, // 3 wavecom diagnose
ue_WIND, // 4 general indications
ue_RING, // 5 ringing
ue_CLIP, // 6 calling line identification
ue_CREG, // 7 network registration state
ue_CNMI, // 8 new msg indicator
ue_CBMI, // 9 new msg
ue_CBM, // 10 new msg
ue_CDSI, // 11 sms status report
ue_CDS, // 12 sms status report
ue_CCWA, // 13 call waiting
ue_CCCM, // 14 advice of charge
ue_CSSU, // 15 supplementary service notification
ue_CRIN, // 16 CRing
ue_count // 17 dummy; insert BEFORE this
} Unso_e;
const ascii *UnSoStrings[ue_count][6] = { "+WVMI",
"+WDCI",
"+WBCI",
"+WDIA",
"+WIND",
"+RING",
"+CLIP",
"+CREG",
"+CNMI",
"+CBMI",
"+CBM:",
"+CDSI",
"+CDS:",
"+CCWA",
"+CCCM",
"+CSSU",
"+CRIN" };
and a search in the list is simply done by a loop…
for (msg_id=0; msg_id<ue_count; msg_id++)
{
if ( strncmp(str2searchfor, (char*)UnSoStrings[msg_id], 5) == 0 )
break;
}
// act on incoming UnSoMessage
switch ( msg_id ) {
.....
}
hth,
Heinz