IoTHub raw messaging client sample using AMQP
Dependencies: iothub_client EthernetInterface NTPClient iothub_amqp_transport azure_c_shared_utility mbed-rtos mbed azure_uamqp_c wolfSSL
This sample showcases the usage of Azure IoT client libraries with the AMQP transport for sending/receiving raw messages from an IoT Hub.
Diff: iothub_client_sample_amqp.c
- Revision:
- 74:d20e4ff30068
- Parent:
- 69:06d895ef6bfc
- Child:
- 78:7acff4261af4
diff -r b935a5a2abb6 -r d20e4ff30068 iothub_client_sample_amqp.c --- a/iothub_client_sample_amqp.c Fri Jun 16 16:17:31 2017 -0700 +++ b/iothub_client_sample_amqp.c Fri Jun 30 10:42:19 2017 -0700 @@ -156,6 +156,10 @@ bool traceOn = true; IoTHubClient_LL_SetOption(iotHubClientHandle, "logtrace", &traceOn); + // Set keep alive is optional. If it is not set the default (240 secs) will be used. If it is zero the service won't send keep alive messages. + uint32_t c2d_keep_alive_freq_secs = 120; + IoTHubClient_LL_SetOption(iotHubClientHandle, "c2d_keep_alive_freq_secs", &c2d_keep_alive_freq_secs); + #ifdef MBED_BUILD_TIMESTAMP // For mbed add the certificate information if (IoTHubClient_LL_SetOption(iotHubClientHandle, "TrustedCerts", certificates) != IOTHUB_CLIENT_OK)