forked from Azure/azure-iot-sdk-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Device Streaming to Azure IoT C SDK
Enable Device Streaming E2E tests Revert improvements in initialize_iothub_client (iothub_client_core_ll.c) Update CONSTBUFFER function calls in iothubtransport_amqp_streaming_ut Fixes for device streaming code and tests Fix memory leak on device streaming e2e tests Update device streaming code with macro_utils renamed macros Adding timeouts to device streaming e2e test requests Disable device streaming over websockets tests if using wolfssl Set trusted cert on uws_client to connect to streaming gateway (ds e2e tests) Disable device streaming tests over websockets when using wolfssl Add more logging on device streaming e2e tests (print SGW urls) Update device streaming code to use product info callback Change device streaming proxy sample to chunk outgoing data into up to 64kb WS frames update readme with device streams DEVICE_STREAM_C2D_REQUEST shall be const (GH issue Azure#901) Rename iothub_client_streaming.h (gh Azure#900) Fixes for DeviceStreaming samples (includes gh#820) Fixed incorrect includes
- Loading branch information
Showing
115 changed files
with
18,462 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
iothub_client/devdoc/requirement_docs/iothub_client_streaming_requirements.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# iothub_client_streaming Requirements | ||
|
||
|
||
## Overview | ||
|
||
This module provides functionality for handling Device Stream requests and responses. | ||
|
||
|
||
## Exposed API | ||
|
||
```c | ||
typedef struct DEVICE_STREAM_C2D_REQUEST_TAG | ||
{ | ||
char* name; | ||
char* uri; | ||
char* authorization_token; | ||
char* request_id; | ||
} DEVICE_STREAM_C2D_REQUEST; | ||
|
||
typedef struct DEVICE_STREAM_C2D_RESPONSE_TAG | ||
{ | ||
bool accept; | ||
char* request_id; | ||
} DEVICE_STREAM_C2D_RESPONSE; | ||
|
||
typedef DEVICE_STREAM_C2D_RESPONSE* (*DEVICE_STREAM_C2D_REQUEST_CALLBACK)(DEVICE_STREAM_C2D_REQUEST* request, const void* context); | ||
|
||
extern DEVICE_STREAM_C2D_RESPONSE* IoTHubClient_StreamC2DResponseCreate(DEVICE_STREAM_C2D_REQUEST* request, bool accept, char* data, char* content_type, char* content_encoding); | ||
extern DEVICE_STREAM_C2D_REQUEST* IoTHubClient_StreamC2DRequestClone(DEVICE_STREAM_C2D_REQUEST* request); | ||
extern void IoTHubClient_StreamC2DResponseDestroy(DEVICE_STREAM_C2D_RESPONSE* response); | ||
extern void IoTHubClient_StreamC2DRequestDestroy(DEVICE_STREAM_C2D_REQUEST* request); | ||
``` | ||
### IoTHubClient_StreamC2DResponseCreate | ||
```c | ||
extern DEVICE_STREAM_C2D_RESPONSE* IoTHubClient_StreamC2DResponseCreate(DEVICE_STREAM_C2D_REQUEST* request, bool accept, char* data, char* content_type, char* content_encoding); | ||
``` | ||
|
||
**SRS_IOTHUB_CLIENT_STREAMING_09_010: [** If `request` is NULL, the function shall return NULL **]** | ||
|
||
**SRS_IOTHUB_CLIENT_STREAMING_09_011: [** The function shall allocate memory for a new instance of DEVICE_STREAM_C2D_RESPONSE (aka `response`) **]** | ||
|
||
**SRS_IOTHUB_CLIENT_STREAMING_09_012: [** If malloc fails, the function shall return NULL **]** | ||
|
||
**SRS_IOTHUB_CLIENT_STREAMING_09_013: [** `request->request_id` shall be copied into `response->request_id` **]** | ||
|
||
|
||
### IoTHubClient_StreamC2DRequestClone | ||
|
||
```c | ||
extern DEVICE_STREAM_C2D_REQUEST* IoTHubClient_StreamC2DRequestClone(DEVICE_STREAM_C2D_REQUEST* request); | ||
``` | ||
**SRS_IOTHUB_CLIENT_STREAMING_09_016: [** If `request` is NULL, the function shall return NULL **]** | ||
**SRS_IOTHUB_CLIENT_STREAMING_09_017: [** The function shall allocate memory for a new instance of DEVICE_STREAM_C2D_REQUEST (aka `clone`) **]** | ||
**SRS_IOTHUB_CLIENT_STREAMING_09_018: [** If malloc fails, the function shall return NULL **]** | ||
**SRS_IOTHUB_CLIENT_STREAMING_09_019: [** All fields of `request` shall be copied into `clone` **]** | ||
**SRS_IOTHUB_CLIENT_STREAMING_09_020: [** If any field fails to be copied, the function shall release the memory allocated and return NULL **]** | ||
### IoTHubClient_StreamC2DResponseDestroy | ||
```c | ||
extern void IoTHubClient_StreamC2DResponseDestroy(DEVICE_STREAM_C2D_RESPONSE* response); | ||
``` | ||
|
||
**SRS_IOTHUB_CLIENT_STREAMING_09_021: [** If `request` is NULL, the function shall return **]** | ||
|
||
**SRS_IOTHUB_CLIENT_STREAMING_09_022: [** The memory allocated for `response` shall be released **]** | ||
|
||
|
||
### IoTHubClient_StreamC2DRequestDestroy | ||
|
||
```c | ||
extern void IoTHubClient_StreamC2DRequestDestroy(DEVICE_STREAM_C2D_REQUEST* request); | ||
``` | ||
**SRS_IOTHUB_CLIENT_STREAMING_09_023: [** If `request` is NULL, the function shall return **]** | ||
**SRS_IOTHUB_CLIENT_STREAMING_09_024: [** The memory allocated for `request` shall be released **]** | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.