-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.toml
More file actions
77 lines (63 loc) · 3.16 KB
/
Copy pathconfig.example.toml
File metadata and controls
77 lines (63 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copy to config.toml and edit. Every value below is a default unless noted,
# so you only need to keep the lines you actually change.
#
# uart-ble-ws -c config.toml
#
# Command-line flags override anything set here.
log_level = "INFO" # CRITICAL | ERROR | WARNING | INFO | DEBUG
[ble]
# --- which device -----------------------------------------------------------
# Set exactly one of `address` or `name`. With neither, the bridge starts idle
# and waits for a WebSocket client to send a connect command.
#
# Find your device with: uart-ble-ws --scan
#
# address = "AA:BB:CC:DD:EE:FF" # Windows/Linux: MAC. macOS: a system UUID.
# name = "MyDevice"
name_match = "exact" # exact | prefix | contains (applies to `name`)
# Connect on startup. Defaults to true when address or name is set.
# auto_connect = true
# --- which characteristics --------------------------------------------------
# Defaults are the Nordic UART Service. The RX/TX names are written from the
# PERIPHERAL's point of view, matching Nordic's documentation:
# rx_char_uuid -> the peripheral receives on it, so the bridge WRITES to it.
# tx_char_uuid -> the peripheral transmits on it, so the bridge SUBSCRIBES.
# If your data flows the wrong way, swap these two.
# 16-bit shorthand such as "180d" is accepted and expanded.
service_uuid = "6e400001-b5a3-f393-e0a9-e50e24dcca9e"
rx_char_uuid = "6e400002-b5a3-f393-e0a9-e50e24dcca9e"
tx_char_uuid = "6e400003-b5a3-f393-e0a9-e50e24dcca9e"
# --- timing and reliability -------------------------------------------------
scan_timeout = 10.0 # seconds to look for the device before giving up
connect_timeout = 20.0
reconnect = true # keep retrying after the device drops
reconnect_initial_delay = 1.0
reconnect_max_delay = 30.0 # exponential backoff ceiling
# --- writes -----------------------------------------------------------------
# NUS RX is normally write-without-response, which is much faster. Set true only
# if your peripheral does not declare the write-without-response property.
write_with_response = false
# Payload split size. Leave unset to derive it from the negotiated MTU, which is
# what you want in almost all cases.
# write_chunk_size = 20
[ws]
host = "127.0.0.1" # localhost only by default
port = 8765
# Shared secret. Clients send it as `Authorization: Bearer <token>`, or as a
# `?token=` query parameter if their WebSocket library cannot set headers.
# REQUIRED to bind a non-loopback host (see allow_insecure below).
# token = "change-me"
# Permit a non-loopback bind with no token. Off by default: without it, anything
# that can reach the port can drive your BLE device.
allow_insecure = false
max_clients = 8
max_message_size = 1048576 # largest inbound WebSocket message, bytes
# Per-client outbound buffer, in messages. Raise it if a client is bursty.
send_queue_size = 256
# What to do when a client cannot keep up with device output:
# "close" - disconnect it, so lost data is loud rather than silent
# "drop" - shed the oldest buffered messages and keep going
slow_client_policy = "close"
# Keepalive. Set both to 0 to disable (useful when debugging with breakpoints).
ping_interval = 20.0
ping_timeout = 20.0