API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

ISENSORUTIL_ITERNEXTKEY()

Brew Release
Brew MP 1.0.2
See Also
ISensorUtil_IterCreate ISensorUtil_IterDelete ISensorUtil_IterNumKeys ISensorUtil_IterNumValues ISensorUtil_IterNextValue ISensorUtil_GetValueByDataType
Description
Returns the next data type or datatype and attribute (if an attribute value was requested) in the response message.
Params
_me
[in]:
Pointer to ISensorUtil interface
iter
[in]:
iterator object to be used for this operation.
pDataType
[out]:
Next data type in the response message. Cannot be NULL. Memory to be allocated by the app.
pDataTypeLen
[in]:
size of pDataType
pDataTypeLenReq
[out]:
Number of bytes copied into pDataType.
pAttribute
[out]:
Next attribute (if present) in the response message. Can be NULL. Memory to be allocated by the app where applicable.
pAttributeLen
[in]:
size of pAttribute
pAttributeLenReq
[out]:
Number of bytes copied into pAttribute. If there is no attribute as part of the Key, this will be 0.
Interface
Prototype
  • AEEResult ISensorUtil_IterNextKey(ISensorUtil* _me, ISensorUtil_iterator iter, 
                                      char* pDataType, int pDataTypeLen, int* pDataTypeLenReq, 
                                      char* pAttribute, int pAttributeLen, int* pAttributeLenReq)
    
Return

  • AEE_SUCCESS: if the next key can be extracted AEE_EINVALIDFORMAT : if the response message in the iterator is invalid. AEE_EFAILED: Otherwise
Side Effect
  • None
Comments
Example code: { // Assume pResponseStr has the message //"error=0#accelx:maxfreq=40,accely=1008,accelz=176#get,accelx,accely,accelz" // myIter is the iterator having the pResponseStr ISensorUtil_iterator myIter; int numKeys; char pDataType[32], pAttribute[32]; ISensorUtil_IterNextDataType(me, myIter, pDataType, STRLEN(pDataType)+1, &pDataTypeLenReq, pAttribute, STRLEN(pAttribute)+1, &pAttributeLenReq); // pDataType will return "accelx" // pAttribute will return "maxfreq" ISensorUtil_IterNextDataType(me, myIter, pDataType, STRLEN(pDataType)+1, &pDataTypeLenReq, pAttribute, STRLEN(pAttribute)+1, &pAttributeLenReq); // pDataType will return "accely" // pAttribute will be null. pAttributeLenReq will be 0 ISensorUtil_IterNextDataType(me, myIter, pDataType, STRLEN(pDataType)+1, &pDataTypeLenReq, pAttribute, STRLEN(pAttribute)+1, &pAttributeLenReq); // pDataType will return "accelz" // pAttribute will be null. pAttributeLenReq will be 0 ISensorUtil_IterNextDataType(me, myIter, pDataType, STRLEN(pDataType)+1, &pDataTypeLenReq, pAttribute, STRLEN(pAttribute)+1, &pAttributeLenReq); // pDataType will return null. pDataTypeLenReq will be 0 // pAttribute will be null. pAttributeLenReq will be 0 }