|
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) |
|
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:
Configuration | Options | Default | Description |
Parameter Checking |
-
Default (BSP)
-
Enabled
-
Disabled
| Default (BSP) | Selects if code for parameter checking is to be included in the build. |
Receive Buffer | Size should be greater than zero | 256 | 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 Size | Size should be greater than zero | 512 | 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)
Configuration | Options | Default | Description |
Name | Name must be a valid C symbol | g_rm_cellular_comm_uart0 | Module name. |
◆ 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_callback | Callback to call upon receiving data |
[in] | pUserData | Pointer to user data to be passed through callback |
[in] | p_instance_ctrl | Pointer to a rm_cellular_comm_uart_aws_instance_ctrl_t |
- Return values
-
IOT_COMM_INTERFACE_SUCCESS | Open succeeded |
IOT_COMM_INTERFACE_BAD_PARAMETER | Bad parameter was passed in |
IOT_COMM_INTERFACE_FAILURE | General failure |
IOT_COMM_INTERFACE_DRIVER_ERROR | Lower 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] | commInterfaceHandle | CellularCommInterfaceHandle_t assigned in open |
[in] | pData | Pointer to data to send |
[in] | dataLength | Length of data to send |
[in] | timeoutMilliseconds | Timeout in MS to wait for data to send |
[in] | pDataSentLength | Actual length of data sent |
- Return values
-
IOT_COMM_INTERFACE_SUCCESS | Send succeeded |
IOT_COMM_INTERFACE_BAD_PARAMETER | Bad parameter was passed in |
IOT_COMM_INTERFACE_FAILURE | General failure |
IOT_COMM_INTERFACE_DRIVER_ERROR | Lower level failure |
IOT_COMM_INTERFACE_TIMEOUT | Send 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] | commInterfaceHandle | CellularCommInterfaceHandle_t assigned in open |
[in] | pBuffer | Pointer to buffer to receive to |
[in] | bufferLength | Length of buffer |
[in] | timeoutMilliseconds | Timeout in MS to wait for data reception |
[in] | pDataReceivedLength | Actual length of data received |
- Return values
-
IOT_COMM_INTERFACE_SUCCESS | Receieve succeeded |
IOT_COMM_INTERFACE_BAD_PARAMETER | Bad parameter was passed in |
IOT_COMM_INTERFACE_FAILURE | General failure |
IOT_COMM_INTERFACE_DRIVER_ERROR | Lower 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] | commInterfaceHandle | CellularCommInterfaceHandle_t assigned in open |
- Return values
-
IOT_COMM_INTERFACE_SUCCESS | Close succeeded |
IOT_COMM_INTERFACE_BAD_PARAMETER | Bad parameter was passed in |
IOT_COMM_INTERFACE_FAILURE | General failure |
◆ comm_uart_aws_callback()
Callback for UART driver
- Parameters
-
[in] | p_args | Arguments from UART RX/TX callback |