Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfc28f45 authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Automerger Merge Worker
Browse files

Merge "floss: Change vector to pointer in gatt btif" am: 501725e9

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1770173

Change-Id: I2289466d89ced4fab6c4a59ffb18522a8e5470d5
parents 88283396 501725e9
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -490,9 +490,11 @@ void write_char_cb(uint16_t conn_id, tGATT_STATUS status, uint16_t handle,

static bt_status_t btif_gattc_write_char(int conn_id, uint16_t handle,
                                         int write_type, int auth_req,
                                         vector<uint8_t> value) {
                                         const uint8_t* val, size_t len) {
  CHECK_BTGATT_INIT();

  std::vector<uint8_t> value(val, val + len);

  if (value.size() > BTGATT_MAX_ATTR_LEN) value.resize(BTGATT_MAX_ATTR_LEN);

  return do_in_jni_thread(Bind(&BTA_GATTC_WriteCharValue, conn_id, handle,
@@ -506,10 +508,12 @@ void write_descr_cb(uint16_t conn_id, tGATT_STATUS status, uint16_t handle,
}

static bt_status_t btif_gattc_write_char_descr(int conn_id, uint16_t handle,
                                               int auth_req,
                                               vector<uint8_t> value) {
                                               int auth_req, const uint8_t* val,
                                               size_t len) {
  CHECK_BTGATT_INIT();

  std::vector<uint8_t> value(val, val + len);

  if (value.size() > BTGATT_MAX_ATTR_LEN) value.resize(BTGATT_MAX_ATTR_LEN);

  return do_in_jni_thread(Bind(&BTA_GATTC_WriteCharDescr, conn_id, handle,
+2 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#define ANDROID_INCLUDE_BT_GATT_CLIENT_H

#include <stdint.h>
#include <vector>
#include "bt_common_types.h"
#include "bt_gatt_types.h"

@@ -256,14 +255,14 @@ typedef struct {
  /** Write a remote characteristic */
  bt_status_t (*write_characteristic)(int conn_id, uint16_t handle,
                                      int write_type, int auth_req,
                                      std::vector<uint8_t> value);
                                      const uint8_t* value, size_t length);

  /** Read the descriptor for a given characteristic */
  bt_status_t (*read_descriptor)(int conn_id, uint16_t handle, int auth_req);

  /** Write a remote descriptor for a given characteristic */
  bt_status_t (*write_descriptor)(int conn_id, uint16_t handle, int auth_req,
                                  std::vector<uint8_t> value);
                                  const uint8_t* value, size_t length);

  /** Execute a prepared write operation */
  bt_status_t (*execute_write)(int conn_id, int execute);