Implements a RIP Farm Test Tool as an example usage of the RIP Farm. More...
Data Structures | |
struct | KEYBOARD_EVENT_CTXT |
Structure used by keyboard_event(). It is anonymously passed through the test tool reactor. More... | |
Functions | |
HqBool | process_keyboard_cmd (char *cmdline, struct RF_IFACE_CTXT *iface_ctxt, int *waitms) |
Translates lines of keyboard text into rip farm commands by calling the appropriate rf_send_*() libripfarm interface function. More... | |
void | keyboard_loop (RELAY_KEYBOARD_CTXT *kbd_ctxt) |
Keyboard commands from stdin are monitored and passed to the test tool reactor via relay_keyboard_string. The test tool reactor will direct the command to process_keyboard_cmd(). More... | |
HqBool | relay_keyboard_string (char *str, RELAY_KEYBOARD_CTXT *kbd_ctxt, int *waitms) |
Relays keyboard strings between the keyboard_worker and main UI threads by sending a messages over a ZeroMQ socket to keyboard_event(). More... | |
Variables | |
HqBool | g_reading_script |
Global flag set if reading commands from a script. More... | |
Implements a RIP Farm Test Tool as an example usage of the RIP Farm.
This header file is private. It declares the interface between the source files of the test tool.
Copyright (C) 2023 Global Graphics Software Ltd. All rights reserved. Global Graphics Software Ltd. Confidential Information.
void keyboard_loop | ( | RELAY_KEYBOARD_CTXT * | kbd_ctxt | ) |
Keyboard commands from stdin are monitored and passed to the test tool reactor via relay_keyboard_string. The test tool reactor will direct the command to process_keyboard_cmd().
This function runs in the keyboard_worker thread.
[in] | kbd_ctxt | Anonymous context for passing to relay_keyboard_string(). |
HqBool process_keyboard_cmd | ( | char * | cmdline, |
RF_IFACE_CTXT * | iface_ctxt, | ||
int * | waitms | ||
) |
Translates lines of keyboard text into rip farm commands by calling the appropriate rf_send_*() libripfarm interface function.
Also handles two internal commands to control keyboard_loop(). These two data items will be returned by this function:
This function runs in the main UI thread.
[in] | cmdline | The line of text entered on the keyboard. |
[in] | iface_ctxt | Anonymous context for passing to rf_send_*() functions. |
[out] | waitms | The value of the sleep command, if it were found in this cmdline. The value is reset to 0 for all other commands. |
TRUE | if the exit command was entered on the cmdline |
FALSE | otherwise. |
HqBool relay_keyboard_string | ( | char * | str, |
RELAY_KEYBOARD_CTXT * | kbd_ctxt, | ||
int * | waitms | ||
) |
Relays keyboard strings between the keyboard_worker and main UI threads by sending a messages over a ZeroMQ socket to keyboard_event().
Waits for a reply from keyboard_event() which contains a keyboard_ack_t struct.
This function runs in the keyboard_worker thread.
[in] | str | The keyboard string. |
[in] | kbd_ctxt | The context from keyboard_worker() passed anonymously via keyboard_loop(). |
[out] | waitms | Normally 0. It is the value, in ms, of the delay that keyboard_loop() should wait before accepting the next command. |
TRUE | Normal return value. |
FALSE | IFF the response from keyboard_event() is to exit the test tool. |
|
extern |
Global flag set if reading commands from a script.
This is used to echo the command read, and suppress the UI prompt. NB. Encapsulating this data in non-global data would distract from the example usage of the libripfarm interface.