Microsoft Azure IoTHub client libraries
Dependents: sht15_remote_monitoring RobotArmDemo iothub_client_sample_amqp f767zi_mqtt ... more
This library implements the Microsoft Azure IoTHub client library. The code is replicated from https://github.com/Azure/azure-iot-sdks
iothub_client_diagnostic.h@85:de16c0a8a196, 2018-03-20 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Tue Mar 20 10:29:00 2018 -0700
- Revision:
- 85:de16c0a8a196
- Parent:
- 77:e4e36df9caee
1.2.1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AzureIoTClient | 77:e4e36df9caee | 1 | // Copyright (c) Microsoft. All rights reserved. |
AzureIoTClient | 77:e4e36df9caee | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
AzureIoTClient | 77:e4e36df9caee | 3 | |
AzureIoTClient | 77:e4e36df9caee | 4 | /** @file iothub_client_diagnostic.h |
AzureIoTClient | 77:e4e36df9caee | 5 | * @brief The @c diagnostic is a component that helps to add predefined diagnostic |
AzureIoTClient | 77:e4e36df9caee | 6 | properties to message for end to end diagnostic purpose |
AzureIoTClient | 77:e4e36df9caee | 7 | */ |
AzureIoTClient | 77:e4e36df9caee | 8 | |
AzureIoTClient | 77:e4e36df9caee | 9 | #ifndef IOTHUB_CLIENT_DIAGNOSTIC_H |
AzureIoTClient | 77:e4e36df9caee | 10 | #define IOTHUB_CLIENT_DIAGNOSTIC_H |
AzureIoTClient | 77:e4e36df9caee | 11 | |
AzureIoTClient | 77:e4e36df9caee | 12 | #include "azure_c_shared_utility/macro_utils.h" |
AzureIoTClient | 77:e4e36df9caee | 13 | #include "azure_c_shared_utility/map.h" |
AzureIoTClient | 77:e4e36df9caee | 14 | #include "azure_c_shared_utility/umock_c_prod.h" |
AzureIoTClient | 77:e4e36df9caee | 15 | |
AzureIoTClient | 77:e4e36df9caee | 16 | #include "iothub_message.h" |
AzureIoTClient | 77:e4e36df9caee | 17 | #include <stdint.h> |
AzureIoTClient | 77:e4e36df9caee | 18 | |
AzureIoTClient | 77:e4e36df9caee | 19 | #ifdef __cplusplus |
AzureIoTClient | 77:e4e36df9caee | 20 | #include <cstddef> |
AzureIoTClient | 77:e4e36df9caee | 21 | extern "C" { |
AzureIoTClient | 77:e4e36df9caee | 22 | #else |
AzureIoTClient | 77:e4e36df9caee | 23 | #include <stddef.h> |
AzureIoTClient | 77:e4e36df9caee | 24 | #endif |
AzureIoTClient | 77:e4e36df9caee | 25 | |
AzureIoTClient | 77:e4e36df9caee | 26 | /** @brief diagnostic related setting */ |
AzureIoTClient | 77:e4e36df9caee | 27 | typedef struct IOTHUB_DIAGNOSTIC_SETTING_DATA_TAG |
AzureIoTClient | 77:e4e36df9caee | 28 | { |
AzureIoTClient | 77:e4e36df9caee | 29 | uint32_t diagSamplingPercentage; |
AzureIoTClient | 77:e4e36df9caee | 30 | uint32_t currentMessageNumber; |
AzureIoTClient | 77:e4e36df9caee | 31 | } IOTHUB_DIAGNOSTIC_SETTING_DATA; |
AzureIoTClient | 77:e4e36df9caee | 32 | |
AzureIoTClient | 77:e4e36df9caee | 33 | /** |
AzureIoTClient | 77:e4e36df9caee | 34 | * @brief Adds diagnostic information to message if: |
AzureIoTClient | 77:e4e36df9caee | 35 | * a. diagSetting->diagSamplingPercentage > 0 and |
AzureIoTClient | 77:e4e36df9caee | 36 | * b. the number of current message matches sample rule specified by diagSetting->diagSamplingPercentage |
AzureIoTClient | 77:e4e36df9caee | 37 | * |
AzureIoTClient | 77:e4e36df9caee | 38 | * @param diagSetting Pointer to an @c IOTHUB_DIAGNOSTIC_SETTING_DATA structure |
AzureIoTClient | 77:e4e36df9caee | 39 | * |
AzureIoTClient | 77:e4e36df9caee | 40 | * @param messageHandle message handle |
AzureIoTClient | 77:e4e36df9caee | 41 | * |
AzureIoTClient | 77:e4e36df9caee | 42 | * @return 0 upon success |
AzureIoTClient | 77:e4e36df9caee | 43 | */ |
AzureIoTClient | 77:e4e36df9caee | 44 | MOCKABLE_FUNCTION(, int, IoTHubClient_Diagnostic_AddIfNecessary, IOTHUB_DIAGNOSTIC_SETTING_DATA *, diagSetting, IOTHUB_MESSAGE_HANDLE, messageHandle); |
AzureIoTClient | 77:e4e36df9caee | 45 | |
AzureIoTClient | 77:e4e36df9caee | 46 | #ifdef __cplusplus |
AzureIoTClient | 77:e4e36df9caee | 47 | } |
AzureIoTClient | 77:e4e36df9caee | 48 | #endif |
AzureIoTClient | 77:e4e36df9caee | 49 | |
AzureIoTClient | 77:e4e36df9caee | 50 | #endif /* IOTHUB_CLIENT_DIAGNOSTIC_H */ |