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


API Reference


Brew Release
Brew MP 1.0.2
See Also
Returns the request string that was echoed as part of the response message.
Pointer to ISensorUtil interface
iterator object to be used for this operation.
The requested string that was part of the response string.
size of pRequestedStr buffer
a)number of bytes succesfully copied into pRequestStr, if pRequestStrLenReq is less than or equal to pRequestStrLen. [if pRequestStrLenReq <= pRequestStrLen, the response string is complete] or b) number of bytes required to succesfully copy the entire string to pRequestStr, if pRequestStrLenReq is greater than pRequestStrLen [if pRequestStrLenReq > pRequestStrLen, the pRequestStr is incomplete.]
  • AEEResult ISensorUtil_IterNextRequestString(ISensorUtil* _me, ISensorUtil_iterator iter, 
                                                char* pRequestStr, int pRequestStrLen, int* pRequestStrLenReq)

  • AEE_SUCCESS: if the response can be parsed for the requested string. AEE_ENOMEMORY: if no memory is allocated for the pRequestStr output parameter. AEE_EINVALIDFORMAT : if the response message in the iterator is invalid. AEE_EFAILED: Otherwise
Side Effect
  • None
if pRequestStr is non-null and the result would not fit, pRequestStr will contain an incomplete string euqal to the size specified in pRequestStrLen argument. Check pRequestStrLenReq to determine if the pRequestStr is complete or not. pRequestedStr is always null-terminated. Example code: { char *pRequestStr; int pRequestStrLen; int pRequestStrLenReq; // Assume pResponseStr has the message //"error=0#accelx=-198,accely=1008,accelz=176#get,accelx,accely,accelz" // myIter is the iterator having the pResponseStr ISensorUtil_iterator myIter; pRequestStrLen = STRLEN(pResponseStr)+1; pRequestStr = (char *)MALLOC(pRequestStrLen); ISensorUtil_GetRequestedString(pMe, myIter, pRequestStr, pRequestStrLen, &pRequestStrLenReq); // If ISensorUtil_GetRequestedString returns SUCCESS, pRequestStr holds the request string. // pRequestStrLenReq holds the number of bytes succesfully copied into pRequestStr (including // null termination). // If pRequestStrLenReq is less than or equal to pRequestStrLen, pRequeststr is completely formed. // If pRequestStrLenReq is greater than pRequestStrLen, pRequeststr is incomplete. // pRequestStrLenReq is the number of bytes needed to completer create pRequeststr }