-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotocol.go
More file actions
25 lines (20 loc) · 802 Bytes
/
protocol.go
File metadata and controls
25 lines (20 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main
// DeviceState represents the current state of a Bluetooth device.
type DeviceState string
const (
StateConnected DeviceState = "connected"
StateConnecting DeviceState = "connecting"
StateBlocked DeviceState = "blocked"
StateDisabled DeviceState = "disabled"
)
// IPCRequest is sent from the CLI client to the daemon.
type IPCRequest struct {
Command string `json:"command"` // "status" | "toggle"
Device string `json:"device,omitempty"` // MAC address, optional
}
// IPCResponse is sent from the daemon back to the CLI client.
type IPCResponse struct {
State string `json:"state,omitempty"` // "connected", "connecting", "blocked", "disabled"
Device string `json:"device,omitempty"` // MAC address of active device
Error string `json:"error,omitempty"`
}