System 59

File

system59-0.1/shell.h

#ifndef SHELL_H
#define SHELL_H

#include <linux/input.h>
#include <stdint.h>

enum { SHELL_KEY_BITS_SIZE = (KEY_CNT + 7) / 8 };

enum {
    SHELL_MESSAGE_WELCOME,
    SHELL_MESSAGE_BUFFER_UNLOCKED,
    SHELL_MESSAGE_KEYBOARD_EVENT,
    SHELL_MESSAGE_KEYBOARD_ATTACHED,
    SHELL_MESSAGE_KEYBOARD_DETACHED,
    SHELL_MESSAGE_RESET,
    SHELL_MESSAGE_RESET_COMPLETED,
    SHELL_MESSAGE_SHOW,
};

enum { SHELL_PACKET_SIZE_MAX = 512 };

struct shell_message_welcome {
    uint16_t class;
    uint32_t width;
    uint32_t height;
};

struct shell_message_buffer_unlocked {
    uint16_t class;
};

struct shell_message_keyboard_event {
    uint16_t class;
    uint16_t code;
    int32_t value;
};

struct shell_message_keyboard_attached {
    uint16_t class;
    uint8_t key_bits[SHELL_KEY_BITS_SIZE];
};

struct shell_message_keyboard_detached {
    uint16_t class;
};

struct shell_message_reset {
    uint16_t class;
};

struct shell_message_reset_completed {
    uint16_t class;
};

struct shell_message_show {
    uint16_t class;
};

#endif