Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Is it possible to parse any keys if there are multiple types of messages received?

 

For example, if I do a IPort1_Read and get the string "error=0#set,accelx:freq=1,accely:freq=1,accelz:freq=1

error=0#accelx=1,accely=2,accelz=3#get,accelx,accely,accelz", how do I get the values and keys in the 2nd message?

 

Using ISensorUtil_IterNextKey just throws an error saying that it doesn't support "set" commands.

 

As it says set type of response is not supported ISensorUtil_IterNextKey.
you may verify a set command just by comparing the response to the set command.
more over, you should not get that double kind of a response.
if you Write/Give a command as :- "set accelx:freq=1,accely:freq=1,accelz:freq=1"
the response may be of format "error=0#set,accelx:freq=1,accely:freq=1,accelz:freq=1".
check the amount of Data that is returned in the IPort1_Read() via - *pnRead.
may be the buffer you pass has some garbage from before.

As it says set type of response is not supported ISensorUtil_IterNextKey.
you may verify a set command just by comparing the response to the set command.
more over, you should not get that double kind of a response.
if you Write/Give a command as :- "set accelx:freq=1,accely:freq=1,accelz:freq=1"
the response may be of format "error=0#set,accelx:freq=1,accely:freq=1,accelz:freq=1".
check the amount of Data that is returned in the IPort1_Read() via - *pnRead.
may be the buffer you pass has some garbage from before.