|
|
@@ -297,6 +297,8 @@ def notification_handler(characteristic: BleakGATTCharacteristic, data: bytearra
|
|
|
async def ble_send(client, data):
|
|
|
global recv_start_time
|
|
|
global g_ble_mtu
|
|
|
+
|
|
|
+ logger.info('发送:{}'.format(bytes(data).hex()))
|
|
|
frame_len = g_ble_mtu #244 #20 #244
|
|
|
if g_config["def_cfg"]["ble_mtu"] > 0:
|
|
|
frame_len = g_config["def_cfg"]["ble_mtu"]
|
|
|
@@ -377,7 +379,6 @@ async def send_form_data_list(client, i, data=None):
|
|
|
byte_array = bytearray(byte_sequence)
|
|
|
byte_array = ev_packing(byte_array)
|
|
|
send_data = bytes(byte_array)
|
|
|
- logger.info('发送{}:{}'.format(json_data[2], send_data.hex()))
|
|
|
await ble_send(client, send_data)
|
|
|
|
|
|
async def task():
|
|
|
@@ -516,9 +517,9 @@ async def main():
|
|
|
|
|
|
try:
|
|
|
# 开始根据设备即功能处理消息
|
|
|
- ws_data = mq.get(device)
|
|
|
+ ws_data = mq.get("ws_recv")
|
|
|
if ws_data:
|
|
|
- ble_send(client, ws_data)
|
|
|
+ await ble_send(client, ws_data)
|
|
|
except Exception as err:
|
|
|
pass
|
|
|
|