nrf5/examples: Updating ubluepy scan example to use constant value from ubluepy instead of hardcoded value.

This commit is contained in:
Glenn Ruben Bakke 2017-04-01 22:50:37 +02:00
parent 9568e07159
commit 460f6dee50

View File

@ -1,4 +1,4 @@
from ubluepy import Scanner
from ubluepy import Scanner, constants
def bytes_to_str(bytes):
string = ""
@ -12,7 +12,7 @@ def get_device_names(scan_entries):
scan = e.getScanData()
if scan:
for s in scan:
if s[0] == 9:
if s[0] == constants.ad_types.AD_TYPE_COMPLETE_LOCAL_NAME:
dev_names.append((e, bytes_to_str(s[2])))
return dev_names