diff --git a/attrib/client.c b/attrib/client.c
index 2423fad..ece16bf 100644
--- a/attrib/client.c
+++ b/attrib/client.c
if (bt_io_set(io, NULL,
BT_IO_OPT_SEC_LEVEL, level,
BT_IO_OPT_INVALID)) {
- gatt_read_char(gatt->attrib, current->handle, 0,
+ gatt_read_char(gatt->attrib, current->handle,
update_char_desc, current);
return;
}
if (bt_io_set(io, NULL,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_HIGH,
BT_IO_OPT_INVALID)) {
- gatt_read_char(gatt->attrib, chr->handle, 0,
+ gatt_read_char(gatt->attrib, chr->handle,
update_char_value, current);
return;
}
if (uuid_desc16_cmp(&uuid, GATT_CHARAC_USER_DESC_UUID) == 0) {
query_list_append(gatt, qfmt);
- gatt_read_char(gatt->attrib, handle, 0, update_char_desc,
+ gatt_read_char(gatt->attrib, handle, update_char_desc,
qfmt);
} else if (uuid_desc16_cmp(&uuid, GATT_CHARAC_FMT_UUID) == 0) {
query_list_append(gatt, qfmt);
- gatt_read_char(gatt->attrib, handle, 0,
- update_char_format, qfmt);
+ gatt_read_char(gatt->attrib, handle, update_char_format,
+ qfmt);
} else
g_free(qfmt);
}
query_list_append(gatt, qvalue);
- gatt_read_char(gatt->attrib, chr->handle, 0, update_char_value, qvalue);
+ gatt_read_char(gatt->attrib, chr->handle, update_char_value, qvalue);
}
static DBusMessage *create_discover_char_reply(DBusMessage *msg, GSList *chars)
diff --git a/attrib/gatt.c b/attrib/gatt.c
index 6880e2d..882f3c1 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
long_read->func(status, rpdu, rlen, long_read->user_data);
}
-guint gatt_read_char(GAttrib *attrib, uint16_t handle, uint16_t offset,
- GAttribResultFunc func, gpointer user_data)
+guint gatt_read_char(GAttrib *attrib, uint16_t handle, GAttribResultFunc func,
+ gpointer user_data)
{
uint8_t *buf;
size_t buflen;
long_read->handle = handle;
buf = g_attrib_get_buffer(attrib, &buflen);
- if (offset > 0) {
- plen = enc_read_blob_req(long_read->handle, offset, buf,
- buflen);
- id = g_attrib_send(attrib, 0, ATT_OP_READ_BLOB_REQ, buf, plen,
- read_blob_helper, long_read, read_long_destroy);
- } else {
- plen = enc_read_req(handle, buf, buflen);
- id = g_attrib_send(attrib, 0, ATT_OP_READ_REQ, buf, plen,
+ plen = enc_read_req(handle, buf, buflen);
+ id = g_attrib_send(attrib, 0, ATT_OP_READ_REQ, buf, plen,
read_char_helper, long_read, read_long_destroy);
- }
if (id == 0)
g_free(long_read);
diff --git a/attrib/gatt.h b/attrib/gatt.h
index 6bb6f0f..3862011 100644
--- a/attrib/gatt.h
+++ b/attrib/gatt.h
bt_uuid_t *uuid, gatt_cb_t func,
gpointer user_data);
-guint gatt_read_char(GAttrib *attrib, uint16_t handle, uint16_t offset,
- GAttribResultFunc func, gpointer user_data);
+guint gatt_read_char(GAttrib *attrib, uint16_t handle, GAttribResultFunc func,
+ gpointer user_data);
guint gatt_write_char(GAttrib *attrib, uint16_t handle, uint8_t *value,
size_t vlen, GAttribResultFunc func,
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 416bb71..3b0ebbc 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
static int opt_handle = -1;
static int opt_mtu = 0;
static int opt_psm = 0;
-static int opt_offset = 0;
static gboolean opt_primary = FALSE;
static gboolean opt_characteristics = FALSE;
static gboolean opt_char_read = FALSE;
return FALSE;
}
- gatt_read_char(attrib, opt_handle, opt_offset, char_read_cb, attrib);
+ gatt_read_char(attrib, opt_handle, char_read_cb, attrib);
return FALSE;
}
{ "value", 'n' , 0, G_OPTION_ARG_STRING, &opt_value,
"Write characteristic value (required for write operation)",
"0x0001" },
- { "offset", 'o', 0, G_OPTION_ARG_INT, &opt_offset,
- "Offset to long read characteristic by handle", "N"},
{NULL},
};
diff --git a/attrib/interactive.c b/attrib/interactive.c
index 38ac30f..8d9531f 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
static void cmd_read_hnd(int argcp, char **argvp)
{
int handle;
- int offset = 0;
if (conn_state != STATE_CONNECTED) {
printf("Command failed: disconnected\n");
return;
}
- if (argcp > 2) {
- char *e;
-
- errno = 0;
- offset = strtol(argvp[2], &e, 0);
- if (errno != 0 || *e != '\0') {
- printf("Invalid offset: %s\n", argvp[2]);
- return;
- }
- }
-
- gatt_read_char(attrib, handle, offset, char_read_cb, attrib);
+ gatt_read_char(attrib, handle, char_read_cb, attrib);
}
static void cmd_read_uuid(int argcp, char **argvp)
"Characteristics Discovery" },
{ "char-desc", cmd_char_desc, "[start hnd] [end hnd]",
"Characteristics Descriptor Discovery" },
- { "char-read-hnd", cmd_read_hnd, "<handle> [offset]",
+ { "char-read-hnd", cmd_read_hnd, "<handle>",
"Characteristics Value/Descriptor Read by handle" },
{ "char-read-uuid", cmd_read_uuid, "<UUID> [start hnd] [end hnd]",
"Characteristics Value/Descriptor Read by UUID" },
diff --git a/profiles/deviceinfo/deviceinfo.c b/profiles/deviceinfo/deviceinfo.c
index e7c442f..57652a0 100644
--- a/profiles/deviceinfo/deviceinfo.c
+++ b/profiles/deviceinfo/deviceinfo.c
static void process_deviceinfo_char(struct characteristic *ch)
{
if (g_strcmp0(ch->attr.uuid, PNPID_UUID) == 0)
- gatt_read_char(ch->d->attrib, ch->attr.value_handle, 0,
+ gatt_read_char(ch->d->attrib, ch->attr.value_handle,
read_pnpid_cb, ch);
}
diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 4b95c5d..94d4b8d 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
} else if (g_strcmp0(c->uuid, BODY_SENSOR_LOCATION_UUID) == 0) {
DBG("Body Sensor Location supported");
- gatt_read_char(hr->attrib, c->value_handle, 0,
+ gatt_read_char(hr->attrib, c->value_handle,
read_sensor_location_cb, hr);
} else if (g_strcmp0(c->uuid,
HEART_RATE_CONTROL_POINT_UUID) == 0) {
diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
index d0912f5..a8cc568 100644
--- a/profiles/input/hog_device.c
+++ b/profiles/input/hog_device.c
break;
case GATT_REPORT_REFERENCE:
report = user_data;
- gatt_read_char(report->hogdev->attrib, handle, 0,
+ gatt_read_char(report->hogdev->attrib, handle,
report_reference_cb, report);
break;
case GATT_EXTERNAL_REPORT_REFERENCE:
hogdev = user_data;
- gatt_read_char(hogdev->attrib, handle, 0,
+ gatt_read_char(hogdev->attrib, handle,
external_report_reference_cb, hogdev);
break;
}
report);
discover_descriptor(hogdev->attrib, chr, next, report);
} else if (bt_uuid_cmp(&uuid, &report_map_uuid) == 0) {
- gatt_read_char(hogdev->attrib, chr->value_handle, 0,
+ gatt_read_char(hogdev->attrib, chr->value_handle,
report_map_read_cb, hogdev);
discover_descriptor(hogdev->attrib, chr, next, hogdev);
} else if (bt_uuid_cmp(&uuid, &info_uuid) == 0)
if (proto_mode_handle) {
hogdev->proto_mode_handle = proto_mode_handle;
- gatt_read_char(hogdev->attrib, proto_mode_handle, 0,
+ gatt_read_char(hogdev->attrib, proto_mode_handle,
proto_mode_read_cb, hogdev);
}
if (info_handle)
- gatt_read_char(hogdev->attrib, info_handle, 0,
- info_read_cb, hogdev);
+ gatt_read_char(hogdev->attrib, info_handle, info_read_cb,
+ hogdev);
}
static void output_written_cb(guint8 status, const guint8 *pdu,
diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c
index a791916..6444a75 100644
--- a/profiles/proximity/monitor.c
+++ b/profiles/proximity/monitor.c
DBG("Tx Power handle: 0x%04x", monitor->txpowerhandle);
- gatt_read_char(monitor->attrib, monitor->txpowerhandle, 0,
+ gatt_read_char(monitor->attrib, monitor->txpowerhandle,
tx_power_read_cb, monitor);
}
bt_uuid_t uuid;
if (monitor->txpowerhandle != 0) {
- gatt_read_char(monitor->attrib, monitor->txpowerhandle, 0,
+ gatt_read_char(monitor->attrib, monitor->txpowerhandle,
tx_power_read_cb, monitor);
return;
}
diff --git a/profiles/thermometer/thermometer.c b/profiles/thermometer/thermometer.c
index 77dcb26..3506ba7 100644
--- a/profiles/thermometer/thermometer.c
+++ b/profiles/thermometer/thermometer.c
if (bt_uuid_cmp(&desc->uuid, &btuuid) == 0 && g_strcmp0(ch->attr.uuid,
MEASUREMENT_INTERVAL_UUID) == 0) {
- gatt_read_char(ch->t->attrib, desc->handle, 0,
- valid_range_desc_cb, desc);
+ gatt_read_char(ch->t->attrib, desc->handle, valid_range_desc_cb,
+ desc);
return;
}
change_property(ch->t, "Intermediate", &intermediate);
return;
} else if (g_strcmp0(ch->attr.uuid, TEMPERATURE_TYPE_UUID) == 0)
- gatt_read_char(ch->t->attrib, ch->attr.value_handle, 0,
+ gatt_read_char(ch->t->attrib, ch->attr.value_handle,
read_temp_type_cb, ch);
else if (g_strcmp0(ch->attr.uuid, MEASUREMENT_INTERVAL_UUID) == 0)
- gatt_read_char(ch->t->attrib, ch->attr.value_handle, 0,
+ gatt_read_char(ch->t->attrib, ch->attr.value_handle,
read_interval_cb, ch);
}