IQRF Gateway Daemon
IDaemon.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016-2017 MICRORISC s.r.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include "DpaTransaction.h"
20 #include <string>
21 
22 typedef std::basic_string<unsigned char> ustring;
24 typedef std::function<void(const DpaMessage& dpaMessage)> AsyncMessageHandlerFunc;
25 
27 class IScheduler;
28 
31 class IDaemon
32 {
33 public:
34  virtual ~IDaemon() {};
35 
40  virtual void executeDpaTransaction(DpaTransaction& dpaTransaction) = 0;
41 
50  virtual void registerAsyncMessageHandler(const std::string& clientId, AsyncMessageHandlerFunc fun) = 0;
51 
56  virtual void unregisterAsyncMessageHandler(const std::string& clientId) = 0;
57 
62  virtual IScheduler* getScheduler() = 0;
63 
70  virtual std::string doCommand(const std::string& cmd) = 0;
71 
76  virtual const std::string& getModuleId() = 0;
77 
82  virtual const std::string& getOsVersion() = 0;
83 
88  virtual const std::string& getTrType() = 0;
89 
94  virtual const std::string& getMcuType() = 0;
95 
100  virtual const std::string& getOsBuild() = 0;
101 
106  virtual const std::string& getDaemonVersion() = 0;
107 
112  virtual const std::string& getDaemonVersionBuild() = 0;
113 };
virtual const std::string & getOsBuild()=0
Get IQRF coordination OS build.
Definition: UdpMessage.h:52
virtual void executeDpaTransaction(DpaTransaction &dpaTransaction)=0
Execute DPA transaction.
virtual const std::string & getOsVersion()=0
Get IQRF coordination OS version.
virtual void registerAsyncMessageHandler(const std::string &clientId, AsyncMessageHandlerFunc fun)=0
Register Asynchronous DPA message handler.
virtual const std::string & getMcuType()=0
Get IQRF coordination MCU type.
virtual IScheduler * getScheduler()=0
Get IScheduler implementation.
IDaemon interface.
Definition: IDaemon.h:31
IScheduler interface.
Definition: IScheduler.h:28
std::basic_string< unsigned char > ustring
Definition: IDaemon.h:22
virtual const std::string & getModuleId()=0
Get IQRF coordination identification.
virtual void unregisterAsyncMessageHandler(const std::string &clientId)=0
Unregister Asynchronous DPA message handler.
virtual std::string doCommand(const std::string &cmd)=0
Perform mode switch command.
virtual const std::string & getDaemonVersionBuild()=0
Get iqrf-daemon build Timestamp.
virtual const std::string & getTrType()=0
Get IQRF coordination TR type.
virtual ~IDaemon()
Definition: IDaemon.h:34
virtual const std::string & getDaemonVersion()=0
Get iqrf-daemon Version.
std::function< void(const DpaMessage &dpaMessage)> AsyncMessageHandlerFunc
Asynchronous DPA message handler functional type.
Definition: IDaemon.h:24