LinuxCNC Documentation

SYNTAX

void rtapi_print(const char* _fmt_, _..._)
void rtapi_print_msg(int level, const char* _fmt_, _..._)
typedef void(**rtapi_msg_handler_t*)(msg_level_t _level_, const char* _msg_);
void rtapi_set_msg_handler(rtapi_msg_handler_t _handler_);
rtapi_msg_handler_t rtapi_get_msg_handler(void);

ARGUMENTE

level

Eine Nachrichtenebene: Eine von RTAPI_MSG_ERR, RTAPI_MSG_WARN, RTAPI_MSG_INFO, or RTAPI_MSG_DBG.

handler

Eine Funktion, die von rtapi_print oder rtapi_print_msg aufgerufen wird, um die Nachricht tatsächlich auszugeben.

fmt, …​

Die übrigen Argumente entsprechen denen von rtapi_vsnprintf(3).

BESCHREIBUNG

rtapi_print and rtapi_print_msg work like the standard C printf functions, except that a reduced set of formatting operations are supported. Notably, formatting long-long values is not supported, and formatting floating-point values has different behavior than standard printf.

Je nach RTOS wird die Meldung standardmäßig auf stdout, stderr, in einem Kernel-Protokoll usw. ausgegeben. Im RTAPI-Code kann die Aktion durch einen Aufruf von rtapi_set_msg_handler geändert werden. Ein NULL-Argument an rtapi_set_msg_handler stellt den Standard-Handler wieder her. rtapi_msg_get_handler gibt den aktuellen Handler zurück. Wenn die Nachricht von rtapi_print kam, ist level RTAPI_MSG_ALL.

rtapi_print_msg works like rtapi_print but only prints if level is less than or equal to the current message level.

REALTIME CONSIDERATIONS

rtapi_print and rtapi_print_msg May be called from non-realtime, init/cleanup, and realtime code. rtapi_get_msg_handler and rtapi_set_msg_handler may be called from realtime init/cleanup code. A message handler passed to rtapi_set_msg_handler may only call functions that can be called from realtime code.

RETURN VALUE

Keinen.

SIEHE AUCH

rtapi_set_msg_level(3), rtapi_get_msg_level(3), rtapi_vsnprintf(3)