CHAI SDK  Version 1.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
CPNS::DeviceID Class Reference

Device ID definition class. More...

+ Collaboration diagram for CPNS::DeviceID:

Public Member Functions

 DeviceID ()
 Constructor. More...
 
 DeviceID (CPNS::uint16 const wBrandID, CPNS::uint16 const wModelID, CPNS::uint32 const dwDuplicateNumber, CPNS::uint16 const wModuleID)
 Constructor. More...
 
 DeviceID (DeviceID const &data)
 Copy constructor. More...
 
CPNS::boolean operator== (DeviceID const &a) const
 Equality check operator. More...
 
CPNS::boolean operator!= (DeviceID const &a) const
 Difference check operator. More...
 
CPNS::boolean operator< (DeviceID const &a) const
 Less than check operator. More...
 
CPNS::boolean operator> (DeviceID const &a) const
 Greater than check operator. More...
 
DeviceID const & operator= (DeviceID const &a)
 Assignment operator. More...
 
CPNS::boolean IsEmpty () const
 Empty check. More...
 
CPNS::UTF8String ToString () const
 String representation. More...
 
void Clear ()
 Clear the DeviceID content. More...
 
CPNS::uint32 GetRootIdentity () const
 Root Identity getter. More...
 
CPNS::DeviceID GetRootInstance () const
 Root Instance getter. More...
 
CPNS::boolean RootIdentityCompare (CPNS::uint16 const wBrandID, CPNS::uint16 const wModelID) const
 Root identity check. More...
 
void SetRootPart (DeviceID const devid)
 Update only the root part (Brand, Model and Duplicate) from the specified DeviceID. More...
 
CPNS::boolean IsRoot () const
 Root check. More...
 
DeviceID const WithDuplicate (CPNS::uint32 const dwDuplicateNumber) const
 Returns the current DeviceID with the specified Duplicate Number value. More...
 
DeviceID const WithModuleID (CPNS::uint16 const wModuleID) const
 Returns the current DeviceID with the specified ModuleID value. More...
 

Static Public Member Functions

static CPNS::int8 Compare (DeviceID const &dev1, DeviceID const &dev2)
 Compare method. More...
 
static CPNS::int8 CompareRoot (DeviceID const &dev1, DeviceID const &dev2)
 Root compare method. More...
 
static CPNS::int8 CompareIdentity (DeviceID const &dev1, DeviceID const &dev2)
 Identity compare method. More...
 
static CPNS::boolean IsRootMatching (DeviceID const &dev1, DeviceID const &dev2)
 Root matching method. More...
 
static CPNS::boolean IsRootMatching (DeviceID const &dev1, CPNS::uint16 const wBrandID, CPNS::uint16 const wModelID, CPNS::uint32 const dwDuplicateNumber)
 Root matching method. More...
 
static CPNS::boolean IsIdentityMatching (DeviceID const &dev1, DeviceID const &dev2)
 Identity matching method. More...
 
static CPNS::boolean IsIdentityMatching (DeviceID const &dev1, CPNS::uint16 const wBrandID, CPNS::uint16 const wModelID, CPNS::uint16 const wModuleID)
 Identity matching method. More...
 

Public Attributes

CPNS::uint16 m_wBrandID
 Device's Manufacturer ID. More...
 
CPNS::uint16 m_wModelID
 Device's Model ID. More...
 
CPNS::uint32 m_dwDuplicateNum
 Device's Duplicate Number. More...
 
CPNS::uint16 m_wModuleID
 Device's Module ID. More...
 

Static Public Attributes

static DeviceID NullDeviceID
 Empty Device ID value. More...
 

Detailed Description

Device ID definition class.

Constructor & Destructor Documentation

CPNS::DeviceID::DeviceID ( )

Constructor.

CPNS::DeviceID::DeviceID ( CPNS::uint16 const  wBrandID,
CPNS::uint16 const  wModelID,
CPNS::uint32 const  dwDuplicateNumber,
CPNS::uint16 const  wModuleID 
)

Constructor.

Parameters
[in]wBrandIDDevice's Manufacturer ID
[in]wModelIDDevice's Model ID
[in]dwDuplicateNumberDevice's Duplicate Number
[in]wModuleIDDevice's Module ID
CPNS::DeviceID::DeviceID ( DeviceID const &  data)

Copy constructor.

Member Function Documentation

void CPNS::DeviceID::Clear ( )

Clear the DeviceID content.

static CPNS::int8 CPNS::DeviceID::Compare ( DeviceID const &  dev1,
DeviceID const &  dev2 
)
static

Compare method.

Returns
-1 if dev1<dev2 +1 if dev1>dev2 0 if dev1==dev2
static CPNS::int8 CPNS::DeviceID::CompareIdentity ( DeviceID const &  dev1,
DeviceID const &  dev2 
)
static

Identity compare method.

Returns
-1 if dev1<dev2 +1 if dev1>dev2 0 if dev1==dev2
static CPNS::int8 CPNS::DeviceID::CompareRoot ( DeviceID const &  dev1,
DeviceID const &  dev2 
)
static

Root compare method.

Returns
-1 if dev1<dev2 +1 if dev1>dev2 0 if dev1==dev2
CPNS::uint32 CPNS::DeviceID::GetRootIdentity ( ) const

Root Identity getter.

Returns
Root Identity (combined BrandID/ModelID value, excluding duplicate and moduleID)
CPNS::DeviceID CPNS::DeviceID::GetRootInstance ( ) const

Root Instance getter.

Returns
Root Instance (BrandID, ModelID and duplicate, excluding moduleID)
CPNS::boolean CPNS::DeviceID::IsEmpty ( ) const

Empty check.

Returns
TRUE if all fields are empty
static CPNS::boolean CPNS::DeviceID::IsIdentityMatching ( DeviceID const &  dev1,
DeviceID const &  dev2 
)
static

Identity matching method.

Compare the identity part of the DeviceIDs (Brand, Model, Module)

Returns
TRUE if equal
static CPNS::boolean CPNS::DeviceID::IsIdentityMatching ( DeviceID const &  dev1,
CPNS::uint16 const  wBrandID,
CPNS::uint16 const  wModelID,
CPNS::uint16 const  wModuleID 
)
static

Identity matching method.

Compare the identity part of the DeviceIDs (Brand, Model, Module)

Returns
TRUE if equal
CPNS::boolean CPNS::DeviceID::IsRoot ( ) const

Root check.

Check if the device is root (ModuleID == 0)

Returns
TRUE if the Device ID is related to a root device
static CPNS::boolean CPNS::DeviceID::IsRootMatching ( DeviceID const &  dev1,
DeviceID const &  dev2 
)
static

Root matching method.

Compare the root part of the DeviceIDs (Brand, Model and Duplicate)

Returns
TRUE if equal
static CPNS::boolean CPNS::DeviceID::IsRootMatching ( DeviceID const &  dev1,
CPNS::uint16 const  wBrandID,
CPNS::uint16 const  wModelID,
CPNS::uint32 const  dwDuplicateNumber 
)
static

Root matching method.

Compare the root part of the DeviceIDs (Brand, Model and Duplicate)

Returns
TRUE if equal
CPNS::boolean CPNS::DeviceID::operator!= ( DeviceID const &  a) const

Difference check operator.

CPNS::boolean CPNS::DeviceID::operator< ( DeviceID const &  a) const

Less than check operator.

DeviceID const& CPNS::DeviceID::operator= ( DeviceID const &  a)

Assignment operator.

CPNS::boolean CPNS::DeviceID::operator== ( DeviceID const &  a) const

Equality check operator.

CPNS::boolean CPNS::DeviceID::operator> ( DeviceID const &  a) const

Greater than check operator.

CPNS::boolean CPNS::DeviceID::RootIdentityCompare ( CPNS::uint16 const  wBrandID,
CPNS::uint16 const  wModelID 
) const

Root identity check.

Checks if the DeviceID is related to a root device with the specified identity.

Parameters
[in]wBrandIDManufacturer ID
[in]wModelIDModel ID
Returns
TRUE if matching
void CPNS::DeviceID::SetRootPart ( DeviceID const  devid)

Update only the root part (Brand, Model and Duplicate) from the specified DeviceID.

Parameters
[in]devidDeviceID
CPNS::UTF8String CPNS::DeviceID::ToString ( ) const

String representation.

Returns
an hexadecimal view of the Device ID
DeviceID const CPNS::DeviceID::WithDuplicate ( CPNS::uint32 const  dwDuplicateNumber) const
inline

Returns the current DeviceID with the specified Duplicate Number value.

DeviceID const CPNS::DeviceID::WithModuleID ( CPNS::uint16 const  wModuleID) const
inline

Returns the current DeviceID with the specified ModuleID value.

Member Data Documentation

CPNS::uint32 CPNS::DeviceID::m_dwDuplicateNum

Device's Duplicate Number.

CPNS::uint16 CPNS::DeviceID::m_wBrandID

Device's Manufacturer ID.

CPNS::uint16 CPNS::DeviceID::m_wModelID

Device's Model ID.

CPNS::uint16 CPNS::DeviceID::m_wModuleID

Device's Module ID.

DeviceID CPNS::DeviceID::NullDeviceID
static

Empty Device ID value.