Closed bmegli closed 8 years ago
In proof-of-concept UDP implementation it works as:
enum Commands {ENABLE=0, DISABLE=1, DISABLE_ALL=3, ENABLED=4, DISABLED=5, FAILED=6 };
struct control_packet
{
uint64_t timestamp_us;
int16_t command;
int16_t creation_delay_ms;
char unique_name[MODULE_NAME_WITH0_MAX];
char call[MODULE_CALL_WITH0_MAX];
};
With:
ENABLE=0, DISABLE=1, DISABLE_ALL=3
component -> module communicationENABLED=4, DISABLED=5, FAILED=6
module -> component communicationThe TCP/IP protocol proposal (v1) for control module/component:
enum Commands {KEEPALIVE=0, ENABLE=1, DISABLE=2, DISABLE_ALL=3, ENABLED=-1, DISABLED=-2, FAILED=-3 };
12 bytes with:
enum Attributes {UNIQUE_NAME=0, CALL=1, CREATION_DELAY_MS=2, RETURN_VALUE=3}
// with types string, string, u16, i32
KEEPALIVE
empty payload
ENABLE
DISABLE
DISABLE_ALL
empty payload
ENABLED
DISABLED
FAILED
The module side was implented in tcp-control branch, not tested yet
The component side was implented in tcp-control ant tested to work with module side
This only needs some final polishing now.
Merged
This currently works on UDP. This protocol is not suitable for that. There are no guarantees that all the packets arrive. Protocol messages should have variable length. The connection should be monitored. Transition to TCP/IP is necessary.