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: PortingGuide.md
+11-8
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@ Current SDK Directory Layout (mbedTLS)
15
15
|--`include` (Header files of the AWS IoT device SDK) <br>
16
16
|--`src` (Source files of the AWS IoT device SDK) <br>
17
17
|--`platform` (Platform specific files) <br>
18
-
|--`samples` (Samples including makefiles for building on mbedTLS) <br>
19
-
|--`tests` (Tests for verifying SDK is functioning as expected) <br>
18
+
|--`samples` (Samples including makefiles for building on mbedTLS) <br>
19
+
|--`tests` (Tests for verifying SDK is functioning as expected) <br>
20
20
21
21
All makefiles in this SDK were configured using the documented folder structure above, so moving or renaming folders will require modifications to makefiles.
22
22
@@ -44,7 +44,7 @@ This section explains the API calls that need to be implemented in order for the
44
44
45
45
### Timer Functions
46
46
47
-
A timer implementation is necessary to handle request timeouts (sending MQTT connect, subscribe, etc. commands) as well as connection maintenance (MQTT keep-alive pings). Timers need millisecond resolution and are polled for expiration so these can be implemented using a "milliseconds since startup" free-running counter if desired. In the synchronous sample provided with this SDK only one command will be "in flight" at one point in time plus the client's ping timer.
47
+
A timer implementation is necessary to handle request timeouts (sending MQTT connect, subscribe, etc. commands) as well as connection maintenance (MQTT keep-alive pings). Timers need millisecond resolution and are polled for expiration so these can be implemented using a "milliseconds since startup" free-running counter if desired. In the synchronous sample provided with this SDK only one command will be "in flight" at one point in time plus the client's ping timer.
48
48
49
49
Define the `Timer` Struct as in `timer_platform.h`
50
50
@@ -63,10 +63,13 @@ countdown_sec - set the timer to expire in x seconds and start the timer.
63
63
`uint32_t left_ms(Timer *);`
64
64
left_ms - query time in milliseconds left on the timer.
65
65
66
+
`void delay(unsigned milliseconds)`
67
+
delay - sleep for the specified number of milliseconds.
68
+
66
69
67
70
### Network Functions
68
71
69
-
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.
72
+
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.
70
73
71
74
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).
72
75
@@ -76,7 +79,7 @@ This is used for data specific to the TLS library being used.
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.
@@ -102,15 +105,15 @@ The TLS library generally provides the API for the underlying TCP socket.
102
105
103
106
### Threading Functions
104
107
105
-
The MQTT client uses a state machine to control operations in multi-threaded situations. However it requires a mutex implementation to guarantee thread safety. This is not required in situations where thread safety is not important and it is disabled by default. The _ENABLE_THREAD_SUPPORT_ macro needs to be defined in aws_iot_config.h to enable this layer. You will also need to add the -lpthread linker flag for the compiler if you are using the provided reference implementation.
108
+
The MQTT client uses a state machine to control operations in multi-threaded situations. However it requires a mutex implementation to guarantee thread safety. This is not required in situations where thread safety is not important and it is disabled by default. The _ENABLE_THREAD_SUPPORT_ macro needs to be defined in aws_iot_config.h to enable this layer. You will also need to add the -lpthread linker flag for the compiler if you are using the provided reference implementation.
106
109
107
110
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).
108
111
109
112
Define the `IoT_Mutex_t` Struct as in `threads_platform.h`
110
113
This is used for data specific to the TLS library being used.
@@ -125,7 +128,7 @@ The threading layer provides the implementation of mutexes used for thread-safe
125
128
126
129
### Sample Porting:
127
130
128
-
Marvell has ported the SDK for their development boards. [These](https://github.com/marvell-iot/aws_starter_sdk/tree/master/sdk/external/aws_iot/platform/wmsdk) files are example implementations of the above mentioned functions.
131
+
Marvell has ported the SDK for their development boards. [These](https://github.com/marvell-iot/aws_starter_sdk/tree/master/sdk/external/aws_iot/platform/wmsdk) files are example implementations of the above mentioned functions.
129
132
This provides a port of the timer and network layer. The threading layer is not a part of this port.
0 commit comments