@@ -28,110 +28,129 @@ class MbedSocketClass {
28
28
void config (IPAddress local_ip);
29
29
30
30
/* Change Ip configuration settings disabling the dhcp client
31
- *
32
- * param local_ip: Static ip configuration as string
33
- */
31
+ *
32
+ * param local_ip: Static ip configuration as string
33
+ */
34
34
void config (const char * local_ip);
35
35
36
36
/* Change Ip configuration settings disabling the dhcp client
37
- *
38
- * param local_ip: Static ip configuration
39
- * param dns_server: IP configuration for DNS server 1
40
- */
37
+ *
38
+ * param local_ip: Static ip configuration
39
+ * param dns_server: IP configuration for DNS server 1
40
+ */
41
41
void config (IPAddress local_ip, IPAddress dns_server);
42
42
43
43
/* Change Ip configuration settings disabling the dhcp client
44
- *
45
- * param local_ip: Static ip configuration
46
- * param dns_server: IP configuration for DNS server 1
47
- * param gateway : Static gateway configuration
48
- */
44
+ *
45
+ * param local_ip: Static ip configuration
46
+ * param dns_server: IP configuration for DNS server 1
47
+ * param gateway : Static gateway configuration
48
+ */
49
49
void config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway);
50
50
51
51
/* Change Ip configuration settings disabling the dhcp client
52
- *
53
- * param local_ip: Static ip configuration
54
- * param dns_server: IP configuration for DNS server 1
55
- * param gateway: Static gateway configuration
56
- * param subnet: Static Subnet mask
57
- */
52
+ *
53
+ * param local_ip: Static ip configuration
54
+ * param dns_server: IP configuration for DNS server 1
55
+ * param gateway: Static gateway configuration
56
+ * param subnet: Static Subnet mask
57
+ */
58
58
void config (IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet);
59
59
60
60
// When using DHCP the hostname provided will be used.
61
61
int setHostname (const char * hostname);
62
62
63
63
/* Change DNS Ip configuration
64
- *
65
- * param dns_server1: ip configuration for DNS server 1
66
- */
64
+ *
65
+ * param dns_server1: ip configuration for DNS server 1
66
+ */
67
67
void setDNS (IPAddress dns_server1);
68
68
69
69
/* Change DNS Ip configuration
70
- *
71
- * param dns_server1: ip configuration for DNS server 1
72
- * param dns_server2: ip configuration for DNS server 2
73
- *
74
- */
70
+ *
71
+ * param dns_server1: ip configuration for DNS server 1
72
+ * param dns_server2: ip configuration for DNS server 2
73
+ *
74
+ */
75
75
void setDNS (IPAddress dns_server1, IPAddress dns_server2);
76
76
77
77
/*
78
- * Get the interface IP address.
79
- *
80
- * return: Ip address value
81
- */
78
+ * Get the interface IP address.
79
+ *
80
+ * return: Ip address value
81
+ */
82
82
IPAddress localIP ();
83
83
84
84
/*
85
- * Get the interface subnet mask address.
86
- *
87
- * return: subnet mask address value
88
- */
85
+ * Get the interface subnet mask address.
86
+ *
87
+ * return: subnet mask address value
88
+ */
89
89
IPAddress subnetMask ();
90
90
91
91
/*
92
- * Get the gateway ip address.
93
- *
94
- * return: gateway ip address value
95
- */
92
+ * Get the gateway ip address.
93
+ *
94
+ * return: gateway ip address value
95
+ */
96
96
IPAddress gatewayIP ();
97
97
98
98
/*
99
- * Get the DNS Server ip address.
100
- *
101
- * return: DNS Server ip address value
102
- */
99
+ * Get the DNS Server ip address.
100
+ *
101
+ * return: DNS Server ip address value
102
+ */
103
103
IPAddress dnsServerIP ();
104
104
105
105
/*
106
- * Get the DNS Server ip address.
107
- *
108
- * return: DNS Server ip address value
109
- */
106
+ * Get the DNS Server ip address.
107
+ *
108
+ * return: DNS Server ip address value
109
+ */
110
110
IPAddress dnsIP (int n = 0 );
111
111
112
112
virtual NetworkInterface* getNetwork () = 0;
113
-
113
+
114
114
/*
115
- * Download a file from an HTTP endpoint and save it in the provided `target` location on the fs
116
- * The parameter cbk can be used to perform actions on the buffer before saving on the fs
117
- *
118
- * return: on success the size of the downloaded file, on error -status code
119
- */
115
+ * Download a file from an HTTP endpoint and save it in the provided `target` location on the fs
116
+ * The parameter cbk can be used to perform actions on the buffer before saving on the fs
117
+ *
118
+ * return: on success the size of the downloaded file, on error -status code
119
+ */
120
120
int download (
121
121
const char * url, const char * target, bool const is_https = false );
122
122
/*
123
- * Download a file from an HTTP endpoint and handle the body of the request on a callback
124
- * passed as an argument
125
- *
126
- * return: on success the size of the downloaded file, on error -status code
127
- */
123
+ * Download a file from an HTTP endpoint and handle the body of the request on a callback
124
+ * passed as an argument
125
+ *
126
+ * return: on success the size of the downloaded file, on error -status code
127
+ */
128
128
int download (
129
129
const char * url, bool const is_https = false ,
130
130
mbed::Callback<void (const char *, uint32_t )> cbk = nullptr);
131
131
132
132
int hostByName (const char * aHostname, IPAddress& aResult);
133
133
134
+ /*
135
+ * Get the interface MAC address.
136
+ *
137
+ * Network interface should be ready to get a valid mac address.
138
+ * Call WiFi.begin("",""); or Ethernet.begin(); before issuing a mac address
139
+ * request, otherwhise returned value will be ff:ff:ff:ff:ff:ff
140
+ *
141
+ * return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH
142
+ */
134
143
uint8_t * macAddress (uint8_t * mac);
144
+
145
+ /*
146
+ * Get the interface MAC address String.
147
+ *
148
+ * Network interface should be ready to get a valid MAC address.
149
+ * Call WiFi.begin("",""); or Ethernet.begin(); before issuing a mac address
150
+ * request, otherwhise returned value will be ff:ff:ff:ff:ff:ff
151
+ *
152
+ * return: MAC Address String
153
+ */
135
154
String macAddress ();
136
155
137
156
void setFeedWatchdogFunc (voidFuncPtr func);
0 commit comments