source: azure_iot_hub/trunk/azure_iohub/iothub_client/inc/internal/iothub_client_retry_control.h@ 388

Last change on this file since 388 was 388, checked in by coas-nagasima, 5 years ago

Azure IoT Hub Device C SDK を使ったサンプルの追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 1.9 KB
Line 
1// Copyright (c) Microsoft. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4#ifndef IOTHUB_CLIENT_RETRY_CONTROL
5#define IOTHUB_CLIENT_RETRY_CONTROL
6
7#include <stdlib.h>
8#include <stdbool.h>
9#include "azure_c_shared_utility/optionhandler.h"
10#include "azure_c_shared_utility/umock_c_prod.h"
11#include "iothub_client_core_ll.h"
12#include "internal/iothubtransport.h"
13#include "azure_c_shared_utility/const_defines.h"
14
15#ifdef __cplusplus
16extern "C"
17{
18#endif
19
20static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_INITIAL_WAIT_TIME_IN_SECS = "initial_wait_time_in_secs";
21static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_MAX_JITTER_PERCENT = "max_jitter_percent";
22static STATIC_VAR_UNUSED const char* RETRY_CONTROL_OPTION_SAVED_OPTIONS = "retry_control_saved_options";
23
24typedef enum RETRY_ACTION_TAG
25{
26 RETRY_ACTION_RETRY_NOW,
27 RETRY_ACTION_RETRY_LATER,
28 RETRY_ACTION_STOP_RETRYING
29} RETRY_ACTION;
30
31struct RETRY_CONTROL_INSTANCE_TAG;
32typedef struct RETRY_CONTROL_INSTANCE_TAG* RETRY_CONTROL_HANDLE;
33
34MOCKABLE_FUNCTION(, RETRY_CONTROL_HANDLE, retry_control_create, IOTHUB_CLIENT_RETRY_POLICY, policy, unsigned int, max_retry_time_in_secs);
35MOCKABLE_FUNCTION(, int, retry_control_should_retry, RETRY_CONTROL_HANDLE, retry_control_handle, RETRY_ACTION*, retry_action);
36MOCKABLE_FUNCTION(, void, retry_control_reset, RETRY_CONTROL_HANDLE, retry_control_handle);
37MOCKABLE_FUNCTION(, int, retry_control_set_option, RETRY_CONTROL_HANDLE, retry_control_handle, const char*, name, const void*, value);
38MOCKABLE_FUNCTION(, OPTIONHANDLER_HANDLE, retry_control_retrieve_options, RETRY_CONTROL_HANDLE, retry_control_handle);
39MOCKABLE_FUNCTION(, void, retry_control_destroy, RETRY_CONTROL_HANDLE, retry_control_handle);
40
41MOCKABLE_FUNCTION(, int, is_timeout_reached, time_t, start_time, unsigned int, timeout_in_secs, bool*, is_timed_out);
42
43#ifdef __cplusplus
44}
45#endif
46
47#endif // IOTHUB_CLIENT_RETRY_CONTROL
Note: See TracBrowser for help on using the repository browser.