Azure IoT middleware for FreeRTOS
azure_iot_http.h
Go to the documentation of this file.
1 /* Copyright (c) Microsoft Corporation.
2  * Licensed under the MIT License. */
3 
12 #ifndef AZURE_IOT_HTTP_H
13 #define AZURE_IOT_HTTP_H
14 
15 #include <stdint.h>
16 
17 #include "azure_iot_http_port.h"
19 
24 #define azureiothttpHttpRangeRequestEndOfFile -1
25 
30 typedef AzureIoTHTTP_t * AzureIoTHTTPHandle_t;
31 
36 typedef enum AzureIoTHTTPResult
37 {
38  eAzureIoTHTTPSuccess = 0,
39  eAzureIoTHTTPInvalidParameter,
40  eAzureIoTHTTPNetworkError,
41  eAzureIoTHTTPPartialResponse,
42  eAzureIoTHTTPNoResponse,
43  eAzureIoTHTTPInsufficientMemory,
44  eAzureIoTHTTPSecurityAlertResponseHeadersSizeLimitExceeded,
45  eAzureIoTHTTPSecurityAlertExtraneousResponseData,
46  eAzureIoTHTTPSecurityAlertInvalidChunkHeader,
47  eAzureIoTHTTPSecurityAlertInvalidProtocolVersion,
48  eAzureIoTHTTPSecurityAlertInvalidStatusCode,
49  eAzureIoTHTTPSecurityAlertInvalidCharacter,
50  eAzureIoTHTTPSecurityAlertInvalidContentLength,
51  eAzureIoTHTTPParserInternalError,
52  eAzureIoTHTTPHeaderNotFound,
53  eAzureIoTHTTPInvalidResponse,
54  eAzureIoTHTTPError
56 
71  AzureIoTTransportInterface_t * pxHTTPTransport,
72  const char * pucURL,
73  uint32_t ulURLLength,
74  const char * pucPath,
75  uint32_t ulPathLength,
76  char * pucHeaderBuffer,
77  uint32_t ulHeaderBufferLength );
78 
92  int32_t lRangeStart,
93  int32_t lRangeEnd,
94  char * pucDataBuffer,
95  uint32_t ulDataBufferLength,
96  char ** ppucOutData,
97  uint32_t * pulOutDataLength );
98 
113  AzureIoTTransportInterface_t * pxHTTPTransport,
114  const char * pucURL,
115  uint32_t ulURLLength,
116  const char * pucPath,
117  uint32_t ulPathLength,
118  char * pucHeaderBuffer,
119  uint32_t ulHeaderBufferLength );
120 
132  char * pucDataBuffer,
133  uint32_t ulDataBufferLength );
134 
144 
145 #endif /* AZURE_IOT_HTTP_H */
AzureIoTHTTPResult_t AzureIoTHTTP_Init(AzureIoTHTTPHandle_t xHTTPHandle, AzureIoTTransportInterface_t *pxHTTPTransport, const char *pucURL, uint32_t ulURLLength, const char *pucPath, uint32_t ulPathLength, char *pucHeaderBuffer, uint32_t ulHeaderBufferLength)
Initialize the Azure HTTP client.
AzureIoTHTTP_t * AzureIoTHTTPHandle_t
The handle for the Azure HTTP client.
Definition: azure_iot_http.h:30
int32_t AzureIoTHTTP_RequestSize(AzureIoTHTTPHandle_t xHTTPHandle, char *pucDataBuffer, uint32_t ulDataBufferLength)
Send a size request.
AzureIoTHTTPResult_t AzureIoTHTTP_Request(AzureIoTHTTPHandle_t xHTTPHandle, int32_t lRangeStart, int32_t lRangeEnd, char *pucDataBuffer, uint32_t ulDataBufferLength, char **ppucOutData, uint32_t *pulOutDataLength)
Send an HTTP GET request.
AzureIoTHTTPResult_t AzureIoTHTTP_Deinit(AzureIoTHTTPHandle_t xHTTPHandle)
Deinitialize the Azure HTTP client.
enum AzureIoTHTTPResult AzureIoTHTTPResult_t
Azure HTTP return codes.
AzureIoTHTTPResult_t AzureIoTHTTP_RequestSizeInit(AzureIoTHTTPHandle_t xHTTPHandle, AzureIoTTransportInterface_t *pxHTTPTransport, const char *pucURL, uint32_t ulURLLength, const char *pucPath, uint32_t ulPathLength, char *pucHeaderBuffer, uint32_t ulHeaderBufferLength)
Initialize a size request.
AzureIoTHTTPResult
Azure HTTP return codes.
Definition: azure_iot_http.h:37
Transport interface definition to send and receive data over the network.
The transport layer interface.
Definition: azure_iot_transport_interface.h:159