From: anuj.bhumiya Date: Thu, 14 Jan 2021 11:21:30 +0000 (+0530) Subject: Mesh: Add Join Network API X-Git-Tag: accepted/tizen/unified/20210209.124411~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f775566a5a41a0274bad80224e2262b6f8c9b64c;p=platform%2Fcore%2Fapi%2Fbluetooth.git Mesh: Add Join Network API This patch add support of Mesh Node Role, this API create a fresh unprovisioned Mesh Node available to attach/provision in any Network. Change-Id: Ief4e9f4c92f9934b6e074d728b3e0f74b1022874 Signed-off-by: anuj.bhumiya --- diff --git a/include/bluetooth_internal.h b/include/bluetooth_internal.h index 16d1c17..433ac5a 100644 --- a/include/bluetooth_internal.h +++ b/include/bluetooth_internal.h @@ -4571,6 +4571,38 @@ int bt_mesh_network_destroy(bt_mesh_network_h network); /** * @internal * @ingroup CAPI_NETWORK_BLUETOOTH_MESH_MODULE + * @brief Call to create a fresh Local unprovisioned Mesh Node. + * Mesh node created by join is ready for provisioning, + * + * @param: in: node_handle, Mesh node instance + * @param: in: callback, callback to be called when node provisioned successfully + * + * Once a fresh node is created successfully + * Node is available to attach to network. + * Note: A Node can be part of only one network at a time. + * + * @since_tizen 6.5 + * @privlevel platform + */ +int bt_mesh_network_join(bt_mesh_node_h node_handle, + bt_mesh_join_complete_cb cb, void *user_data); + +/** + * @internal + * @ingroup CAPI_NETWORK_BLUETOOTH_MESH_MODULE + * @brief Call to cancel an ongoing join Network request. + * + * @param: in: node_handle, Local Mesh node + * + * @see bt_mesh_network_join + * @since_tizen 6.5 + * @privlevel platform + */ +int bt_mesh_cancel_join(bt_mesh_node_h node_handle); + +/** + * @internal + * @ingroup CAPI_NETWORK_BLUETOOTH_MESH_MODULE * @brief Call to load a previously created Local Mesh Provisioner. * Each Mesh Network will be characterisized * by only one Mesh Provisioner. Mesh Provisioner will contain a diff --git a/include/bluetooth_type_internal.h b/include/bluetooth_type_internal.h index 5184759..22feb8c 100644 --- a/include/bluetooth_type_internal.h +++ b/include/bluetooth_type_internal.h @@ -1740,6 +1740,9 @@ typedef void (*bt_mesh_network_device_provision_cb) (int result, bt_mesh_network_h network, const char *dev_uuid, void *user_data); +typedef void (*bt_mesh_join_complete_cb) + (int result, bt_mesh_node_h node_handle, + char *token, void *user_data); typedef void (*bt_mesh_authentication_request_cb) (int result, bt_mesh_authentication_type_e auth_type,