The abstract class, session-layer components must implement to handle communication with personal health devices from any transport class.
More...
#include <personalhealthdevice.h>
PersonalHealthDeviceHandler::~PersonalHealthDeviceHandler |
( |
| ) |
|
|
virtual |
The destructor will make sure that any connection to the PAL-layer components that was left open will be disconnected, and that any registered datatype that the session-layer component (child class) forgot to unregister will be properly unregistered.
void PersonalHealthDeviceHandler::disconnect |
( |
std::shared_ptr< VirtualPHD > |
device | ) |
|
|
protectedvirtualnoexcept |
A protocol-to-PAL message. If the device is currently connected, it will be disconnected immediately (and a disconnectIndication() will be returned from the PAL shortly), otherwise nothing will happen.
- Parameters
-
device | The device, we wish to disconnect. |
Implements PAL::PersonalHealthDeviceConnector.
void PersonalHealthDeviceHandler::registerDatatype |
( |
uint16_t |
datatype | ) |
|
|
protectedvirtual |
A protocol-to-PAL message. This message is issued by the session-layer component, when it is ready to handle a given datatype. When the component no longer handles the datatype, the unregisterDatatype() is used to stop new connections of that particular datatype.
The datatype must be one of the IEEE MDC_DEV_SPEC_PROFILE_
codes belonging to the MDC_PART_INFRA
partition.
The PersonalHealthDeviceProviderBase and PersonalHealthDeviceHandler classes will keep track of which session-layer components handles which datatypes, and will broadcast the registerDatatype() and unregisterDatatype() messages to all PAL-layer components when a previously unhandled datatype is registered for the first time and when a datatype is no longer being handled.
Except in the unlikely event of memory exhaustion, this method should never throw any exceptions.
- See also
- unregisterDatatype()
- Parameters
-
datatype | The datatype handled by this component. |
- Exceptions
-
std::bad_alloc | in case of memory exhaustion. |
Implements PAL::PersonalHealthDeviceConnector.
void PersonalHealthDeviceHandler::sendApduPrimary |
( |
std::shared_ptr< VirtualPHD > |
device, |
|
|
std::shared_ptr< std::vector< uint8_t > > |
apdu |
|
) |
| |
|
protectedvirtualnoexcept |
A protocol-to-PAL message. If the device is currently connected, this method will (attempt to) send a message to the device on the primary virtual channel (which by definition is a reliable transport service). There will be no indication of whether this attempt was succesful or not. In particular, if this device object is currently not connected, the method invocation will be ignored.
- Parameters
-
device | The device, we are sending to. |
apdu | The buffer of bytes to transmit to the device. |
Implements PAL::PersonalHealthDeviceConnector.
void PersonalHealthDeviceHandler::sendApduStreaming |
( |
std::shared_ptr< VirtualPHD > |
device, |
|
|
std::shared_ptr< std::vector< uint8_t > > |
apdu |
|
) |
| |
|
protectedvirtualnoexcept |
A protocol-to-PAL message. If the device is currently connected, this method will (attempt to) send a message to the device on a streaming virtual channel. If such a channel is not available, it will attempt the primary virtual channel instead. There will be no indication of whether this attempt was succesful or not. In particular, if this device object is currently not connected, the method invocation will simply be ignored.
- Parameters
-
device | The bluetooth device to send to. The shared pointer must point to a PHDBluetoothDevice, otherwise the method will use the primary virtual channel. |
apdu | The buffer of bytes to transmit to the device. |
Implements PAL::PHDBluetoothConnector.
void PersonalHealthDeviceHandler::unregisterDatatype |
( |
uint16_t |
datatype | ) |
|
|
protectedvirtualnoexcept |
A protocol-to-PAL message. This message is issued by the session-layer component, when it no longer wishes to handle the given datatype. For more details, see the documentation of the registerDatatype() method.
- See also
- registerDatatype()
- Parameters
-
datatype | The datatype no longer handled by this component. |
Implements PAL::PersonalHealthDeviceConnector.
The documentation for this class was generated from the following files: