From 1b60260267631329a6794614ece52ba34bd644be Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 24 Oct 2024 13:42:16 -0600 Subject: [PATCH] Updated Geek Stuff (markdown) --- Geek-Stuff.md | 41 ++++------------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/Geek-Stuff.md b/Geek-Stuff.md index 052a5fd..ff8cd90 100644 --- a/Geek-Stuff.md +++ b/Geek-Stuff.md @@ -1,43 +1,10 @@ -# Message Format +# Protocol -Vail uses [WebSockets](https://en.wikipedia.org/wiki/WebSocket) at https://vail.woozle.org/chat?repeater=Foo. It accepts two subprotocols: both of these provide the same message information, in different encodings. +The Vail websockets protocol is described in [protocol.md](https://github.com/nealey/vail/blob/main/docs/protocol.md) -The server will accept packets in either format, but will only send packets in the format described by the subprotocol. +The [API demo](https://vail.woozle.org/testing/api-demo.html) will help if you are writing JavaScript. -## Subprotocol `binary.vail.woozle.org` - -Network byte order, "binary" version of a Message structure. To send messages in this format, be sure you specify a binary WebSocket message. - -```go -// Message is a single Vail message. -type Message struct { - // Timestamp of this message. Milliseconds since epoch. - Timestamp int64 - - // Number of connected clients. - Clients uint16 - - // Message timing in milliseconds. - // Timings alternate between tone and silence. - // For example, `A` could be sent as [80, 80, 240] - Duration []uint16 -} -``` - -## Subprotocol `json.vail.woozle.org` - -A JSON encoded version of the message structure. -Be sure to specify a text WebSocket message. - -Example: - -```json -{ - "Timestamp": 1654548878301, - "Clients": 3, - "Duration": [101, 100, 103, 98, 97, 106, 315] -} -``` +The [protocol demo](https://vail.woozle.org/testing/protocol-demo.html) will help if you are working with Arduino or another language. # How Vail Gets Realtime Morse Code across the Internet