Bluetooth PAL-layer module wrapper class.
More...
#include <bluetooth.h>
|
| BluetoothModule () |
| Launch and initialize the Bluetooth module. More...
|
|
| ~BluetoothModule () |
| Free resources used by the Bluetooth module.
|
|
void | msgGoingDown () |
| Will stop the module and (relatively gracefully) disconnect any open connections. More...
|
|
void | registerDatatype (uint16_t datatype) noexcept |
| A session-layer component has been registered as handler of a datatype. More...
|
|
void | unregisterDatatype (uint16_t datatype) noexcept |
| Session-layer components are no longer registered to handle this datatype. More...
|
|
void | sendApduPrimary (std::shared_ptr< PAL::VirtualPHD > device, std::shared_ptr< std::vector< uint8_t > > apdu) noexcept |
| Send a message to this device on the primary channel. More...
|
|
void | sendApduStreaming (std::shared_ptr< PAL::VirtualPHD > device, std::shared_ptr< std::vector< uint8_t > > apdu) noexcept |
| Send a message to this device on a streaming channel. More...
|
|
void | disconnect (std::shared_ptr< PAL::VirtualPHD > device) noexcept |
| Session-layer component request to disconnect a device. More...
|
|
virtual void | msgReady (void) |
|
virtual void | msgGroupReady (void) |
|
virtual void | msgSystemReady (void) |
|
virtual void | msgDestroy (void) |
|
|
class | PrivateBluetoothModule |
|
This class wraps a module providing connections to classic Bluetooth (Health Device Profile) devices. In the future, support for BLE devices and device management operations should be be added to this class as well.
The class derives from the PAL::PHDBluetoothProvider which handles the HDP communication with other modules.
- Todo:
- Revisit documentation for instructions on starting and terminating the module using the module launcher
- See also
- PAL::PHDBluetoothProvider
PAL::BluetoothModule::BluetoothModule |
( |
| ) |
|
The Bluetooth module is initialized.
- Todo:
- Revisit documentation for instructions on starting and terminating the module using the module launcher
void PAL::BluetoothModule::disconnect |
( |
std::shared_ptr< PAL::VirtualPHD > |
device | ) |
|
|
noexcept |
The session-layer component handling this device wishes to disconnect. When the device has been disconnected, we must reply with a disconnectIndication().
- Parameters
-
device | The device we must disconnect. |
void PAL::BluetoothModule::msgGoingDown |
( |
| ) |
|
|
virtual |
This method stops the Bluetooth module. If any connections are open, they will be disconnected with "gentle force". This signal should be delivered to the module just before it is destructed. When the module receives this signal, it will stop accepting new connections and close all existing - in other words: it will be a brick waiting for destruction.
- Parameters
-
signal | The Terminate signal. |
Reimplemented from FSYS::Module.
void PAL::BluetoothModule::registerDatatype |
( |
uint16_t |
datatype | ) |
|
|
virtualnoexcept |
This method is called when a session-layer component is ready to handle the given datatype. We should start accepting incoming connections of this type.
- Parameters
-
datatype | The datatype that will be handled. |
Implements PAL::PersonalHealthDeviceConnector.
void PAL::BluetoothModule::sendApduPrimary |
( |
std::shared_ptr< PAL::VirtualPHD > |
device, |
|
|
std::shared_ptr< std::vector< uint8_t > > |
apdu |
|
) |
| |
|
noexcept |
Send a message to the given device on the reliable primary channel. If no channel is currently open to this device, ignore the call; if the transmission fails (e.g. because the destination went out of range), follow up with a disconnectIndication() with a suitable error code.
- Parameters
-
device | The destination |
apdu | The message payload |
void PAL::BluetoothModule::sendApduStreaming |
( |
std::shared_ptr< PAL::VirtualPHD > |
device, |
|
|
std::shared_ptr< std::vector< uint8_t > > |
apdu |
|
) |
| |
|
noexcept |
Attempt to send this message to the given device on an unreliable streaming channel. If no streaming channel is currently open, use the primary channel instead (
- See also
- sendApduPrimary()).
- Parameters
-
device | The destination |
apdu | The message payload |
void PAL::BluetoothModule::unregisterDatatype |
( |
uint16_t |
datatype | ) |
|
|
virtualnoexcept |
This method is called when no more session-layer components are ready to handle the given datatype. We should no longer accept incoming connections of this type.
- Parameters
-
datatype | The datatype that will no longer be accepted. |
Implements PAL::PersonalHealthDeviceConnector.
The documentation for this class was generated from the following file: