Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: sht15_remote_monitoring RobotArmDemo iothub_client_sample_amqp f767zi_mqtt ... more
internal/iothub_client_diagnostic.h@88:248736be106e, 2018-06-11 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Mon Jun 11 15:39:23 2018 -0700
- Revision:
- 88:248736be106e
- Child:
- 92:97148cf9aa2a
1.2.5
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| AzureIoTClient | 88:248736be106e | 1 | // Copyright (c) Microsoft. All rights reserved. |
| AzureIoTClient | 88:248736be106e | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| AzureIoTClient | 88:248736be106e | 3 | |
| AzureIoTClient | 88:248736be106e | 4 | /** @file iothub_client_diagnostic.h |
| AzureIoTClient | 88:248736be106e | 5 | * @brief The @c diagnostic is a component that helps to add predefined diagnostic |
| AzureIoTClient | 88:248736be106e | 6 | properties to message for end to end diagnostic purpose |
| AzureIoTClient | 88:248736be106e | 7 | */ |
| AzureIoTClient | 88:248736be106e | 8 | |
| AzureIoTClient | 88:248736be106e | 9 | #ifndef IOTHUB_CLIENT_DIAGNOSTIC_H |
| AzureIoTClient | 88:248736be106e | 10 | #define IOTHUB_CLIENT_DIAGNOSTIC_H |
| AzureIoTClient | 88:248736be106e | 11 | |
| AzureIoTClient | 88:248736be106e | 12 | #include "azure_c_shared_utility/umock_c_prod.h" |
| AzureIoTClient | 88:248736be106e | 13 | |
| AzureIoTClient | 88:248736be106e | 14 | #include "iothub_message.h" |
| AzureIoTClient | 88:248736be106e | 15 | #include <stdint.h> |
| AzureIoTClient | 88:248736be106e | 16 | |
| AzureIoTClient | 88:248736be106e | 17 | #ifdef __cplusplus |
| AzureIoTClient | 88:248736be106e | 18 | #include <cstddef> |
| AzureIoTClient | 88:248736be106e | 19 | extern "C" { |
| AzureIoTClient | 88:248736be106e | 20 | #else |
| AzureIoTClient | 88:248736be106e | 21 | #include <stddef.h> |
| AzureIoTClient | 88:248736be106e | 22 | #endif |
| AzureIoTClient | 88:248736be106e | 23 | |
| AzureIoTClient | 88:248736be106e | 24 | /** @brief diagnostic related setting */ |
| AzureIoTClient | 88:248736be106e | 25 | typedef struct IOTHUB_DIAGNOSTIC_SETTING_DATA_TAG |
| AzureIoTClient | 88:248736be106e | 26 | { |
| AzureIoTClient | 88:248736be106e | 27 | uint32_t diagSamplingPercentage; |
| AzureIoTClient | 88:248736be106e | 28 | uint32_t currentMessageNumber; |
| AzureIoTClient | 88:248736be106e | 29 | } IOTHUB_DIAGNOSTIC_SETTING_DATA; |
| AzureIoTClient | 88:248736be106e | 30 | |
| AzureIoTClient | 88:248736be106e | 31 | /** |
| AzureIoTClient | 88:248736be106e | 32 | * @brief Adds diagnostic information to message if: |
| AzureIoTClient | 88:248736be106e | 33 | * a. diagSetting->diagSamplingPercentage > 0 and |
| AzureIoTClient | 88:248736be106e | 34 | * b. the number of current message matches sample rule specified by diagSetting->diagSamplingPercentage |
| AzureIoTClient | 88:248736be106e | 35 | * |
| AzureIoTClient | 88:248736be106e | 36 | * @param diagSetting Pointer to an @c IOTHUB_DIAGNOSTIC_SETTING_DATA structure |
| AzureIoTClient | 88:248736be106e | 37 | * |
| AzureIoTClient | 88:248736be106e | 38 | * @param messageHandle message handle |
| AzureIoTClient | 88:248736be106e | 39 | * |
| AzureIoTClient | 88:248736be106e | 40 | * @return 0 upon success |
| AzureIoTClient | 88:248736be106e | 41 | */ |
| AzureIoTClient | 88:248736be106e | 42 | MOCKABLE_FUNCTION(, int, IoTHubClient_Diagnostic_AddIfNecessary, IOTHUB_DIAGNOSTIC_SETTING_DATA *, diagSetting, IOTHUB_MESSAGE_HANDLE, messageHandle); |
| AzureIoTClient | 88:248736be106e | 43 | |
| AzureIoTClient | 88:248736be106e | 44 | #ifdef __cplusplus |
| AzureIoTClient | 88:248736be106e | 45 | } |
| AzureIoTClient | 88:248736be106e | 46 | #endif |
| AzureIoTClient | 88:248736be106e | 47 | |
| AzureIoTClient | 88:248736be106e | 48 | #endif /* IOTHUB_CLIENT_DIAGNOSTIC_H */ |
