Skip to content

Commit 8aa5c18

Browse files
committed
Release of version 2.0.0
1 parent d2ed84c commit 8aa5c18

File tree

96 files changed

+6851
-6604
lines changed

Some content is hidden

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

96 files changed

+6851
-6604
lines changed

CHANGELOG.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,58 @@
11
#Change Log
2-
## [1.1.2](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.2) (April 22,2016)
2+
## [2.0.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v2.0.0) (April 28, 2016)
3+
4+
New features:
5+
6+
- Refactored API to make it instance specific. This is a breaking change in the API from 1.x releases because a Client Instance parameter had to be added to all APIs
7+
- Added Threading library porting layer wrapper
8+
- Added support for multiple connections from one application
9+
- Shadows and connections de-linked, connection needs to be set up separately, can be used independently of shadow
10+
- Added integration tests for testing SDK functionality
311

412
Bugfixes/Improvements:
13+
14+
- Yield cannot be called again while waiting for application callback to return
15+
- Fixed issue with TLS layer handles not being cleaned up properly on connection failure reported [here](https://github.com/aws/aws-iot-device-sdk-embedded-C/issues/16)
16+
- Renamed timer_linux.h to timer_platform.h as requested [here](https://github.com/aws/aws-iot-device-sdk-embedded-C/issues/5)
17+
- Adds support for disconnect handler to shadow. A similar pull request can be found [here](https://github.com/aws/aws-iot-device-sdk-embedded-C/pull/9)
18+
- New SDK folder structure, cleaned and simplified code structure
19+
- Removed Paho Wrapper, Merge MQTT into SDK code, added specific error codes
20+
- Refactored Network and Timer layer wrappers, added specific error codes
21+
- Refactored samples and makefiles
22+
23+
## [1.1.2](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.2) (April 22, 2016)
24+
25+
Bugfixes/Improvements:
26+
527
- Signature mismatch in MQTT library file fixed
628
- Makefiles have a protective target on the top to prevent accidental execution
729

8-
## [1.1.1](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.1) (April 1,2016)
30+
## [1.1.1](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.1) (April 1, 2016)
931

1032
Bugfixes/Improvements:
33+
1134
- Removing the Executable bit from all the files in the repository. Fixing [this](https://github.com/aws/aws-iot-device-sdk-embedded-C/issues/14) issue
1235
- Refactoring MQTT client to remove declaration after statement warnings
1336
- Fixing [this](https://forums.aws.amazon.com/thread.jspa?threadID=222467&tstart=0) bug
1437

1538

16-
## [1.1.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.0) (February 10,2016)
39+
## [1.1.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.1.0) (February 10, 2016)
1740
Features:
41+
1842
- Auto Reconnect and Resubscribe
43+
1944
Bugfixes/Improvements:
45+
2046
- MQTT buffer handling incase of bigger message
2147
- Large timeout values converted to seconds and milliseconds
2248
- Dynamic loading of Shadow parameters. Client ID and Thing Name are not hard-coded
2349
- MQTT Library refactored
2450

2551

26-
## [1.0.1](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.0.1) (October 21,2015)
52+
## [1.0.1](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.0.1) (October 21, 2015)
2753

2854
Bugfixes/Improvements:
55+
2956
- Paho name changed to Eclipse Paho
3057
- Renamed the Makefiles in the samples directory
3158
- Device Shadow - Delete functionality macro fixed
@@ -34,6 +61,7 @@ Bugfixes/Improvements:
3461
## [1.0.0](https://github.com/aws/aws-iot-device-sdk-embedded-C/releases/tag/v1.0.0) (October 8, 2015)
3562

3663
Features:
64+
3765
- Release to github
3866
- SDK tarballs made available for public download
3967

NOTICE.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ Amazon Inc (http://www.amazon.com/).
77
**********************
88
THIRD PARTY COMPONENTS
99
**********************
10-
This software includes third party software subject to the following copyrights:
10+
This software includes third party software subject to the following licensing:
1111
- Embedded C MQTT Client - From the Eclipse Paho Project - EPL v1.0
12-
- mbedTLS
13-
- jsmn (JSON Parsing)
14-
- cURL (hostname verification)
15-
- SSL Conservatory (hostname verification)
12+
- mbedTLS (external library, included in tarball or downloaded separately) - Apache 2.0
13+
- jsmn (JSON Parsing) - MIT
14+
- cURL (hostname verification) - MIT
1615

1716
The licenses for these third party components are included in LICENSE.txt

PortingGuide.md

Lines changed: 78 additions & 70 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
##Note: Upgrade
2-
3-
Makefiles in the samples folder had the executable bit set and could potentially delete all files of the host machine if executed as a bash script.
4-
More details could be found [here](https://github.com/aws/aws-iot-device-sdk-embedded-C/issues/14). Please upgrade to the latest version of the SDK.
5-
61
##Overview
72

83
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/).
@@ -20,20 +15,19 @@ The Device SDK implements the specific protocol for Thing Shadows to retrieve, u
2015
The embedded C SDK was specifically designed for resource constrained devices (running on micro-controllers and RTOS).
2116

2217
Primary aspects are:
23-
* Flexibility in picking and choosing functionalities (reduce memory footprint)
18+
* Flexibility in picking and choosing functionality (reduce memory footprint)
2419
* Static memory only (no malloc’s)
2520
* Configurable resource usage(JSON tokens, MQTT subscription handlers, etc…)
26-
* Portability across RTOS due to use of wrapper functionality
21+
* Can be ported to a different RTOS, uses wrappers for OS specific functions
2722

2823
For more information on the Architecture of the SDK refer [here](http://aws-iot-device-sdk-embedded-c-docs.s3-website-us-east-1.amazonaws.com/index.html)
2924

3025
##How to get started ?
3126
Ensure you understand the AWS IoT platform and create the necessary certificates and policies. For more information on the AWS IoT platform please visit the [AWS IoT developer guide](http://docs.aws.amazon.com/iot/latest/developerguide/iot-security-identity.html).
3227

33-
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.
28+
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 SDK is configured for the mbedTLS library and can be built out of the box with *GCC* using *make utility*. The tarball can be downloaded from the below link:
3429

35-
* [OpenSSL](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_openssl-1.1.2.tar)
36-
* [mbedTLS from ARM](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_mbedtls-1.1.2.tar)
30+
* [mbedTLS from ARM](https://s3.amazonaws.com/aws-iot-device-sdk-embedded-c/linux_mqtt_mbedtls-2.0.0.tar)
3731

3832
##Installation
3933
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.
@@ -43,64 +37,74 @@ Steps:
4337
* Create a directory to hold your application e.g. (/home/<user>/aws_iot/my_app)
4438
* Change directory to this new directory
4539
* Download the SDK to device and place in the newly created directory
46-
* Expand the tarball (tar -xf <tarball.tar>). This will create 4 directories:
47-
* `aws_iot_src` - the AWS IoT SDK source files
48-
* `sample_apps` - the sample applications
49-
* `aws_mqtt_embedded_client_lib` - the aws MQTT client derived from [Eclipse Paho](http://www.eclipse.org/paho/clients/c/embedded/) Embedded C client
50-
* `certs` - TLS certificates directory
51-
* Change directory to sample_apps. The following sample applications are included:
52-
* `subscribe_publish_sample` - a simple pub/sub MQTT example
53-
* `shadow_sample` - a simple device shadow example using a connected window example
54-
* `shadow_sample_console_echo` - a sample to work with the AWS IoT Console interactive guide
55-
* For each sample:
56-
* Explore the example. It connects to AWS IoT platform using MQTT and demonstrates few actions that can be performed by the SDK
57-
* Build the example using make. (''make'')
58-
* Place device identity cert and private key in locations referenced in the example (certs/). Alternatively, you can run the sample application with the ''-c'' flag to point to a specific certificate directory.
59-
* Download certificate authority CA file from [Symantec](https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem) and place in location referenced in the example (certs/). Ensure the names of the cert files are the same as in the `aws_iot_config.h` file
60-
* Run sample application (./subscribe_publish_sample or ./shadow_sample). The sample will print status messages to stdout.
61-
* More information on the examples could be found in the sample source file
40+
* Expand the tarball (tar -xf <tarball.tar>). This will create the below directories:
41+
* `certs` - TLS certificates directory
42+
* `docs` - SDK API and file documentation
43+
* `external_libs` - The mbedTLS and jsmn source files
44+
* `include` - The AWS IoT SDK header files
45+
* `platform` - Platform specific files for timer, TLS and threading layers
46+
* `samples` - The sample applications
47+
* `src` - The AWS IoT SDK source files
48+
* `tests` - Contains tests for verifying that the SDK is functioning as expected. More information can be found [here](https://github.com/aws/aws-iot-device-sdk-embedded-c/blob/master/tests/README.md)
49+
* View further information on how to use the SDK in the Readme file for samples that can be found [here](https://github.com/aws/aws-iot-device-sdk-embedded-c/blob/master/samples/README.md)
6250

6351
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).
6452

65-
##Porting to different platforms
66-
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).
53+
## Porting to different platforms
54+
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).
55+
56+
## Migrating from 1.x to 2.x
57+
The 2.x branch makes several changes to the SDK. This section provides information on what changes will be required in the client application for migrating from v1.x to 2.x.
58+
59+
* The first change is in the folder structure. Client applications using the SDK now need to keep only the certs, external_libs, include, src and platform folder in their application. The folder descriptions can be found above
60+
* All the SDK headers are in the `include` folder. These need to be added to the makefile as include directories
61+
* The source files are in the `src` folder. These need to be added to the makefile as one of the source directories
62+
* Similar to 1.x, the platform folder contains the platform specific headers and source files. These need to be added to the makefile as well
63+
* The `platform/threading` folder only needs to be added if multi-threading is required, and the `_ENABLE_THREAD_SUPPORT_` macro is defined in config
64+
* The list below provides a mapping for migrating from the major APIs used in 1.x to the new APIs:
6765

68-
##Resources
66+
| Description | 1.x | 2.x |
67+
| :---------- | :-- | :-- |
68+
| Initializing the client | ```void aws_iot_mqtt_init(MQTTClient_t *pClient);``` | ```IoT_Error_t aws_iot_mqtt_init(AWS_IoT_Client *pClient, IoT_Client_Init_Params *pInitParams);``` |
69+
| Connect | ```IoT_Error_t aws_iot_mqtt_connect(MQTTConnectParams *pParams);``` | ```IoT_Error_t aws_iot_mqtt_connect(AWS_IoT_Client *pClient, IoT_Client_Connect_Params *pConnectParams);``` |
70+
| Subscribe | ```IoT_Error_t aws_iot_mqtt_subscribe(MQTTSubscribeParams *pParams);``` | ```IoT_Error_t aws_iot_mqtt_subscribe(AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen, QoS qos, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData);``` |
71+
| Unsubscribe | ```IoT_Error_t aws_iot_mqtt_unsubscribe(char *pTopic);``` | ```IoT_Error_t aws_iot_mqtt_unsubscribe(AWS_IoT_Client *pClient, const char *pTopicFilter, uint16_t topicFilterLen);``` |
72+
| Yield | ```IoT_Error_t aws_iot_mqtt_yield(int timeout);``` | ```IoT_Error_t aws_iot_mqtt_yield(AWS_IoT_Client *pClient, uint32_t timeout_ms);``` |
73+
| Publish | ```IoT_Error_t aws_iot_mqtt_publish(MQTTPublishParams *pParams);``` | ```IoT_Error_t aws_iot_mqtt_publish(AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen, IoT_Publish_Message_Params *pParams);``` |
74+
| Disconnect | ```IoT_Error_t aws_iot_mqtt_disconnect(void);``` | ```IoT_Error_t aws_iot_mqtt_disconnect(AWS_IoT_Client *pClient);``` |
75+
76+
You can find more information on how to use the new APIs in the Readme file for samples that can be found [here](https://github.com/aws/aws-iot-device-sdk-embedded-c/blob/master/samples/README.md)
77+
78+
## Resources
6979
[API Documentation](http://aws-iot-device-sdk-embedded-c-docs.s3-website-us-east-1.amazonaws.com/index.html)
7080

7181
[MQTT 3.1.1 Spec](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/csprd02/mqtt-v3.1.1-csprd02.html)
7282

73-
##Support
83+
## Support
7484
If you have any technical questions about AWS IoT Device SDK, use the [AWS IoT forum](https://forums.aws.amazon.com/forum.jspa?forumID=210).
7585
For any other questions on AWS IoT, contact [AWS Support](https://aws.amazon.com/contact-us/).
7686

77-
##Sample APIs
87+
## Sample APIs
7888
Connecting to the AWS IoT MQTT platform
7989

8090
```
81-
rc = aws_iot_mqtt_connect( &connectParams ) ;
91+
AWS_IoT_Client client;
92+
rc = aws_iot_mqtt_init(&client, &iotInitParams);
93+
rc = aws_iot_mqtt_connect(&client, &iotConnectParams);
8294
```
8395

8496

8597
Subscribe to a topic
8698

8799
```
88-
MQTTSubscribeParams subParams = MQTTSubscribeParamsDefault;
89-
subParams.mHandler = MQTTcallbackHandler;
90-
subParams.qos = QOS_0;
91-
subParams.pTopic = "sdkTest/sub";
92-
rc = aws_iot_mqtt_subscribe( &subParams ) ;
100+
AWS_IoT_Client client;
101+
rc = aws_iot_mqtt_subscribe(&client, "sdkTest/sub", 11, QOS0, iot_subscribe_callback_handler, NULL);
93102
```
94103

95104

96105
Update Thing Shadow from a device
97106

98107
```
99-
rc = aws_iot_shadow_update(&mqttClient,
100-
AWS_IOT_MY_THING_NAME,
101-
pJsonDocumentBuffer,
102-
ShadowUpdateStatusCallback,
103-
pCallbackContext,
104-
TIMEOUT_4SEC,
105-
persistenSubscription);
106-
```
108+
rc = aws_iot_shadow_update(&mqttClient, AWS_IOT_MY_THING_NAME, pJsonDocumentBuffer, ShadowUpdateStatusCallback,
109+
pCallbackContext, TIMEOUT_4SEC, persistenSubscription);
110+
```

0 commit comments

Comments
 (0)