V-BLACK BLE Simulator
A real BLE GATT server in Go that simulates a V-BLACK device using tinygo.org/x/bluetooth.
Platform Support
- Linux: Requires BlueZ 5.48+. May need
sudofor BLE access. - Windows: Works out of the box with WinRT.
- macOS: NOT SUPPORTED - CoreBluetooth doesn't allow peripheral mode.
Building
go build ./cmd/simulator
Running
# Linux (may require root)
sudo ./simulator
# Windows
simulator.exe
BLE UUIDs
Uses Nordic UART Service (NUS) UUIDs - same as real V-BLACK sensors:
| Characteristic | UUID | Properties |
|---|---|---|
| Service | 6e400001-b5a3-f393-e0a9-e50e24dcca9e |
- |
| Command (RX) | 6e400002-b5a3-f393-e0a9-e50e24dcca9e |
Write |
| Notify (TX) | 6e400003-b5a3-f393-e0a9-e50e24dcca9e |
Read, Notify |
Flutter Example
const serviceUuid = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
const commandCharUuid = "6e400002-b5a3-f393-e0a9-e50e24dcca9e";
const notifyCharUuid = "6e400003-b5a3-f393-e0a9-e50e24dcca9e";
Commands
Global Commands
| Command | Response | Description |
|---|---|---|
PROG_ON |
PROG_MODE: ON |
Enable programming mode |
PROG_OFF |
PROG_MODE: OFF |
Exit programming mode |
RESET |
INFO: Uscita allarme resettata (BT). |
Reset alarm output |
CALI |
--- MODALITA CALIBRAZIONE ATTIVA --- |
Toggle calibration mode |
FACTORY |
FACTORY RESET DONE |
Restore factory defaults |
Write Parameters (requires PROG_ON first)
| Command | Range | Default | Description |
|---|---|---|---|
W1 <val> |
0-2000 | 1200 | Min threshold |
W2 <val> |
0-4095 | 4000 | Max threshold |
W3 <val> |
1-50 | 2 | Pulse count |
W4 <val> |
10-1000 | 40 | Time window (ms) |
W20 <val> |
0-255 | 128 | Gain (wiper) |
Read Parameters (requires PROG_ON first)
| Command | Response |
|---|---|
R1 |
PARAM: W1=<val> |
R2 |
PARAM: W2=<val> |
R20 |
PARAM: W20=<val> |
Notifications
The simulator sends sensor readings every 500ms:
SENSOR:2067
SENSOR:2063
SENSOR:2071
Testing with nRF Connect
- Run the simulator
- Open nRF Connect app on your phone
- Scan for "GO_SIMULATOR"
- Connect to the device
- Find service
6e400001-...(Nordic UART Service) - Subscribe to notify characteristic
6e400003-...(NUS TX) - You should see
SENSOR:xxxxevery 500ms - Write
PROG_ONto command characteristic6e400002-...(NUS RX) - You should receive
PROG_MODE: ONon notify
Console Output
[INFO] BLE Simulator v1.0
[INFO] Advertising as GO_SIMULATOR...
[INFO] Waiting for connections...
[CONN] Client Connected: AA:BB:CC:DD:EE:FF
[RX] Command: PROG_ON
[TX] Response: PROG_MODE: ON
[TX] Sending: SENSOR:2063
[TX] Sending: SENSOR:2071
[RX] Command: R1
[TX] Response: PARAM: W1=1200
[CONN] Client Disconnected
Description
Languages
Go
100%