Skip to content

Commit

Permalink
Fix derp
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous committed Aug 30, 2022
1 parent 10a3453 commit eca66f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mqtt_down.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def create_config_pkt(voice, volume,
for b in b1:
csum += b
b1 += bytes([csum & 0xff])
return pack_frame(0x27, b1)
return pack_frame(0x34, b1)

async def doOutput(message):
global lastKey
Expand All @@ -129,17 +129,17 @@ async def doOutput(message):
reply_cb_thing.clear()
await ble_client.start_notify(response_characteristic, reply_cb_thing.reply_cb)
await ble_client.write_gatt_char(command_characteristic, pack_frame(20, bytes([])), False)
await asyncio.wait_for(reply_cb_thing, timeout=5)
#await asyncio.wait_for(reply_cb_thing, timeout=5)
reply_cb_thing.clear()
voice = message["voice"] if "voice" in message else 0
volume = message["vol"] if "vol" in message else 0
vibration = message["vibration"] if "vibration" in message else 0
shock = message["shock"] if "shock" in message else 50
await ble_client.write_gatt_char(command_characteristic, create_config_pkt(voice, volume, vibration, shock), False)
await asyncio.wawait_forit(reply_cb_thing, timeout=5)
#await asyncio.wait_for(reply_cb_thing, timeout=5)
reply_cb_thing.clear()
await ble_client.write_gatt_char(command_characteristic, pack_frame(0x2A, bytes([])), False)
await asyncio.wait_for(reply_cb_thing, timeout=5)
#await asyncio.wait_for(reply_cb_thing, timeout=5)
reply_cb_thing.clear()
elif (message["mode"] == "shock"):
reply_cb_thing.clear()
Expand Down

0 comments on commit eca66f0

Please sign in to comment.