1 /* Copyright (c) 2017, 2020 The Linux Foundation. All rights reserved.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are
5  * met:
6  *     * Redistributions of source code must retain the above copyright
7  *       notice, this list of conditions and the following disclaimer.
8  *     * Redistributions in binary form must reproduce the above
9  *       copyright notice, this list of conditions and the following
10  *       disclaimer in the documentation and/or other materials provided
11  *       with the distribution.
12  *     * Neither the name of The Linux Foundation, nor the names of its
13  *       contributors may be used to endorse or promote products derived
14  *       from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  */
29 
30 #ifndef __IFRAMEWORKACTIONREQ_H__
31 #define __IFRAMEWORKACTIONREQ_H__
32 
33 #include <string>
34 #include  <DataItemId.h>
35 
36 using namespace std;
37 
38 namespace loc_core
39 {
40 
41 /**
42  * @brief IFrameworkActionReq interface
43  * @details IFrameworkActionReq interface;
44  *          Defines an interface for operations such as turnOn, turnOff a
45  *          framework module described by the data item. Framework module
46  *          could be bluetooth, wifi etc.
47  *          Must be implemented by OS dependent code.
48  *
49  */
50 class IFrameworkActionReq {
51 
52 public:
53     /**
54      * @brief Turn on the framework module described by the data item.
55      * @details  Turn on the framework module described by the data item;
56      *          An IFrameworkActionReq implementer invokes this method to
57      *          turn on the framework module described by the data item.
58      *          Framework module could be bluetooth, wifi etc.
59      *
60      * @param dit DataItemId
61      * @param timeout Timeout after which to turn off the framework module.
62      */
63     virtual void turnOn (DataItemId dit, int timeOut = 0) = 0;
64 
65     /**
66      * @brief Turn off the framework module described by the data item.
67      * @details  Turn off the framework module described by the data item;
68      *          An IFrameworkActionReq implementer invokes this method to
69      *          turn off the framework module described by the data item.
70      *          Framework module could be bluetooth, wifi etc.
71      *
72      * @param dit DataItemId
73      */
74     virtual void turnOff (DataItemId dit) = 0;
75 
76 #ifdef USE_GLIB
77     /**
78      * @brief Setup WWAN backhaul
79      * @details  Setup WWAN backhaul
80      *
81      * @param None
82      */
83     virtual bool connectBackhaul(const string& clientName) = 0;
84 
85     /**
86      * @brief Disconnects the WWANbackhaul
87      * @details Disconnects the WWANbackhaul, only if it was setup by us
88      *
89      * @param None
90      */
91     virtual bool disconnectBackhaul(const string& clientName) = 0;
92 #endif
93 
94     /**
95      * @brief Destructor
96      * @details Destructor
97      */
~IFrameworkActionReq()98     virtual ~IFrameworkActionReq () {}
99 };
100 
101 } // namespace loc_core
102 
103 #endif // #ifndef __IFRAMEWORKACTIONREQ_H__
104 
105