#include "state.h"
#include "name.h"
#include "leds.h"
#include "backlight.h"
#include <unistd.h>
#include <string.h>
Functions | |
struct g13_device_state | g13_device_get_state (g13_device *device) |
Get a state structure for the device. | |
void | g13_device_set_state (g13_device *device, struct g13_device_state *state) |
Set the device parameters according to a state structure. |
struct g13_device_state g13_device_get_state | ( | g13_device * | device | ) | [read] |
Get a state structure for the device.
The state structure returned does not use any dynamic allocations and therefore it does not need to be freed.
Any parameters that cannot be retrieved will be set to zero.
References g13_device_state::b, g13_device_state::error, g13_device_state::g, g13_device_free_keymap(), g13_device_free_name(), g13_device_get_backlight_rgb(), g13_device_get_keymap(), g13_device_get_keymap_index(), g13_device_get_keymap_switching(), g13_device_get_led(), g13_device_get_name(), G13_KEYMAP_SIZE, g13_device_state::keymap, g13_device_state::keymap_index, g13_device_state::keymap_switching, g13_device_state::led, g13_device_state::name, g13_device_state::name_len, and g13_device_state::r.
void g13_device_set_state | ( | g13_device * | device, | |
struct g13_device_state * | state | |||
) |
Set the device parameters according to a state structure.
This function will attempt to set all parameters. If setting one or more parameter results in an error, the remainder of the parameters will still try to be set.
References g13_device_state::b, g13_device_state::g, g13_device_set_backlight_rgb(), g13_device_set_keymap_from_array(), g13_device_set_keymap_index(), g13_device_set_keymap_switching(), g13_device_set_name(), g13_device_state::keymap, g13_device_state::keymap_index, g13_device_state::keymap_switching, g13_device_state::name, g13_device_state::name_len, and g13_device_state::r.