• DeviceClass
  • DeviceClass Class

    Describes Devices. More...

    Header: #include <DeviceClass>

    Public Types

    enum CreateMethod { CreateMethodUser, CreateMethodAuto, CreateMethodDiscovery }
    flags CreateMethods
    enum SetupMethod { SetupMethodJustAdd, SetupMethodDisplayPin, SetupMethodEnterPin, SetupMethodPushButton }

    Public Functions

    DeviceClass(const PluginId & pluginId = PluginId(), const VendorId & vendorId = VendorId(), const DeviceClassId & id = DeviceClassId())
    ActionTypes actionTypes() const
    CreateMethods createMethods() const
    QList<ParamType> discoveryParamTypes() const
    QString displayName() const
    EventTypes eventTypes() const
    StateType getStateType(const StateTypeId & stateTypeId)
    bool hasActionType(const ActionTypeId & actionTypeId)
    bool hasEventType(const EventTypeId & eventTypeId)
    bool hasStateType(const StateTypeId & stateTypeId)
    DeviceClassId id() const
    QStringList interfaces() const
    bool isValid() const
    QString name() const
    QString pairingInfo() const
    QList<ParamType> paramTypes() const
    PluginId pluginId() const
    void setActionTypes(const QList<ActionType> & actionTypes)
    void setCreateMethods(CreateMethods createMethods)
    void setDiscoveryParamTypes(const QList<ParamType> & params)
    void setDisplayName(const QString & displayName)
    void setEventTypes(const QList<EventType> & eventTypes)
    void setInterfaces(const QStringList & interfaces)
    void setName(const QString & name)
    void setPairingInfo(const QString & pairingInfo)
    void setParamTypes(const QList<ParamType> & params)
    void setSetupMethod(SetupMethod setupMethod)
    void setStateTypes(const QList<StateType> & stateTypes)
    SetupMethod setupMethod() const
    StateTypes stateTypes() const
    VendorId vendorId() const
    bool operator==(const DeviceClass & deviceClass) const

    Static Public Members

    QStringList mandatoryTypeProperties()
    QStringList typeProperties()

    Detailed Description

    Describes Devices.

    It holds information general information about devices and their vendors and describes what actions, events and states a device supports. As this is just a description of device and does not represent actual Devices, the actions, events and states are described in form of EventType, StateType and ActionType

    See also Device.

    Member Type Documentation

    enum DeviceClass::CreateMethod
    flags DeviceClass::CreateMethods

    This enum type specifies the CreateMethod of this DeviceClass

    ConstantValueDescription
    DeviceClass::CreateMethodUser0x01The user will specify the Params.
    DeviceClass::CreateMethodAuto0x02The device will be created automatically.
    DeviceClass::CreateMethodDiscovery0x04The device will be discovered and added by the user by selecting the DeviceDescriptorId from the list of discovered possible ones.

    The CreateMethods type is a typedef for QFlags<CreateMethod>. It stores an OR combination of CreateMethod values.

    enum DeviceClass::SetupMethod

    This enum type specifies the SetupMethod of this DeviceClass

    ConstantValueDescription
    DeviceClass::SetupMethodJustAdd0The Device will be just added. This is the default value.
    DeviceClass::SetupMethodDisplayPin1During the setup, a pin will be displayed on the Device. The pin will be needed in order to pair the device.
    DeviceClass::SetupMethodEnterPin2During the setup, a pin will be needed in order to pair the Device.
    DeviceClass::SetupMethodPushButton3During the setup, a button has to be pushed in order to pair the Device.

    Member Function Documentation

    DeviceClass::DeviceClass(const PluginId & pluginId = PluginId(), const VendorId & vendorId = VendorId(), const DeviceClassId & id = DeviceClassId())

    Constructs a DeviceClass with the give pluginId ,vendorId and id . When implementing a plugin, create a DeviceClass for each device you support. Generate a new uuid (e.g. uuidgen) and hardode it into the plugin. The id should never change or it will appear as a new DeviceClass in the system.

    ActionTypes DeviceClass::actionTypes() const

    Returns the actionTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.

    See also setActionTypes().

    CreateMethods DeviceClass::createMethods() const

    Returns the DeviceClass::CreateMethods of this DeviceClass.

    See also setCreateMethods().

    QList<ParamType> DeviceClass::discoveryParamTypes() const

    Returns the discovery params description of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their params matching to this template.

    See also setDiscoveryParamTypes().

    QString DeviceClass::displayName() const

    Returns the displayed name of this DeviceClass. This is visible to the user.

    See also setDisplayName().

    EventTypes DeviceClass::eventTypes() const

    Returns the eventTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their events matching to this template.

    See also setEventTypes().

    StateType DeviceClass::getStateType(const StateTypeId & stateTypeId)

    Returns the StateType with the given stateTypeId of this DeviceClass. If there is no matching StateType, an invalid StateType will be returned.

    bool DeviceClass::hasActionType(const ActionTypeId & actionTypeId)

    Returns true if this DeviceClass has a ActionType with the given actionTypeId.

    bool DeviceClass::hasEventType(const EventTypeId & eventTypeId)

    Returns true if this DeviceClass has a EventType with the given eventTypeId.

    bool DeviceClass::hasStateType(const StateTypeId & stateTypeId)

    Returns true if this DeviceClass has a StateType with the given stateTypeId.

    DeviceClassId DeviceClass::id() const

    Returns the id of this DeviceClass.

    QStringList DeviceClass::interfaces() const

    Returns the interfaces of this DeviceClass.

    See also setInterfaces().

    bool DeviceClass::isValid() const

    Returns true if this DeviceClass id, vendorId and pluginId are valid uuids.

    [static] QStringList DeviceClass::mandatoryTypeProperties()

    Returns a list of mandatory JSON properties a DeviceClass JSON definition must have.

    QString DeviceClass::name() const

    Returns the name of this DeviceClass. This is visible to the user.

    See also setName().

    QString DeviceClass::pairingInfo() const

    Returns the pairing information of this DeviceClass.

    See also setPairingInfo().

    QList<ParamType> DeviceClass::paramTypes() const

    Returns the params description of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their params matching to this template.

    See also setParamTypes().

    PluginId DeviceClass::pluginId() const

    Returns the pluginId this DeviceClass is managed by.

    void DeviceClass::setActionTypes(const QList<ActionType> & actionTypes)

    Set the actionTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.

    See also actionTypes().

    void DeviceClass::setCreateMethods(CreateMethods createMethods)

    Set the createMethods of this DeviceClass.

    See also createMethods() and CreateMethod.

    void DeviceClass::setDiscoveryParamTypes(const QList<ParamType> & params)

    Set the params of this DeviceClass for the discovery. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.

    See also discoveryParamTypes().

    void DeviceClass::setDisplayName(const QString & displayName)

    Set the displayName of this DeviceClass. This is visible to the user.

    See also displayName().

    void DeviceClass::setEventTypes(const QList<EventType> & eventTypes)

    Set the eventTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their events matching to this template.

    See also eventTypes().

    void DeviceClass::setInterfaces(const QStringList & interfaces)

    Set the interfaces of this DeviceClass.

    Note: You can find information about interfaces here.

    See also interfaces().

    void DeviceClass::setName(const QString & name)

    Set the name of this DeviceClass. This is visible to the user.

    See also name().

    void DeviceClass::setPairingInfo(const QString & pairingInfo)

    Set the pairingInfo of this DeviceClass.

    See also pairingInfo().

    void DeviceClass::setParamTypes(const QList<ParamType> & params)

    Set the params of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their actions matching to this template.

    See also paramTypes().

    void DeviceClass::setSetupMethod(SetupMethod setupMethod)

    Set the setupMethod of this DeviceClass.

    See also setupMethod() and SetupMethod.

    void DeviceClass::setStateTypes(const QList<StateType> & stateTypes)

    Set the stateTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their states matching to this template.

    See also stateTypes().

    SetupMethod DeviceClass::setupMethod() const

    Returns the DeviceClass::SetupMethod of this DeviceClass.

    StateTypes DeviceClass::stateTypes() const

    Returns the statesTypes of this DeviceClass. {Device}{Devices} created from this DeviceClass must have their states matching to this template.

    See also setStateTypes().

    [static] QStringList DeviceClass::typeProperties()

    Returns a list of all valid JSON properties a DeviceClass JSON definition can have.

    VendorId DeviceClass::vendorId() const

    Returns the VendorId for this DeviceClass

    bool DeviceClass::operator==(const DeviceClass & deviceClass) const

    Compare this deviceClass to another. This is effectively the same as calling a.id() == b.id(). Returns true if the ids match.