I have tried to search for the duplicates of my problem, but could not find. Also, sorry for the not so understandable title. I am so confused about what I am searching, and also about the terminology. I am an electronics engineer with very little knowledge on .Net framework, so treat me well :)
My current project is a heart rate monitor that can store measured heart rates to an EEPROM to be sent to a PC for later log viewing.
I am interfacing with an 8-bit microcontroller using RS-232 (serial) protocol. Whenever I send a char l
, which stands for log
, to the microcontroller, it will send me back some information in the following format:
0x1E 0x21 0x01 0x13 0x14 0x35 0x46 0x1E 0x21 0x01 0x13 0x14 0x43 0x48 0x0A 0x0D
Empty spaces are for information purposes, these bytes are not seperated from each other.
These 8 bit HEX values that are sent from the microcontroller include a start of record information, which is 0x1E
, the date and time in the format DD MM YY HH MM and also the recorded heart rate. When all the records are echoed, then 0x0A and 0x0D character is sent.
For example, above code means:
Record start.
21.01.13 14:35
Heart Rate: 70
Record start.
21.01.13 14:43
Heart Rate: 72
End of records.
How can I get the string value like this: "S210113143570S210113144372", where S
can be anything. Afterwards, I am going to apply a regex syntax to this and divide it to groups so that I can add these values to a listview
control.
Edit after comments and answers:
I have not written the sample wrong. Unfortunately, the encoding is exactly like above.
HEX
, is it? – Imogeneimojean