From 26d1617608ea0272ebb1373e6f489bc771091b21 Mon Sep 17 00:00:00 2001 From: Roman Bazalevskiy Date: Tue, 7 Aug 2018 13:23:08 +0300 Subject: [PATCH 1/1] =?utf8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D1=8C=D0=BD?= =?utf8?q?=D0=B0=D1=8F=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?utf8?q?=D0=B0=20=D0=BF=D1=80=D0=BE=D1=87=D0=B8=D1=85=20=D1=82=D0=B8?= =?utf8?q?=D0=BF=D0=BE=D0=B2=20=D0=BC=D0=B0=D1=8F=D0=BA=D0=BE=D0=B2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- mqtt-bt/scan-beacons | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mqtt-bt/scan-beacons b/mqtt-bt/scan-beacons index 4f2a01c..a574f66 100644 --- a/mqtt-bt/scan-beacons +++ b/mqtt-bt/scan-beacons @@ -119,10 +119,14 @@ function process_packet(packet) if type=='iBeacon' then details=uuid elseif name then - type="name" + if not(type) then + type="name" + end details=name else - type='unknown' + if not type then + type='unknown' + end details=mac end @@ -185,15 +189,21 @@ function read_loop() value=split(value)[1] end packet[name]=value + elseif #t==1 and name then + if not(packet[name..'.list']) then + packet[name..'.list']={} + end + table.insert(packet[name..'.list'],(trim(t[1]))) end end if starts(str,'> HCI Event: LE Meta Event (0x3e)') then inbound=true + name=nil elseif starts(str,'RSSI:') then inbound=false process_packet(packet) - packet={} + packet={} end end -- 2.34.1