You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Logi Actions SDK plugin that exposes MX Master 4 haptic feedback via a local HTTPS server and WebSocket API.
4
12
5
13
## Requirements
6
14
@@ -10,64 +18,187 @@ A Logi Actions SDK plugin that exposes MX Master 4 haptic feedback via a local H
10
18
11
19
## API Server
12
20
13
-
The plugin runs an HTTP server on `http://127.0.0.1:8765/` when loaded.
21
+
The plugin runs an HTTPS server on `https://local.jmw.nz:41443/` when loaded.
22
+
23
+
### About local.jmw.nz
24
+
25
+
`local.jmw.nz` resolves to `127.0.0.1`. The plugin uses this domain to serve HTTPS with a valid SSL certificate instead of self-signed certs that browsers reject. The certificate is automatically downloaded from GitHub, cached locally, and refreshed every 24 hours.
14
26
15
-
### Endpoints
27
+
### REST API Endpoints
16
28
17
29
| Endpoint | Method | Description |
18
30
|----------|--------|-------------|
19
31
|`/`| GET | Health check with service info and available endpoints |
20
-
|`/waveforms`| GET | List all 16 available haptic **waveforms** with descriptions|
32
+
|`/waveforms`| GET | List all 15 available haptic waveforms |
21
33
|`/haptic/{waveform}`| POST | Trigger a specific haptic waveform |
22
34
35
+
### WebSocket API
36
+
37
+
**Endpoint:**`wss://local.jmw.nz:41443/ws`
38
+
39
+
Keeps a warm connection for theoritically lower latency.
40
+
41
+
**Protocol:**
42
+
- Send a single byte containing the waveform index (0-14)
43
+
- No response is sent back
44
+
- Connection stays open for repeated triggers
45
+
23
46
### Available Waveforms
24
47
25
-
| Waveform | Category |
26
-
|----------|----------|
27
-
|`sharp_collision`| Precision enhancers |
28
-
|`sharp_state_change`| Progress indicators |
29
-
|`knock`| Incoming events |
30
-
|`damp_collision`| Precision enhancers |
31
-
|`mad`| Progress indicators |
32
-
|`ringing`| Incoming events |
33
-
|`subtle_collision`| Precision enhancers |
34
-
|`completed`| Progress indicators |
35
-
|`jingle`| Incoming events |
36
-
|`damp_state_change`| Precision enhancers |
37
-
|`firework`| Progress indicators |
38
-
|`happy_alert`| Progress indicators |
39
-
|`wave`| Progress indicators |
40
-
|`angry_alert`| Progress indicators |
41
-
|`square`| Progress indicators |
48
+
The plugin supports 15 haptic waveforms across different categories:
49
+
50
+
| Waveform | Index | Category |
51
+
|----------|-------|----------|
52
+
|`sharp_collision`| 0 | Precision enhancers |
53
+
|`sharp_state_change`| 1 | Progress indicators |
54
+
|`knock`| 2 | Incoming events |
55
+
|`damp_collision`| 3 | Precision enhancers |
56
+
|`mad`| 4 | Progress indicators |
57
+
|`ringing`| 5 | Incoming events |
58
+
|`subtle_collision`| 6 | Precision enhancers |
59
+
|`completed`| 7 | Progress indicators |
60
+
|`jingle`| 8 | Incoming events |
61
+
|`damp_state_change`| 9 | Precision enhancers |
62
+
|`firework`| 10 | Progress indicators |
63
+
|`happy_alert`| 11 | Progress indicators |
64
+
|`wave`| 12 | Progress indicators |
65
+
|`angry_alert`| 13 | Progress indicators |
66
+
|`square`| 14 | Progress indicators |
42
67
43
68
## Example Usage
44
69
70
+
### HTTP REST API
71
+
45
72
```bash
46
73
# Health check
47
-
curl http://127.0.0.1:8765/
74
+
curl https://local.jmw.nz:41443/
48
75
49
76
# List all available waveforms
50
-
curl http://127.0.0.1:8765/waveforms
77
+
curl https://local.jmw.nz:41443/waveforms
78
+
79
+
# Trigger haptic feedback (note: -d '' is required to send Content-Length header)
80
+
curl -X POST -d '' https://local.jmw.nz:41443/haptic/sharp_collision
81
+
curl -X POST -d '' https://local.jmw.nz:41443/haptic/happy_alert
82
+
curl -X POST -d '' https://local.jmw.nz:41443/haptic/completed
83
+
# {
84
+
# "success": true,
85
+
# "waveform": "completed"
86
+
# }
87
+
88
+
```
51
89
52
-
# Trigger haptic feedback
53
-
curl -X POST http://127.0.0.1:8765/haptic/sharp_collision
54
-
curl -X POST http://127.0.0.1:8765/haptic/happy_alert
55
-
curl -X POST http://127.0.0.1:8765/haptic/completed
90
+
> **Note:** POST requests require a `Content-Length` header. When using curl, include `-d ''` to send an empty body with the proper header otherwise the request will hang. I have some *thoughts* about this design choice by the otherwise great NetCoreServer library.
0 commit comments