0.01.00
Internal-debug-api

Functions

void otPlatDebugUart_printf (const char *fmt,...)
 Standard printf() to the debug uart with no log decoration. More...
 
void otPlatDebugUart_vprintf (const char *fmt, va_list ap)
 Standard vprintf() to the debug uart, with no log decoration. More...
 
void otPlatDebugUart_putchar_raw (int the_byte)
 Platform specific write single byte to Debug Uart This should not perform CR/LF mapping. More...
 
int otPlatDebugUart_kbhit (void)
 Poll/test debug uart if a key has been pressed. More...
 
int otPlatDebugUart_getc (void)
 Poll/Read a byte from the debug uart. More...
 
void otPlatDebugUart_putchar (int the_byte)
 Write byte to the uart, expand cr/lf as need. More...
 
void otPlatDebugUart_puts (const char *s)
 identical to "man 3 puts" - terminates with lf Which is then mapped to cr/lf as required More...
 
void otPlatDebugUart_write_bytes (const uint8_t *pBytes, int nBytes)
 Write N bytes to the UART, mapping cr/lf. More...
 
void otPlatDebugUart_puts_no_nl (const char *s)
 puts() without a terminal newline. More...
 
otError otPlatDebugUart_logfile (const char *filename)
 Some platforms (posix) can log to a file. More...
 

Detailed Description

Function Documentation

§ otPlatDebugUart_getc()

int otPlatDebugUart_getc ( void  )

Poll/Read a byte from the debug uart.

This function MUST be implemented by the platform

Return values
(negative)no data available,
See also
otPlatDebugUart_kbhit()
Return values
(0x00..0x0ff)data byte value

§ otPlatDebugUart_kbhit()

int otPlatDebugUart_kbhit ( void  )

Poll/test debug uart if a key has been pressed.

It would be common to a stub function that returns 0.

This function MUST be implemented by the platform

Return values
zero- nothing ready
nonzero- otPlatDebugUart_getc() will succeed.

§ otPlatDebugUart_logfile()

otError otPlatDebugUart_logfile ( const char *  filename)

Some platforms (posix) can log to a file.

Returns
OT_ERROR_NONE
OT_ERROR_FAILED

Platforms that desire this MUST provide an implementation.

§ otPlatDebugUart_printf()

void otPlatDebugUart_printf ( const char *  fmt,
  ... 
)

Standard printf() to the debug uart with no log decoration.

Parameters
[in]fmtprintf formatter text

This is a debug convenience function that is not intended to be used in anything other then "debug scenarios" by a developer.

lf -> cr/lf mapping is automatically handled via otPlatDebugUart_putchar()

See also
otPlatDebugUart_vprintf() for limitations

This is a WEAK symbol that can easily be overridden as needed.

§ otPlatDebugUart_putchar()

void otPlatDebugUart_putchar ( int  the_byte)

Write byte to the uart, expand cr/lf as need.

A WEAK default implementation is provided that can be overridden as needed.

Parameters
[in]the_bytethe byte to transmit

§ otPlatDebugUart_putchar_raw()

void otPlatDebugUart_putchar_raw ( int  the_byte)

Platform specific write single byte to Debug Uart This should not perform CR/LF mapping.

This function MUST be implemented by the platform

Parameters
[in]the_bytewhat to transmit

§ otPlatDebugUart_puts()

void otPlatDebugUart_puts ( const char *  s)

identical to "man 3 puts" - terminates with lf Which is then mapped to cr/lf as required

A WEAK default implementation is provided that can be overridden as needed.

Parameters
[in]sthe string to print with a lf at the end

§ otPlatDebugUart_puts_no_nl()

void otPlatDebugUart_puts_no_nl ( const char *  s)

puts() without a terminal newline.

see: "man 3 puts", without a adding a terminal lf

Parameters
[in]sthe string to print without a lf at the end

Note, the terminal "lf" mapped to cr/lf via the function otPlatDebugUart_putchar()

§ otPlatDebugUart_vprintf()

void otPlatDebugUart_vprintf ( const char *  fmt,
va_list  ap 
)

Standard vprintf() to the debug uart, with no log decoration.

Parameters
[in]fmtprintf formatter text
[in]apva_list value for print parameters.

Implementation limitation: this formats the text into a purposely small text buffer on the stack, thus long messages may be truncated.

This is a WEAK symbol that can easily be overridden as needed.

For example, some platforms might override this via a non-WEAK symbol because the platform provides a UART_vprintf() like function that can handle an arbitrary length output.

§ otPlatDebugUart_write_bytes()

void otPlatDebugUart_write_bytes ( const uint8_t *  pBytes,
int  nBytes 
)

Write N bytes to the UART, mapping cr/lf.

Parameters
[in]pBytespointer to bytes to transmit.
[in]nByteshow many bytes to transmit.