Thread (53 messages) flat view 53 messages, 13 authors, 2012-01-11

Re: GATT Dbus API on BlueZ - attirbute-api.txt modifications

From: Anderson Lizardo <hidden>
Date: 2011-10-27 13:32:51

Hi Chen,

On Wed, Oct 26, 2011 at 3:20 AM, Ganir, Chen [off-list ref] wrote:
+               int WriteValue(array{byte} value, int method)
I think you meant "uint8" as return value, which corresponds to the
ATT error code type.
+
+                   Write the value of the characteristic, with specified method :
+                   0: Write without response. Always return 0.
+                   1: Write with response. Return server response code.
+                   Other write methods will be added in the future.
+
Besides what others suggested, I would avoid using integers as
enumerations on D-Bus API, specially if the actual values are not
defined by any specification. If you take a look at other API docs in
doc/* you may see examples where string are used. IMHO this make the
client code much more readable and does not require looking at the API
doc all the time. Example:

###
uint8 WriteValue(array{byte} value, string method)

Write the value of the characteristic, with specified method:
"WithoutResponse" or "WithResponse". Other write methods may be added
in the future.
###

An alternative is to use dict, if multiple "flags" are allowed.

Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help