Application Architecture

Our application is what Bluetooth calls a "peripheral". The peripheral advertises is presence for a "central" device that want's to connect to it. The central could be a cell phone, or web browser - it's usually where the human interaction happens. If you're familiar with the Tesla "phone key" this is a great example. The car is the peripheral, and the phone(key) acts as the central listening for the car's advertisement. When the phone(key) sees the car's advertisement, it connects and tells the car that it's OK to unlock.
Components of the Application
Component | Responsibility |
---|---|
BTLE_Manager.py | The manager is the entry point for our application. It's going to manage the connections to D-Bus and BlueZ while setting up and advertising our peripheral service. |
Advertisement.py | This class is going to tell BlueZ how to advertise our service. If we setup our advertisement correctly, the central will know what kind of device our peripheral is. We're going to advertise as a thermometer . |
Application.py | A simple wrapper for our service and characteristic |
Service.py | Another wrapper. A "service" is just a collection of related characteristics. |
Characteristic.py | This is where the work happens. The characteristic is going to keep track of the temperature, and notify connected centrals' when the temperature changes. |
Now we're ready to write the application!