LibGII commands and information events
Name
gii_cmd_event, gii_cmd_nodata_event : LibGII commands and information events
Synopsis
#include <ggi/gii-events.h>
typedef struct {
    GII_EV_COMMON_DATA;
    uint32_t  code;
    uint32_t  seqnum;
} gii_cmd_nodata_event;
#define GII_CMD_DATA_MAX  (248-sizeof(gii_cmd_nodata_event))
typedef struct {
    GII_EV_COMMON_DATA;
    uint32_t  code;
    uint32_t  seqnum;
    uint8_t   data[GII_CMD_DATA_MAX];
} gii_cmd_event;Description
These are used internally either to the application or the kernel. The same event is used for both Command and Information events.
Generated Events
gii_cmd_event is the basic structure for evCommand and evInformation events. It may need to be casted to some other structure (depending on code) to access the data.
Structure Members
- code
- The command or request code. 
- seqnum
- The sequence number of the packet. 
- data
- Provides raw access to the device and/or command specific data. The recipient must not store references to the data. If the data information is needed afterwards, copy it! 
Device information
The use of evCommand is to convey information on a GII device. The command codes are:
- GII_CMDCODE_EVENTLOST
- Input: None.
- Output: Inform that an event was lost due to queue overflow. No data.
 
- GII_CMDCODE_PREFER_ABSPTR / GII_CMDCODE_PREFER_RELPTR
- Input: Tell sources that they should try to generate the prefered ABS/REL pointer events.
- Output: None.
 
- GII_CMDCODE_DEVICE_INFO
- Input: Request device information/capabilities.
- Output: Responds to information request, notify new device or device state change. Data is gii_cmddata_devinfo(3)
 
- GII_CMDCODE_DEVICE_CLOSE
- Input: Tell a device to stop operating (forever). No data.
- Output: Report a device is not available anymore. No data.
 
- GII_CMDCODE_DEVICE_ENABLE / GII_CMDCODE_DEVICE_DISABLE
- Input: Enable/disable a device. No data. A disabled device is still there but does not generate events.
- Output: Confirm device enabling/disabling. No data.
 
- GII_CMDCODE_SET_REGISTER / GII_CMDCODE_GET_REGISTER
- Input: Initiate an io operation on a device register. Data is gii_cmddata_ioreg(3)
- Output: Notify that the io operation is completed or that an error occured if ev.any.error is set. Data is gii_cmddata_ioreg(3)
 
- GII_CMDCODE_REGISTER_INFO
- Input: Request register information. Data is gii_cmddata_reginfo(3) with only number set.
- Output: Notify that the io operation is completed or that an error occured if ev.any.error is set. Data is gii_cmddata_reginfo(3).
 
- GII_CMDCODE_VALUATOR_INFO
- Input: Request valuator information. Data is gii_cmddata_valinfo(3) with only number set.
- Output: Respond to valuator information request. Data is gii_cmddata_valinfo(3).
 
