Structs

struct LibMK_Instruction

Single instruction that can be executed by a controller.

An instruction should not be executed multiple times. An instruction is bound to a specific controller as its id attribute is bound to the linked list of instructions of a controller.

Public Members

unsigned char c

LIBMK_INSTR_SINGLE, row and column coords.

unsigned char *colors

LIBMK_INSTR_ALL, key color matrix.

unsigned char color[3]

LIBMK_INSTR_SINGLE, LIBMK_INSTR_FULL.

unsigned int duration

Delay after execution of instruction.

unsigned int id

ID number set by the scheduler.

struct LibMK_Instruction *next

Linked list attribute.

LibMK_Instruction_Type type

For the instruction execution.

struct LibMK_Controller

Controller for a keyboard managing a single handle.

Access to the various attributes of the Controller is protected by mutexes and the attributes of the controller should therefore not be accessed directly.

Public Members

LibMK_Handle *handle

Handle of the keyboard to control.

LibMK_Instruction *instr

Linked list of instructions.

pthread_mutex_t instr_lock

Protects LibMK_Instruction* instr.

pthread_t thread

Thread for libmk_run_controller.

pthread_mutex_t exit_flag_lock

Protects bool exit_flag and wait_flag.

bool exit_flag

Exit event: Thread exits immediately.

bool wait_flag

Wait event: Thread exits when all instructions are done.

pthread_mutex_t state_lock

Protects LibMK_Controller_State state.

LibMK_Controller_State state

Stores current state of controller.

pthread_mutex_t error_lock

Protects LibMK_Result error.

LibMK_Result error

Set for LIBMK_STATE_ERROR.