annotate src/cs/drivers/drv_app/r2d/r2d_blrr_api.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 bb1f572ac098
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
217
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module implements the blrr_display_ctrl() function defined
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * in r2d_blrr_api.h; this implementation consists of posting the
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * necessary internal message to the R2D task.
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 */
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include "r2d/r2d_blrr_api.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include "r2d/r2d_i.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include "r2d/r2d_messages.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include "rv/rv_general.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include "rvf/rvf_api.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 #include "rvm/rvm_use_id_list.h"
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 T_RV_RET blrr_display_ctrl(enum blrr_display_state arg)
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 {
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 T_R2D_EVT *msg;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
224
bb1f572ac098 BLRR display control: emit debug trace
Mychaela Falconia <falcon@freecalypso.org>
parents: 217
diff changeset
18 rvf_send_trace("BLRR display state change", 25, arg,
bb1f572ac098 BLRR display control: emit debug trace
Mychaela Falconia <falcon@freecalypso.org>
parents: 217
diff changeset
19 RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID);
217
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 if (rvf_get_buf(r2d_mb_id, sizeof(T_R2D_EVT), (T_RVF_BUFFER **)&msg)
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 == RVF_RED) {
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 rvf_send_trace(
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 "rvf_get_buf() failed in blrr_display_ctrl()", 43,
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 NULL_PARAM, RV_TRACE_LEVEL_ERROR, R2D_USE_ID);
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 return RV_MEMORY_ERR;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 }
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 msg->os_hdr.msg_id = R2D_MESSAGE_ONOFF;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 msg->os_hdr.src_addr_id = r2d_addr_id;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 msg->os_hdr.dest_addr_id = r2d_addr_id;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 msg->os_hdr.callback_func = NULL;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 msg->status = arg;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 if (rvf_send_msg(r2d_addr_id, msg) != RV_OK) {
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 rvf_send_trace("blrr_display_ctrl(): Send failed!", 33,
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 NULL_PARAM, RV_TRACE_LEVEL_ERROR, R2D_USE_ID);
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 rvf_free_buf(msg);
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 return RV_INTERNAL_ERR;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 }
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 return RV_OK;
6541e43f88e5 R2D display on/off control implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 }