• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1EXAMPLES
2========
3
4The project includes a few simple example applications the illustrate some of the ways the library APIs can be used.
5These examples include:
6
7## `battery_service.py`
8Run a simple device example with a GATT server that exposes a standard Battery Service.
9
10## `get_peer_device_info.py`
11An app that connects to a device, discovers its GATT services, and, if the Device Information Service is found, looks for a Manufacturer Name characteristics, reads and prints it.
12
13## `keyboard.py`
14An app that implements a virtual keyboard or mouse, or can connect to a real keyboard and receive key presses.
15
16## `run_a2dp_info.py`
17An app that connects to a device, phone or computer and inspects its A2DP (Advanced Audio Profile) capabilities
18
19## `run_a2dp_source.py`
20An app that can connect to a Bluetooth speaker and play audio.
21
22## `run_a2dp_sink.py`
23An app that implements a virtual Bluetooth speaker that can receive audio.
24
25## `run_advertiser.py`
26An app that runs a simple device that just advertises (BLE).
27
28## `run_classic_connect.py`
29An app that connects to a Bluetooth Classic device and prints its services.
30
31## `run_classic_discoverable.py`
32An app that implements a discoverable and connectable Bluetooth Classic device.
33
34## `run_classic_discovery.py`
35An app that discovers Bluetooth Classic devices and prints their information.
36
37## `run_connect_and_encrypt.py`
38An app that connected to a device (BLE) and encrypts the connection.
39
40## `run_controller_with_scanner.py`
41
42## `run_controller.py`
43Creates two linked controllers, attaches one to a transport, and the other to a local host with a GATT server application. This can be used, for example, to attach a virtual controller to a native stack, like BlueZ on Linux, and use the native tools, like `bluetoothctl`, to scan and connect to the GATT server included in the example.
44
45## `run_gatt_client_and_server.py`
46Runs a local GATT server and GATT client, connected to each other. The GATT client discovers and logs all the services and characteristics exposed by the GATT server
47
48## `run_gatt_client.py`
49A simple GATT client that either connects to another BLE device or waits for a connection, then dumps its GATT database.
50
51## `run_gatt_server.py`
52A simple GATT server that either connects to another BLE device or waits for connections.
53
54## `run_hfp_gateway.py`
55A app that implements a Hands Free gateway. It can connect to a Hands Free headset.
56
57## `run_hfp_handsfree.py`
58A app that implements a Hands Free headset. It can simulate some of the events that a real headset would
59emit, like picking up or hanging up a call, pressing a button, etc.
60
61## `run_notifier.py`
62An app that implements a GATT server with characteristics that can be subscribed to, and emits notifications
63for those characteristics at regular intervals.
64
65## `run_rfcomm_client.py`
66An app that connects to an RFComm server and bridges the RFComm channel to a local TCP socket
67
68## `run_rfcomm_server.py`
69An app that implements an RFComm server and, when a connection is received, bridges the channel to a local TCP socket
70
71## `run_scanner.py`
72An app that scan for BLE devices and print the advertisements received.
73