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.
serializer/inc/commanddecoder.h@0:f7f1f0d76dd6, 2018-08-23 (annotated)
- Committer:
- XinZhangMS
- Date:
- Thu Aug 23 06:52:14 2018 +0000
- Revision:
- 0:f7f1f0d76dd6
azure-c-sdk for mbed os supporting NUCLEO_F767ZI
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
XinZhangMS | 0:f7f1f0d76dd6 | 1 | // Copyright (c) Microsoft. All rights reserved. |
XinZhangMS | 0:f7f1f0d76dd6 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
XinZhangMS | 0:f7f1f0d76dd6 | 3 | |
XinZhangMS | 0:f7f1f0d76dd6 | 4 | #ifndef COMMAND_DECODER_H |
XinZhangMS | 0:f7f1f0d76dd6 | 5 | #define COMMAND_DECODER_H |
XinZhangMS | 0:f7f1f0d76dd6 | 6 | |
XinZhangMS | 0:f7f1f0d76dd6 | 7 | #include "multitree.h" |
XinZhangMS | 0:f7f1f0d76dd6 | 8 | #include "schema.h" |
XinZhangMS | 0:f7f1f0d76dd6 | 9 | #include "agenttypesystem.h" |
XinZhangMS | 0:f7f1f0d76dd6 | 10 | #include "azure_c_shared_utility/macro_utils.h" |
XinZhangMS | 0:f7f1f0d76dd6 | 11 | #include "methodreturn.h" |
XinZhangMS | 0:f7f1f0d76dd6 | 12 | |
XinZhangMS | 0:f7f1f0d76dd6 | 13 | #ifdef __cplusplus |
XinZhangMS | 0:f7f1f0d76dd6 | 14 | extern "C" { |
XinZhangMS | 0:f7f1f0d76dd6 | 15 | #else |
XinZhangMS | 0:f7f1f0d76dd6 | 16 | #include <stdbool.h> |
XinZhangMS | 0:f7f1f0d76dd6 | 17 | #endif |
XinZhangMS | 0:f7f1f0d76dd6 | 18 | |
XinZhangMS | 0:f7f1f0d76dd6 | 19 | #define COMMANDDECODER_RESULT_VALUES \ |
XinZhangMS | 0:f7f1f0d76dd6 | 20 | COMMANDDECODER_OK, \ |
XinZhangMS | 0:f7f1f0d76dd6 | 21 | COMMANDDECODER_ERROR, \ |
XinZhangMS | 0:f7f1f0d76dd6 | 22 | COMMANDDECODER_INVALID_ARG |
XinZhangMS | 0:f7f1f0d76dd6 | 23 | |
XinZhangMS | 0:f7f1f0d76dd6 | 24 | DEFINE_ENUM(COMMANDDECODER_RESULT, COMMANDDECODER_RESULT_VALUES) |
XinZhangMS | 0:f7f1f0d76dd6 | 25 | |
XinZhangMS | 0:f7f1f0d76dd6 | 26 | #define EXECUTE_COMMAND_RESULT_VALUES \ |
XinZhangMS | 0:f7f1f0d76dd6 | 27 | EXECUTE_COMMAND_SUCCESS, /*when the final recipient of the command indicates a successful execution*/ \ |
XinZhangMS | 0:f7f1f0d76dd6 | 28 | EXECUTE_COMMAND_FAILED, /*when the final recipient of the command indicates a failure*/ \ |
XinZhangMS | 0:f7f1f0d76dd6 | 29 | EXECUTE_COMMAND_ERROR /*when a transient error either in the final recipient or until the final recipient*/ |
XinZhangMS | 0:f7f1f0d76dd6 | 30 | |
XinZhangMS | 0:f7f1f0d76dd6 | 31 | DEFINE_ENUM(EXECUTE_COMMAND_RESULT, EXECUTE_COMMAND_RESULT_VALUES) |
XinZhangMS | 0:f7f1f0d76dd6 | 32 | |
XinZhangMS | 0:f7f1f0d76dd6 | 33 | |
XinZhangMS | 0:f7f1f0d76dd6 | 34 | |
XinZhangMS | 0:f7f1f0d76dd6 | 35 | |
XinZhangMS | 0:f7f1f0d76dd6 | 36 | /* Codes_SRS_COMMAND_DECODER_99_001:[ The CommandDecoder module shall expose the following API:] */ |
XinZhangMS | 0:f7f1f0d76dd6 | 37 | |
XinZhangMS | 0:f7f1f0d76dd6 | 38 | typedef struct COMMAND_DECODER_HANDLE_DATA_TAG* COMMAND_DECODER_HANDLE; |
XinZhangMS | 0:f7f1f0d76dd6 | 39 | typedef EXECUTE_COMMAND_RESULT(*ACTION_CALLBACK_FUNC)(void* actionCallbackContext, const char* relativeActionPath, const char* actionName, size_t argCount, const AGENT_DATA_TYPE* args); |
XinZhangMS | 0:f7f1f0d76dd6 | 40 | typedef METHODRETURN_HANDLE(*METHOD_CALLBACK_FUNC)(void* methodCallbackContext, const char* relativeMethodPath, const char* methodName, size_t argCount, const AGENT_DATA_TYPE* args); |
XinZhangMS | 0:f7f1f0d76dd6 | 41 | |
XinZhangMS | 0:f7f1f0d76dd6 | 42 | #include "azure_c_shared_utility/umock_c_prod.h" |
XinZhangMS | 0:f7f1f0d76dd6 | 43 | |
XinZhangMS | 0:f7f1f0d76dd6 | 44 | MOCKABLE_FUNCTION(,COMMAND_DECODER_HANDLE, CommandDecoder_Create, SCHEMA_MODEL_TYPE_HANDLE, modelHandle, ACTION_CALLBACK_FUNC, actionCallback, void*, actionCallbackContext, METHOD_CALLBACK_FUNC, methodCallback, void*, methodCallbackContext); |
XinZhangMS | 0:f7f1f0d76dd6 | 45 | MOCKABLE_FUNCTION(,EXECUTE_COMMAND_RESULT, CommandDecoder_ExecuteCommand, COMMAND_DECODER_HANDLE, handle, const char*, command); |
XinZhangMS | 0:f7f1f0d76dd6 | 46 | MOCKABLE_FUNCTION(,METHODRETURN_HANDLE, CommandDecoder_ExecuteMethod, COMMAND_DECODER_HANDLE, handle, const char*, fullMethodName, const char*, methodPayload); |
XinZhangMS | 0:f7f1f0d76dd6 | 47 | MOCKABLE_FUNCTION(,void, CommandDecoder_Destroy, COMMAND_DECODER_HANDLE, commandDecoderHandle); |
XinZhangMS | 0:f7f1f0d76dd6 | 48 | |
XinZhangMS | 0:f7f1f0d76dd6 | 49 | MOCKABLE_FUNCTION(, EXECUTE_COMMAND_RESULT, CommandDecoder_IngestDesiredProperties, void*, startAddress, COMMAND_DECODER_HANDLE, handle, const char*, jsonPayload, bool, parseDesiredNode); |
XinZhangMS | 0:f7f1f0d76dd6 | 50 | |
XinZhangMS | 0:f7f1f0d76dd6 | 51 | #ifdef __cplusplus |
XinZhangMS | 0:f7f1f0d76dd6 | 52 | } |
XinZhangMS | 0:f7f1f0d76dd6 | 53 | #endif |
XinZhangMS | 0:f7f1f0d76dd6 | 54 | |
XinZhangMS | 0:f7f1f0d76dd6 | 55 | #endif /* COMMAND_DECODER_H */ |