diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index a5e6dcb..4592a90 100644
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
size += info->num_attrs;
}
- start_handle = attrib_db_find_avail(adapter, size);
+ start_handle = attrib_db_find_avail(adapter, svc_uuid, size);
if (start_handle == 0) {
error("Not enough free handles to register service");
goto fail;
diff --git a/plugins/gatt-example.c b/plugins/gatt-example.c
index e791c53..f12fbde 100644
--- a/plugins/gatt-example.c
+++ b/plugins/gatt-example.c
bt_uuid_t uuid;
int len;
- start_handle = attrib_db_find_avail(adapter->adapter, svc_size);
+ bt_uuid16_create(&uuid, THERM_HUMIDITY_SVC_UUID);
+ start_handle = attrib_db_find_avail(adapter->adapter, &uuid, svc_size);
if (start_handle == 0) {
error("Not enough free handles to register service");
return;
bt_uuid_t uuid;
int len;
- start_handle = attrib_db_find_avail(adapter->adapter, svc_size);
+ bt_uuid16_create(&uuid, MANUFACTURER_SVC_UUID);
+ start_handle = attrib_db_find_avail(adapter->adapter, &uuid, svc_size);
if (start_handle == 0) {
error("Not enough free handles to register service");
return;
bt_uuid_t uuid;
int len;
- start_handle = attrib_db_find_avail(adapter->adapter, svc_size);
+ bt_uuid16_create(&uuid, MANUFACTURER_SVC_UUID);
+ start_handle = attrib_db_find_avail(adapter->adapter, &uuid, svc_size);
if (start_handle == 0) {
error("Not enough free handles to register service");
return;
uint8_t atval[256];
bt_uuid_t uuid;
- start_handle = attrib_db_find_avail(adapter->adapter, svc_size);
+ bt_uuid16_create(&uuid, VENDOR_SPECIFIC_SVC_UUID);
+ start_handle = attrib_db_find_avail(adapter->adapter, &uuid, svc_size);
if (start_handle == 0) {
error("Not enough free handles to register service");
return;
const uint128_t prim_weight_uuid_btorder = {
.data = { 0x4F, 0x0A, 0xC0, 0x96, 0x35, 0xD4, 0x49, 0x11,
0x96, 0x31, 0xDE, 0xA8, 0xDC, 0x74, 0xEE, 0xFE } };
- uint128_t char_weight_uuid;
+ uint128_t prim_weight_uuid, char_weight_uuid;
uint16_t start_handle, h;
const int svc_size = 6;
uint32_t sdp_handle;
int len;
btoh128(&char_weight_uuid_btorder, &char_weight_uuid);
-
- start_handle = attrib_db_find_avail(adapter->adapter, svc_size);
+ btoh128(&prim_weight_uuid_btorder, &prim_weight_uuid);
+ bt_uuid128_create(&uuid, prim_weight_uuid);
+ start_handle = attrib_db_find_avail(adapter->adapter, &uuid, svc_size);
if (start_handle == 0) {
error("Not enough free handles to register service");
return;
diff --git a/proximity/reporter.c b/proximity/reporter.c
index a139c7c..b29c75b 100644
--- a/proximity/reporter.c
+++ b/proximity/reporter.c
uint8_t atval[256];
bt_uuid_t uuid;
+ bt_uuid16_create(&uuid, LINK_LOSS_SVC_UUID);
/* FIXME: Provide the adapter in next function */
- start_handle = attrib_db_find_avail(NULL, svc_size);
+ start_handle = attrib_db_find_avail(NULL, &uuid, svc_size);
if (start_handle == 0) {
error("Not enough free handles to register service");
return;
uint8_t atval[256];
bt_uuid_t uuid;
+ bt_uuid16_create(&uuid, TX_POWER_SVC_UUID);
/* FIXME: Provide the adapter in next function */
- start_handle = attrib_db_find_avail(NULL, svc_size);
+ start_handle = attrib_db_find_avail(NULL, &uuid, svc_size);
if (start_handle == 0) {
error("Not enough free handles to register service");
return;
uint8_t atval[256];
bt_uuid_t uuid;
+ bt_uuid16_create(&uuid, IMMEDIATE_ALERT_SVC_UUID);
/* FIXME: Provide the adapter in next function */
- start_handle = attrib_db_find_avail(NULL, svc_size);
+ start_handle = attrib_db_find_avail(NULL, &uuid, svc_size);
if (start_handle == 0) {
error("Not enough free handles to register service");
return;
diff --git a/src/attrib-server.c b/src/attrib-server.c
index d91a31e..5347c42 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
remove_record_from_server(sdp_handle);
}
-uint16_t attrib_db_find_avail(struct btd_adapter *adapter, uint16_t nitems)
+uint16_t attrib_db_find_avail(struct btd_adapter *adapter, bt_uuid_t *svc_uuid,
+ uint16_t nitems)
{
struct gatt_server *server;
uint16_t handle;
diff --git a/src/attrib-server.h b/src/attrib-server.h
index 2c6f428..fb4637c 100644
--- a/src/attrib-server.h
+++ b/src/attrib-server.h
*
*/
-uint16_t attrib_db_find_avail(struct btd_adapter *adapter, uint16_t nitems);
+uint16_t attrib_db_find_avail(struct btd_adapter *adapter, bt_uuid_t *svc_uuid,
+ uint16_t nitems);
struct attribute *attrib_db_add(struct btd_adapter *adapter, uint16_t handle,
bt_uuid_t *uuid, int read_reqs, int write_reqs,
const uint8_t *value, int len);