OSDN Git Service

Replace BT_HDR => BT_HDR_RIGID
[android-x86/system-bt.git] / bta / gatt / bta_gatts_api.cc
index 5ba47cf..5e49a7c 100644 (file)
  *
  ******************************************************************************/
 
-#include "bt_target.h"
-
 #include <base/bind.h>
-#include <string.h>
+#include <base/location.h>
+#include <cstdint>
+#include <memory>
+#include <vector>
+
+#include "bt_target.h"  // Must be first to define build configuration
 
-#include "bt_common.h"
-#include "bta_gatt_api.h"
-#include "bta_gatts_int.h"
-#include "bta_sys.h"
-#include "stack/include/btu.h"
+#include "bta/gatt/bta_gatts_int.h"
+#include "osi/include/allocator.h"
+#include "stack/include/btu.h"  // do_in_main_thread
+#include "types/bluetooth/uuid.h"
 #include "types/bt_transport.h"
+#include "types/raw_address.h"
 
 /*****************************************************************************
  *  Constants
@@ -58,7 +61,7 @@ void BTA_GATTS_Disable(void) {
     return;
   }
 
-  BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
+  BT_HDR_RIGID* p_buf = (BT_HDR_RIGID*)osi_malloc(sizeof(BT_HDR_RIGID));
   p_buf->event = BTA_GATTS_API_DISABLE_EVT;
   bta_sys_sendmsg(p_buf);
   bta_sys_deregister(BTA_ID_GATTS);
@@ -190,7 +193,7 @@ extern void BTA_GATTS_AddService(tGATT_IF server_if,
  *
  ******************************************************************************/
 void BTA_GATTS_DeleteService(uint16_t service_id) {
-  BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
+  BT_HDR_RIGID* p_buf = (BT_HDR_RIGID*)osi_malloc(sizeof(BT_HDR_RIGID));
 
   p_buf->event = BTA_GATTS_API_DEL_SRVC_EVT;
   p_buf->layer_specific = service_id;
@@ -210,7 +213,7 @@ void BTA_GATTS_DeleteService(uint16_t service_id) {
  *
  ******************************************************************************/
 void BTA_GATTS_StopService(uint16_t service_id) {
-  BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
+  BT_HDR_RIGID* p_buf = (BT_HDR_RIGID*)osi_malloc(sizeof(BT_HDR_RIGID));
 
   p_buf->event = BTA_GATTS_API_STOP_SRVC_EVT;
   p_buf->layer_specific = service_id;
@@ -352,7 +355,7 @@ void BTA_GATTS_CancelOpen(tGATT_IF server_if, const RawAddress& remote_bda,
  *
  ******************************************************************************/
 void BTA_GATTS_Close(uint16_t conn_id) {
-  BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
+  BT_HDR_RIGID* p_buf = (BT_HDR_RIGID*)osi_malloc(sizeof(BT_HDR_RIGID));
 
   p_buf->event = BTA_GATTS_API_CLOSE_EVT;
   p_buf->layer_specific = conn_id;