[OTP] Add support for OACP Read
[platform/core/connectivity/bluetooth-frwk.git] / include / bluetooth-api.h
index c35f4dd..94f8a89 100644 (file)
@@ -86,6 +86,8 @@ extern "C" {
  */
 #define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100
 
+#define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH   500 /**< OTP Characteristics Value Max length */
+
 /**
  * This is Bluetooth error code
  */
@@ -506,6 +508,32 @@ typedef struct {
 } bluetooth_tds_transport_data_info_t;
 
 /**
+* OTP Characteristics Value
+*/
+typedef struct {
+       int length;                                                     /**< Characteristics value length */
+       guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH];        /**< Characteristics data */
+} bluetooth_otp_charc_data_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;
+
+/**
+* Structure to hold the OTC Channel Info
+*/
+typedef struct {
+       gboolean connected;     /**< Connection Status */
+       int fd;                         /**< Fd */
+       char *address;      /**< Remote address */
+} bluetooth_otc_info_t;
+
+/**
 * Advertising parameters
 */
 typedef struct {
@@ -822,6 +850,11 @@ typedef enum {
        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_OTP_WRITE_CHAR_VAL,     /* OTP Write Value Response */
+       BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
+       BLUETOOTH_EVENT_OTC_STATE_CHANGED,              /* OTC Connection State Changed Event */
 } bluetooth_event_type_t;
 
  /**
@@ -7570,6 +7603,93 @@ int bluetooth_otp_server_init(const char *directory);
 int bluetooth_otp_server_deinit();
 
 /**
+ * @fn int bluetooth_otp_enable_notification(const char *handle);
+ *
+ * @brief Enable notification for remote OACP & OLCP characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception  None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark     None
+ */
+int bluetooth_otp_enable_notification(const char *handle);
+
+/**
+ * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
+ *                                             unsigned char *buf, int length);
+ *
+ * @brief Write value on remote characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception  None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark     None
+ */
+int bluetooth_otp_write_characteristics_value( const char *handle,
+                                       unsigned char *buf, int length);
+
+/**
+ * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
+ *
+ * @brief Read value for remote characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception  None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark     None
+ */
+int bluetooth_otp_read_characteristic_value(const char *handle);
+
+/**
+ * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
+ *
+ * @brief Read value for remote characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception  None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark     None
+ */
+int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
+
+/**
+ * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
+ *
+ * @brief Read value for remote characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception  None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark     None
+ */
+int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
+
+/**
  * @}
  */