view 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
line wrap: on
line source

/*
 * This module implements the blrr_display_ctrl() function defined
 * in r2d_blrr_api.h; this implementation consists of posting the
 * necessary internal message to the R2D task.
 */

#include "r2d/r2d_blrr_api.h"
#include "r2d/r2d_i.h"
#include "r2d/r2d_messages.h"
#include "rv/rv_general.h"
#include "rvf/rvf_api.h"
#include "rvm/rvm_use_id_list.h"

T_RV_RET blrr_display_ctrl(enum blrr_display_state arg)
{
	T_R2D_EVT *msg;

	rvf_send_trace("BLRR display state change", 25, arg,
			RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID);
	if (rvf_get_buf(r2d_mb_id, sizeof(T_R2D_EVT), (T_RVF_BUFFER **)&msg)
	    == RVF_RED) {
		rvf_send_trace(
			"rvf_get_buf() failed in blrr_display_ctrl()", 43,
			NULL_PARAM, RV_TRACE_LEVEL_ERROR, R2D_USE_ID);
		return RV_MEMORY_ERR;
	}
	msg->os_hdr.msg_id        = R2D_MESSAGE_ONOFF;
	msg->os_hdr.src_addr_id   = r2d_addr_id;
	msg->os_hdr.dest_addr_id  = r2d_addr_id;
	msg->os_hdr.callback_func = NULL;
	msg->status = arg;
	if (rvf_send_msg(r2d_addr_id, msg) != RV_OK) {
		rvf_send_trace("blrr_display_ctrl(): Send failed!", 33,
				NULL_PARAM, RV_TRACE_LEVEL_ERROR, R2D_USE_ID);
		rvf_free_buf(msg);
		return RV_INTERNAL_ERR;
	}
	return RV_OK;
}