Interface: AttrRegister
Interface for registering attributes.
See lib/Attributes/... for examples of components that register attributes
See interfaces/Attr.h for the data structures used in this interface. See
docs/tinyschema.pdf for more detailed documentation.
Implemented by lib/Attr.td
- Components providing this interface:
-
tos.lib.Attr
- Components requiring this interface:
-
tos.lib.Attributes.AttrAccelM
tos.lib.Attributes.AttrGlobalM
tos.lib.Attributes.AttrMagM
tos.lib.Attributes.AttrMicM
tos.lib.Attributes.AttrPhotoM
tos.lib.Attributes.AttrPotM
tos.lib.Attributes.AttrTempM
tos.lib.Attributes.AttrVoltageM
tos.lib.TinyDB.NetworkC
-
result_t
registerAttr
(char *name, TOSType attrType, uint8_t attrLen)
-
result_t
getAttrDone
(char *name, char *resultBuf, SchemaErrorNo errorNo)
-
result_t
getAttr
(char *name, char *resultBuf, SchemaErrorNo *errorNo)
-
result_t setAttr(char *name, char *attrVal)
registerAttr
result_t registerAttr(char *name, TOSType attrType, uint8_t attrLen)
getAttrDone
result_t getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo) Should be called when a split-phase attribute get has completed.
Parameters: |
name - The name of the attribute that was fetched
resultBuf - The buffer where the value of the result was written
errorNo - An error code
|
getAttr
result_t getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) The provider (client) receives this event when a request for an attribute
value is made. See AttrUse.td. The provider must fetch the value
of the attribute (and/or set the errorNo.) If this is a split phase
get, the client must call getAttrDone() once the fetch is complete.
Parameters: |
name - The name of the attribute to get
resultBuf - The buffer to write the result into
errorNo - (on return) The error code, if any (see SchemaType.h)
|