summaryrefslogtreecommitdiff
path: root/attrib/att.h
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2011-02-23 12:14:17 -0300
committerJohan Hedberg <johan.hedberg@nokia.com>2011-02-24 15:41:47 -0300
commitc3717e342076126f2dd4b9b8dba81e86c14c1972 (patch)
treeaaf740acdf1ed529253db6a4ba90f895fc90527f /attrib/att.h
parent1847ffb1b66778558a06a3d6893cfa67cab33ce2 (diff)
downloadbluez-c3717e342076126f2dd4b9b8dba81e86c14c1972.tar.gz
Add read/write callbacks to attribute server
These callbacks will allow profiles to act before an attribute is read and after it is written, to e.g. update the attribute value to/from an external source. Note that by the time the callback is called, the necessary security checks (attribute permissions, authentication and encryption) were already performed by the core attribute server. The callback can optionally return an ATT status code, which will be sent to the client using an Error Response PDU.
Diffstat (limited to 'attrib/att.h')
-rw-r--r--attrib/att.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/attrib/att.h b/attrib/att.h
index 7d9afebe8..9b0b5389a 100644
--- a/attrib/att.h
+++ b/attrib/att.h
@@ -123,6 +123,9 @@ struct attribute {
uuid_t uuid;
int read_reqs;
int write_reqs;
+ uint8_t (*read_cb)(struct attribute *a, gpointer user_data);
+ uint8_t (*write_cb)(struct attribute *a, gpointer user_data);
+ gpointer cb_user_data;
int len;
uint8_t data[0];
};