Support Tizen2.3 to add the OOB features 29/32729/1
authorwu zheng <wu.zheng@intel.com>
Tue, 23 Dec 2014 08:33:11 +0000 (16:33 +0800)
committerwu zheng <wu.zheng@intel.com>
Tue, 23 Dec 2014 08:33:11 +0000 (16:33 +0800)
bt_adapter_get_local_oob_data
bt_adapter_set_remote_oob_data
bt_adapter_remove_remote_oob_data

The above points have been added.

Change-Id: Ic6e11f7014286838cc6e2531d3691e99f7a9995f
Signed-off-by: Wu Zheng <wu.zheng@intel.com>
capi/bluetooth.c
include/bluetooth.h

index facf984f5e537bba237ebd61fbb57fb398013619..6a91299abc339b4015f2b63483838650f71ba9b3 100644 (file)
@@ -2048,6 +2048,32 @@ int bt_adapter_get_local_info(char **chipset, char **firmware,
        return BT_ERROR_NOT_SUPPORTED;
 }
 
+int bt_adapter_get_local_oob_data(unsigned char **hash,
+                               unsigned char **randomizer,
+                               int *hash_len, int *randomizer_len)
+{
+       return BT_ERROR_NOT_SUPPORTED;
+}
+
+int bt_adapter_set_remote_oob_data(const char *remote_address,
+                               unsigned char *hash,
+                               unsigned char *randomizer,
+                               int hash_len, int randomizer_len)
+{
+       return BT_ERROR_NOT_SUPPORTED;
+}
+
+int bt_adapter_remove_remote_oob_data(const char *remote_address)
+{
+       /*bluez5.X does not provide the interface.
+       * At the same time, it is not necessary to be used by app.
+       * neard(NFC daemon) has controlled it after bluez5.X
+       * Therefore, the CAPI won't be implemented.
+       * NTB will match the design of upstream.
+       */
+       return BT_ERROR_NOT_SUPPORTED;
+}
+
 int bt_device_get_service_mask_from_uuid_list(char **uuids,
                                        int no_of_service,
                                        bt_service_class_t *service_mask_list)
index fba7badc653c53453b982f4226935a1e6799039d..213bc222caa68cfdedb86945c64179c8bef17b43 100644 (file)
@@ -4455,6 +4455,84 @@ int bt_adapter_get_connectable(bool *connectable);
  */
 int bt_adapter_set_connectable(bool connectable);
 
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Get the Hash and Randmoizer value, synchronously.
+ * @since_tizen 2.3
+ *
+ * @param[out] hash The hash value recieved from the controller
+ * @param[out] randomizer The hash value recieved from the controller
+ * @param[out] hash_len The length of the hash value
+ * @param[out] randomizer_len The length of the randomizer value
+ * @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_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @see bt_initialize()
+ */
+int bt_adapter_get_local_oob_data(unsigned char **hash,
+                                       unsigned char **randomizer,
+                                       int *hash_len, int *randomizer_len);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Sets the Hash and Randmoizer value, synchronously.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/bluetooth
+ *
+ * @param[in] remote_address Remote device address
+ * @param[in] hash The hash value recieved from the controller
+ * @param[in] randomizer The hash value recieved from the controller
+ * @param[in] hash_len The length of the hash value. Allowed value is 16
+ * @param[in] randomizer_len The length of the randomizer value. Allowed value is 16
+ * @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_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @see bt_initialize()
+ */
+int bt_adapter_set_remote_oob_data(const char *remote_address,
+                               unsigned char *hash,
+                               unsigned char *randomizer,
+                               int hash_len, int randomizer_len);
+
+/**
+ * @ingroup CAPI_NETWORK_BLUETOOTH_ADAPTER_MODULE
+ * @brief Deletes the Hash and Randomizer value, synchronously.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/bluetooth
+ *
+ * @param[in] remote_address Remote device address
+ * @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_NOT_ENABLED  Not enabled
+ * @retval #BT_ERROR_OPERATION_FAILED  Operation failed
+ * @retval #BT_ERROR_PERMISSION_DENIED  Permission denied
+ * @retval #BT_ERROR_NOT_SUPPORTED  Not supported
+ *
+ * @pre The state of local Bluetooth must be #BT_ADAPTER_ENABLED.
+ * @pre The Bluetooth service must be initialized with bt_initialize().
+ * @see bt_initialize()
+ */
+int bt_adapter_remove_remote_oob_data(const char *remote_address);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */