Created
January 1, 2024 18:23
-
-
Save jacksonkeating/0db1af4c0148031d4df7d63ec865a68d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var result: {status: string, data: Uint8Array } = {} | |
var commandStartHil = 1 | |
await wavecake.ble.setReconnect('','0000180f-0000-1000-8000-00805f9b34fb'); | |
while(true) { | |
result = await wavecake.mqtt.expect('wavecake') | |
if (result.data[0] === commandStartHil) { | |
await wavecake.ble.connect('', '0000180f-0000-1000-8000-00805f9b34fb'); | |
await wavecake.ble.notifyEnable('', '0000180f-0000-1000-8000-00805f9b34fb', '00002a19-0000-1000-8000-00805f9b34fb'); | |
result = await wavecake.ble.notifyExpect('', '0000180f-0000-1000-8000-00805f9b34fb', '00002a19-0000-1000-8000-00805f9b34fb'); | |
await wavecake.ble.disconnect(); | |
await wavecake.mqtt.publish('wavecake',result.status); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment