yocto_wireless.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_wireless.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindWireless(), the high-level API for Wireless functions
6  *
7  * - - - - - - - - - License information: - - - - - - - - -
8  *
9  * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
10  *
11  * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
12  * non-exclusive license to use, modify, copy and integrate this
13  * file into your software for the sole purpose of interfacing
14  * with Yoctopuce products.
15  *
16  * You may reproduce and distribute copies of this file in
17  * source or object form, as long as the sole purpose of this
18  * code is to interface with Yoctopuce products. You must retain
19  * this notice in the distributed source file.
20  *
21  * You should refer to Yoctopuce General Terms and Conditions
22  * for additional information regarding your rights and
23  * obligations.
24  *
25  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
26  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
27  * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
28  * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
29  * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
30  * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
31  * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
32  * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
33  * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
34  * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
35  * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
36  * WARRANTY, OR OTHERWISE.
37  *
38  *********************************************************************/
39 
40 #ifndef YOCTO_WIRELESS_H
41 #define YOCTO_WIRELESS_H
42 
43 #include "yocto_api.h"
44 #include <cfloat>
45 #include <cmath>
46 #include <map>
47 
48 //--- (generated code: YWireless definitions)
49 class YWireless; // forward declaration
50 
51 typedef void (*YWirelessValueCallback)(YWireless *func, const string& functionValue);
52 #ifndef _Y_SECURITY_ENUM
53 #define _Y_SECURITY_ENUM
54 typedef enum {
62 #endif
63 #ifndef _Y_WLANSTATE_ENUM
64 #define _Y_WLANSTATE_ENUM
65 typedef enum {
72 #endif
73 #define Y_LINKQUALITY_INVALID (YAPI_INVALID_UINT)
74 #define Y_SSID_INVALID (YAPI_INVALID_STRING)
75 #define Y_CHANNEL_INVALID (YAPI_INVALID_UINT)
76 #define Y_MESSAGE_INVALID (YAPI_INVALID_STRING)
77 #define Y_WLANCONFIG_INVALID (YAPI_INVALID_STRING)
78 //--- (end of generated code: YWireless definitions)
79 
80 
81 //--- (generated code: YWlanRecord definitions)
82 //--- (end of generated code: YWlanRecord definitions)
83 
84 //--- (generated code: YWlanRecord declaration)
91 #ifdef __BORLANDC__
92 #pragma option push -w-8022
93 #endif
94 //--- (end of generated code: YWlanRecord declaration)
95  //--- (generated code: YWlanRecord attributes)
96  // Attributes (function value cache)
97  string _ssid;
98  int _channel;
99  string _sec;
100  int _rssi;
101  //--- (end of generated code: YWlanRecord attributes)
102  //--- (generated code: YWlanRecord constructor)
103 
104  //--- (end of generated code: YWlanRecord constructor)
105  //--- (generated code: YWlanRecord initialization)
106  //--- (end of generated code: YWlanRecord initialization)
107 
108 public:
109  YWlanRecord(const string& json);
110  //--- (generated code: YWlanRecord accessors declaration)
111 
112 
113  virtual string get_ssid(void);
114 
115  virtual int get_channel(void);
116 
117  virtual string get_security(void);
118 
119  virtual int get_linkQuality(void);
120 
121 #ifdef __BORLANDC__
122 #pragma option pop
123 #endif
124  //--- (end of generated code: YWlanRecord accessors declaration)
125 };
126 
127 
128 
129 
130 //--- (generated code: YWireless declaration)
138 #ifdef __BORLANDC__
139 #pragma option push -w-8022
140 #endif
141 //--- (end of generated code: YWireless declaration)
142  //--- (generated code: YWireless attributes)
143  // Attributes (function value cache)
145  string _ssid;
146  int _channel;
148  string _message;
149  string _wlanConfig;
152 
153  friend YWireless *yFindWireless(const string& func);
154  friend YWireless *yFirstWireless(void);
155 
156  // Function-specific method for parsing of JSON output and caching result
157  virtual int _parseAttr(YJSONObject* json_val);
158 
159  // Constructor is protected, use yFindWireless factory function to instantiate
160  YWireless(const string& func);
161  //--- (end of generated code: YWireless attributes)
162  //--- (generated code: YWireless initialization)
163  //--- (end of generated code: YWireless initialization)
164 
165 public:
166  ~YWireless();
167  //--- (generated code: YWireless accessors declaration)
168 
169  static const int LINKQUALITY_INVALID = YAPI_INVALID_UINT;
170  static const string SSID_INVALID;
171  static const int CHANNEL_INVALID = YAPI_INVALID_UINT;
172  static const Y_SECURITY_enum SECURITY_UNKNOWN = Y_SECURITY_UNKNOWN;
173  static const Y_SECURITY_enum SECURITY_OPEN = Y_SECURITY_OPEN;
174  static const Y_SECURITY_enum SECURITY_WEP = Y_SECURITY_WEP;
175  static const Y_SECURITY_enum SECURITY_WPA = Y_SECURITY_WPA;
176  static const Y_SECURITY_enum SECURITY_WPA2 = Y_SECURITY_WPA2;
177  static const Y_SECURITY_enum SECURITY_INVALID = Y_SECURITY_INVALID;
178  static const string MESSAGE_INVALID;
179  static const string WLANCONFIG_INVALID;
180  static const Y_WLANSTATE_enum WLANSTATE_DOWN = Y_WLANSTATE_DOWN;
181  static const Y_WLANSTATE_enum WLANSTATE_SCANNING = Y_WLANSTATE_SCANNING;
182  static const Y_WLANSTATE_enum WLANSTATE_CONNECTED = Y_WLANSTATE_CONNECTED;
183  static const Y_WLANSTATE_enum WLANSTATE_REJECTED = Y_WLANSTATE_REJECTED;
184  static const Y_WLANSTATE_enum WLANSTATE_INVALID = Y_WLANSTATE_INVALID;
185 
193  int get_linkQuality(void);
194 
195  inline int linkQuality(void)
196  { return this->get_linkQuality(); }
197 
205  string get_ssid(void);
206 
207  inline string ssid(void)
208  { return this->get_ssid(); }
209 
218  int get_channel(void);
219 
220  inline int channel(void)
221  { return this->get_channel(); }
222 
231  Y_SECURITY_enum get_security(void);
232 
234  { return this->get_security(); }
235 
243  string get_message(void);
244 
245  inline string message(void)
246  { return this->get_message(); }
247 
248  string get_wlanConfig(void);
249 
250  inline string wlanConfig(void)
251  { return this->get_wlanConfig(); }
252 
253  int set_wlanConfig(const string& newval);
254  inline int setWlanConfig(const string& newval)
255  { return this->set_wlanConfig(newval); }
256 
278  Y_WLANSTATE_enum get_wlanState(void);
279 
281  { return this->get_wlanState(); }
282 
310  static YWireless* FindWireless(string func);
311 
323  virtual int registerValueCallback(YWirelessValueCallback callback);
325 
326  virtual int _invokeValueCallback(string value);
327 
338  virtual int startWlanScan(void);
339 
352  virtual int joinNetwork(string ssid,string securityKey);
353 
374  virtual int adhocNetwork(string ssid,string securityKey);
375 
394  virtual int softAPNetwork(string ssid,string securityKey);
395 
407  virtual vector<YWlanRecord> get_detectedWlans(void);
408 
409 
410  inline static YWireless* Find(string func)
411  { return YWireless::FindWireless(func); }
412 
420  YWireless *nextWireless(void);
421  inline YWireless *next(void)
422  { return this->nextWireless();}
423 
433  static YWireless* FirstWireless(void);
434  inline static YWireless* First(void)
435  { return YWireless::FirstWireless();}
436 #ifdef __BORLANDC__
437 #pragma option pop
438 #endif
439  //--- (end of generated code: YWireless accessors declaration)
440 };
441 
442 //--- (generated code: YWireless functions declaration)
443 
471 inline YWireless* yFindWireless(const string& func)
472 { return YWireless::FindWireless(func);}
483 { return YWireless::FirstWireless();}
484 
485 //--- (end of generated code: YWireless functions declaration)
486 
487 #endif
Y_SECURITY_enum _security
Y_SECURITY_enum security(void)
string ssid(void)
static const string SSID_INVALID
YWirelessValueCallback _valueCallbackWireless
static const string MESSAGE_INVALID
Y_SECURITY_enum
Y_WLANSTATE_enum _wlanState
#define YAPI_INVALID_UINT
Definition: yocto_api.h:71
YWireless * yFindWireless(const string &func)
static const string WLANCONFIG_INVALID
string wlanConfig(void)
int channel(void)
string _wlanConfig
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
int setWlanConfig(const string &newval)
int linkQuality(void)
static YWireless * First(void)
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
Y_WLANSTATE_enum wlanState(void)
static YWireless * FirstWireless(void)
Y_WLANSTATE_enum
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
YWireless * yFirstWireless(void)
YWireless * next(void)
string message(void)
static YWireless * Find(string func)
void(* YWirelessValueCallback)(YWireless *func, const string &functionValue)
static YWireless * FindWireless(string func)
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563
string _message
string _ssid


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:11