FreeCalypso > hg > fc-tourmaline
view src/cs/services/fcbm/fcbm_kpd_if.c @ 303:f76436d19a7a default tip
!GPRS config: fix long-standing AT+COPS chance hanging bug
There has been a long-standing bug in FreeCalypso going back years:
sometimes in the AT command bring-up sequence of an ACI-only MS,
the AT+COPS command would produce only a power scan followed by
cessation of protocol stack activity (only L1 ADC traces), instead
of the expected network search sequence. This behaviour was seen
in different FC firmware versions going back to Citrine, and seemed
to follow some law of chance, not reliably repeatable.
This bug has been tracked down and found to be specific to !GPRS
configuration, stemming from our TCS2/TCS3 hybrid and reconstruction
of !GPRS support that was bitrotten in TCS3.2/LoCosto version.
ACI module psa_mms.c, needed only for !GPRS, was missing in the TCS3
version and had to be pulled from TCS2 - but as it turns out,
there is a new field in the MMR_REG_REQ primitive that needs to be
set correctly, and that psa_mms.c module is the place where this
initialization needed to be added.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 08 Jun 2023 08:23:37 +0000 |
parents | baa738eeb842 |
children |
line wrap: on
line source
/* * This module implements the interface to KPD for FCBM. */ #include "fcbm/fcbm_env.h" #include "fcbm/fcbm_func_i.h" #include "kpd/kpd_api.h" #include "rv/rv_general.h" #include "rvf/rvf_api.h" #include "rvm/rvm_use_id_list.h" static T_KPD_SUBSCRIBER fcbm_kpd_sub; T_RV_RET fcbm_subscribe_kpd(void) { T_RV_RET rc; T_RV_RETURN return_path; T_KPD_VIRTUAL_KEY_TABLE notified_keys; return_path.callback_func = 0; return_path.addr_id = fcbm_addr_id; notified_keys.nb_notified_keys = KPD_NB_PHYSICAL_KEYS; notified_keys.notified_keys[0] = KPD_KEY_0; notified_keys.notified_keys[1] = KPD_KEY_1; notified_keys.notified_keys[2] = KPD_KEY_2; notified_keys.notified_keys[3] = KPD_KEY_3; notified_keys.notified_keys[4] = KPD_KEY_4; notified_keys.notified_keys[5] = KPD_KEY_5; notified_keys.notified_keys[6] = KPD_KEY_6; notified_keys.notified_keys[7] = KPD_KEY_7; notified_keys.notified_keys[8] = KPD_KEY_8; notified_keys.notified_keys[9] = KPD_KEY_9; notified_keys.notified_keys[10] = KPD_KEY_UP; notified_keys.notified_keys[11] = KPD_KEY_DOWN; notified_keys.notified_keys[12] = KPD_KEY_SOFT_LEFT; notified_keys.notified_keys[13] = KPD_KEY_SOFT_RIGHT; notified_keys.notified_keys[14] = KPD_KEY_CONNECT; notified_keys.notified_keys[15] = KPD_KEY_DISCONNECT; notified_keys.notified_keys[16] = KPD_KEY_STAR; notified_keys.notified_keys[17] = KPD_KEY_DIESE; notified_keys.notified_keys[18] = KPD_KEY_LEFT; notified_keys.notified_keys[19] = KPD_KEY_RIGHT; notified_keys.notified_keys[20] = KPD_KEY_ENTER; notified_keys.notified_keys[21] = KPD_KEY_VOL_UP; notified_keys.notified_keys[22] = KPD_KEY_VOL_DOWN; notified_keys.notified_keys[23] = KPD_KEY_RECORD; rc = kpd_subscribe(&fcbm_kpd_sub, KPD_DEFAULT_MODE, ¬ified_keys, return_path); if (rc != RV_OK) { rvf_send_trace("kpd_subscribe() failed", 22, rc, RV_TRACE_LEVEL_ERROR, FCBM_USE_ID); return rc; } /* long press and repeat times are dummies copied from MFW */ rc = kpd_define_key_notification(fcbm_kpd_sub, ¬ified_keys, KPD_FIRST_PRESS_NOTIF | KPD_RELEASE_NOTIF, 30, 50); if (rc != RV_OK) rvf_send_trace("kpd_define_key_notification() failed", 36, rc, RV_TRACE_LEVEL_ERROR, FCBM_USE_ID); return rc; } T_RV_RET fcbm_unsubscribe_kpd(void) { T_RV_RET rc; rc = kpd_unsubscribe(&fcbm_kpd_sub); if (rc != RV_OK) rvf_send_trace("kpd_unsubscribe() failed", 24, rc, RV_TRACE_LEVEL_ERROR, FCBM_USE_ID); return rc; }