4S Device Communication Module Collection  Version 0.6-SNAPSHOT
Full documentation of the modules in the 4SDC collection (aimed at 4SDC module developers)
PAL::VirtualPHD Class Referenceabstract

The base interface of a personal health device seen from the perspective of a transport module. More...

#include <personalhealthdevice.h>

+ Inheritance diagram for PAL::VirtualPHD:
+ Collaboration diagram for PAL::VirtualPHD:

Public Member Functions

 VirtualPHD ()
 Default constructor. More...
 
 VirtualPHD (FSYS::Handle &h)
 Constructor used to clone the handle. More...
 
virtual ~VirtualPHD ()
 Virtual destructor.
 
virtual PhysicalPHDgetPhysicalDevice () noexcept=0
 
virtual const PhysicalPHDgetPhysicalDevice () const noexcept=0
 
virtual uint16_t getDatatype () const noexcept=0
 The IEEE MDC_DEV_SPEC_PROFILE_ datatype implemented by this device. More...
 
virtual std::string getDisplayName () const noexcept=0
 A user-friendly name of the device. More...
 
- Public Member Functions inherited from FSYS::Handle
 Handle (void)
 Default constructor. More...
 
 Handle (Handle &ref)
 Copy constructor for handle object. More...
 
 Handle (const Handle &ref)
 Copy constructor for handle object. More...
 
Handleoperator= (Handle const &theOtherOne)
 
bool operator== (Handle const &compareTo) const
 Equality comparator. More...
 
bool operator!= (Handle const &compareTo) const
 Not equalify operator. More...
 
bool operator> (Handle const &compareTo) const
 Greater than operator ('>') More...
 
bool operator< (Handle const &compareTo) const
 Less than operator ('<') More...
 

Additional Inherited Members

- Static Public Member Functions inherited from FSYS::Handle
static HandlebroadCastHandle (void)
 Generic broadcast handle. More...
 
static Handlenull (void)
 The null handle. More...
 

Detailed Description

This class is implemented by the transport components in the PAL layer to model a connected device. Each transport type (USB, Bluetooth, ZigBee) implements different subclasses of this class, each adding the characteristics of that particular transport type.

Objects deriving from this class are always created by components in the PAL layer and managed by smart references (std::shared_ptr). The objects are then communicated back and forth between the PAL and session layers using the PersonalHealthDeviceConnector interfaces. Notice that the object appearing at the session layer will be a by-value copy (a proxy) of the original object.

This class derives from FSYS::Handle so that upper layers and applications may compare these device objects (and proxies) with objects/proxies obtained from other PAL layer interfaces (e.g. Bluetooth pairing, ZigBee network monitors and the like). Hence, two (different) proxy-objects representing the same device will always turn out to be equal when compared (==) as they will be clones of the same FSYS::Handle.

Constructor & Destructor Documentation

PAL::VirtualPHD::VirtualPHD ( )
inline

The default constructor will create a PersonalHealthDevice object with a new unique FSYS::Handle.

PAL::VirtualPHD::VirtualPHD ( FSYS::Handle h)
inline

This alternative constructor will create a PersonalHealthDevice object with a cloned FSYS::Handle.

Member Function Documentation

virtual uint16_t PAL::VirtualPHD::getDatatype ( ) const
pure virtualnoexcept

This getter will return the datatype implemented by this device. The datatype is a 16-bit unsigned integer – one of the MDC_DEV_SPEC_PROFILE_ codes belonging to the MDC_PART_INFRA partition.

Returns
The datatype implemented by this device.

Implemented in anonymous_namespace{bluedroid.cpp}::VirtualDevice, and anonymous_namespace{personalhealthdevice.cpp}::PHDProxy.

virtual std::string PAL::VirtualPHD::getDisplayName ( ) const
pure virtualnoexcept

This getter will return a user-friendly (or at least user-recognizable) name of the virtual device, suitable for use in the user interface. Implementing classes should enforce consistent naming across other PAL layer interfaces (e.g. Bluetooth pairing, ZigBee network monitors and the like).

Bluetooth devices may (should?) grab the name from the optional MDEP Description field of the SDP record, if available; while USB devices may (should?) grab the name from the interface descriptor's iInterface field. If no name is available (including the case when the PAL component is not allowed to read these names), this name should be set to the empty string, and the user interface should be able to generate a default text based on the getDatatype() value.

Returns
The device name to be used in user interfaces, or "".

Implemented in anonymous_namespace{bluedroid.cpp}::VirtualDevice, and anonymous_namespace{personalhealthdevice.cpp}::PHDProxy.


The documentation for this class was generated from the following file: