#define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */
#define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */
+/*
+ * < This defines the maximum size of OTP server directory name
+ */
+#define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
+
/**
* This is Bluetooth error code
*/
#define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
#define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
-
+/*
+ * Bluetooth OTP error codes
+ */
+#define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
+#define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
+#define BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED 0x80
+#define BLUETOOTH_ERROR_OBJECT_NOT_SELECTED 0x81
+#define BLUETOOTH_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
+#define BLUETOOTH_ERROR_OBJECT_NAME_EXISITS 0x83
/**
* Device disconnect reason
} bluetooth_device_address_type_t;
/**
+ * This is BD Address type defined in kernel BT header
+ */
+typedef enum {
+ BLUETOOTH_BDADDR_BREDR = 0x00,
+ BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
+ BLUETOOTH_BDADDR_LE_RANDOM = 0x02
+} bluetooth_bdaddr_type_e;
+
+/**
* This is Bluetooth version
*/
typedef struct {
} bluetooth_tds_transport_data_info_t;
/**
+* Structure to hold the OTP response data from remote OTP server
+*/
+typedef struct {
+ char *handle; /**< Handle */
+ int data_length; /**< Data length */
+ char *data; /**< Read data */
+} bluetooth_otp_resp_info_t;
+
+/**
* Advertising parameters
*/
typedef struct {
BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
+
+ BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
+ BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
+ BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
} bluetooth_event_type_t;
/**
/**
* @fn int bluetooth_oob_add_remote_data(
* const bluetooth_device_address_t *remote_device_address,
+ * bluetooth_bdaddr_type_e address_type,
* bt_oob_data_t *oob_data)
* @brief Add/updated the remote device Hash and Randmizer.
*
*
* @exception None
* @param[in] remote_device_address - Remote device address
+ * address_type - bdaddr type
* remote_oob_data - Ponter to Hash and Randomizer oob data structure
*
* @remark None
int bluetooth_oob_add_remote_data(
const bluetooth_device_address_t *remote_device_address,
+ bluetooth_bdaddr_type_e address_type,
bt_oob_data_t *remote_oob_data);
unsigned char *buf, int length);
/**
+ * @fn int bluetooth_otp_server_init(const char *directory);
+ *
+ * @brief Starts OTP server.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark None
+ */
+int bluetooth_otp_server_init(const char *directory);
+
+/**
+ * @fn int bluetooth_otp_server_deinit();
+ *
+ * @brief Stops OTP server.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark None
+ */
+int bluetooth_otp_server_deinit();
+
+int bluetooth_otp_enable_notification(const char *handle);
+
+int bluetooth_otp_read_characteristic_value(const char *handle);
+
+/**
* @}
*/