1 /* 2 * Copyright Runtime.io 2018. All rights reserved. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /** @file 8 * @brief Bluetooth transport for the mcumgr SMP protocol. 9 */ 10 11 #ifndef ZEPHYR_INCLUDE_MGMT_SMP_BT_H_ 12 #define ZEPHYR_INCLUDE_MGMT_SMP_BT_H_ 13 14 #include <zephyr/types.h> 15 struct bt_conn; 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 /** 22 * @brief Registers the SMP Bluetooth service. Should only be called if the Bluetooth 23 * transport has been unregistered by calling smp_bt_unregister(). 24 * 25 * @return 0 on success; negative error code on failure. 26 */ 27 int smp_bt_register(void); 28 29 /** 30 * @brief Unregisters the SMP Bluetooth service. 31 * 32 * @return 0 on success; negative error code on failure. 33 */ 34 int smp_bt_unregister(void); 35 36 /** 37 * @brief Transmits an SMP command/response over the specified Bluetooth connection as a 38 * notification. 39 * 40 * @param conn Connection object. 41 * @param data Pointer to SMP message. 42 * @param len data length. 43 * 44 * @return 0 in case of success or negative value in case of error. 45 */ 46 int smp_bt_notify(struct bt_conn *conn, const void *data, uint16_t len); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif 53