Sending HEX string via serial port

Does anyone have any suggestions for sending large strings of hex values to a serial port? Maybe I’m missing something obvious but I have searched the manual, forums, code examples and Google but cannot find an easy way to send large strings of HEX values without sending one at a time via serXputc.

For example, this is the command string I need to send to a device (in HEX):
02 89 89 1B 82 1B 83 FF 00 FE 03

I can use the following:
… and so on…

Any other suggestions other than forming a function with a loop?


I am having the exact same issue with trying to talk to an x10 modem, except my serial port is D on RCM4300.

Also, my actual problem is getting responses back from that peripheral. Any… responses. Which btw, I know it works using other products.

Edit: Actually, mine is a RX problem, yours is a TX problem.

Here’s some code to help if you haven’t found the answer:

const static char s[] = { 0x01, 0x09, 0x00, 0x00, … 0x0d, 0xf2 };
serBwrite (s, sizeof(s));

At least this works for me. I’m using Docklight to verify the results. I’m starting my own thread for my similar-but-not-the-same problem.