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 aws_iot_network.h for
\r
29 * Amazon FreeRTOS Secure Sockets.
\r
32 #ifndef _IOT_NETWORK_AFR_H_
\r
33 #define _IOT_NETWORK_AFR_H_
\r
35 /* Standard includes. */
\r
36 #include <stdbool.h>
\r
38 /* Platform network include. */
\r
39 #include "platform/iot_network.h"
\r
41 /* Amazon FreeRTOS Secure Sockets include. */
\r
42 #include "iot_secure_sockets.h"
\r
45 * @brief Represents a network connection that uses Amazon FreeRTOS Secure Sockets.
\r
47 * This is an incomplete type. In application code, only pointers to this type
\r
50 typedef struct _networkConnection IotNetworkConnectionAfr_t;
\r
53 * @brief Provides a default value for an #IotNetworkConnectionAfr_t.
\r
55 * All instances of #IotNetworkConnectionAfr_t should be initialized with
\r
58 * @warning Failing to initialize an #IotNetworkConnectionAfr_t with this
\r
59 * initializer may result in undefined behavior!
\r
60 * @note This initializer may change at any time in future versions, but its
\r
61 * name will remain the same.
\r
63 #define IOT_NETWORK_CONNECTION_AFR_INITIALIZER { 0 }
\r
66 * @brief Generic initializer for an #IotNetworkServerInfo_t.
\r
68 * @note This initializer may change at any time in future versions, but its
\r
69 * name will remain the same.
\r
71 #define IOT_NETWORK_SERVER_INFO_AFR_INITIALIZER { 0 }
\r
74 * @brief Generic initializer for an #IotNetworkCredentials_t.
\r
76 * @note This initializer may change at any time in future versions, but its
\r
77 * name will remain the same.
\r
79 #define IOT_NETWORK_CREDENTIALS_AFR_INITIALIZER { 0 }
\r
82 * @brief Provides a pointer to an #IotNetworkInterface_t that uses the functions
\r
83 * declared in this file.
\r
85 #define IOT_NETWORK_INTERFACE_AFR ( &( IotNetworkAfr ) )
\r
88 * @brief An implementation of #IotNetworkInterface_t::create for Amazon FreeRTOS
\r
91 IotNetworkError_t IotNetworkAfr_Create( void * pConnectionInfo,
\r
92 void * pCredentialInfo,
\r
93 void ** const pConnection );
\r
96 * @brief An implementation of #IotNetworkInterface_t::setReceiveCallback for
\r
97 * Amazon FreeRTOS Secure Sockets.
\r
99 IotNetworkError_t IotNetworkAfr_SetReceiveCallback( void * pConnection,
\r
100 IotNetworkReceiveCallback_t receiveCallback,
\r
104 * @brief An implementation of #IotNetworkInterface_t::send for Amazon FreeRTOS
\r
107 size_t IotNetworkAfr_Send( void * pConnection,
\r
108 const uint8_t * pMessage,
\r
109 size_t messageLength );
\r
112 * @brief An implementation of #IotNetworkInterface_t::receive for Amazon FreeRTOS
\r
115 size_t IotNetworkAfr_Receive( void * pConnection,
\r
117 size_t bytesRequested );
\r
120 * @brief An implementation of #IotNetworkInterface_t::close for Amazon FreeRTOS
\r
123 IotNetworkError_t IotNetworkAfr_Close( void * pConnection );
\r
126 * @brief An implementation of #IotNetworkInterface_t::destroy for Amazon FreeRTOS
\r
129 IotNetworkError_t IotNetworkAfr_Destroy( void * pConnection );
\r
132 * @cond DOXYGEN_IGNORE
\r
133 * Doxygen should ignore this section.
\r
135 * Declaration of a network interface struct using the functions in this file.
\r
137 extern const IotNetworkInterface_t IotNetworkAfr;
\r
140 #endif /* ifndef _IOT_NETWORK_AFR_H_ */
\r