Introduced advertisement on channel 1 and clock-channel to be configurable.

This commit is contained in:
2018-12-01 09:02:19 +01:00
parent 97be2b6791
commit 06b36ed3d0
5 changed files with 211 additions and 71 deletions

View File

@@ -18,7 +18,7 @@ The tasks of the master clock / controller is:
* addresses are a number in the range of 0..255
* address 0 is reserved for master/controller
* address 255 is reserved for a broadcast to all devices
* if acknowledges are necessary/wanted, then separate messages needs to be applied
* if acknowledges are necessary/wanted, then separate messages need to be defined
* after receiving a message that needs an acknowledge, no device is allowed to send a message for a TBD. period of time except the requested device, which may send an acknowledge
* after sending a message, the same device must wait a TBD. period of time before sending another message
@@ -33,19 +33,25 @@ P,p,A,U,a,C,T,H,E | 0..255 | 0..255 | msg type dependent
## Message definitions
Nachricht | msgType | Attribute | Status
--------- | ------- | --------- | ------
PairingOffering | P | FastclockName (8), ClockChannel | Implemented
PairingRequest | p | ClientName(10) | Implemented
PairingAck | A | FastclockName (8), ClientName (10), Network-Address | Implemented
UnpairRequest | U | tbd. | ---
UnpairAck | a | tbd. | ---
FastClock | C | FastclockName (8), Hour, Minute, Second, ClockSpeed, Weekday | Implemented
TextMessage | T | FastclockName (8), Message | Implemented
Hello | H | tbd. | ---
HelloEcho | E | RSSI, canRouteToMaster, FastclockName(8) | ---
Nachricht | msgType | Attribute | Status | Description
--------- | ------- | --------- | ------ | -----------
ClockAdvertisement | c | FastclockName (8)<br>ClockChannel | done | Using ADVERTISEMENT_CHANNEL (channel 1) to<br>announce the clock's existence.
PairingOffering | P | FastclockName (8)<br>ClockChannel | done | Announce clock master and<br>allow immediate reply by clients<br>(master waits with further messages<br>for at least 20ms).
PairingRequest | p | ClientName(10) | done | Message from client as reply<br>to PairingOffering.
PairingAck | A | FastclockName (8)<br>ClientName (10)<br>Network-Address | done | Master acknowledges a PairingRequest.
UnpairRequest | U | tbd. | --- | Remove a client from master's client list,<br>initiated by client.
UnpairAck | a | tbd. | --- | Acknowledge an UnpairRequest,<br>sent by master.
FastClock | C | FastclockName (8)<br>Hour<br>Minute<br>Second<br>ClockSpeed<br>Weekday<br>stopped | done | Current fastclock time.
TextMessage | T | FastclockName (8)<br>Message | done | Additional text sent by master may be displayed<br>by client, if possible.
Hello | H | tbd. | --- | Test message sent by master<br>to receive signal quality data.
HelloEcho | E | RSSI<br>canRouteToMaster<br>FastclockName(8) | --- | Hello reply with signal quality data<br>and the ability to route (if a client cannot<br>receive a master but routing clients, this<br>is the chance to get access;<br>routing not clearly defined so far,<br>it's just an idea)
Quiet | Q | quietTime_ms (1) | --- | Master sends this message and asks for being<br>quiet for some time, as the master will switch<br>off (e.g. to the advertisement channel to send<br>an announcement).
The communication is done on two (!) channels. One channel is used as an advertisement channel, where all clocks shall send advertisement messages from time to time to inform interested clients, on which channel they can be found. No dialogues are allowed between clock masters and clients on the advertisement channel. The advertisement channel is currently defined as channel \#1.
Each clock master may use an own channel to avoid collisions, although it is possible, that multiple clock systems communicate on the same channel. The clock's channel is announced on the advertisement channel. The master switches back to the clock's channel immediately after sending the advertisement. The same advertised message is sent on the clock's channel as well from time to time as an invitation to register as a client at the master ("Pairing"). This is an optional step and only used to be able to show at the master's display, which clients are displaying the fastclock informations.
As all clock messages from the master are sent as broadcasts, each client can read/follow the clock.
## Links / References