nrf5/examples: Updating ubluepy scan example to use constant value from ubluepy instead of hardcoded value.
This commit is contained in:
parent
9568e07159
commit
460f6dee50
@ -1,4 +1,4 @@
|
|||||||
from ubluepy import Scanner
|
from ubluepy import Scanner, constants
|
||||||
|
|
||||||
def bytes_to_str(bytes):
|
def bytes_to_str(bytes):
|
||||||
string = ""
|
string = ""
|
||||||
@ -12,7 +12,7 @@ def get_device_names(scan_entries):
|
|||||||
scan = e.getScanData()
|
scan = e.getScanData()
|
||||||
if scan:
|
if scan:
|
||||||
for s in 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])))
|
dev_names.append((e, bytes_to_str(s[2])))
|
||||||
return dev_names
|
return dev_names
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user