Mbed OS Reference
Loading...
Searching...
No Matches
Network interface and other utility functions

Functions

void mbed_mac_address (char *mac)
 This returns a unique 6-byte MAC address, based on the interface UID If the interface is not present, it returns a default fixed MAC address (00:02:F7:F0:00:00) More...
 
MBED_NORETURN void mbed_die (void)
 Cause the mbed to flash the BLOD (Blue LEDs Of Death) sequence. More...
 
void mbed_error_printf (const char *format,...) MBED_PRINTF(1
 Print out an error message. More...
 
void void mbed_error_vprintf (const char *format, va_list arg) MBED_PRINTF(1
 Print out an error message. More...
 
void void void mbed_error_puts (const char *str)
 Print out an error message. More...
 

Detailed Description

Function Documentation

◆ mbed_mac_address()

void mbed_mac_address ( char *  mac)

This returns a unique 6-byte MAC address, based on the interface UID If the interface is not present, it returns a default fixed MAC address (00:02:F7:F0:00:00)

This is a weak function that can be overwritten if you want to provide your own mechanism to provide a MAC address.

Parameters
macA 6-byte array to write the MAC address

◆ mbed_die()

MBED_NORETURN void mbed_die ( void  )

Cause the mbed to flash the BLOD (Blue LEDs Of Death) sequence.

◆ mbed_error_printf()

void mbed_error_printf ( const char *  format,
  ... 
)

Print out an error message.

This is typically called when handling a crash.

Note
Synchronization level: Interrupt safe, as long as the FileHandle::write of the stderr device is. See mbed_error_puts for more information.
This uses an internal 128-byte buffer to format the string, so the output may be truncated. If you need to write a potentially long string, use mbed_error_puts.
Parameters
formatC string that contains data stream to be printed. Code snippets below show valid format.
mbed_error_printf("Failed: %s, file: %s, line %d \n", expr, file, line);
void mbed_error_printf(const char *format,...) MBED_PRINTF(1
Print out an error message.

◆ mbed_error_vprintf()

void void mbed_error_vprintf ( const char *  format,
va_list  arg 
)

Print out an error message.

Similar to mbed_error_printf but uses a va_list.

Note
Synchronization level: Interrupt safe, as long as the FileHandle::write of the stderr device is. See mbed_error_puts for more information.
Parameters
formatC string that contains data stream to be printed.
argVariable arguments list

◆ mbed_error_puts()

void void void mbed_error_puts ( const char *  str)

Print out an error message.

This is typically called when handling a crash.

Unlike mbed_error_printf, there is no limit to the maximum output length. Unlike standard puts, but like standard fputs, this does not append a '
' character.

Note
Synchronization level: Interrupt safe, as long as the FileHandle::write of the stderr device is. The default serial console is safe, either buffered or not. If the console has not previously been initialized, an attempt to use this from interrupt may crash during console initialization. Special handling of mbed_error relaxes various system traps to increase the chance of initialization working.
Parameters
strC string that contains data stream to be printed.