Here is a sample API format for Zigbee I/O Data Sample
7E0014920013A20040522BAA7D840101001C0200140225F5
We can tell the frame type is 92 and the data length is 14 (Both values are in Hex)
We are trying to capture this API data stream without using library as assistance, using serial.read() that reads 1 byte at a time. We created a "for loop" and an "array" to store incoming data, however the array is not storing "7E", "00", "14" .... so on but in decimal format.
Any idea to have (1) the value in array converted from (Dec to Hex) and (2) Compose everything from array to another string variable? Want to achieve something like this below?
The fact that you can't be bothered to show the separation between values doesn't meant that it doesn't exist.
We are trying to capture this API data stream without using library as assistance, using serial.read() that reads 1 byte at a time. We created a "for loop" and an "array" to store incoming data, however the array is not storing "7E", "00", "14" .... so on but in decimal format.
Because the incoming data isn't "7E", "00", "14", etc. The incoming bytes are 0x7E, 0x00, 0x14, etc.
In this case, would byte or char datatype more make sense being used first to hold the incoming data?
To whom? If all the values are less than 0x7F, it doesn't matter. Since you can't guarantee that, byte is more appropriate. char would be, if the data was ASCII values (but, it isn't).
Question is, what is needed so that apiData contains a true String with "7E 00 12 92 00 13 A2 00 40 A8 2F F2" ?
Why do you want to take 12 bytes and make a 35 character String from them?
You can create a String from a byte, using whatever base you want. You can NOT expect that the String class will know what base you used when defining the value stored in the byte. What is actually stored in the byte is binary data.