IQRF Gateway Daemon
|
Create component instances. More...
#include <DaemonController.h>
Public Types | |
enum | Mode { Mode::Operational, Mode::Service, Mode::Forwarding } |
operational mode More... | |
Public Member Functions | |
DaemonController (const DaemonController &)=delete | |
void | run (const std::string &cfgFileName) |
main loop More... | |
void | executeDpaTransaction (DpaTransaction &dpaTransaction) override |
Execute DPA transaction. More... | |
void | registerAsyncMessageHandler (const std::string &serviceId, AsyncMessageHandlerFunc fun) override |
Register Asynchronous DPA message handler. More... | |
void | unregisterAsyncMessageHandler (const std::string &serviceId) override |
Unregister Asynchronous DPA message handler. More... | |
IScheduler * | getScheduler () override |
Get IScheduler implementation. More... | |
std::string | doCommand (const std::string &cmd) override |
Perform mode switch command. More... | |
const std::string & | getModuleId () override |
Get IQRF coordination identification. More... | |
const std::string & | getOsVersion () override |
Get IQRF coordination OS version. More... | |
const std::string & | getTrType () override |
Get IQRF coordination TR type. More... | |
const std::string & | getMcuType () override |
Get IQRF coordination MCU type. More... | |
const std::string & | getOsBuild () override |
Get IQRF coordination OS build. More... | |
const std::string & | getDaemonVersion () override |
Get iqrf-daemon Version. More... | |
const std::string & | getDaemonVersionBuild () override |
Get iqrf-daemon build Timestamp. More... | |
void | exit () |
Invoke exit of this process. More... | |
void | setMode (Mode mode) |
switch operational mode More... | |
![]() | |
virtual | ~IDaemon () |
Static Public Member Functions | |
static DaemonController & | getController () |
Create component instances.
Based on configuration file passed from cmdl it instantiate and bind all component instances. The instances together implements configured daemon functions. As this version of daemon is statically linked, the components must be linked with iqrf_startup executable. It starts watch dog to monitor comunication threads and invoke exit in case of something got stucked
It accepts configuration JSON file:
|
strong |
|
delete |
|
overridevirtual |
Perform mode switch command.
[in] | cmd | command to switch mode |
Switches communication mode to oparational, forwarding or service according the command Supported command strings are: "operational" | "service" | "forwarding"
Implements IDaemon.
|
overridevirtual |
Execute DPA transaction.
[in] | dpaTransaction | Transaction to be executed |
The transaction consists from DPA requeste sent to coordinator. It is finished by DPA response or timeout
Implements IDaemon.
void DaemonController::exit | ( | ) |
Invoke exit of this process.
|
static |
|
inlineoverridevirtual |
Get iqrf-daemon Version.
Version is hardcoded during build, e.g. "v1.0.0"
Implements IDaemon.
|
inlineoverridevirtual |
Get iqrf-daemon build Timestamp.
Timestamp is hardcoded during build, e.g. "Fri 06/23/2017 9:53:37.74"
Implements IDaemon.
|
inlineoverridevirtual |
Get IQRF coordination MCU type.
MCU type is taken from the coordinator at the initialization phase, e.g. "PIC16F1938"
Implements IDaemon.
|
inlineoverridevirtual |
Get IQRF coordination identification.
Implements IDaemon.
|
inlineoverridevirtual |
Get IQRF coordination OS build.
OS build is taken from the coordinator at the initialization phase, e.g. "0879"
Implements IDaemon.
|
inlineoverridevirtual |
Get IQRF coordination OS version.
OS version is taken from the coordinator at the initialization phase, e.g. "3.08D"
Implements IDaemon.
|
inlineoverridevirtual |
Get IScheduler implementation.
Provides an instance of IScheduler implementation.
Implements IDaemon.
|
inlineoverridevirtual |
Get IQRF coordination TR type.
TR type is taken from the coordinator at the initialization phase, e.g. "DCTR-72D"
Implements IDaemon.
|
overridevirtual |
Register Asynchronous DPA message handler.
[in] | clientId | client identification registering handler function |
[in] | fun | handler function |
Whenever an asynchronous DPA message is received its passed to the handler function. It is possible to register more handlers for different clients distinguished via client identifications. All registered handlers are invoked to handle the message, however the order is not quaranteed. Repeated registration with the same client identification replaces previously registered handler
Implements IDaemon.
void DaemonController::run | ( | const std::string & | cfgFileName | ) |
main loop
void DaemonController::setMode | ( | Mode | mode | ) |
switch operational mode
[in] | mode | operational mode to switch |
Operational is used for normal work Service the only UDP Messaging is used to communicate with IQRF IDE Forwarding normal work but all DPA messages are forwarded to IQRF IDE to me monitored there
|
overridevirtual |
Unregister Asynchronous DPA message handler.
[in] | clientId | client identification |
If the handler is not required anymore, it is possible to unregister via this method.
Implements IDaemon.