To send an api frame, I use the following code:
byte[] bytesToSend5 = new byte[] { 0x7E, 0x00, 0x10, 0x17, 0x01, 0x00, 0x13, 0xA2, 0x00, 0x40, 0xA6, 0x5E, 0x23, 0xFF, 0xFE, 0x02, 0x44, 0x34, 0x05, 0x4F };
serialPort1.Write(bytesToSend5, 0, bytesToSend5.Length);
The items from 5 to 12 represent a macaddress that the user will change from time to time. To make this easy, I want the user to input the new macaddress in a windows form application like this "123456789012" (this input window is called "prop1_serienr"). I then want to save this to a string, which I have done using this code:
string xbee_serienr;
xbee_serienr = prop1_serienr.Text;
I want to get this string into the array, changing the items on place 5-12 in the array, on the form 0x12, 0x,34, 0x56 and so on.
In theory, it would look something like this:
byte[] bytesToSend5 = new byte[] { 0x7E, 0x00, 0x10, 0x17, 0x01, xbee_serienr, 0xFF, 0xFE, 0x02, 0x44, 0x34, 0x04, 0x50 };
serialPort1.Write(bytesToSend5, 0, bytesToSend5.Length);
Anyone know if this is possible, if I should take another approach or otherwise have any suggestions/advice?