You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DevGuide.md
+11-1
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,16 @@ The SDK uses [RapidJson](https://github.com/miloyip/rapidjson) to provide Json p
114
114
115
115
Please note that while RapidJson supports nested Json parsing and the SDK itself also supports it, operations such as merge and diff are very expensive. The server supports a nested Json depth of up to 5. But the SDK uses recursion to perform nested Json operations which might cause issues on devices with limited resources. The recommended approach is to keep the Json depth as low as possible. Code for the merge and diff operations can be seen in [here](./src/util/JsonParser.cpp).
116
116
117
+
<aname="logging"></a>
118
+
### Logging
119
+
The ConsoleLogSystem class is used to provide logging capabilities. To enable logging in your application, using the PubSub sample as an example:
120
+
*[Create](./samples/PubSub/PubSub.cpp#L271) an instance of the ConsoleLogSystem
121
+
*[Initialize](./samples/PubSub/PubSub.cpp#L273) the instance
122
+
* Define a [log tag](./samples/PubSub/PubSub.cpp#L40) for use in the application
123
+
* Use [AWS_LOG_INFO](./src/mqtt/Connect.cpp#L74) for logging information
124
+
* Use [AWS_LOG_ERROR](./samples/PubSub/PubSub.cpp#142) for logging errors
125
+
126
+
117
127
<aname="advancedguide"></a>
118
128
## Advanced Usage Guidelines
119
129
The SDK can also be used to create custom clients for different use cases. The SDK is structured around a Core Client and Actions that are executed by this client. The provided MQTT Client referenced above, is simply one implementation that uses all the supported Actions. Custom Clients can be created using only some of the Actions which perform only a subset of MQTT functionality.
@@ -153,4 +163,4 @@ Please note that the provided Shadow implementation uses the full MQTT Client in
153
163
* All threads created in the above manner are cleared out when either the PerformAction function returns or the ClientCore instance goes out of scope
154
164
* To Perform a registered Action, the PerformAction and PerformActionAsync APIs can be used depending on desired behavior
155
165
* Only one Sync/Blocking action can be performed at a time in the current version of the SDK
156
-
* When the ClientCore instance goes out of scope, the destructor automatically stops all running threads and frees any memory associated with those threads
166
+
* When the ClientCore instance goes out of scope, the destructor automatically stops all running threads and frees any memory associated with those threads
- Client Core - Reduce shared pointer usage, figure out ways to use fewer copy operations
7
7
- Network Read - Add recovery options for out of sync buffers
8
8
- Network Layer, Common - Currently, vector resize is called before the vector is passed for reading in data. Determine if a more flexible solution is possible with fewer allocations
9
-
- Network Layer, OpenSSL - error handling for library API calls
10
-
- Network Layer, OpenSSL - memory leak
9
+
- Network Layer, OpenSSL - error handling for library API call
10
+
- Network Layer, OpenSSL - setting for disconnect timeouts
11
11
- Network Layer, WebSocket - Refactor WSLay and merge it with the WebSocket wrapper, improve testing
12
12
- Network Layer, WebSocket - TLS Read and Write are highly inefficient in current implementation, improvements required
13
13
- Network Layer, Common - Add support for IPv6, remove deprecated system API calls
Copy file name to clipboardExpand all lines: README.md
+68-2
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
## ***** NOTICE *****
2
+
3
+
This repository is moving to a new branching system. The master branch will now contain bug fixes/features that have been minimally tested to ensure nothing major is broken. The release branch will contain new releases for the SDK that have been tested thoroughly on all supported platforms. Please ensure that you are tracking the release branch for all production work.
4
+
5
+
This change will allow us to push out bug fixes quickly and avoid having situations where issues stay open for a very long time.
6
+
1
7
## AWS IoT C++ Device SDK
2
8
3
9
*[Overview](#overview)
@@ -36,6 +42,15 @@ Primary aspects are:
36
42
* Support for multiple platforms and compilers. Tested on Linux, Windows (with VS2015) and Mac OS
37
43
* Flexibility in picking and choosing functionality, can create Clients which only perform a subset of MQTT operations
38
44
* Support for Rapidjson allowing use of complex shadow document structures
45
+
46
+
<aname="metrics"></a>
47
+
## Collection of Metrics
48
+
Beginning with Release v1.2.0 of the SDK, AWS collects usage metrics indicating which language and version of the SDK is being used. This allows us to prioritize our resources towards addressing issues faster in SDKs that see the most and is an important data point. However, we do understand that not all customers would want to report this data by default. In that case, the sending of usage metrics can be easily disabled by the user by using the overloaded Connect action which takes in a boolean for enabling or disabling the SDK metrics:
std::move(client_id), nullptr, nullptr, nullptr, false); // false for disabling metrics
53
+
```
39
54
40
55
<aname="getstarted"></a>
41
56
## How to get started ?
@@ -92,10 +107,40 @@ We provide the following reference implementations for the Network layer:
92
107
* Please be aware that while the provided reference implementation allows initialization of credentials from any source, the recommended way to do so is to use the aws cli to generate credential files and read the generated files
93
108
* Use the https port setting from the config file while setting up the network instance
94
109
110
+
### Cross-compiling the SDK for other platforms
111
+
The included ToolchainFile.cmake file can be used to cross-compile the SDK for other platforms.
112
+
Procedure for testing cross compiling (if using OpenSSL):
113
+
114
+
1. build/download toolchain for specific platform
115
+
2. modify the ToolchainFile.cmake with location and target of toolchain.
116
+
```
117
+
# specify toolchain directory
118
+
SET(TOOLCHAIN_DIR /home/toolchain/dir/here/bin)
119
+
120
+
# specify cross compilation target
121
+
SET(TARGET_CROSS target-here)`
122
+
```
123
+
3. Cross-compile OpenSSL using the same toolchain
124
+
4. modify `network/CMakeLists.txt.in` and change OpenSSL library location to cross-compiled OpenSSL
6. Scp the application binary, certs and config for the application into the platform you're testing
133
+
7. Run `./<application>`
134
+
135
+
For MbedTLS, you don't need to cross-compile MbedTLS as it gets compiled when you run `make` with the same compiler as pointed to by the toolchain file.
136
+
137
+
Also included is a simple example 'toolchain' which is used for setting the default compiler as clang++ instead of g++ as an example to show how the toolchain file can be modified.
138
+
139
+
95
140
<aname="quicklinks"></a>
96
141
## Quick Links
97
142
98
-
*[SDK Documentation](http://aws-iot-device-sdk-cpp-docs.s3-website-us-east-1.amazonaws.com/v1.0.0/index.html) - API documentation for the SDK
143
+
*[SDK Documentation](http://aws-iot-device-sdk-cpp-docs.s3-website-us-east-1.amazonaws.com/v1.2.0/index.html) - API documentation for the SDK
99
144
*[Platform Guide](./Platform.md) - This file lists the steps needed to set up the pre-requisites on some popular platforms
100
145
*[Developers Guide](./DevGuide.md) - Provides a guide on how the SDK can be included in custom code
101
146
*[Greengrass Discovery Support Guide](./GreengrassDiscovery.md) - Provides information on support for AWS Greengrass Discovery Service
0 commit comments