diff options
author | Anderson Lizardo <anderson.lizardo@openbossa.org> | 2010-10-07 14:02:41 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2010-10-09 18:22:09 +0300 |
commit | 0a70694d3afd91470a83567c18d20a29ad1996e6 (patch) | |
tree | 491be65ca91e829962c1e88eb726fa90c66f4c46 /attrib/gatt.c | |
parent | b331672c7d0ef2a00f82977f695b3bf0333d79ec (diff) | |
download | bluez-0a70694d3afd91470a83567c18d20a29ad1996e6.tar.gz |
Add support for Attribute Write Request
Implement encoders/decoders for Write Request/Response and the handling
on attribute server. The attribute client still uses the Write Command
because currently SetProperty() has no means to wait for the server
response.
Diffstat (limited to 'attrib/gatt.c')
-rw-r--r-- | attrib/gatt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/attrib/gatt.c b/attrib/gatt.c index e8171a907..24ec99049 100644 --- a/attrib/gatt.c +++ b/attrib/gatt.c @@ -76,6 +76,17 @@ guint gatt_read_char(GAttrib *attrib, uint16_t handle, GAttribResultFunc func, user_data, NULL); } +guint gatt_write_char(GAttrib *attrib, uint16_t handle, uint8_t *value, + int vlen, GAttribResultFunc func, gpointer user_data) +{ + uint8_t pdu[ATT_DEFAULT_MTU]; + guint16 plen; + + plen = enc_write_req(handle, value, vlen, pdu, sizeof(pdu)); + return g_attrib_send(attrib, ATT_OP_WRITE_REQ, pdu, plen, func, + user_data, NULL); +} + guint gatt_find_info(GAttrib *attrib, uint16_t start, uint16_t end, GAttribResultFunc func, gpointer user_data) { |