views:

29

answers:

1

I have set of api's to be called over a transport (say for eg RS232 and some other transports). Essentially the calling side runs on a host and sends something like this:

(func_name, param_1, param_2, param_3)

over the RS232 link and a bit of code at the other end does the actual function calling.

To transfer the function name and params serialized over the transport, what are the points I should keep in mind ? Assuming security is not an issue and I am not expecting any attacks over the RS232 or any other transport interface, can I simply create a string of the form:

"(func_name, param_1, param_2, param_3)" and send it over the RS232 ?

A: 

I would use an existing format such as JSON and use it to serialize the data.

Ignacio Vazquez-Abrams
I have C implementations at both sends. Although at some point I need to be ready to have simpler scripting laguages calling the api
The website I linked to lists several C libraries that handle JSON.
Ignacio Vazquez-Abrams