mirror of
https://github.com/markqvist/Sideband.git
synced 2025-11-30 04:06:39 -05:00
Use local version of able
This commit is contained in:
parent
2e44d49d6b
commit
9b6a51a03e
67 changed files with 5305 additions and 0 deletions
28
libs/able/examples/service_advertise/service.py
Normal file
28
libs/able/examples/service_advertise/service.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"""Service to advertise data, while not stopped."""
|
||||
import time
|
||||
from os import environ
|
||||
|
||||
from able import BluetoothDispatcher
|
||||
from able.advertising import (
|
||||
Advertiser,
|
||||
AdvertiseData,
|
||||
ServiceUUID,
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
uuid = environ.get(
|
||||
"PYTHON_SERVICE_ARGUMENT",
|
||||
"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
|
||||
)
|
||||
advertiser = Advertiser(
|
||||
ble=BluetoothDispatcher(),
|
||||
data=AdvertiseData(ServiceUUID(uuid)),
|
||||
)
|
||||
advertiser.start()
|
||||
while True:
|
||||
time.sleep(0xDEAD)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue