Skip to content

Commit 69b3228

Browse files
author
bhadrip
committed
Release of version 1.1.0
1 parent 4ffe458 commit 69b3228

File tree

98 files changed

+2233
-7228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2233
-7228
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
#Change Log
2+
## [1.1.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.0) (February 10,2016)
3+
Features:
4+
- Auto Reconnect and Resubscribe
5+
Bugfixes/Improvements:
6+
- MQTT buffer handling incase of bigger message
7+
- Large timeout values converted to seconds and milliseconds
8+
- Dynamic loading of Shadow parameters. Client ID and Thing Name are not hard-coded
9+
- MQTT Library refactored
10+
11+
112
## [1.0.1](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.0.1) (October 21,2015)
213

314
Bugfixes/Improvements:

PortingGuide.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ The scope of this document is to provide instructions to modify the provided sou
66
##Contents of the SDK
77

88
The SDK ported for linux can be downloaded from the below links.
9-
* [OpenSSL](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_openssl-1.0.1.tar)
10-
* [mbedTLS from ARM](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_mbedtls-1.0.1.tar)
9+
* [OpenSSL](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_openssl-1.1.0.tar)
10+
* [mbedTLS from ARM](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_mbedtls-1.1.0.tar)
1111

1212
The C-code files of this SDK are delivered via the following directory structure (see comment behind folder name for an explanation of its content).
1313

@@ -52,57 +52,56 @@ A timer implementation is necessary to handle request timeouts (sending MQTT con
5252

5353
Define the `Timer` Struct as in `timer_linux.h`
5454

55-
```
56-
void InitTimer(Timer*);
55+
`void InitTimer(Timer*);`
5756
InitTimer - A timer structure is initialized to a clean state.
5857

59-
char expired(Timer*);
58+
`char expired(Timer*);`
6059
expired - a poling function to determine if the timer has expired.
6160

62-
void countdown_ms(Timer*, unsigned int);
61+
`void countdown_ms(Timer*, unsigned int);`
6362
countdown_ms - set the timer to expire in x milliseconds and start the timer.
6463

65-
void countdown(Timer*, unsigned int);
64+
`void countdown(Timer*, unsigned int);`
6665
countdown - set the timer to expire in x seconds and start the timer.
6766

68-
int left_ms(Timer*);
67+
`int left_ms(Timer*);`
6968
left_ms - query time in milliseconds left on the timer.
70-
```
69+
7170

7271
###Network Functions
7372

7473
In order for the MQTT client stack to be able to communicate via the TCP/IP network protocol stack using a mutually authenticated TLS connection, the following API calls need to be implemented for your platform.
7574

7675
For additional details about API parameters refer to the [API documentation](http://aws-iot-device-sdk-embedded-c-docs.s3-website-us-east-1.amazonaws.com/index.html).
7776

78-
```
79-
int iot_tls_init(Network *pNetwork);
77+
78+
`int iot_tls_init(Network *pNetwork);`
8079
Initialize the network client / structure.
8180

82-
int iot_tls_connect(Network *pNetwork, TLSConnectParams TLSParams);
81+
`int iot_tls_connect(Network *pNetwork, TLSConnectParams TLSParams);`
8382
Create a TLS TCP socket to the configure address using the credentials provided via the NewNetwork API call. This will include setting up certificate locations / arrays.
8483

8584

86-
int iot_tls_read(Network*, unsigned char*, int, int);
85+
`int iot_tls_read(Network*, unsigned char*, int, int);`
8786
Read from the TLS network buffer.
8887

89-
int iot_tls_write(Network*, unsigned char*, int, int);
88+
`int iot_tls_write(Network*, unsigned char*, int, int);`
9089
Write to the TLS network buffer.
9190

92-
void iot_tls_disconnect(Network *pNetwork);
91+
`void iot_tls_disconnect(Network *pNetwork);`
9392
Disconnect API
9493

95-
int iot_tls_destroy(Network *pNetwork);
94+
`int iot_tls_destroy(Network *pNetwork);`
9695
Clean up the connection
97-
```
96+
9897
The TLS library generally provides the API for the underlying TCP socket.
9998

10099
##Time source for certificate validation
101100
As part of the TLS handshake the device (client) needs to validate the server certificate which includes validation of the certificate lifetime requiring that the device is aware of the actual time. Devices should be equipped with a real time clock or should be able to obtain the current time via NTP. Bypassing validation of the lifetime of a certificate is not recommended as it exposes the device to a security vulnerability, as it will still accept server certificates even when they have already expired.
102101

103102
##Integration into operating system
104103
###Single-Threaded implementation
105-
The single threaded implementation implies that the sample application code (SDK + MQTT client) is called periodically by the firmware application running on the main thread. This is done by calling the function `iot_mqtt_yield` (in the simple pub-sub example) and by calling `iot_shadow_yield` (in the device shadow example). In both cases the keep-alive time is set to 10 seconds. This means that the yield functions need to be called at a minimum frequency of once every 10 seconds. Note however that the `iot_mqtt_yield` function takes care of reading incoming MQTT messages from the IoT service as well and hence should be called more frequently depending on the timing requirements of an application. All incoming messages can only be processed at the frequency at which `yield` is called.
104+
The single threaded implementation implies that the sample application code (SDK + MQTT client) is called periodically by the firmware application running on the main thread. This is done by calling the function `iot_mqtt_yield` (in the simple pub-sub example) and by calling `iot_shadow_yield()` (in the device shadow example). In both cases the keep-alive time is set to 10 seconds. This means that the yield functions need to be called at a minimum frequency of once every 10 seconds. Note however that the `iot_mqtt_yield()` function takes care of reading incoming MQTT messages from the IoT service as well and hence should be called more frequently depending on the timing requirements of an application. All incoming messages can only be processed at the frequency at which `yield` is called.
106105

107106
###Multi-Threaded implementation
108107
In the simple multithreaded case the yield() function can be moved to a background thread. Ensure this task runs at the frequency described above. In this case, depending on the OS mechanism, a message queue or mailbox could be used to proxy incoming MQTT messages from the callback to the worker task responsible for responding to or dispatching messages. A similar mechanism could be employed to queue publish messages from threads into a publish queue that are processed by a publishing task.

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
#AWS IoT Embedded-C SDK
2-
31
##Overview
42

5-
The AWS IoT device SDK for embedded C is a collection of C source files which can be used in embedded applications to securely connect to the [AWS IoT platform](http://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html). It includes transport clients **(MQTT)**, **TLS** implementations and examples for their use. It also supports AWS IoT specific features such as **Thing Shadow**. It is distributed in source form and intended to be built into customer firmware along with application code, other libraries and RTOS. For additional information about porting the Device SDK for embedded C onto additional platforms please refer to the [Porting Guide](https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/master/PortingGuide.md).
3+
The AWS IoT device SDK for embedded C is a collection of C source files which can be used in embedded applications to securely connect to the [AWS IoT platform](http://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html). It includes transport clients **MQTT**, **TLS** implementations and examples for their use. It also supports AWS IoT specific features such as **Thing Shadow**. It is distributed in source form and intended to be built into customer firmware along with application code, other libraries and RTOS. For additional information about porting the Device SDK for embedded C onto additional platforms please refer to the [PortingGuide](https://github.com/aws/aws-iot-device-sdk-embedded-c/blob/master/PortingGuide.md/).
64

75
##Features
86
The Device SDK simplifies access to the Pub/Sub functionality of the AWS IoT broker via MQTT and provide APIs to interact with Thing Shadows. The SDK has been tested to work with the AWS IoT platform to ensure best interoperability of a device with the AWS IoT platform.
@@ -29,8 +27,8 @@ Ensure you understand the AWS IoT platform and create the necessary certificates
2927

3028
In order to quickly get started with the AWS IoT platform, we have ported the SDK for POSIX type Operating Systems like Ubuntu, OS X and RHEL. The porting of the SDK happens at the TLS layer, and for the MQTT protocol. The SDK is configured for two TLS libraries and can be built out of the box with *GCC* using *make utility*. The tarballs can be downloaded from the below links.
3129

32-
* [OpenSSL](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_openssl-1.0.1.tar)
33-
* [mbedTLS from ARM](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_mbedtls-1.0.1.tar)
30+
* [OpenSSL](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_openssl-1.1.0.tar)
31+
* [mbedTLS from ARM](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_mbedtls-1.1.0.tar)
3432

3533
##Installation
3634
This section explains the individual steps to retrieve the necessary files and be able to build your first application using the AWS IoT device SDK for embedded C.
@@ -60,7 +58,7 @@ Steps:
6058
Also, for a guided example on getting started with the Thing Shadow, visit the AWS IoT Console's [Interactive Guide](https://console.aws.amazon.com/iot).
6159

6260
##Porting to different platforms
63-
As Embedded devices run on different Real Time Operating Systems and TCP/IP stacks, it is one of the important design goals for the Device SDK to keep it portable. Please refer to the [porting guide](https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/master/PortingGuide.md) to get more information on how to make this SDK run on your devices (i.e. micro-controllers).
61+
As Embedded devices run on different Real Time Operating Systems and TCP/IP stacks, it is one of the important design goals for the Device SDK to keep it portable. Please refer to the [porting guide](https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/master/PortingGuide.md/) to get more information on how to make this SDK run on your devices (i.e. micro-controllers).
6462

6563
##Resources
6664
[API Documentation](http://aws-iot-device-sdk-embedded-c-docs.s3-website-us-east-1.amazonaws.com/index.html)
@@ -73,7 +71,11 @@ For any other questions on AWS IoT, contact [AWS Support](https://aws.amazon.com
7371

7472
##Sample APIs
7573
Connecting to the AWS IoT MQTT platform
76-
``` rc = aws_iot_mqtt_connect(&connectParams);```
74+
75+
```
76+
rc = aws_iot_mqtt_connect( &connectParams ) ;
77+
```
78+
7779

7880
Subscribe to a topic
7981

@@ -82,11 +84,12 @@ MQTTSubscribeParams subParams = MQTTSubscribeParamsDefault;
8284
subParams.mHandler = MQTTcallbackHandler;
8385
subParams.qos = QOS_0;
8486
subParams.pTopic = "sdkTest/sub";
85-
rc = aws_iot_mqtt_subscribe(&subParams);
87+
rc = aws_iot_mqtt_subscribe( &subParams ) ;
8688
```
8789

8890

8991
Update Thing Shadow from a device
92+
9093
```
9194
rc = aws_iot_shadow_update(&mqttClient,
9295
AWS_IOT_MY_THING_NAME,

0 commit comments

Comments
 (0)