Daemon communication protocol
The daemon uses a shared memory segment with the ID 0x56444D58 for the communication with the clients. That shared memory will hold an array of signed int whose size may change in the future.
Memory structure
Offset | variable | use |
0 | dmx_maxchannels | Number of channels to send (6..512) |
1 | dmx_shutdown | Set to -1 to ask to the daemon to shutdown |
2 | dmx_caps | Flags telling which extra-capabilities are present |
3 | Reserved for future use | |
4 | Reserved for future use | |
5 | Reserved for future use | |
6 | Reserved for future use | |
7 | Reserved for future use | |
8 | Reserved for future use | |
9 | Reserved for future use | |
10..521 | dmx_channels[] | Current values of the DMX channels. If you need to read these values, you need to AND them with 0xFF as the higher bits may be used by some extensions. |
future extensions
The 7 reserved fields will be used for extensions. Additionnals fields may also be added after the channels table. These extensions will be made so older client which don't use these feature will work out of the box with a freshly started daemon.
An "auto-change" feature is planned for the channels (increase/decrease to a given value, ...). These will be enabled by high bits in the channel value. By storing values between 0 and 255, these features will be turned off as an easy way to keep compatibility with older clients. If you need to read a channel value, don't forget to mask it to only keep lower bits.
The behaviour of the shutdown flag may be changed. It'll anyway be done in such a way that setting it to 0 will allow normal behaviour. Right now, any non-zero value will make the daemon shutdown but this can be changed in the future.