![]() |
4S Device Communication Module Collection
Version 0.6-SNAPSHOT
Full documentation of the modules in the 4SDC collection (aimed at 4SDC module developers)
|
|
Bluetooth PAL-layer module wrapper class. More...
#include <bluetooth.h>
Classes | |
class | PrivateBluetoothModule |
Public Member Functions | |
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) |
Private Attributes | |
PrivateBluetoothModule * | privateParts |
Friends | |
class | PrivateBluetoothModule |
Additional Inherited Members | |
![]() | |
virtual void | sendApduStreaming (std::shared_ptr< VirtualPHD > device, std::shared_ptr< std::vector< uint8_t > > apdu) noexcept=0 |
Send a message to this device on a streaming virtual channel. More... | |
![]() | |
virtual void | sendApduPrimary (std::shared_ptr< VirtualPHD > device, std::shared_ptr< std::vector< uint8_t > > apdu) noexcept=0 |
Send a message to this device on the primary virtual channel. More... | |
virtual void | disconnect (std::shared_ptr< VirtualPHD > device) noexcept=0 |
Disconnect the device. More... | |
![]() | |
void | connectIndication (std::shared_ptr< VirtualPHD > device) noexcept |
Indicates the connection of a new device. More... | |
void | disconnectIndication (std::shared_ptr< VirtualPHD > device, errortype error) noexcept |
Indicates a device disconnection along with error details. More... | |
void | apduReceived (std::shared_ptr< VirtualPHD > device, std::shared_ptr< std::vector< uint8_t > > apdu, bool reliableTransport) noexcept |
Receive a message from this device. More... | |
virtual | ~PersonalHealthDeviceProviderBase () |
Cleanup and make sure all devices are disconnected. More... | |
![]() | |
PrivatePHDProvider * | privateParts |
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.
BluetoothModule::BluetoothModule | ( | ) |
The Bluetooth module is initialized.
|
noexcept |
The session-layer component handling this device wishes to disconnect. When the device has been disconnected, we must reply with a disconnectIndication().
device | The device we must disconnect. |
|
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.
signal | The Terminate signal. |
Reimplemented from FSYS::Module.
|
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.
datatype | The datatype that will be handled. |
Implements PAL::PersonalHealthDeviceConnector.
|
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.
device | The destination |
apdu | The message payload |
|
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 (
device | The destination |
apdu | The message payload |
|
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.
datatype | The datatype that will no longer be accepted. |
Implements PAL::PersonalHealthDeviceConnector.