Skip to content

WCC protocol

Version: 0.5

This is an overview of the WCC (Wireless Command Control) protocol used to communicate between train, car, and element modules. Note: Using WCC on your layout does not require you to understand this protocol but if you plan to develop new hardware, firmware and software based on WCC - this document provides information about WCC messages format.

Basics

WCC is based on mesh networking which means that each module is connected to every other module on the layout. WCC modules work in the same way as DCC decoders - receive messages and control trains, cars, and layout elements but all messages are sent in a wireless way and WCC modules can communicate with each other. This document describes the structure of those messages.

Message Format

All messages are sent in the byte format which means that messages should be parsed byte by byte.

WCC message format:

[0...1] - Element ID, which should handle the message, 2 bytes
[2] - Number of current states of this element, 1 byte
[3....k-1] - Array with element's current states (array length is specified in byte [2])
             Each element in this array has 2 values
             - 1 byte, length of a state 1-255
             - n bytes specified in the previous byte, the value of the state
[k] - Number of actions that this element can handle, 1 byte
[k+1...] - Array with action handlers (array length is specified in byte [k])
           Each element in this array has 2 values
           - 2 bytes, Event ID
           - 1 byte, ID of a state to change
           - 1 byte, length of a state 1-255
           - n bytes specified in the previous byte, the value of the state

If you connect multiple elements to one module, a message for this module should include an array of messages described above.

Message example for a module with one connected element

0d 52 | 02 | 03 | 68 65 79 | 01 | 02 | 04 | 32 0d | 01 | 01 | 00 | ... other 3 handlers ...
2 bytes - Element ID, in this example - [0d 52]
1 byte - Number of values, in this example - 02
1 byte - Length of the value, in this example - 03 and 01
n bytes, specified in the previous byte - State value, in this example - [68 65 79] and 02
1 byte - Number of action handlers, in this example - 04
2 bytes - Event ID, in this example - 32 0d
1 byte - ID of a state to update, in this example 01
1 byte - Length of a new value, in this example 01
k bytes, specified in the previous byte - New value to set, in this example 00

Message example for a module with multiple connected elements

[0d 52 02 03 68 65 79 01 02][0e 52 03 01 00 01 01 01 00]

Feel free to contact us if you have any questions and suggestions