mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
daemon/binding/python: show warning if not running on Python 3
This commit is contained in:
parent
a2a10e8d66
commit
5f5762db78
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from btstack import btstack_server, btstack_client, event_factory
|
||||
import sys
|
||||
|
||||
def packet_handler(packet):
|
||||
global btstack_client
|
||||
@ -12,6 +13,11 @@ def packet_handler(packet):
|
||||
if isinstance(packet, event_factory.GAPEventAdvertisingReport):
|
||||
print(packet)
|
||||
|
||||
# check version
|
||||
if sys.version_info < (3, 0):
|
||||
print('BTstack Server Client library, requires Python 3.x or higher.\n')
|
||||
sys.exit(10)
|
||||
|
||||
# Conrtrol for BTstack Server
|
||||
btstack_server = btstack_server.BTstackServer()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user