1 /* 2 * Copyright (c) 2023 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef H_MCUMGR_EXAMPLE_MGMT_CALLBACKS_ 7 #define H_MCUMGR_EXAMPLE_MGMT_CALLBACKS_ 8 #include <stdint.h> 9 #include <zephyr/mgmt/mcumgr/mgmt/callbacks.h> 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 /* This is the event ID for the example group */ 16 #define MGMT_EVT_GRP_EXAMPLE MGMT_EVT_GRP_USER_CUSTOM_START 17 18 /* MGMT event opcodes for example management group */ 19 enum example_mgmt_group_events { 20 /* Callback when the other command is received, data is example_mgmt_other_data */ 21 MGMT_EVT_OP_EXAMPLE_OTHER = MGMT_DEF_EVT_OP_ID(MGMT_EVT_GRP_EXAMPLE, 0), 22 23 /* Used to enable all smp_group events */ 24 MGMT_EVT_OP_EXAMPLE_MGMT_ALL = MGMT_DEF_EVT_OP_ALL(MGMT_EVT_GRP_EXAMPLE), 25 }; 26 27 /* Structure provided in the #MGMT_EVT_OP_EXAMPLE_OTHER notification callback */ 28 struct example_mgmt_other_data { 29 /* Contains the user supplied value */ 30 uint32_t user_value; 31 }; 32 33 #ifdef __cplusplus 34 } 35 #endif 36 37 #endif 38