source: azure_iot_hub_riscv/trunk/azure_iot_sdk/serializer/inc/commanddecoder.h@ 453

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

ファイルを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 2.5 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 COMMAND_DECODER_H
5#define COMMAND_DECODER_H
6
7#include "multitree.h"
8#include "schema.h"
9#include "agenttypesystem.h"
10#include "azure_macro_utils/macro_utils.h"
11#include "methodreturn.h"
12
13#ifdef __cplusplus
14extern "C" {
15#else
16#include <stdbool.h>
17#endif
18
19#define COMMANDDECODER_RESULT_VALUES \
20 COMMANDDECODER_OK, \
21 COMMANDDECODER_ERROR, \
22 COMMANDDECODER_INVALID_ARG
23
24MU_DEFINE_ENUM_WITHOUT_INVALID(COMMANDDECODER_RESULT, COMMANDDECODER_RESULT_VALUES)
25
26#define EXECUTE_COMMAND_RESULT_VALUES \
27EXECUTE_COMMAND_SUCCESS, /*when the final recipient of the command indicates a successful execution*/ \
28EXECUTE_COMMAND_FAILED, /*when the final recipient of the command indicates a failure*/ \
29EXECUTE_COMMAND_ERROR /*when a transient error either in the final recipient or until the final recipient*/
30
31MU_DEFINE_ENUM_WITHOUT_INVALID(EXECUTE_COMMAND_RESULT, EXECUTE_COMMAND_RESULT_VALUES)
32
33
34
35
36/* Codes_SRS_COMMAND_DECODER_99_001:[ The CommandDecoder module shall expose the following API:] */
37
38typedef struct COMMAND_DECODER_HANDLE_DATA_TAG* COMMAND_DECODER_HANDLE;
39typedef EXECUTE_COMMAND_RESULT(*ACTION_CALLBACK_FUNC)(void* actionCallbackContext, const char* relativeActionPath, const char* actionName, size_t argCount, const AGENT_DATA_TYPE* args);
40typedef METHODRETURN_HANDLE(*METHOD_CALLBACK_FUNC)(void* methodCallbackContext, const char* relativeMethodPath, const char* methodName, size_t argCount, const AGENT_DATA_TYPE* args);
41
42#include "umock_c/umock_c_prod.h"
43
44MOCKABLE_FUNCTION(,COMMAND_DECODER_HANDLE, CommandDecoder_Create, SCHEMA_MODEL_TYPE_HANDLE, modelHandle, ACTION_CALLBACK_FUNC, actionCallback, void*, actionCallbackContext, METHOD_CALLBACK_FUNC, methodCallback, void*, methodCallbackContext);
45MOCKABLE_FUNCTION(,EXECUTE_COMMAND_RESULT, CommandDecoder_ExecuteCommand, COMMAND_DECODER_HANDLE, handle, const char*, command);
46MOCKABLE_FUNCTION(,METHODRETURN_HANDLE, CommandDecoder_ExecuteMethod, COMMAND_DECODER_HANDLE, handle, const char*, fullMethodName, const char*, methodPayload);
47MOCKABLE_FUNCTION(,void, CommandDecoder_Destroy, COMMAND_DECODER_HANDLE, commandDecoderHandle);
48
49MOCKABLE_FUNCTION(, EXECUTE_COMMAND_RESULT, CommandDecoder_IngestDesiredProperties, void*, startAddress, COMMAND_DECODER_HANDLE, handle, const char*, jsonPayload, bool, parseDesiredNode);
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif /* COMMAND_DECODER_H */
Note: See TracBrowser for help on using the repository browser.