initial commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package protocol
|
||||
|
||||
// Protocol message type names for clipsync v1.
|
||||
Message_Type :: enum {
|
||||
HELLO,
|
||||
PAIR_REQUEST,
|
||||
PAIR_CHALLENGE,
|
||||
PAIR_CONFIRM,
|
||||
PAIR_ACCEPT,
|
||||
CLIP_UPDATE,
|
||||
ACK,
|
||||
ERROR,
|
||||
PING,
|
||||
PONG,
|
||||
}
|
||||
|
||||
HELLO_Message :: struct {
|
||||
version: string,
|
||||
message_type: string,
|
||||
device_id: string,
|
||||
device_name: string,
|
||||
platform: string,
|
||||
tcp_port: int,
|
||||
timestamp_ms: i64,
|
||||
nonce: string,
|
||||
}
|
||||
|
||||
make_hello_message :: proc(device_id, device_name, platform, nonce: string, tcp_port: int) -> HELLO_Message {
|
||||
return HELLO_Message{
|
||||
version = "1",
|
||||
message_type = "HELLO",
|
||||
device_id = device_id,
|
||||
device_name = device_name,
|
||||
platform = platform,
|
||||
tcp_port = tcp_port,
|
||||
timestamp_ms = 0,
|
||||
nonce = nonce,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user