Does that pick up the Leonardo as a feasible port?
Below something that I would consider
If you want to query from the PC, you can send something like
<id,q,param>
- id; the device that is connected to the leonardo that you want to communicate with
- q; command to query the device identified by id
- param; the field that you want to query from the device, can be a numeric value or a text like temperature. humidity
At the Arduino side, you can parse the command; for guidance, you can look at Robin's Serial Input Basics - updated (example 3).
The reply from the Leonardo can be
<id,r,c,value>
- id; the device that is connected to the leonardo that the reply came from
- r; rply from the device identified by id
- c; reply code; 0 = OK, other value = error
- value; value of the requested field; not transmitted or empty on error
If the devices send data on their own to the Leonardo, you can e.g. use a capital 'R' instead of 'r'.
To set a parameter, you can use something like
<id,s,param=value>
- id; the device that is connected to the leonardo that you want to communicate with
- q; command to query the device identified by id
- param; parameter that you want to set on the device, can be a numeric value or a text like temperature. humidity
- value; the value to set the parameter to
The reply could be something like
<id,r,c>
- id; the device that is connected to the leonardo that the reply came from
- r; rply from the device identified by id
- c; reply code; 0 = OK, other value = error
Note on id:
You can use id 0 for communication with the Leonardo itself if needed, your devices would be 1, 2