File tree Expand file tree Collapse file tree 7 files changed +46
-28
lines changed Expand file tree Collapse file tree 7 files changed +46
-28
lines changed Original file line number Diff line number Diff line change 1
- /* CellularStack
1
+ /* CellularInterface
2
2
* Copyright (c) 2015 ARM Limited
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
19
19
20
20
#include " NetworkStack.h"
21
21
22
- /* * CellularStack class
22
+ /* * CellularInterface class
23
23
*
24
24
* Common interface that is shared between ethernet hardware
25
25
*/
26
- class CellularStack : public NetworkStack
26
+ class CellularInterface
27
27
{
28
28
public:
29
29
/* * Start the interface
@@ -40,6 +40,12 @@ class CellularStack : public NetworkStack
40
40
* @return 0 on success, negative error code on failure
41
41
*/
42
42
virtual int disconnect () = 0;
43
+
44
+ /* * Get the local MAC address
45
+ *
46
+ * @return Null-terminated representation of the local MAC address
47
+ */
48
+ virtual const char *get_mac_address () = 0;
43
49
};
44
50
45
51
#endif
Original file line number Diff line number Diff line change 1
- /* EthernetStack
1
+ /* EthernetInterface
2
2
* Copyright (c) 2015 ARM Limited
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
19
19
20
20
#include " NetworkStack.h"
21
21
22
- /* * EthernetStack class
22
+ /* * EthernetInterface class
23
23
*
24
24
* Common interface that is shared between ethernet hardware.
25
25
*/
26
- class EthernetStack : public NetworkStack
26
+ class EthernetInterface
27
27
{
28
28
public:
29
29
/* * Start the interface
@@ -37,6 +37,12 @@ class EthernetStack : public NetworkStack
37
37
* @return 0 on success, negative error code on failure
38
38
*/
39
39
virtual int disconnect () = 0;
40
+
41
+ /* * Get the local MAC address
42
+ *
43
+ * @return Null-terminated representation of the local MAC address
44
+ */
45
+ virtual const char *get_mac_address () = 0;
40
46
};
41
47
42
48
#endif
Original file line number Diff line number Diff line change 1
- /* MeshStack
1
+ /* MeshInterface
2
2
* Copyright (c) 2015 ARM Limited
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
19
19
20
20
#include " NetworkStack.h"
21
21
22
- /* * MeshStack class
22
+ /* * MeshInterface class
23
23
*
24
24
* Common interface that is shared between mesh hardware
25
25
*/
26
- class MeshStack : public NetworkStack
26
+ class MeshInterface
27
27
{
28
28
public:
29
29
/* * Start the interface
@@ -37,6 +37,12 @@ class MeshStack : public NetworkStack
37
37
* @return 0 on success, negative on failure
38
38
*/
39
39
virtual int disconnect () = 0;
40
+
41
+ /* * Get the local MAC address
42
+ *
43
+ * @return Null-terminated representation of the local MAC address
44
+ */
45
+ virtual const char *get_mac_address () = 0;
40
46
};
41
47
42
48
#endif
Original file line number Diff line number Diff line change @@ -77,14 +77,6 @@ enum nsapi_option_t {
77
77
NSAPI_RCVBUF, /* !< Sets recv buffer size */
78
78
};
79
79
80
- /* * Maximum size of MAC address representation
81
- */
82
- #define NSAPI_MAC_SIZE 18
83
-
84
- /* * Maximum number of bytes for MAC address
85
- */
86
- #define NSAPI_MAC_BYTES 6
87
-
88
80
89
81
/* * NetworkStack class
90
82
*
@@ -105,12 +97,6 @@ class NetworkStack
105
97
*/
106
98
virtual const char *get_ip_address () = 0;
107
99
108
- /* * Get the local MAC address
109
- *
110
- * @return Null-terminated representation of the local MAC address
111
- */
112
- virtual const char *get_mac_address () = 0;
113
-
114
100
/* * Translates a hostname to an IP address
115
101
*
116
102
* The hostname may be either a domain name or an IP address. If the
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ int Socket::close()
52
52
if (!_socket) {
53
53
return 0 ;
54
54
}
55
-
55
+
56
56
_iface->socket_attach (_socket, 0 , 0 );
57
-
57
+
58
58
void *volatile socket = _socket;
59
59
_socket = 0 ;
60
60
return _iface->socket_close (socket);
Original file line number Diff line number Diff line change 28
28
*/
29
29
#define NSAPI_IP_BYTES NSAPI_IPv6_BYTES
30
30
31
+ /* * Maximum size of MAC address representation
32
+ */
33
+ #define NSAPI_MAC_SIZE 18
34
+
35
+ /* * Maximum number of bytes for MAC address
36
+ */
37
+ #define NSAPI_MAC_BYTES 6
38
+
31
39
/* * Enum of IP address versions
32
40
*
33
41
* The IP version specifies the type of an IP address.
Original file line number Diff line number Diff line change 1
- /* WiFiStack
1
+ /* WiFiInterface
2
2
* Copyright (c) 2015 ARM Limited
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -33,11 +33,11 @@ enum nsapi_security_t {
33
33
NSAPI_SECURITY_WPA2, /* !< phrase conforms to WPA2 */
34
34
};
35
35
36
- /* * WiFiStack class
36
+ /* * WiFiInterface class
37
37
*
38
38
* Common interface that is shared between WiFi devices
39
39
*/
40
- class WiFiStack : public NetworkStack
40
+ class WiFiInterface
41
41
{
42
42
public:
43
43
/* * Start the interface
@@ -57,6 +57,12 @@ class WiFiStack : public NetworkStack
57
57
* @return 0 on success, negative error code on failure
58
58
*/
59
59
virtual int disconnect () = 0;
60
+
61
+ /* * Get the local MAC address
62
+ *
63
+ * @return Null-terminated representation of the local MAC address
64
+ */
65
+ virtual const char *get_mac_address () = 0;
60
66
};
61
67
62
68
#endif
You can’t perform that action at this time.
0 commit comments