Skip to content

Commit 0534d2d

Browse files
committed
httmsg lora, always subscribe, more buttons
1 parent df0f74e commit 0534d2d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/services/httpmsg/msgs.toit

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ sample-messages := {
4141
"Duration 0": (messages.AlarmControl.doMsg --duration=0).bytesForProtocol,
4242
"3s pattern 4 intensity 1": (messages.AlarmControl.doMsg --duration=3 --buzzerPattern=4 --buzzerIntensity=1).bytesForProtocol,
4343
},
44-
"$(messages.Lora.MT) LORA": {
45-
"Transmit lblb, receive 10s": (messages.Lora.doMsg --payload="lblb".to-byte-array --receiveMs=10000).bytesForProtocol,
46-
"Subscribe": (messages.Lora.subscribeMsg).bytesForProtocol,
47-
"Unsubscribe": (messages.Lora.unsubscribeMsg).bytesForProtocol,
44+
"$(messages.Lora.MT) LORA, Transmit & Receive for 10s": {
45+
"Lightbug": (messages.Lora.doMsg --payload="Lightbug".to-byte-array --receiveMs=10000).bytesForProtocol,
46+
"MWC": (messages.Lora.doMsg --payload="MWC".to-byte-array --receiveMs=10000).bytesForProtocol,
47+
"2025": (messages.Lora.doMsg --payload="2025".to-byte-array --receiveMs=10000).bytesForProtocol,
48+
// "Subscribe": (messages.Lora.subscribeMsg).bytesForProtocol, // Don't have a subscribe button, just ask for subscription on startup
49+
// "Unsubscribe": (messages.Lora.unsubscribeMsg).bytesForProtocol,
4850
},
4951
// "GSM": {
5052
// "SET Normal mode": #[0x03, 0x17, 0x00, 0x31, 0x00, 0x01, 0x00, 0x05, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x75, 0x30],

src/services/httpmsg/service.toit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class HttpMsg:
3333
device-comms_ = device-comms
3434
custom-actions_ = custom-actions
3535
response-message-formatter_ = response-message-formatter
36+
37+
// This service always wants us to be subscribing to LORA data (if possible)
38+
device-comms.send messages.Lora.subscribeMsg
39+
3640
if serve:
3741
service-http-catchAndRestart
3842

0 commit comments

Comments
 (0)