You can use something like scapy for this. If you want to spin upsend a TCP connection and sendpacket with data of 0xb03e01, for example:
Since you're dealing with a TCP-to-Serial connection, sending individual packets likePutting that in the context of a well- oneformed TCP connection, one packet, and closed - is probably fine. The Serial bridge probably might care less how many TCP connections are useda little more work.
If If you do need to run multiple packets across a single connection, you'll need to dig a little deeper into scapy (for example, reusing sockets), but that's the tool that will quickly and easily do what you want to do. You could also put a Perl/Python wrapper around nmap, for example, although that gives you a little less per-packet control.
Since you're dealing with a TCP-to-Serial connection, sending individual packets like that - one TCP connection, one packet, and closed - is probably fine. The Serial bridge probably might care less how many TCP connections are used.