]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/abstractions/platform/freertos/include/platform/iot_network_freertos.h
Rename \FreeRTOS-Plus\Source\FreeRTOS-Plus-IoT-SDK to \FreeRTOS-Plus\Source\FreeRTOS...
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-IoT-Libraries / abstractions / platform / freertos / include / platform / iot_network_freertos.h
diff --git a/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/abstractions/platform/freertos/include/platform/iot_network_freertos.h b/FreeRTOS-Plus/Source/FreeRTOS-IoT-Libraries/abstractions/platform/freertos/include/platform/iot_network_freertos.h
new file mode 100644 (file)
index 0000000..e4449ae
--- /dev/null
@@ -0,0 +1,140 @@
+/*\r
+ * Amazon FreeRTOS Platform V1.0.0\r
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ *\r
+ * http://aws.amazon.com/freertos\r
+ * http://www.FreeRTOS.org\r
+ */\r
+\r
+/**\r
+ * @file iot_network_freertos.h\r
+ * @brief Declares the network stack functions specified in aws_iot_network.h for\r
+ * Amazon FreeRTOS Secure Sockets.\r
+ */\r
+\r
+#ifndef _IOT_NETWORK_AFR_H_\r
+#define _IOT_NETWORK_AFR_H_\r
+\r
+/* Standard includes. */\r
+#include <stdbool.h>\r
+\r
+/* Platform network include. */\r
+#include "platform/iot_network.h"\r
+\r
+/* Amazon FreeRTOS Secure Sockets include. */\r
+#include "iot_secure_sockets.h"\r
+\r
+/**\r
+ * @brief Represents a network connection that uses Amazon FreeRTOS Secure Sockets.\r
+ *\r
+ * This is an incomplete type. In application code, only pointers to this type\r
+ * should be used.\r
+ */\r
+typedef struct _networkConnection IotNetworkConnectionAfr_t;\r
+\r
+/**\r
+ * @brief Provides a default value for an #IotNetworkConnectionAfr_t.\r
+ *\r
+ * All instances of #IotNetworkConnectionAfr_t should be initialized with\r
+ * this constant.\r
+ *\r
+ * @warning Failing to initialize an #IotNetworkConnectionAfr_t with this\r
+ * initializer may result in undefined behavior!\r
+ * @note This initializer may change at any time in future versions, but its\r
+ * name will remain the same.\r
+ */\r
+#define IOT_NETWORK_CONNECTION_AFR_INITIALIZER     { 0 }\r
+\r
+/**\r
+ * @brief Generic initializer for an #IotNetworkServerInfo_t.\r
+ *\r
+ * @note This initializer may change at any time in future versions, but its\r
+ * name will remain the same.\r
+ */\r
+#define IOT_NETWORK_SERVER_INFO_AFR_INITIALIZER    { 0 }\r
+\r
+/**\r
+ * @brief Generic initializer for an #IotNetworkCredentials_t.\r
+ *\r
+ * @note This initializer may change at any time in future versions, but its\r
+ * name will remain the same.\r
+ */\r
+#define IOT_NETWORK_CREDENTIALS_AFR_INITIALIZER    { 0 }\r
+\r
+/**\r
+ * @brief Provides a pointer to an #IotNetworkInterface_t that uses the functions\r
+ * declared in this file.\r
+ */\r
+#define IOT_NETWORK_INTERFACE_AFR    ( &( IotNetworkAfr ) )\r
+\r
+/**\r
+ * @brief An implementation of #IotNetworkInterface_t::create for Amazon FreeRTOS\r
+ * Secure Sockets.\r
+ */\r
+IotNetworkError_t IotNetworkAfr_Create( void * pConnectionInfo,\r
+                                        void * pCredentialInfo,\r
+                                        void ** const pConnection );\r
+\r
+/**\r
+ * @brief An implementation of #IotNetworkInterface_t::setReceiveCallback for\r
+ * Amazon FreeRTOS Secure Sockets.\r
+ */\r
+IotNetworkError_t IotNetworkAfr_SetReceiveCallback( void * pConnection,\r
+                                                    IotNetworkReceiveCallback_t receiveCallback,\r
+                                                    void * pContext );\r
+\r
+/**\r
+ * @brief An implementation of #IotNetworkInterface_t::send for Amazon FreeRTOS\r
+ * Secure Sockets.\r
+ */\r
+size_t IotNetworkAfr_Send( void * pConnection,\r
+                           const uint8_t * pMessage,\r
+                           size_t messageLength );\r
+\r
+/**\r
+ * @brief An implementation of #IotNetworkInterface_t::receive for Amazon FreeRTOS\r
+ * Secure Sockets.\r
+ */\r
+size_t IotNetworkAfr_Receive( void * pConnection,\r
+                              uint8_t * pBuffer,\r
+                              size_t bytesRequested );\r
+\r
+/**\r
+ * @brief An implementation of #IotNetworkInterface_t::close for Amazon FreeRTOS\r
+ * Secure Sockets.\r
+ */\r
+IotNetworkError_t IotNetworkAfr_Close( void * pConnection );\r
+\r
+/**\r
+ * @brief An implementation of #IotNetworkInterface_t::destroy for Amazon FreeRTOS\r
+ * Secure Sockets.\r
+ */\r
+IotNetworkError_t IotNetworkAfr_Destroy( void * pConnection );\r
+\r
+/**\r
+ * @cond DOXYGEN_IGNORE\r
+ * Doxygen should ignore this section.\r
+ *\r
+ * Declaration of a network interface struct using the functions in this file.\r
+ */\r
+extern const IotNetworkInterface_t IotNetworkAfr;\r
+/** @endcond */\r
+\r
+#endif /* ifndef _IOT_NETWORK_AFR_H_ */\r