} \
} while (0)
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
- * @brief Enumerations of the authentication event types.
- *
- */
-typedef enum {
- BT_AUTH_KEYBOARD_PASSKEY_DISPLAY = 0, /**< PIN display event to user for entering PIN in keyboard */
- BT_AUTH_PIN_REQUEST, /**< Legacy PIN or PASSKEY request event */
- BT_AUTH_PASSKEY_CONFIRM_REQUEST, /**< PASSKEY confirmation event to match PASSKEY in remote device */
-} bt_authentication_type_info_e;
-
/**
* @internal
* @brief Check the initialzating status
int bt_device_le_set_data_length_change_cb(
_bt_le_set_data_length_changed_cb callback, void *user_data);
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
- * @brief Called when remote device requests authentication.
- * @param[in] result
- * @param[in] auth_type
- * typedef enum {
- * BT_AUTH_KEYBOARD_PASSKEY_DISPLAY = 0, : PIN display event to user for entering PIN in keyboard
- * BT_AUTH_PIN_REQUEST, : Legacy PIN or PASSKEY request event
- * BT_AUTH_PASSKEY_CONFIRM_REQUEST, : PASSKEY confirmation event to match PASSKEY in remote device
- * } bt_authentication_type_info_e;
- * @param[in] device_name Name of the remote device
- * @param[in] remote_addr Remote BD address
- * @param[in] pass_key PASSKEY string
- * PASSKEY string is valid only if authentication types are following
- * a/ BT_AUTH_KEYBOARD_PASSKEY_DISPLAY
- * b/ BT_AUTH_PASSKEY_CONFIRM_REQUEST
- * pass_key string will be invalid if authentication event is of type BT_AUTH_PIN_REQUEST
- * as this event indicates that user MUST enter PIN or PASSKEY and perform authentication.
- *
- * Upon receiving BT_AUTH_KEYBOARD_PASSKEY_DISPLAY event, user should enter PASSKEY in keyboard
- * Application can also call bt_device_cancel_bonding() Upon receiving BT_AUTH_KEYBOARD_PASSKEY_DISPLAY
- * event which will fail the on-going pairing with remote device.
- * @param[in] user_data The user data passed from the callback registration function
- * @see bt_adapter_set_authentication_req_cb()
- */
-typedef void (*bt_adapter_authentication_req_cb)(int result, bt_authentication_type_info_e auth_type,
- char *device_name, char *remote_addr,
- char *pass_key, void *user_data);
-
-int bt_adapter_set_authentication_req_cb(bt_adapter_authentication_req_cb callback, void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
- * @brief Unregisters a callback function that will be invoked when remote device requests authentication.
- * @return 0 on success, otherwise a negative error value.
- * @retval #BT_ERROR_NONE Successful
- * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
- * @pre The Bluetooth service must be initialized by bt_initialize().
- * @see bt_initialize()
- * @see bt_adapter_set_authentication_req_cb()
- */
-int bt_adapter_unset_authentication_req_cb(void);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
- * @brief API to reply with PIN or PASSKEY with authentication type - TRUE or FALSE.
- * @remarks This function can be called by application when remote device requests PIN or PASSKEY from
- * local adapter.
- * @param[in] passkey The passkey to be provided by application when remote devices requests for it.
- * @param[in] authentication_reply This indicates whether application wants to accept or cancel the on-going pairing
- * @pre This function can only be called when application receieves authentication event (BT_AUTH_PIN_REQUEST)
- * from remote device.
- * @see bt_adapter_set_authentication_req_cb()
- */
-int bt_passkey_reply(char *passkey, bool authentication_reply);
-
-/**
- * @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
- * @brief API to reply to the PASSKEY confirmation for on-going pairing with remote device.
- * @remarks This function can be called by application, when local adapter wants PASSKEY confirmation from user.
- * @param[in] confirmation_reply This indicates whether application wants to accepts or cancels the on-going pairing
- * confirmation_reply : TRUE will indicate that Application has confirmed the PASSKEY
- * confirmation_reply : FALSE will indicate that Application has failed to confirm the PASSKEY. In this situation
- * the pairing will be failed.
- * @pre This function can only be called when application receives authentication event (BT_AUTH_PASSKEY_CONFIRM_REQUEST)
- * from remote device.
- * @see bt_adapter_set_authentication_req_cb()
- */
-int bt_passkey_confirmation_reply(bool confirmation_reply);
-
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_HID_MODULE
* @brief Sends the custom event data.
*/
int bt_adapter_set_visibility(bt_adapter_visibility_mode_e discoverable_mode, int duration);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Registers a callback function that will be invoked when remote device requests authentication.
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @pre The Bluetooth service must be initialized by bt_initialize().
+ * @param[in] callback callback function to be set when a request is received.
+ * @param[in] user_data data from application which will be provided in callback.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see bt_initialize()
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_set_authentication_req_cb(bt_adapter_authentication_req_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Unregisters a callback function that will be invoked when remote device requests authentication.
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @pre The Bluetooth service must be initialized by bt_initialize().
+ * @see bt_initialize()
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_unset_authentication_req_cb(void);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief API to reply with PIN or PASSKEY with authentication type - TRUE or FALSE.
+ * @remarks This function can be called by application when remote device requests PIN or PASSKEY from
+ * local adapter.
+ * @param[in] passkey The passkey to be provided by application when remote devices requests for it.
+ * @param[in] authentication_reply This indicates whether application wants to accept or cancel the on-going pairing
+ * @pre This function can only be called when application receieves authentication event (BT_AUTH_PIN_REQUEST)
+ * from remote device.
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_passkey_reply(char *passkey, bool authentication_reply);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief API to reply to the PASSKEY confirmation for on-going pairing with remote device.
+ * @remarks This function can be called by application, when local adapter wants PASSKEY confirmation from user.
+ * @param[in] confirmation_reply This indicates whether application wants to accepts or cancels the on-going pairing
+ * confirmation_reply : TRUE will indicate that Application has confirmed the PASSKEY
+ * confirmation_reply : FALSE will indicate that Application has failed to confirm the PASSKEY. In this situation
+ * the pairing will be failed.
+ * @pre This function can only be called when application receives authentication event (BT_AUTH_PASSKEY_CONFIRM_REQUEST)
+ * from remote device.
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_passkey_confirmation_reply(bool confirmation_reply);
+
/**
* @internal
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
BT_RESTRICTED_PROFILE_A2DP,
} bt_restricted_profile_t;
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Enumerations of the authentication event types.
+ * @since_tizen 3.0
+ *
+ */
+typedef enum {
+ BT_AUTH_KEYBOARD_PASSKEY_DISPLAY = 0, /**< PIN display event to user for entering PIN in keyboard */
+ BT_AUTH_PIN_REQUEST, /**< Legacy PIN or PASSKEY request event */
+ BT_AUTH_PASSKEY_CONFIRM_REQUEST, /**< PASSKEY confirmation event to match PASSKEY in remote device */
+} bt_authentication_type_info_e;
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
* @brief Called when Trusted Profiles is changed.
(int result, bool connected, const char *remote_address, const char *iface_name, void *user_data);
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Called when remote device requests authentication.
+ * @since_tizen 3.0
+ * @param[in] result
+ * @param[in] auth_type
+ * typedef enum {
+ * BT_AUTH_KEYBOARD_PASSKEY_DISPLAY = 0, : PIN display event to user for entering PIN in keyboard
+ * BT_AUTH_PIN_REQUEST, : Legacy PIN or PASSKEY request event
+ * BT_AUTH_PASSKEY_CONFIRM_REQUEST, : PASSKEY confirmation event to match PASSKEY in remote device
+ * } bt_authentication_type_info_e;
+ * @param[in] device_name Name of the remote device
+ * @param[in] remote_addr Remote BD address
+ * @param[in] pass_key PASSKEY string
+ * PASSKEY string is valid only if authentication types are following
+ * a/ BT_AUTH_KEYBOARD_PASSKEY_DISPLAY
+ * b/ BT_AUTH_PASSKEY_CONFIRM_REQUEST
+ * pass_key string will be invalid if authentication event is of type BT_AUTH_PIN_REQUEST
+ * as this event indicates that user MUST enter PIN or PASSKEY and perform authentication.
+ *
+ * Upon receiving BT_AUTH_KEYBOARD_PASSKEY_DISPLAY event, user should enter PASSKEY in keyboard
+ * Application can also call bt_device_cancel_bonding() Upon receiving BT_AUTH_KEYBOARD_PASSKEY_DISPLAY
+ * event which will fail the on-going pairing with remote device.
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+typedef void (*bt_adapter_authentication_req_cb)(int result, bt_authentication_type_info_e auth_type,
+ char *device_name, char *remote_addr,
+ char *pass_key, void *user_data);
+
/**
* @}
*/
*/
int bt_adapter_set_visibility(bt_adapter_visibility_mode_e discoverable_mode, int duration);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Registers a callback function that will be invoked when remote device requests authentication.
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @pre The Bluetooth service must be initialized by bt_initialize().
+ * @param[in] callback callback function to be set when a request is received.
+ * @param[in] user_data data from application which will be provided in callback.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see bt_initialize()
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_set_authentication_req_cb(bt_adapter_authentication_req_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Unregisters a callback function that will be invoked when remote device requests authentication.
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @pre The Bluetooth service must be initialized by bt_initialize().
+ * @see bt_initialize()
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_unset_authentication_req_cb(void);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief API to reply with PIN or PASSKEY with authentication type - TRUE or FALSE.
+ * @remarks This function can be called by application when remote device requests PIN or PASSKEY from
+ * local adapter.
+ * @param[in] passkey The passkey to be provided by application when remote devices requests for it.
+ * @param[in] authentication_reply This indicates whether application wants to accept or cancel the on-going pairing
+ * @pre This function can only be called when application receieves authentication event (BT_AUTH_PIN_REQUEST)
+ * from remote device.
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_passkey_reply(char *passkey, bool authentication_reply);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief API to reply to the PASSKEY confirmation for on-going pairing with remote device.
+ * @remarks This function can be called by application, when local adapter wants PASSKEY confirmation from user.
+ * @param[in] confirmation_reply This indicates whether application wants to accepts or cancels the on-going pairing
+ * confirmation_reply : TRUE will indicate that Application has confirmed the PASSKEY
+ * confirmation_reply : FALSE will indicate that Application has failed to confirm the PASSKEY. In this situation
+ * the pairing will be failed.
+ * @pre This function can only be called when application receives authentication event (BT_AUTH_PASSKEY_CONFIRM_REQUEST)
+ * from remote device.
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_passkey_confirmation_reply(bool confirmation_reply);
+
/**
* @internal
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
BT_RESTRICTED_PROFILE_A2DP,
} bt_restricted_profile_t;
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Enumerations of the authentication event types.
+ * @since_tizen 3.0
+ *
+ */
+typedef enum {
+ BT_AUTH_KEYBOARD_PASSKEY_DISPLAY = 0, /**< PIN display event to user for entering PIN in keyboard */
+ BT_AUTH_PIN_REQUEST, /**< Legacy PIN or PASSKEY request event */
+ BT_AUTH_PASSKEY_CONFIRM_REQUEST, /**< PASSKEY confirmation event to match PASSKEY in remote device */
+} bt_authentication_type_info_e;
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
* @brief Called when Trusted Profiles is changed.
typedef void (*bt_ipsp_connection_state_changed_cb)
(int result, bool connected, const char *remote_address, const char *iface_name, void *user_data);
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Called when remote device requests authentication.
+ * @since_tizen 3.0
+ * @param[in] result
+ * @param[in] auth_type
+ * typedef enum {
+ * BT_AUTH_KEYBOARD_PASSKEY_DISPLAY = 0, : PIN display event to user for entering PIN in keyboard
+ * BT_AUTH_PIN_REQUEST, : Legacy PIN or PASSKEY request event
+ * BT_AUTH_PASSKEY_CONFIRM_REQUEST, : PASSKEY confirmation event to match PASSKEY in remote device
+ * } bt_authentication_type_info_e;
+ * @param[in] device_name Name of the remote device
+ * @param[in] remote_addr Remote BD address
+ * @param[in] pass_key PASSKEY string
+ * PASSKEY string is valid only if authentication types are following
+ * a/ BT_AUTH_KEYBOARD_PASSKEY_DISPLAY
+ * b/ BT_AUTH_PASSKEY_CONFIRM_REQUEST
+ * pass_key string will be invalid if authentication event is of type BT_AUTH_PIN_REQUEST
+ * as this event indicates that user MUST enter PIN or PASSKEY and perform authentication.
+ *
+ * Upon receiving BT_AUTH_KEYBOARD_PASSKEY_DISPLAY event, user should enter PASSKEY in keyboard
+ * Application can also call bt_device_cancel_bonding() Upon receiving BT_AUTH_KEYBOARD_PASSKEY_DISPLAY
+ * event which will fail the on-going pairing with remote device.
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+typedef void (*bt_adapter_authentication_req_cb)(int result, bt_authentication_type_info_e auth_type,
+ char *device_name, char *remote_addr,
+ char *pass_key, void *user_data);
/**
* @}
*/
int bt_adapter_set_visibility(bt_adapter_visibility_mode_e discoverable_mode, int duration);
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Registers a callback function that will be invoked when remote device requests authentication.
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @pre The Bluetooth service must be initialized by bt_initialize().
+ * @param[in] callback callback function to be set when a request is received.
+ * @param[in] user_data data from application which will be provided in callback.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see bt_initialize()
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_set_authentication_req_cb(bt_adapter_authentication_req_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Unregisters a callback function that will be invoked when remote device requests authentication.
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #BT_ERROR_NONE Successful
+ * @retval #BT_ERROR_NOT_INITIALIZED Not initialized
+ * @pre The Bluetooth service must be initialized by bt_initialize().
+ * @see bt_initialize()
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_unset_authentication_req_cb(void);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief API to reply with PIN or PASSKEY with authentication type - TRUE or FALSE.
+ * @remarks This function can be called by application when remote device requests PIN or PASSKEY from
+ * local adapter.
+ * @param[in] passkey The passkey to be provided by application when remote devices requests for it.
+ * @param[in] authentication_reply This indicates whether application wants to accept or cancel the on-going pairing
+ * @pre This function can only be called when application receieves authentication event (BT_AUTH_PIN_REQUEST)
+ * from remote device.
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_passkey_reply(char *passkey, bool authentication_reply);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief API to reply to the PASSKEY confirmation for on-going pairing with remote device.
+ * @remarks This function can be called by application, when local adapter wants PASSKEY confirmation from user.
+ * @param[in] confirmation_reply This indicates whether application wants to accepts or cancels the on-going pairing
+ * confirmation_reply : TRUE will indicate that Application has confirmed the PASSKEY
+ * confirmation_reply : FALSE will indicate that Application has failed to confirm the PASSKEY. In this situation
+ * the pairing will be failed.
+ * @pre This function can only be called when application receives authentication event (BT_AUTH_PASSKEY_CONFIRM_REQUEST)
+ * from remote device.
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+int bt_adapter_passkey_confirmation_reply(bool confirmation_reply);
+
/**
* @internal
* @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
BT_RESTRICTED_PROFILE_A2DP,
} bt_restricted_profile_t;
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Enumerations of the authentication event types.
+ * @since_tizen 3.0
+ *
+ */
+typedef enum {
+ BT_AUTH_KEYBOARD_PASSKEY_DISPLAY = 0, /**< PIN display event to user for entering PIN in keyboard */
+ BT_AUTH_PIN_REQUEST, /**< Legacy PIN or PASSKEY request event */
+ BT_AUTH_PASSKEY_CONFIRM_REQUEST, /**< PASSKEY confirmation event to match PASSKEY in remote device */
+} bt_authentication_type_info_e;
+
/**
* @ingroup CAPI_NETWORK_BLUETOOTH_DEVICE_MODULE
* @brief Called when Trusted Profiles is changed.
typedef void (*bt_ipsp_connection_state_changed_cb)
(int result, bool connected, const char *remote_address, const char *iface_name, void *user_data);
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Called when remote device requests authentication.
+ * @since_tizen 3.0
+ * @param[in] result
+ * @param[in] auth_type
+ * typedef enum {
+ * BT_AUTH_KEYBOARD_PASSKEY_DISPLAY = 0, : PIN display event to user for entering PIN in keyboard
+ * BT_AUTH_PIN_REQUEST, : Legacy PIN or PASSKEY request event
+ * BT_AUTH_PASSKEY_CONFIRM_REQUEST, : PASSKEY confirmation event to match PASSKEY in remote device
+ * } bt_authentication_type_info_e;
+ * @param[in] device_name Name of the remote device
+ * @param[in] remote_addr Remote BD address
+ * @param[in] pass_key PASSKEY string
+ * PASSKEY string is valid only if authentication types are following
+ * a/ BT_AUTH_KEYBOARD_PASSKEY_DISPLAY
+ * b/ BT_AUTH_PASSKEY_CONFIRM_REQUEST
+ * pass_key string will be invalid if authentication event is of type BT_AUTH_PIN_REQUEST
+ * as this event indicates that user MUST enter PIN or PASSKEY and perform authentication.
+ *
+ * Upon receiving BT_AUTH_KEYBOARD_PASSKEY_DISPLAY event, user should enter PASSKEY in keyboard
+ * Application can also call bt_device_cancel_bonding() Upon receiving BT_AUTH_KEYBOARD_PASSKEY_DISPLAY
+ * event which will fail the on-going pairing with remote device.
+ * @param[in] user_data The user data passed from the callback registration function
+ * @see bt_adapter_set_authentication_req_cb()
+ */
+typedef void (*bt_adapter_authentication_req_cb)(int result, bt_authentication_type_info_e auth_type,
+ char *device_name, char *remote_addr,
+ char *pass_key, void *user_data);
+
/**
* @}
*/
return BT_ERROR_NONE;
}
/* LCOV_EXCL_STOP */
+
+int bt_adapter_passkey_reply(char *passkey, bool authentication_reply)
+{
+ BT_CHECK_INIT_STATUS();
+ BT_CHECK_INPUT_PARAMETER(passkey);
+ int error_code = BT_ERROR_NONE;
+ error_code = _bt_get_error_code(bluetooth_passkey_reply(passkey, authentication_reply));
+ if (error_code != BT_ERROR_NONE)
+ BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
+
+ return error_code;
+}
+
+int bt_adapter_passkey_confirmation_reply(bool confirmation_reply)
+{
+ BT_CHECK_INIT_STATUS();
+
+ int error_code = BT_ERROR_NONE;
+ error_code = _bt_get_error_code(bluetooth_passkey_confirmation_reply(confirmation_reply));
+ if (error_code != BT_ERROR_NONE)
+ BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
+
+ return error_code;
+}
+/* LCOV_EXCL_STOP */
}
/* LCOV_EXCL_START */
-int bt_passkey_reply(char *passkey, bool authentication_reply)
-{
- BT_CHECK_INIT_STATUS();
- BT_CHECK_INPUT_PARAMETER(passkey);
- int error_code = BT_ERROR_NONE;
- error_code = _bt_get_error_code(bluetooth_passkey_reply(passkey, authentication_reply));
- if (error_code != BT_ERROR_NONE)
- BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
-
- return error_code;
-}
-
-int bt_passkey_confirmation_reply(bool confirmation_reply)
-{
- BT_CHECK_INIT_STATUS();
-
- int error_code = BT_ERROR_NONE;
- error_code = _bt_get_error_code(bluetooth_passkey_confirmation_reply(confirmation_reply));
- if (error_code != BT_ERROR_NONE)
- BT_ERR("%s(0x%08x)", _bt_convert_error_to_string(error_code), error_code);
-
- return error_code;
-}
-
int bt_device_set_pin_code(const char *remote_address, const char *pin_code)
{
int error_code = BT_ERROR_NONE;
, BT_UNIT_TEST_FUNCTION_ADAPTER_SET_AUTHENTICATION_REQUSET_CB},
{"bt_adapter_unset_authentication_req_cb"
, BT_UNIT_TEST_FUNCTION_ADAPTER_UNSET_AUTHENTICATION_REQUSET_CB},
- {"bt_passkey_reply(passkey, TRUE)"
+ {"bt_adapter_passkey_reply(passkey, TRUE)"
, BT_UNIT_TEST_FUNCTION_ADAPTER_PASSKEY_REPLY_ACCEPT},
- {"bt_passkey_reply(passkey, FALSE)"
+ {"bt_adapter_passkey_reply(passkey, FALSE)"
, BT_UNIT_TEST_FUNCTION_ADAPTER_PASSKEY_REPLY_CANCEL},
- {"bt_passkey_confirmation_reply(TRUE)"
+ {"bt_adapter_passkey_confirmation_reply(TRUE)"
, BT_UNIT_TEST_FUNCTION_ADAPTER_PASSKEY_CONFIRMATION_REPLY_ACCEPT},
- {"bt_passkey_confirmation_reply(FALSE)"
+ {"bt_adapter_passkey_confirmation_reply(FALSE)"
, BT_UNIT_TEST_FUNCTION_ADAPTER_PASSKEY_CONFIRMATION_REPLY_REJECT},
{"Select this menu to set parameters and then select the function again."
, BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS},
case BT_UNIT_TEST_FUNCTION_ADAPTER_PASSKEY_REPLY_ACCEPT:
{
char *passkey = NULL;
- TC_PRT("bt_passkey_reply: Authenticate Logitech Mouse: reply = Accept");
+ TC_PRT("bt_adapter_passkey_reply: Authenticate Logitech Mouse: reply = Accept");
passkey = g_strdup("0000"); /* Passkey - "0000" for mouse */
- ret = bt_passkey_reply(passkey, TRUE);
+ ret = bt_adapter_passkey_reply(passkey, TRUE);
if (ret < BT_ERROR_NONE)
TC_PRT("failed with [0x%04x]", ret);
else
- TC_PRT("bt_passkey_reply: accept authentication result = %d", ret);
+ TC_PRT("bt_adapter_passkey_reply: accept authentication result = %d", ret);
g_free(passkey);
break;
}
case BT_UNIT_TEST_FUNCTION_ADAPTER_PASSKEY_REPLY_CANCEL:
{
char *passkey = NULL;
- TC_PRT("bt_passkey_reply: cancel authentication reply");
+ TC_PRT("bt_adapter_passkey_reply: cancel authentication reply");
passkey = g_strdup("0000"); /* Passkey - "0000" */
- ret = bt_passkey_reply(passkey, FALSE);
+ ret = bt_adapter_passkey_reply(passkey, FALSE);
if (ret < BT_ERROR_NONE)
TC_PRT("failed with [0x%04x]", ret);
else
- TC_PRT("bt_passkey_reply: Logitech Mouse cancel authentication result = %d", ret);
+ TC_PRT("bt_adapter_passkey_reply: Logitech Mouse cancel authentication result = %d", ret);
g_free(passkey);
break;
}
case BT_UNIT_TEST_FUNCTION_ADAPTER_PASSKEY_CONFIRMATION_REPLY_ACCEPT:
{
- ret = bt_passkey_confirmation_reply(TRUE);
+ ret = bt_adapter_passkey_confirmation_reply(TRUE);
if (ret < BT_ERROR_NONE)
TC_PRT("failed with [0x%04x]", ret);
else
- TC_PRT("bt_passkey_confirmation_reply accept, result = %d", ret);
+ TC_PRT("bt_adapter_passkey_confirmation_reply accept, result = %d", ret);
break;
}
case BT_UNIT_TEST_FUNCTION_ADAPTER_PASSKEY_CONFIRMATION_REPLY_REJECT:
{
- ret = bt_passkey_confirmation_reply(FALSE);
+ ret = bt_adapter_passkey_confirmation_reply(FALSE);
if (ret < BT_ERROR_NONE)
TC_PRT("failed with [0x%04x]", ret);
else
- TC_PRT("bt_passkey_confirmation_reply reject, result = %d", ret);
+ TC_PRT("bt_adapter_passkey_confirmation_reply reject, result = %d", ret);
break;
}
case BT_UNIT_TEST_FUNCTION_ACTIVATE_FLAG_TO_SET_PARAMETERS: