File tree Expand file tree Collapse file tree 7 files changed +53
-1
lines changed
cores/arduino/mbed/connectivity
netsocket/include/netsocket Expand file tree Collapse file tree 7 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,13 @@ class STM32_EMAC : public EMAC {
148
148
*/
149
149
virtual void set_memory_manager (EMACMemoryManager &mem_mngr);
150
150
151
+ /* return the status of the interface as integer */
152
+ int get_interface_status () override ;
153
+ /* return true if the interface is in the correct state to transmit */
154
+ bool is_ready_to_tx () override ;
155
+ /* restart only if the interface is in error state */
156
+ void restart () override ;
157
+
151
158
// Called from driver functions
152
159
ETH_HandleTypeDef EthHandle;
153
160
osThreadId_t thread; /* *< Processing thread */
Original file line number Diff line number Diff line change @@ -176,6 +176,17 @@ class EMAC {
176
176
* @param mem_mngr Pointer to memory manager
177
177
*/
178
178
virtual void set_memory_manager (EMACMemoryManager &mem_mngr) = 0;
179
+
180
+ virtual bool is_ready_to_tx () {
181
+ return true ;
182
+ }
183
+
184
+ virtual void restart () {
185
+ }
186
+
187
+ virtual int get_interface_status () {
188
+ return -1 ;
189
+ }
179
190
};
180
191
181
192
Original file line number Diff line number Diff line change @@ -83,6 +83,12 @@ class EMACInterface : public virtual NetworkInterface {
83
83
/* * @copydoc NetworkInterface::disconnect */
84
84
nsapi_error_t disconnect () override ;
85
85
86
+ /* * @copydoc NetworkInterface::get_hostname */
87
+ const char *get_hostname () override ;
88
+
89
+ /* * @copydoc NetworkInterface::set_hostname */
90
+ nsapi_error_t set_hostname (const char *hostname) override ;
91
+
86
92
/* * @copydoc NetworkInterface::get_mac_address */
87
93
const char *get_mac_address () override ;
88
94
@@ -146,6 +152,8 @@ class EMACInterface : public virtual NetworkInterface {
146
152
OnboardNetworkStack::Interface *_interface = nullptr ;
147
153
bool _dhcp = true ;
148
154
bool _blocking = true ;
155
+ bool _hostname_set = false ;
156
+ char _hostname[NSAPI_HOSTNAME_SIZE];
149
157
bool _hw_mac_addr_set = false ;
150
158
char _mac_address[NSAPI_MAC_SIZE];
151
159
char _ip_address[NSAPI_IPv6_SIZE] {};
Original file line number Diff line number Diff line change @@ -90,6 +90,22 @@ class NetworkInterface: public DNS {
90
90
*/
91
91
virtual void set_as_default ();
92
92
93
+ /* * Get hostname.
94
+ *
95
+ * @return Hostname if configured, null otherwise
96
+ */
97
+ virtual const char *get_hostname ();
98
+
99
+ /* * Set hostname.
100
+ *
101
+ * @param hostname Hostname string
102
+ * @retval NSAPI_ERROR_OK on success
103
+ * @retval NSAPI_ERROR_UNSUPPORTED if this feature is not supported
104
+ * @retval NSAPI_ERROR_PARAMETER if hostname is not valid
105
+ * @retval NSAPI_ERROR_BUSY if hostname can't be set
106
+ */
107
+ virtual nsapi_error_t set_hostname (const char *hostname);
108
+
93
109
/* * Get the local MAC address.
94
110
*
95
111
* Provided MAC address is intended for info or debug purposes and
Original file line number Diff line number Diff line change @@ -196,6 +196,16 @@ typedef enum nsapi_security {
196
196
*/
197
197
#define NSAPI_IP_BYTES NSAPI_IPv6_BYTES
198
198
199
+ /** Maximum size of hostname
200
+ *
201
+ * According to RFC 1034 [1], Section 3.1 "Name space specifications and
202
+ * terminology", 63 is the maximum size of a hostname. +1 for the string
203
+ * terminator.
204
+ *
205
+ * [1] https://www.rfc-editor.org/rfc/rfc1034
206
+ */
207
+ #define NSAPI_HOSTNAME_SIZE 64
208
+
199
209
/** Maximum size of MAC address representation
200
210
*/
201
211
#define NSAPI_MAC_SIZE 18
Original file line number Diff line number Diff line change 44
44
-DFEATURE_BLE=1
45
45
-D__FPU_PRESENT=1
46
46
-D__MBED__=1
47
- -DMBED_BUILD_TIMESTAMP=1719929630.0019104
47
+ -DMBED_BUILD_TIMESTAMP=1720562782.5913384
48
48
-D__MBED_CMSIS_RTOS_CM
49
49
-DMBED_TICKLESS
50
50
-DMBEDTLS_FS_IO
You can’t perform that action at this time.
0 commit comments