Skip to content

Instantly share code, notes, and snippets.

@jacksonkeating
Created January 1, 2024 18:23
Show Gist options
  • Save jacksonkeating/0db1af4c0148031d4df7d63ec865a68d to your computer and use it in GitHub Desktop.
Save jacksonkeating/0db1af4c0148031d4df7d63ec865a68d to your computer and use it in GitHub Desktop.
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