SXnet Protocol

Instead of using the SRCP protocol (which is pretty DCC centric and not in all parts "straightforward") I use the "SXnet Protocol" (name still to be defined....) on port 4104.

It is socket based (ASCII messages) and is very simple. It only uses the "channels" 0..127.

Feel free to implement software based on this protocol. :-))

/**
* SX Net Protocol (all msg terminated with CR)
* 
* client sends                           |  SXnetServer Response  
* ---------------------------------------|-------------------
* R cc    = Read channel cc (0..127)     |  "X" cc dd
* B cc b  = SetBit Ch. cc Bit b (1..8)   |  "OK" (and later, when changed in CS: X cc dd )
* C cc b  = Clear Ch cc Bit b (1..8)     |  "OK" (and later, when changed in CS: X cc dd )
* S cc dd = set channel cc Data dd (<256)|  "OK" (and later, when changed in CS: X cc dd )
* DSDF 89sf  (i.e. garbage)              |  "ERROR" 
* 
* channel 127 bit 8 == Track Power
* 
* changes in all channels which the client has set or read at least once
* are always transmitted back to the client
*
*/

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer