Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
log_backend_net.h File Reference
#include <stdbool.h>
#include <zephyr/net/net_ip.h>

Go to the source code of this file.

Functions

bool log_backend_net_set_addr (const char *addr)
 Allows user to set a server IP address, provided as string, at runtime.
 
bool log_backend_net_set_ip (const struct sockaddr *addr)
 Allows user to set a server IP address, provided as sockaddr structure, at runtime.
 
static void log_backend_net_hostname_set (const char *hostname, size_t len)
 update the hostname
 
const struct log_backendlog_backend_net_get (void)
 Get the net logger backend.
 
void log_backend_net_start (void)
 Start the net logger backend.
 

Function Documentation

◆ log_backend_net_get()

const struct log_backend * log_backend_net_get ( void  )

Get the net logger backend.

This function returns the net logger backend.

Returns
Pointer to the net logger backend.

◆ log_backend_net_hostname_set()

static void log_backend_net_hostname_set ( const char *  hostname,
size_t  len 
)
inlinestatic

update the hostname

This function allows to update the hostname displayed by the logging backend. It will be called by the network stack if the hostname is set with net_hostname_set().

Parameters
hostnamenew hostname as char array.
lenLength of the hostname array.

◆ log_backend_net_set_addr()

bool log_backend_net_set_addr ( const char *  addr)

Allows user to set a server IP address, provided as string, at runtime.

This function allows the user to set an IPv4 or IPv6 address at runtime. It can be called either before or after the backend has been initialized. If it gets called when the net logger backend context is running, it'll release it and create another one with the new address next time process() gets called.

Parameters
addrString that contains the IP address.
Returns
True if parsing could be done, false otherwise.

◆ log_backend_net_set_ip()

bool log_backend_net_set_ip ( const struct sockaddr addr)

Allows user to set a server IP address, provided as sockaddr structure, at runtime.

This function allows the user to set an IPv4 or IPv6 address at runtime. It can be called either before or after the backend has been initialized. If it gets called when the net logger backend context is running, it'll release it and create another one with the new address next time process() gets called.

Parameters
addrPointer to the sockaddr structure that contains the IP address.
Returns
True if address could be set, false otherwise.

◆ log_backend_net_start()

void log_backend_net_start ( void  )

Start the net logger backend.

This function starts the net logger backend.