File: beacon.py

package info (click to toggle)
pygattlib 0~20201113-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 448 kB
  • sloc: ansic: 5,028; cpp: 1,685; python: 389; makefile: 46; sh: 1
file content (17 lines) | stat: -rwxr-xr-x 410 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/python
# -*- mode: python; coding: utf-8 -*-

# Copyright (C) 2014, Oscar Acena <oscaracena@gmail.com>
# This software is under the terms of Apache License v2 or later.

from gattlib import BeaconService
import time

service = BeaconService("hci0")

service.start_advertising("11111111-2222-3333-4444-555555555555",
            1, 1, 1, 200)
time.sleep(5)
service.stop_advertising()

print("Done.")