From: Jakub Latusek Date: Wed, 1 Feb 2023 05:50:11 +0000 (+0900) Subject: Add support for custom advertising flags. X-Git-Tag: accepted/tizen/6.5/unified/20230719.174756^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c542bf2630350016971160e2095d6ebb35c8e12;p=platform%2Fcore%2Fapi%2Fbluetooth.git Add support for custom advertising flags. It is required to set proper advertising flags when establishing a connection using Bluetooth low energy to properly recognize device type. Without this, the Linux device cannot recognize the Tizen device properly and establish a connection. Change-Id: I4ac31464007f67711ea05a6227a7a46c33b6c8ef Signed-off-by: Jakub Latusek Signed-off-by: Wootak Jung --- diff --git a/include/bluetooth_internal.h b/include/bluetooth_internal.h index c464265..236cf7e 100644 --- a/include/bluetooth_internal.h +++ b/include/bluetooth_internal.h @@ -1206,6 +1206,30 @@ int bt_adapter_le_set_advertising_transport_discovery_data(bt_advertiser_h adver bt_tds_transport_e org_id, char tds_flags, unsigned char *transport_data, unsigned int transport_data_len); +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_LE_MODULE + * @brief Adds advertising flags. + * @since_tizen 8.0 + * @privlevel public + * @privilege %http://tizen.org/privilege/bluetooth + * + * @param[in] advertiser The handle of advertiser + * @param[in] flags The advertising flags + * + * @return 0 on success, otherwise a negative error value. + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_INITIALIZED Not initialized + * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #BT_ERROR_PERMISSION_DENIED Permission denied + * + * @pre The Bluetooth service must be initialized with bt_initialize(). + * + * @see bt_adapter_le_advertising_flags_e + * @see bt_adapter_le_create_advertiser() + * @see bt_adapter_le_start_advertising_new() + */ +int bt_adapter_le_set_advertising_flags(bt_advertiser_h advertiser, unsigned char flags); + /** * @internal * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE diff --git a/include/bluetooth_private.h b/include/bluetooth_private.h index 0850506..da41913 100644 --- a/include/bluetooth_private.h +++ b/include/bluetooth_private.h @@ -204,6 +204,7 @@ typedef enum { * @internal */ typedef enum { + BT_ADAPTER_LE_ADVERTISING_DATA_FLAGS = 0x01, /**< Flags */ BT_ADAPTER_LE_ADVERTISING_DATA_INCOMP_LIST_16_BIT_SERVICE_CLASS_UUIDS = 0x02, /**