FreeRTOS: FreeRTOS Cellular Library v1.4.0
FreeRTOS Cellular Library
 
Loading...
Searching...
No Matches
cellular_comm_interface.h
Go to the documentation of this file.
1/*
2 * FreeRTOS-Cellular-Interface v1.4.0
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * https://www.FreeRTOS.org
25 * https://github.com/FreeRTOS
26 */
27
32#ifndef __CELLULAR_COMM_INTERFACE_H__
33#define __CELLULAR_COMM_INTERFACE_H__
34
35/* *INDENT-OFF* */
36#ifdef __cplusplus
37 extern "C" {
38#endif
39/* *INDENT-ON* */
40
41#include "cellular_types.h"
42
43/* Standard includes. */
44#include <stdint.h>
45
49typedef enum CellularCommInterfaceError
50{
59
60struct CellularCommInterfaceContext;
61
65typedef struct CellularCommInterfaceContext * CellularCommInterfaceHandle_t;
66
81 CellularCommInterfaceHandle_t commInterfaceHandle );
82
96 void * pUserData,
97 CellularCommInterfaceHandle_t * pCommInterfaceHandle );
98
115 const uint8_t * pData,
116 uint32_t dataLength,
117 uint32_t timeoutMilliseconds,
118 uint32_t * pDataSentLength );
119
137 uint8_t * pBuffer,
138 uint32_t bufferLength,
139 uint32_t timeoutMilliseconds,
140 uint32_t * pDataReceivedLength );
141
152
159typedef struct CellularCommInterface
160{
166
167/* *INDENT-OFF* */
168#ifdef __cplusplus
169 }
170#endif
171/* *INDENT-ON* */
172
173#endif /* __CELLULAR_COMM_INTERFACE_H__ */
CellularCommInterfaceError_t(* CellularCommInterfaceRecv_t)(CellularCommInterfaceHandle_t commInterfaceHandle, uint8_t *pBuffer, uint32_t bufferLength, uint32_t timeoutMilliseconds, uint32_t *pDataReceivedLength)
Receive data from the comm interface.
Definition: cellular_comm_interface.h:136
CellularCommInterfaceError_t(* CellularCommInterfaceReceiveCallback_t)(void *pUserData, CellularCommInterfaceHandle_t commInterfaceHandle)
Provide an asynchronous notification of incoming data.
Definition: cellular_comm_interface.h:80
CellularCommInterfaceError_t(* CellularCommInterfaceClose_t)(CellularCommInterfaceHandle_t commInterfaceHandle)
Close the connection to the comm interface.
Definition: cellular_comm_interface.h:151
CellularCommInterfaceError_t(* CellularCommInterfaceSend_t)(CellularCommInterfaceHandle_t commInterfaceHandle, const uint8_t *pData, uint32_t dataLength, uint32_t timeoutMilliseconds, uint32_t *pDataSentLength)
Send data to the comm interface.
Definition: cellular_comm_interface.h:114
CellularCommInterfaceError_t(* CellularCommInterfaceOpen_t)(CellularCommInterfaceReceiveCallback_t receiveCallback, void *pUserData, CellularCommInterfaceHandle_t *pCommInterfaceHandle)
Open a connection to the comm interface.
Definition: cellular_comm_interface.h:95
CellularCommInterfaceError_t
Return codes from various APIs.
Definition: cellular_comm_interface.h:50
@ IOT_COMM_INTERFACE_SUCCESS
Definition: cellular_comm_interface.h:51
@ IOT_COMM_INTERFACE_NO_MEMORY
Definition: cellular_comm_interface.h:54
@ IOT_COMM_INTERFACE_BAD_PARAMETER
Definition: cellular_comm_interface.h:53
@ IOT_COMM_INTERFACE_FAILURE
Definition: cellular_comm_interface.h:52
@ IOT_COMM_INTERFACE_DRIVER_ERROR
Definition: cellular_comm_interface.h:56
@ IOT_COMM_INTERFACE_TIMEOUT
Definition: cellular_comm_interface.h:55
@ IOT_COMM_INTERFACE_BUSY
Definition: cellular_comm_interface.h:57
struct CellularCommInterfaceContext * CellularCommInterfaceHandle_t
Opaque handle to comm interface.
Definition: cellular_comm_interface.h:65
Represents the functions of a comm interface.
Definition: cellular_comm_interface.h:160
CellularCommInterfaceRecv_t recv
Definition: cellular_comm_interface.h:163
CellularCommInterfaceSend_t send
Definition: cellular_comm_interface.h:162
CellularCommInterfaceClose_t close
Definition: cellular_comm_interface.h:164
CellularCommInterfaceOpen_t open
Definition: cellular_comm_interface.h:161