• NymeaCore
  • NymeaCore Class

    (nymeaserver::NymeaCore)

    The main entry point for the nymea Server and the place where all the messages are dispatched. More...

    Header: #include <NymeaCore>
    Inherits:

    Public Functions

    ~NymeaCore()
    BluetoothServer * bluetoothServer() const
    CloudManager * cloudManager() const
    NymeaConfiguration * configuration() const
    DebugServerHandler * debugServerHandler() const
    void destroy()
    DeviceManager * deviceManager() const
    DeviceManager::DeviceError executeAction(const Action & action)
    void executeRuleActions(const QList<RuleAction> ruleActions)
    JsonRPCServer * jsonRPCServer() const
    LogEngine * logEngine() const
    NetworkManager * networkManager() const
    QPair<DeviceManager::DeviceError, QList<RuleId> > removeConfiguredDevice(const DeviceId & deviceId, const QHash<RuleId, RuleEngine::RemovePolicy> & removePolicyList)
    DeviceManager::DeviceError removeConfiguredDevice(const DeviceId & deviceId, const RuleEngine::RemovePolicy & removePolicy)
    RuleEngine::RuleError removeRule(const RuleId & id)
    RestServer * restServer() const
    RuleEngine * ruleEngine() const
    ServerManager * serverManager() const
    TagsStorage * tagsStorage() const
    TimeManager * timeManager() const
    UserManager * userManager() const

    Signals

    void actionExecuted(const ActionId & id, DeviceManager::DeviceError status)
    void deviceAdded(Device * device)
    void deviceChanged(Device * device)
    void deviceReconfigurationFinished(Device * device, DeviceManager::DeviceError status)
    void deviceRemoved(const DeviceId & deviceId)
    void deviceSetupFinished(Device * device, DeviceManager::DeviceError status)
    void deviceStateChanged(Device * device, const QUuid & stateTypeId, const QVariant & value)
    void devicesDiscovered(const DeviceClassId & deviceClassId, const QList<DeviceDescriptor> deviceDescriptors)
    void eventTriggered(const Event & event)
    void initialized()
    void pairingFinished(const PairingTransactionId & pairingTransactionId, DeviceManager::DeviceError status, const DeviceId & deviceId)
    void pluginConfigChanged(const PluginId & id, const ParamList & config)
    void ruleActiveChanged(const Rule & rule)
    void ruleAdded(const Rule & rule)
    void ruleConfigurationChanged(const Rule & rule)
    void ruleRemoved(const RuleId & ruleId)

    Static Public Members

    QStringList getAvailableLanguages()
    NymeaCore * instance()

    Detailed Description

    The main entry point for the nymea Server and the place where all the messages are dispatched.

    NymeaCore is a singleton instance and the main entry point of the nymea daemon. It is responsible to instantiate, set up and connect all the other components.

    Member Function Documentation

    NymeaCore::~NymeaCore()

    Destructor of the NymeaCore.

    [signal] void NymeaCore::actionExecuted(const ActionId & id, DeviceManager::DeviceError status)

    This signal is emitted when the Action with the given id is finished. The status of the Action execution will be described as DeviceError.

    BluetoothServer * NymeaCore::bluetoothServer() const

    Returns a pointer to the BluetoothServer instance owned by NymeaCore.

    CloudManager * NymeaCore::cloudManager() const

    Returns a pointer to the CloudManager instance owned by NymeaCore.

    NymeaConfiguration * NymeaCore::configuration() const

    Returns a pointer to the NymeaConfiguration instance owned by NymeaCore.

    DebugServerHandler * NymeaCore::debugServerHandler() const

    Returns a pointer to the DebugServerHandler instance owned by NymeaCore.

    void NymeaCore::destroy()

    Destroyes the NymeaCore instance.

    [signal] void NymeaCore::deviceAdded(Device * device)

    This signal is emitted when a device was added to the system.

    [signal] void NymeaCore::deviceChanged(Device * device)

    This signal is emitted when the Params of a device have been changed.

    DeviceManager * NymeaCore::deviceManager() const

    Returns a pointer to the DeviceManager instance owned by NymeaCore.

    [signal] void NymeaCore::deviceReconfigurationFinished(Device * device, DeviceManager::DeviceError status)

    This signal is emitted when the edit request of a device is finished. The status of the edit request will be described as DeviceError.

    [signal] void NymeaCore::deviceRemoved(const DeviceId & deviceId)

    This signal is emitted when a Device with the given deviceId was removed.

    [signal] void NymeaCore::deviceSetupFinished(Device * device, DeviceManager::DeviceError status)

    This signal is emitted when the setup of a device is finished. The status parameter describes the DeviceError that occurred.

    [signal] void NymeaCore::deviceStateChanged(Device * device, const QUuid & stateTypeId, const QVariant & value)

    This signal is emitted when the State of a device changed. The stateTypeId parameter describes the StateType and the value parameter holds the new value.

    [signal] void NymeaCore::devicesDiscovered(const DeviceClassId & deviceClassId, const QList<DeviceDescriptor> deviceDescriptors)

    This signal is emitted when the discovery of a deviceClassId is finished. The deviceDescriptors parameter describes the list of DeviceDescriptors of all discovered Devices.

    See also DeviceManager::discoverDevices().

    [signal] void NymeaCore::eventTriggered(const Event & event)

    This signal is emitted when an event happend.

    DeviceManager::DeviceError NymeaCore::executeAction(const Action & action)

    Calls the metheod DeviceManager::executeAction(action).

    See also DeviceManager::executeAction().

    void NymeaCore::executeRuleActions(const QList<RuleAction> ruleActions)

    Execute the given ruleActions.

    [static] QStringList NymeaCore::getAvailableLanguages()

    Returns the list of available system languages.

    [signal] void NymeaCore::initialized()

    This signal is emitted when the core is initialized.

    [static] NymeaCore * NymeaCore::instance()

    Returns a pointer to the single NymeaCore instance.

    JsonRPCServer * NymeaCore::jsonRPCServer() const

    Returns the pointer to the JsonRPCServer of this instance.

    LogEngine * NymeaCore::logEngine() const

    Return the instance of the log engine

    NetworkManager * NymeaCore::networkManager() const

    Returns a pointer to the NetworkManager instance owned by NymeaCore.

    [signal] void NymeaCore::pairingFinished(const PairingTransactionId & pairingTransactionId, DeviceManager::DeviceError status, const DeviceId & deviceId)

    The DeviceManager will emit a this Signal when the pairing of a Device with the deviceId and pairingTransactionId is finished. The status of the pairing will be described as DeviceError.

    [signal] void NymeaCore::pluginConfigChanged(const PluginId & id, const ParamList & config)

    This signal is emitted when the plugin config of the plugin with the given id changed.

    QPair<DeviceManager::DeviceError, QList<RuleId> > NymeaCore::removeConfiguredDevice(const DeviceId & deviceId, const QHash<RuleId, RuleEngine::RemovePolicy> & removePolicyList)

    Removes a configured Device with the given deviceId and removePolicyList.

    DeviceManager::DeviceError NymeaCore::removeConfiguredDevice(const DeviceId & deviceId, const RuleEngine::RemovePolicy & removePolicy)

    Removes a configured Device with the given deviceId and removePolicy.

    RuleEngine::RuleError NymeaCore::removeRule(const RuleId & id)

    Calls the metheod RuleEngine::removeRule(id).

    See also RuleEngine.

    RestServer * NymeaCore::restServer() const

    Returns the pointer to the RestServer of this instance.

    [signal] void NymeaCore::ruleActiveChanged(const Rule & rule)

    This signal is emitted when a rule changed the active state. A Rule is active, when all States match with the StateDescriptor conditions.

    See also Rule::active().

    [signal] void NymeaCore::ruleAdded(const Rule & rule)

    This signal is emitted when a rule was added to the system.

    [signal] void NymeaCore::ruleConfigurationChanged(const Rule & rule)

    This signal is emitted when the configuration of rule changed.

    RuleEngine * NymeaCore::ruleEngine() const

    Returns a pointer to the RuleEngine instance owned by NymeaCore.

    [signal] void NymeaCore::ruleRemoved(const RuleId & ruleId)

    This signal is emitted when a Rule with the given ruleId was removed.

    ServerManager * NymeaCore::serverManager() const

    Returns a pointer to the ServerManager instance owned by NymeaCore.

    TagsStorage * NymeaCore::tagsStorage() const

    Returns a pointer to the TagsStorage instance owned by NymeaCore.

    TimeManager * NymeaCore::timeManager() const

    Returns a pointer to the TimeManager instance owned by NymeaCore.

    UserManager * NymeaCore::userManager() const

    Returns a pointer to the UserManager instance owned by NymeaCore.