[Help] Separate incoming data from SerialPort !

Hey Guys!. I just started using arduino with Arduino Mega. I have some problems about Serial. I using Zigbee connect with Serial1. It's received data about temperature and humidity from 2 Zigbee Router. Data received is of the form "UCAST:IDZigbeerouter,lendata=temperature,humidity". Eg
"UCAST:000D6F000B1FDC75,05=17,80"
and "UCAST:000D6F000B1FBF65,05=18,82". I need Split the temperature and humidity data into tempbuffer and humibuffer (int). Please help me!
Thanks!

strchr to find equal sign, next strchr or strtok to split the part after the equal sign on the comma

Well, you already know the length of the data in the serial buffer, so I would start working backwards from the end of the buffer and pick up the digits of the humidity, until I found the comma ",". Then the next character back is the temperature digit. And continue back until I found the equal, "=", sign and you are done.

Paul

Have a look at the parse example in Serial Input Basics

...R

Paul_KD7HB:
Well, you already know the length of the data in the serial buffer, so I would start working backwards from the end of the buffer and pick up the digits of the humidity, until I found the comma ",". Then the next character back is the temperature digit. And continue back until I found the equal, "=", sign and you are done.

Paul

That's a good idea, and I need split data from 2 router through routerID. It's mean have 2 buffer temp and 2 buffer humi. can you guide me