File tree Expand file tree Collapse file tree 1 file changed +37
-34
lines changed
ArduinoCore-Linux/cores/arduino Expand file tree Collapse file tree 1 file changed +37
-34
lines changed Original file line number Diff line number Diff line change 5
5
6
6
/* *
7
7
* @brief We provide the WiFi class to simulate the Arduino WIFI. In in Linux
8
- * we can expect that networking is already active. So we dont need to do anything
9
- *
8
+ * we can expect that networking is already active. So we dont need to do
9
+ * anything
10
+ *
10
11
*/
11
12
12
13
namespace arduino {
13
14
14
15
typedef enum {
15
- WL_NO_SHIELD = 255 ,
16
- WL_IDLE_STATUS = 0 ,
17
- WL_NO_SSID_AVAIL,
18
- WL_SCAN_COMPLETED,
19
- WL_CONNECTED,
20
- WL_CONNECT_FAILED,
21
- WL_CONNECTION_LOST,
22
- WL_DISCONNECTED
16
+ WL_NO_SHIELD = 255 ,
17
+ WL_IDLE_STATUS = 0 ,
18
+ WL_NO_SSID_AVAIL,
19
+ WL_SCAN_COMPLETED,
20
+ WL_CONNECTED,
21
+ WL_CONNECT_FAILED,
22
+ WL_CONNECTION_LOST,
23
+ WL_DISCONNECTED
23
24
} wl_status_t ;
24
-
25
-
25
+
26
26
class WifiMock {
27
- public:
28
- virtual void begin (const char *name, const char * pwd){
29
- // nothing to be done
30
- }
31
-
32
- // we assume the network to be available on a desktop or host machine
33
- wl_status_t status () {
34
- return WL_CONNECTED;
35
- }
36
-
37
- IPAddress &localIP (){
38
- SocketImpl sock;
39
- adress.fromString (sock.getIPAddress ());
40
- return adress;
41
- }
42
-
43
- protected:
44
- IPAddress adress;
45
-
27
+ public:
28
+ virtual void begin (const char *name, const char *pwd) {
29
+ // nothing to be done
30
+ }
31
+
32
+ // we assume the network to be available on a desktop or host machine
33
+ wl_status_t status () { return WL_CONNECTED; }
34
+
35
+ IPAddress &localIP () {
36
+ SocketImpl sock;
37
+ adress.fromString (sock.getIPAddress ());
38
+ return adress;
39
+ }
40
+
41
+ void setSleep (bool ){
42
+ }
46
43
44
+ int macAddress () {
45
+ return mac;
46
+ }
47
+
48
+ protected:
49
+ IPAddress adress;
50
+ int mac = 0 ;
47
51
};
48
-
49
- extern WifiMock WiFi;
50
52
51
- }
53
+ extern WifiMock WiFi;
52
54
55
+ } // namespace arduino
You can’t perform that action at this time.
0 commit comments