RA Flexible Software Package Documentation  Release v5.2.0

 
Cellular Comm Interface on UART (rm_cellular_comm_uart_aws)

Functions

CellularCommInterfaceError_t RM_CELLULAR_COMM_UART_AWS_Open (rm_cellular_comm_uart_aws_instance_ctrl_t *p_instance_ctrl, CellularCommInterfaceReceiveCallback_t receive_callback, void *pUserData)
 
CellularCommInterfaceError_t RM_CELLULAR_COMM_UART_AWS_Send (CellularCommInterfaceHandle_t commInterfaceHandle, const uint8_t *pData, uint32_t dataLength, uint32_t timeoutMilliseconds, uint32_t *pDataSentLength)
 
CellularCommInterfaceError_t RM_CELLULAR_COMM_UART_AWS_Receive (CellularCommInterfaceHandle_t commInterfaceHandle, uint8_t *pBuffer, uint32_t bufferLength, uint32_t timeoutMilliseconds, uint32_t *pDataReceivedLength)
 
CellularCommInterfaceError_t RM_CELLULAR_COMM_UART_AWS_Close (CellularCommInterfaceHandle_t commInterfaceHandle)
 
void comm_uart_aws_callback (uart_callback_args_t *p_args)
 

Detailed Description

Middleware implementing the AWS Cellular Comm Interface for the FSP UART API.

Overview

See AWS documentation for how the Cellular Comm Interface works: https://www.freertos.org/Documentation/api-ref/cellular/cellular_porting.html#cellular_porting_comm_if

Configuration

Note
Using DTC with UART is recommended to reduce the number of interrupts in the system.

Build Time Configurations for rm_cellular_comm_uart_aws

The following build time configurations are defined in fsp_cfg/middleware/rm_cellular_comm_uart_aws_cfg.h:

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
Default (BSP) Selects if code for parameter checking is to be included in the build.
Receive BufferSize should be greater than zero256 Temporary buffer for received bytes. When read function is called reamaining bytes will be read directly into buffer specified by read function argument.
Receive Transfer SizeSize should be greater than zero512 The comm interface will break down UART reads into smaller read requests based on this number. For instance if this is set to 512 bytes then the interface will request 512 bytes at a time until the requested length is met or timeout. This is helpful for making use of DTC without having a long timeout period. AWS Cellular Interface Common->Comm Interface Receive Timeout is the timeout used for individual reads and should set accordingly based on this setting.

Configurations for Networking > Cellular Comm Interface on UART (rm_cellular_comm_uart_aws)

ConfigurationOptionsDefaultDescription
NameName must be a valid C symbolg_rm_cellular_comm_uart0 Module name.

Function Documentation

◆ RM_CELLULAR_COMM_UART_AWS_Open()

CellularCommInterfaceError_t RM_CELLULAR_COMM_UART_AWS_Open ( rm_cellular_comm_uart_aws_instance_ctrl_t *  p_instance_ctrl,
CellularCommInterfaceReceiveCallback_t  receive_callback,
void *  pUserData 
)

Implements open for CellularCommInterface_t

Parameters
[in]receive_callbackCallback to call upon receiving data
[in]pUserDataPointer to user data to be passed through callback
[in]p_instance_ctrlPointer to a rm_cellular_comm_uart_aws_instance_ctrl_t
Return values
IOT_COMM_INTERFACE_SUCCESSOpen succeeded
IOT_COMM_INTERFACE_BAD_PARAMETERBad parameter was passed in
IOT_COMM_INTERFACE_FAILUREGeneral failure
IOT_COMM_INTERFACE_DRIVER_ERRORLower level failure

◆ RM_CELLULAR_COMM_UART_AWS_Send()

CellularCommInterfaceError_t RM_CELLULAR_COMM_UART_AWS_Send ( CellularCommInterfaceHandle_t  commInterfaceHandle,
const uint8_t *  pData,
uint32_t  dataLength,
uint32_t  timeoutMilliseconds,
uint32_t *  pDataSentLength 
)

Implements send for CellularCommInterface_t. This function will block the calling thread until data is sent.

Parameters
[in]commInterfaceHandleCellularCommInterfaceHandle_t assigned in open
[in]pDataPointer to data to send
[in]dataLengthLength of data to send
[in]timeoutMillisecondsTimeout in MS to wait for data to send
[in]pDataSentLengthActual length of data sent
Return values
IOT_COMM_INTERFACE_SUCCESSSend succeeded
IOT_COMM_INTERFACE_BAD_PARAMETERBad parameter was passed in
IOT_COMM_INTERFACE_FAILUREGeneral failure
IOT_COMM_INTERFACE_DRIVER_ERRORLower level failure
IOT_COMM_INTERFACE_TIMEOUTSend operation timed out

◆ RM_CELLULAR_COMM_UART_AWS_Receive()

CellularCommInterfaceError_t RM_CELLULAR_COMM_UART_AWS_Receive ( CellularCommInterfaceHandle_t  commInterfaceHandle,
uint8_t *  pBuffer,
uint32_t  bufferLength,
uint32_t  timeoutMilliseconds,
uint32_t *  pDataReceivedLength 
)

Implements receive for CellularCommInterface_t. This function will block the calling thread until data is received.

Parameters
[in]commInterfaceHandleCellularCommInterfaceHandle_t assigned in open
[in]pBufferPointer to buffer to receive to
[in]bufferLengthLength of buffer
[in]timeoutMillisecondsTimeout in MS to wait for data reception
[in]pDataReceivedLengthActual length of data received
Return values
IOT_COMM_INTERFACE_SUCCESSReceieve succeeded
IOT_COMM_INTERFACE_BAD_PARAMETERBad parameter was passed in
IOT_COMM_INTERFACE_FAILUREGeneral failure
IOT_COMM_INTERFACE_DRIVER_ERRORLower level failure

◆ RM_CELLULAR_COMM_UART_AWS_Close()

CellularCommInterfaceError_t RM_CELLULAR_COMM_UART_AWS_Close ( CellularCommInterfaceHandle_t  commInterfaceHandle)

Implements close for CellularCommInterface_t

Parameters
[in]commInterfaceHandleCellularCommInterfaceHandle_t assigned in open
Return values
IOT_COMM_INTERFACE_SUCCESSClose succeeded
IOT_COMM_INTERFACE_BAD_PARAMETERBad parameter was passed in
IOT_COMM_INTERFACE_FAILUREGeneral failure

◆ comm_uart_aws_callback()

void comm_uart_aws_callback ( uart_callback_args_t p_args)

Callback for UART driver

Parameters
[in]p_argsArguments from UART RX/TX callback