RDK Documentation (Open Sourced RDK Components)
Device_WiFi_EndPoint.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 
21 
22 /**
23 * @defgroup tr69hostif
24 * @{
25 * @defgroup hostif
26 * @{
27 **/
28 
29 
30 #ifndef DEVICE_WIFI_ENDPOINT_H_
31 #define DEVICE_WIFI_ENDPOINT_H_
32 
33 #include "hostIf_main.h"
34 #include "hostIf_utils.h"
35 #include "hostIf_tr69ReqHandler.h"
36 #include "hostIf_updateHandler.h"
37 
38 /**
39  * @defgroup TR69_HOSTIF_WIFI_ENDPOINT TR-069 Object (Device.WiFi.EndPoint.{i}) Public APIs
40  * This object models an 802.11 connection from the perspective of a wireless end point.
41  * Each EndPoint entry is associated with a particular SSID interface instance via the SSIDReference parameter,
42  * and an associated active Profile instance via the ProfileReference parameter.
43  * The active profile is responsible for specifying the actual SSID and security settings used by the end point.
44  *
45  * For enabled table entries, if SSIDReference or ProfileReference is not a valid reference then the table entry
46  * is inoperable and the CPE MUST set Status to Error_Misconfigured.
47  *
48  * Note: The EndPoint table includes a unique key parameter that is a strong reference.
49  * If a strongly referenced object is deleted, the CPE will set the referencing parameter to an empty string.
50  * However, doing so under these circumstances might cause the updated EndPoint row to then violate the table's
51  * unique key constraint;
52  *
53  * if this occurs, the CPE MUST set Status to Error_Misconfigured and disable the offending EndPoint row.
54  * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given value for Alias.
55  * On creation of a new table entry, the CPE MUST choose an initial value for Alias
56  * such that the new entry does not conflict with any existing entries.
57  *
58  * At most one enabled entry in this table can exist with a given value for SSIDReference.
59  *
60  * @ingroup TR69_HOSTIF_WIFI
61  */
63 
64  static GHashTable *ifHash;
65  int dev_id;
66  hostIf_WiFi_EndPoint(int dev_id);
68 
69  int refreshCache ();
70 
71 public:
72  static class hostIf_WiFi_EndPoint *getInstance(int dev_id);
73  static GList* getAllInstances();
74  static void closeInstance(hostIf_WiFi_EndPoint *);
75  static void closeAllInstances();
76 
77  bool Enable;
78  char Status[64];
79  char Alias[64];
80  char ProfileReference[256];
81  char SSIDReference[256]; // value of WiFi_EndPoint_Diag_Params.SSIDReference returned by IARM call to netsrvmgr
82  unsigned int ProfileNumberOfEntries;
83  struct {
84  unsigned long LastDataDownlinkRate;
85  unsigned long LastDataUplinkRate;
86  int SignalStrength;
87  unsigned long Retransmissions;
88  } stats;
89 
90  /**
91  * @ingroup TR69_HOSTIF_WIFI_ENDPOINT
92  * @{
93  */
94  /**
95  * @brief Check wethen wifi endpoint is enabled or not.
96  *
97  * @param[out] stMsgData TR-069 Host interface message request.
98  *
99  * @return Returns 0 on success, otherwise will return the appropriate error code.
100  */
102 
103  /**
104  * @brief Enables or disables this end point.
105  *
106  * @param[out] stMsgData TR-069 Host interface message request.
107  *
108  * @return Returns 0 on success, otherwise will return the appropriate error code.
109  */
111 
112  /**
113  * @brief Get the status of the wireless end point.
114  *
115  * The status of the wifi end point could be the enumeration of:
116  * - Disabled
117  * - Enabled
118  * - Error_Misconfigured
119  * - Error (OPTIONAL)
120  *
121  * The Error_Misconfigured value indicates that a necessary configuration value is undefined or invalid.
122  * The Error value MAY be used by the CPE to indicate a locally defined error condition.
123  *
124  * @param[out] stMsgData TR-069 Host interface message request.
125  *
126  * @return Returns 0 on success, otherwise will return the appropriate error code.
127  */
129 
130  /**
131  * @brief Get the alias name of the wireless endpoint.
132  *
133  * A non-volatile handle used to reference this instance. Alias provides a
134  * mechanism for an ACS to label this instance for future reference.
135  * An initial unique value MUST be assigned when the CPE creates an instance of
136  * this object.
137  * @param[out] stMsgData TR-069 Host interface message request.
138  *
139  * @return Returns 0 on success, otherwise will return the appropriate error code.
140  */
142 
143  /**
144  * @brief Set the alias name for the wireless endpoint.
145  *
146  * A non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to
147  * label this instance for future reference.
148  * If the CPE supports the Alias-based Addressing feature as defined in [Section 3.6.1/TR-069a4] and
149  * described in [Appendix II/TR-069a4], the following mandatory constraints MUST be enforced:
150  * - Its value MUST NOT be empty.
151  * - Its value MUST start with a letter.
152  * - If its value is not assigned by the ACS, it MUST start with a "cpe-" prefix.
153  * - The CPE MUST NOT change the parameter value.
154  *
155  * @param[out] stMsgData TR-069 Host interface message request.
156  *
157  * @return Returns 0 on success, otherwise will return the appropriate error code.
158  */
160 
161  /**
162  * @brief Set the alias name for the wireless endpoint.
163  *
164  * A non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to
165  * label this instance for future reference.
166  * If the CPE supports the Alias-based Addressing feature as defined in [Section 3.6.1/TR-069a4] and
167  * described in [Appendix II/TR-069a4], the following mandatory constraints MUST be enforced:
168  * - Its value MUST NOT be empty.
169  * - Its value MUST start with a letter.
170  * - If its value is not assigned by the ACS, it MUST start with a "cpe-" prefix.
171  * - The CPE MUST NOT change the parameter value.
172  *
173  * @param[out] stMsgData TR-069 Host interface message request.
174  *
175  * @return Returns 0 on success, otherwise will return the appropriate error code.
176  */
178 
179  /**
180  * @brief Set the value MUST be the path name of a row in the Profile table.
181  * If the referenced object is deleted, the parameter value MUST be set to an empty string.
182  * This is the currently active profile, which specifies the SSID and security settings to be used by the end point.
183  *
184  * @param[out] stMsgData TR-069 Host interface message request.
185  *
186  * @return Returns 0 on success, otherwise will return the appropriate error code.
187  */
189 
190  /*
191  * @brief Get the wireless endpoint reference. The value MUST be the path name of a row in the SSID table.
192  * If the referenced object is deleted, the parameter value MUST be set to an empty string.
193  * SSIDReference is determined based on the Profile.{i}.SSID within the associated ProfileReference)
194  * endpoint profile. SSIDReference MUST be an empty string if ProfileReference is an empty string
195  * (i.e. only when an active profile is assigned can the associated SSID interface be determined).
196  *
197  * @param[out] stMsgData TR-069 Host interface message request.
198  *
199  * @return Returns 0 on success, otherwise will return the appropriate error code.
200  */
202 
203  /*
204  * @brief Get the number of entries in the wireless endpoint Profile table.
205  *
206  * @param[out] stMsgData TR-069 Host interface message request.
207  *
208  * @return Returns 0 on success, otherwise will return the appropriate error code.
209  */
211 
212  /**
213  * @brief Get the data transmit rate in kbps that was most recently used for transmission from the access point
214  * to the end point device.
215  *
216  * @param[out] stMsgData TR-069 Host interface message request.
217  *
218  * @return Returns 0 on success, otherwise will return the appropriate error code.
219  */
221 
222  /**
223  * @brief The data transmit rate in kbps that was most recently used for transmission from the end point
224  * to the access point device.
225  *
226  * @param[out] stMsgData TR-069 Host interface message request.
227  *
228  * @return Returns 0 on success, otherwise will return the appropriate error code.
229  */
231 
232  /**
233  * @brief This function provide an indicator of radio signal strength of the downlink from the
234  * access point to the end point, measured in dBm, as an average of the last 100 packets received from the device..
235  *
236  * @param[out] stMsgData TR-069 Host interface message request.
237  *
238  * @return Returns 0 on success, otherwise will return the appropriate error code.
239  */
241 
242  /**
243  * @brief Get the number of packets that had to be re-transmitted, from the last 100 packets sent
244  * to the access point. Multiple re-transmissions of the same packet count as one.
245  *
246  * @param[out] stMsgData TR-069 Host interface message request.
247  *
248  * @return Returns 0 on success, otherwise will return the appropriate error code.
249  */
251 
252  /** @} */ //End of doxygen tag TR69_HOSTIF_WIFI_ENDPOINT
253 };
254 
255 #endif /* DEVICE_WIFI_ENDPOINT_H_ */
256 
257 /** @} */
258 /** @} */
hostIf_WiFi_EndPoint::set_Device_WiFi_EndPoint_Alias
int set_Device_WiFi_EndPoint_Alias(HOSTIF_MsgData_t *stMsgData)
Set the alias name for the wireless endpoint.
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Enable
int get_Device_WiFi_EndPoint_Enable(HOSTIF_MsgData_t *stMsgData)
Check wethen wifi endpoint is enabled or not.
hostIf_WiFi_EndPoint::set_Device_WiFi_EndPoint_ProfileReference
int set_Device_WiFi_EndPoint_ProfileReference(HOSTIF_MsgData_t *stMsgData)
Set the value MUST be the path name of a row in the Profile table. If the referenced object is delete...
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Alias
int get_Device_WiFi_EndPoint_Alias(HOSTIF_MsgData_t *stMsgData)
Get the alias name of the wireless endpoint.
hostIf_WiFi_EndPoint
Definition: Device_WiFi_EndPoint.h:62
hostIf_main.h
hostIf_main API.
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Stats_LastDataUplinkRate
int get_Device_WiFi_EndPoint_Stats_LastDataUplinkRate(HOSTIF_MsgData_t *stMsgData)
The data transmit rate in kbps that was most recently used for transmission from the end point to the...
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_ProfileNumberOfEntries
int get_Device_WiFi_EndPoint_ProfileNumberOfEntries(HOSTIF_MsgData_t *stMsgData)
Check wethen wifi endpoint is enabled or not.
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Stats_SignalStrength
int get_Device_WiFi_EndPoint_Stats_SignalStrength(HOSTIF_MsgData_t *stMsgData)
This function provide an indicator of radio signal strength of the downlink from the access point to ...
hostIf_WiFi_EndPoint::set_Device_WiFi_EndPoint_Enable
int set_Device_WiFi_EndPoint_Enable(HOSTIF_MsgData_t *stMsgData)
Enables or disables this end point.
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_ProfileReference
int get_Device_WiFi_EndPoint_ProfileReference(HOSTIF_MsgData_t *stMsgData)
Set the alias name for the wireless endpoint.
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Stats_LastDataDownlinkRate
int get_Device_WiFi_EndPoint_Stats_LastDataDownlinkRate(HOSTIF_MsgData_t *stMsgData)
Get the data transmit rate in kbps that was most recently used for transmission from the access point...
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_SSIDReference
int get_Device_WiFi_EndPoint_SSIDReference(HOSTIF_MsgData_t *stMsgData)
Check wethen wifi endpoint is enabled or not.
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Status
int get_Device_WiFi_EndPoint_Status(HOSTIF_MsgData_t *stMsgData)
Get the status of the wireless end point.
hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Stats_Retransmissions
int get_Device_WiFi_EndPoint_Stats_Retransmissions(HOSTIF_MsgData_t *stMsgData)
Get the number of packets that had to be re-transmitted, from the last 100 packets sent to the access...