FreeRTOS: FreeRTOS Cellular Library v1.4.0
FreeRTOS Cellular Library
 
Loading...
Searching...
No Matches
cellular_module_urc_handler

Implement URC handler to handle URC event and call the corresponding callback function.

Example URC handler table:

CellularAtParseTokenMap_t CellularUrcHandlerTable[] =
{
{ "NORMAL POWER DOWN", _Cellular_ProcessPowerDown },
}
uint32_t CellularUrcHandlerTableSize = 4;
CellularPktStatus_t Cellular_CommonUrcProcessCereg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CEREG handler for FreeRTOS Cellular Library.
Definition: cellular_3gpp_urc_handler.c:680
CellularPktStatus_t Cellular_CommonUrcProcessCreg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CREG handler for FreeRTOS Cellular Library.
Definition: cellular_3gpp_urc_handler.c:626
CellularPktStatus_t Cellular_CommonUrcProcessCgreg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CGREG handler for FreeRTOS Cellular Library.
Definition: cellular_3gpp_urc_handler.c:653
the URC token and URC handler mapping structure used by pkthandler.
Definition: cellular_common.h:101


There are two types of URC strings can be handled with this table:

  • URC with prefix
    This type of URC string is of the following format:

    <URC_leading_char><URC_prefix>":"<URC_payload>

    The logic to check the URC prefix can be referenced in Cellular_ATIsPrefixPresent
    Example of URC with prefix: "+CREG:2,0"
    In this example,
    URC_leading_char is "+"
    URC_prefix is "CREG"
    URC_payload is "2,0"
    The URC callback function, CellularAtParseTokenHandler_t, will be called with parameter pInputStr point to string URC_payload, "2,0" in this example.

    ‍The default prefix leading char can be referenced in this config CELLULAR_CHECK_IS_PREFIX_LEADING_CHAR.
    The default valid prefix string chars can be referenced in this config CELLULAR_CHECK_IS_PREFIX_CHAR.
    Reference Customization config for prefix string. for more information.

  • URC without prefix
    This type of URC string is of fixed format.
    Example of URC without prefix : "NORMAL POWER DOWN"
    The URC callback function, CellularAtParseTokenHandler_t, will be called with parameter pInputStr point to URC string, "NORMAL POWER DOWN" in this example.