Skip to content

Commit

Permalink
rebuild OPTA variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Channel59 committed Jul 9, 2024
1 parent 6d45bb7 commit 74a9a6d
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ class STM32_EMAC : public EMAC {
*/
virtual void set_memory_manager(EMACMemoryManager &mem_mngr);

/* return the status of the interface as integer */
int get_interface_status() override;
/* return true if the interface is in the correct state to transmit */
bool is_ready_to_tx() override;
/* restart only if the interface is in error state */
void restart() override;

// Called from driver functions
ETH_HandleTypeDef EthHandle;
osThreadId_t thread; /**< Processing thread */
Expand Down
11 changes: 11 additions & 0 deletions cores/arduino/mbed/connectivity/netsocket/include/netsocket/EMAC.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ class EMAC {
* @param mem_mngr Pointer to memory manager
*/
virtual void set_memory_manager(EMACMemoryManager &mem_mngr) = 0;

virtual bool is_ready_to_tx() {
return true;
}

virtual void restart() {
}

virtual int get_interface_status() {
return -1;
}
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class EMACInterface : public virtual NetworkInterface {
/** @copydoc NetworkInterface::disconnect */
nsapi_error_t disconnect() override;

/** @copydoc NetworkInterface::get_hostname */
const char *get_hostname() override;

/** @copydoc NetworkInterface::set_hostname */
nsapi_error_t set_hostname(const char *hostname) override;

/** @copydoc NetworkInterface::get_mac_address */
const char *get_mac_address() override;

Expand Down Expand Up @@ -146,6 +152,8 @@ class EMACInterface : public virtual NetworkInterface {
OnboardNetworkStack::Interface *_interface = nullptr;
bool _dhcp = true;
bool _blocking = true;
bool _hostname_set = false;
char _hostname[NSAPI_HOSTNAME_SIZE];
bool _hw_mac_addr_set = false;
char _mac_address[NSAPI_MAC_SIZE];
char _ip_address[NSAPI_IPv6_SIZE] {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ class NetworkInterface: public DNS {
*/
virtual void set_as_default();

/** Get hostname.
*
* @return Hostname if configured, null otherwise
*/
virtual const char *get_hostname();

/** Set hostname.
*
* @param hostname Hostname string
* @retval NSAPI_ERROR_OK on success
* @retval NSAPI_ERROR_UNSUPPORTED if this feature is not supported
* @retval NSAPI_ERROR_PARAMETER if hostname is not valid
* @retval NSAPI_ERROR_BUSY if hostname can't be set
*/
virtual nsapi_error_t set_hostname(const char *hostname);

/** Get the local MAC address.
*
* Provided MAC address is intended for info or debug purposes and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ typedef enum nsapi_security {
*/
#define NSAPI_IP_BYTES NSAPI_IPv6_BYTES

/** Maximum size of hostname
*
* According to RFC 1034 [1], Section 3.1 "Name space specifications and
* terminology", 63 is the maximum size of a hostname. +1 for the string
* terminator.
*
* [1] https://www.rfc-editor.org/rfc/rfc1034
*/
#define NSAPI_HOSTNAME_SIZE 64

/** Maximum size of MAC address representation
*/
#define NSAPI_MAC_SIZE 18
Expand Down
2 changes: 1 addition & 1 deletion variants/OPTA/defines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
-DFEATURE_BLE=1
-D__FPU_PRESENT=1
-D__MBED__=1
-DMBED_BUILD_TIMESTAMP=1719929630.0019104
-DMBED_BUILD_TIMESTAMP=1720562782.5913384
-D__MBED_CMSIS_RTOS_CM
-DMBED_TICKLESS
-DMBEDTLS_FS_IO
Expand Down
Binary file modified variants/OPTA/libs/libmbed.a
Binary file not shown.

0 comments on commit 74a9a6d

Please sign in to comment.