FreeCalypso > hg > fc-magnetite
changeset 478:5e39123540e6
hybrid fw: Openmoko-mimicking AT@BAND command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 14 Jun 2018 06:04:54 +0000 |
parents | f65a4399093d |
children | e9e72ec7b318 |
files | src/aci2/alr/alr_csf.c src/g23m-aci/aci/ati_cmd.c src/g23m-aci/aci/ati_omcompat.c |
diffstat | 3 files changed, 44 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/aci2/alr/alr_csf.c Thu Jun 14 03:04:53 2018 +0000 +++ b/src/aci2/alr/alr_csf.c Thu Jun 14 06:04:54 2018 +0000 @@ -177,4 +177,33 @@ #endif /* !NTRACE */ +/* + * Function added in FreeCalypso to support Openmoko's AT@BAND command + * without making ACI include ALR header files. + */ + +GLOBAL void alr_get_band_of_serving_cell (char *strbuf) +{ + switch(alr_data->sc_band) + { + case BAND_GSM_900: + strcpy(strbuf, "GSM 900"); + break; + case BAND_DCS_1800: + strcpy(strbuf, "DCS 1800"); + break; + case BAND_PCS_1900: + strcpy(strbuf, "PCS 1900"); + break; + case BAND_E_GSM: + strcpy(strbuf, "EGSM"); + break; + case BAND_GSM_850: + strcpy(strbuf, "GSM 850"); + break; + default: + strcpy(strbuf, "Unknown"); + } +} + #endif
--- a/src/g23m-aci/aci/ati_cmd.c Thu Jun 14 03:04:53 2018 +0000 +++ b/src/g23m-aci/aci/ati_cmd.c Thu Jun 14 06:04:54 2018 +0000 @@ -1202,9 +1202,7 @@ {"@ST", AT_CMD_P_ST, atAtST, test_gen, queatAtST, "%s: (-26,-23,-20,-17,-14,-11,-8,-5,-2,1)"}, {"@POFF", AT_CMD_P_POFF, atAtPOFF, 0, 0, 0}, {"@RST", AT_CMD_P_RST, atAtRST, 0, 0, 0}, -#if 0 {"@BAND", AT_CMD_P_BAND, atAtBAND, 0, 0, 0}, -#endif /* FreeCalypso additions */ #if defined(CONFIG_TARGET_DSAMPLE) || defined(CONFIG_TARGET_FCDEV3B) {"@SPKR", AT_CMD_AT_SPKR, atAtSPKR, test_gen, queatAtSPKR, "%s: (0,1)"},
--- a/src/g23m-aci/aci/ati_omcompat.c Thu Jun 14 03:04:53 2018 +0000 +++ b/src/g23m-aci/aci/ati_omcompat.c Thu Jun 14 06:04:54 2018 +0000 @@ -61,6 +61,8 @@ #include "abb.h" #include "dar/dar_api.h" +EXTERN void alr_get_band_of_serving_cell (char *strbuf); + /* * PURPOSE : @ST command (Configure the sidetone level) */ @@ -137,5 +139,18 @@ return (ATI_CMPL); } +/* + * PURPOSE : @BAND command (Get RF band) + */ + +GLOBAL T_ATI_RSLT atAtBAND (char *cl, UBYTE srcId) +{ + TRACE_FUNCTION("atAtBAND"); + alr_get_band_of_serving_cell(g_sa); + io_sendMessage(srcId, g_sa, ATI_NORMAL_OUTPUT); + + return (ATI_CMPL); +} + #endif /* ATI_OMCOMPAT_C */