2 * Amazon FreeRTOS Platform V1.0.0
\r
3 * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
6 * this software and associated documentation files (the "Software"), to deal in
\r
7 * the Software without restriction, including without limitation the rights to
\r
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
9 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
10 * subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in all
\r
13 * copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
22 * http://aws.amazon.com/freertos
\r
23 * http://www.FreeRTOS.org
\r
27 * @file iot_network_freertos.h
\r
28 * @brief Declares the network stack functions specified in iot_network.h for
\r
32 #ifndef _IOT_NETWORK_FREERTOS_H_
\r
33 #define _IOT_NETWORK_FREERTOS_H_
\r
35 /* Standard includes. */
\r
36 #include <stdbool.h>
\r
38 /* Platform network include. */
\r
39 #include "platform/iot_network.h"
\r
42 * @brief Represents a network connection that uses FreeRTOS+TCP sockets.
\r
44 * This is an incomplete type. In application code, only pointers to this type
\r
47 typedef struct _networkConnection IotNetworkConnectionFreeRTOS_t;
\r
50 * @brief Provides a default value for an #IotNetworkConnectionFreeRTOS_t.
\r
52 * All instances of #IotNetworkConnectionFreeRTOS_t should be initialized with
\r
55 * @warning Failing to initialize an #IotNetworkConnectionFreeRTOS_t with this
\r
56 * initializer may result in undefined behavior!
\r
57 * @note This initializer may change at any time in future versions, but its
\r
58 * name will remain the same.
\r
60 #define IOT_NETWORK_CONNECTION_FREERTOS_INITIALIZER { 0 }
\r
63 * @brief Generic initializer for an #IotNetworkServerInfo_t.
\r
65 * @note This initializer may change at any time in future versions, but its
\r
66 * name will remain the same.
\r
68 #define IOT_NETWORK_SERVER_INFO_FREERTOS_INITIALIZER { 0 }
\r
71 * @brief Generic initializer for an #IotNetworkCredentials_t.
\r
73 * @note This initializer may change at any time in future versions, but its
\r
74 * name will remain the same.
\r
76 #define IOT_NETWORK_CREDENTIALS_FREERTOS_INITIALIZER { 0 }
\r
79 * @brief Provides a pointer to an #IotNetworkInterface_t that uses the functions
\r
80 * declared in this file.
\r
82 #define IOT_NETWORK_INTERFACE_FREERTOS ( &( IotNetworkFreeRTOS ) )
\r
85 * @brief An implementation of #IotNetworkInterface_t::create for FreeRTOS+TCP
\r
88 IotNetworkError_t IotNetworkFreeRTOS_Create( void * pConnectionInfo,
\r
89 void * pCredentialInfo,
\r
90 void ** const pConnection );
\r
93 * @brief An implementation of #IotNetworkInterface_t::setReceiveCallback for
\r
94 * FreeRTOS+TCP sockets.
\r
96 IotNetworkError_t IotNetworkFreeRTOS_SetReceiveCallback( void * pConnection,
\r
97 IotNetworkReceiveCallback_t receiveCallback,
\r
101 * @brief An implementation of #IotNetworkInterface_t::send for FreeRTOS+TCP
\r
104 size_t IotNetworkFreeRTOS_Send( void * pConnection,
\r
105 const uint8_t * pMessage,
\r
106 size_t messageLength );
\r
109 * @brief An implementation of #IotNetworkInterface_t::receive for FreeRTOS+TCP
\r
112 size_t IotNetworkFreeRTOS_Receive( void * pConnection,
\r
114 size_t bytesRequested );
\r
117 * @brief An implementation of #IotNetworkInterface_t::close for FreeRTOS+TCP
\r
120 IotNetworkError_t IotNetworkFreeRTOS_Close( void * pConnection );
\r
123 * @brief An implementation of #IotNetworkInterface_t::destroy for FreeRTOS+TCP
\r
126 IotNetworkError_t IotNetworkFreeRTOS_Destroy( void * pConnection );
\r
129 * @cond DOXYGEN_IGNORE
\r
130 * Doxygen should ignore this section.
\r
132 * Declaration of a network interface struct using the functions in this file.
\r
134 extern const IotNetworkInterface_t IotNetworkFreeRTOS;
\r
137 #endif /* ifndef _IOT_NETWORK_FREERTOS_H_ */
\r