FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-aci/aci/ati_ret.c @ 786:e7250023ca12
aci: ati_phb.c, ati_prs.c and ati_ret.c done
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Thu, 12 Mar 2015 06:53:01 +0000 |
parents | eedbf248bac0 |
children |
comparison
equal
deleted
inserted
replaced
785:09382de17df9 | 786:e7250023ca12 |
---|---|
18 +----------------------------------------------------------------------------- | 18 +----------------------------------------------------------------------------- |
19 */ | 19 */ |
20 | 20 |
21 #ifndef ATI_RET_C | 21 #ifndef ATI_RET_C |
22 #define ATI_RET_C | 22 #define ATI_RET_C |
23 | |
24 #include "config.h" | |
25 #include "fixedconf.h" | |
26 #include "condat-features.h" | |
27 #include "aci_conf.h" | |
23 | 28 |
24 #include "aci_all.h" /* defines FF_TIMEZONE */ | 29 #include "aci_all.h" /* defines FF_TIMEZONE */ |
25 | 30 |
26 #include "line_edit.h" | 31 #include "line_edit.h" |
27 #include "aci_cmh.h" /* uses FF_TIMEZONE */ | 32 #include "aci_cmh.h" /* uses FF_TIMEZONE */ |
305 } | 310 } |
306 | 311 |
307 cmdErrStr = NULL; | 312 cmdErrStr = NULL; |
308 | 313 |
309 #ifdef ACI /* for ATI only version */ | 314 #ifdef ACI /* for ATI only version */ |
310 cmhMMI_handleAudioTone ( cmdId, RAT_NO_CARRIER, CPI_MSG_NotPresent ); | 315 cmhMMI_handleAudioTone ( cmdId, RAT_NO_CARRIER, CPI_MSG_NotPresent ); |
311 #endif | 316 #endif |
312 } | 317 } |
313 | 318 |
314 /* | 319 /* |
315 +--------------------------------------------------------------------+ | 320 +--------------------------------------------------------------------+ |
367 io_sendConfirm(srcId, cmdAtError(atNoAnswer), ATI_ERROR_OUTPUT); | 372 io_sendConfirm(srcId, cmdAtError(atNoAnswer), ATI_ERROR_OUTPUT); |
368 | 373 |
369 cmdErrStr = NULL; | 374 cmdErrStr = NULL; |
370 | 375 |
371 #ifdef ACI /* for ATI only version */ | 376 #ifdef ACI /* for ATI only version */ |
372 cmhMMI_handleAudioTone ( cmdId, RAT_NO_ANSWER, CPI_MSG_NotPresent ); | 377 cmhMMI_handleAudioTone ( cmdId, RAT_NO_ANSWER, CPI_MSG_NotPresent ); |
373 #endif | 378 #endif |
374 } | 379 } |
375 | 380 |
376 /* | 381 /* |
377 +--------------------------------------------------------------------+ | 382 +--------------------------------------------------------------------+ |
487 ledit_ctrl (srcId,LEDIT_CTRL_CMPL, NULL); | 492 ledit_ctrl (srcId,LEDIT_CTRL_CMPL, NULL); |
488 | 493 |
489 cmdErrStr = NULL; | 494 cmdErrStr = NULL; |
490 | 495 |
491 #ifdef ACI /* for ATI only version */ | 496 #ifdef ACI /* for ATI only version */ |
492 cmhMMI_handleAudioTone ( cmdId, RAT_CONNECT, CPI_MSG_NotPresent ); | 497 cmhMMI_handleAudioTone ( cmdId, RAT_CONNECT, CPI_MSG_NotPresent ); |
493 #endif | 498 #endif |
494 } | 499 } |
495 | 500 |
496 /* | 501 /* |
497 +--------------------------------------------------------------------+ | 502 +--------------------------------------------------------------------+ |
529 io_sendConfirm(srcId, cmdCmeError(err), ATI_ERROR_OUTPUT); | 534 io_sendConfirm(srcId, cmdCmeError(err), ATI_ERROR_OUTPUT); |
530 | 535 |
531 cmdErrStr = NULL; | 536 cmdErrStr = NULL; |
532 | 537 |
533 #ifdef ACI /* for ATI only version */ | 538 #ifdef ACI /* for ATI only version */ |
534 cmhMMI_handleAudioTone ( cmdId, RAT_CME, CPI_MSG_NotPresent ); | 539 cmhMMI_handleAudioTone ( cmdId, RAT_CME, CPI_MSG_NotPresent ); |
535 #endif | 540 #endif |
536 } | 541 } |
537 else | 542 else |
538 { | 543 { |
539 curAbrtCmd = AT_CMD_NONE; | 544 curAbrtCmd = AT_CMD_NONE; |
604 case(CGREG_STAT_REG_ROAM): | 609 case(CGREG_STAT_REG_ROAM): |
605 return(STAT_Roam); | 610 return(STAT_Roam); |
606 | 611 |
607 default: | 612 default: |
608 return(STAT_Other); | 613 return(STAT_Other); |
609 } | 614 } |
610 } | 615 } |
611 | 616 |
612 LOCAL T_ACI_NTW_STATUS get_raw_stat_among_P_CGREG( T_P_CGREG_STAT status ) | 617 LOCAL T_ACI_NTW_STATUS get_raw_stat_among_P_CGREG( T_P_CGREG_STAT status ) |
613 { | 618 { |
614 switch(status) | 619 switch(status) |
619 case(P_CGREG_STAT_REG_ROAM): | 624 case(P_CGREG_STAT_REG_ROAM): |
620 return(STAT_Roam); | 625 return(STAT_Roam); |
621 | 626 |
622 default: | 627 default: |
623 return(STAT_Other); | 628 return(STAT_Other); |
624 } | 629 } |
625 } | 630 } |
626 #endif /* GPRS */ | 631 #endif /* GPRS */ |
627 | 632 |
628 /* function fills up registration status parameters according to type of | 633 /* function fills up registration status parameters according to type of |
629 user notification (+CREG/+CGREG/%CGREG) | 634 user notification (+CREG/+CGREG/%CGREG) |
5283 | 5288 |
5284 */ | 5289 */ |
5285 | 5290 |
5286 void aci_format_plmn_name(T_full_name * plmn, UBYTE *out) | 5291 void aci_format_plmn_name(T_full_name * plmn, UBYTE *out) |
5287 { | 5292 { |
5288 USHORT size_of_plmn_name; | 5293 USHORT size_of_plmn_name; |
5289 UBYTE dest_len=0; | 5294 UBYTE dest_len=0; |
5290 UBYTE buf[MMR_MAX_TEXT_LEN]; | 5295 UBYTE buf[MMR_MAX_TEXT_LEN]; |
5291 | 5296 |
5292 if(plmn->dcs ==0) /*GSM default */ | 5297 if(plmn->dcs ==0) /*GSM default */ |
5293 { | 5298 { |
5294 dest_len = utl_cvt7To8(plmn->text,plmn->c_text,buf,0); | 5299 dest_len = utl_cvt7To8(plmn->text,plmn->c_text,buf,0); |
5295 utl_chsetFromGsm(buf,dest_len,out,MMR_MAX_TEXT_LEN,&size_of_plmn_name,GSM_ALPHA_Def); | 5300 utl_chsetFromGsm(buf,dest_len,out,MMR_MAX_TEXT_LEN,&size_of_plmn_name,GSM_ALPHA_Def); |
5296 } | 5301 } |
5297 else if(plmn->dcs ==1) /*UCS2 */ | 5302 else if(plmn->dcs ==1) /*UCS2 */ |
5298 { | 5303 { |
5299 utl_hexFromGsm(plmn->text,plmn->c_text,out,MMR_MAX_TEXT_LEN,&size_of_plmn_name,GSM_ALPHA_Def,CSCS_ALPHA_7_Bit); | 5304 utl_hexFromGsm(plmn->text,plmn->c_text,out,MMR_MAX_TEXT_LEN,&size_of_plmn_name,GSM_ALPHA_Def,CSCS_ALPHA_7_Bit); |
5300 | 5305 } |
5301 } | |
5302 } | 5306 } |
5303 | 5307 |
5304 /* | 5308 /* |
5305 +--------------------------------------------------------------------+ | 5309 +--------------------------------------------------------------------+ |
5306 | PROJECT : GSM-F&D (8411) MODULE : ACI_RET | | 5310 | PROJECT : GSM-F&D (8411) MODULE : ACI_RET | |
5312 */ | 5316 */ |
5313 | 5317 |
5314 GLOBAL void rCI_PercentCNIV (T_MMR_INFO_IND *mmr_info_ind) | 5318 GLOBAL void rCI_PercentCNIV (T_MMR_INFO_IND *mmr_info_ind) |
5315 { | 5319 { |
5316 UBYTE srcId = srcId_cb; | 5320 UBYTE srcId = srcId_cb; |
5317 char buf1[MMR_MAX_TEXT_LEN] ; /*we limit the size of printed symbols to avoid stack size increase*/ | 5321 char buf1[MMR_MAX_TEXT_LEN] ; /*we limit the size of printed symbols to avoid stack size increase*/ |
5318 char buf2[MMR_MAX_TEXT_LEN] ; | 5322 char buf2[MMR_MAX_TEXT_LEN] ; |
5319 | 5323 |
5320 char plmn[7] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00}; | 5324 char plmn[7] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00}; |
5321 SHORT mcc = 0; | 5325 SHORT mcc = 0; |
5322 SHORT mnc = 0; | 5326 SHORT mnc = 0; |
5323 | 5327 |
5324 TRACE_FUNCTION("rCI_PercentCNIV()"); | 5328 TRACE_FUNCTION("rCI_PercentCNIV()"); |
5325 | 5329 |
5326 memset(buf1,0,MMR_MAX_TEXT_LEN); | 5330 memset(buf1,0,MMR_MAX_TEXT_LEN); |
5327 memset(buf2,0,MMR_MAX_TEXT_LEN); | 5331 memset(buf2,0,MMR_MAX_TEXT_LEN); |
5328 | 5332 |
5329 if (mmr_info_ind->plmn.v_plmn) | 5333 if (mmr_info_ind->plmn.v_plmn) |
5330 { | 5334 { |
5331 cmhMM_CnvrtPLMN2INT( mmr_info_ind->plmn.mcc, mmr_info_ind->plmn.mnc, &mcc, &mnc ); | 5335 cmhMM_CnvrtPLMN2INT( mmr_info_ind->plmn.mcc, mmr_info_ind->plmn.mnc, &mcc, &mnc ); |
5332 } | 5336 } |
5333 | 5337 |
5334 /* build numeric plmn representation */ | 5338 /* build numeric plmn representation */ |
5335 if ((mnc & 0x000F) EQ 0x000F) | 5339 if ((mnc & 0x000F) EQ 0x000F) |
5336 { | 5340 { |
5339 else | 5343 else |
5340 { | 5344 { |
5341 sprintf (plmn, "\"%03X%03X\"", mcc, mnc); | 5345 sprintf (plmn, "\"%03X%03X\"", mcc, mnc); |
5342 } | 5346 } |
5343 | 5347 |
5344 if (mmr_info_ind->short_name.v_name) /* short name */ | 5348 if (mmr_info_ind->short_name.v_name) /* short name */ |
5345 { | 5349 { |
5346 aci_format_plmn_name(&mmr_info_ind->short_name, (UBYTE *)buf1); | 5350 aci_format_plmn_name(&mmr_info_ind->short_name, (UBYTE *)buf1); |
5347 } | 5351 } |
5352 | |
5353 if (mmr_info_ind->full_name.v_name) /* full name */ | |
5354 { | |
5355 aci_format_plmn_name(&mmr_info_ind->full_name, (UBYTE *)buf2); | |
5356 } | |
5348 | 5357 |
5349 if (mmr_info_ind->full_name.v_name) /* full name */ | 5358 sprintf (g_sa, "%s \"%s\",\"%s\",%s", "%CNIV:", buf2, buf1, plmn); |
5350 { | |
5351 aci_format_plmn_name(&mmr_info_ind->full_name, (UBYTE *)buf2); | |
5352 } | |
5353 | |
5354 sprintf (g_sa, "%s \"%s\",\"%s\",%s", "%CNIV:", buf2, buf1, plmn); | |
5355 | 5359 |
5356 /* Send response to AT interface */ | 5360 /* Send response to AT interface */ |
5357 io_sendIndication(srcId, g_sa, ATI_NORMAL_OUTPUT); | 5361 io_sendIndication(srcId, g_sa, ATI_NORMAL_OUTPUT); |
5358 } | 5362 } |
5359 | 5363 |
5477 SHORT pos = 0; | 5481 SHORT pos = 0; |
5478 UBYTE srcId = srcId_cb; | 5482 UBYTE srcId = srcId_cb; |
5479 | 5483 |
5480 TRACE_FUNCTION("rCI_PercentCSTAT()"); | 5484 TRACE_FUNCTION("rCI_PercentCSTAT()"); |
5481 | 5485 |
5482 if (ati_user_output_cfg[srcId].CSTAT_stat EQ 1) | 5486 if (ati_user_output_cfg[srcId].CSTAT_stat EQ 1) |
5483 { | 5487 { |
5484 pos = sprintf(g_sa,"%s: ","%CSTAT"); | 5488 pos = sprintf(g_sa,"%s: ","%CSTAT"); |
5485 | 5489 |
5486 switch(msgType.entityId) | 5490 switch(msgType.entityId) |
5487 { | 5491 { |