ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
notify.h
Go to the documentation of this file.
1 #ifndef NOTIFY_H
2 #define NOTIFY_H
3 
4 #include "includes.h"
5 #include "device.h"
6 
7 // Note: Lock imutex (see device.h) before accessing notification settings/nodes
8 // The cmd_ functions do this automatically, all others need to be done before
9 
10 // Prints output to a keyboard's notification node. Use nodenumber = -1 to print to all nodes.
11 // Specify a USB mode to print "mode <n>" before the notification. A null mode will not print a number
12 void nprintf(usbdevice* kb, int nodenumber, usbmode* mode, const char* format, ...);
13 
14 // Prints a key's current state to a notification node
15 void nprintkey(usbdevice* kb, int nnumber, int keyindex, int down);
16 // Prints the current indicator state to a notification node (led should be an I_ constant)
17 // MUTEXES: Lock imutex before calling
18 void nprintind(usbdevice* kb, int nnumber, int led, int on);
19 
20 // Enables or disables notification for a key
21 // MUTEXES: Locks imutex during operation. Unlocks on close.
22 void cmd_notify(usbdevice* kb, usbmode* mode, int nnumber, int keyindex, const char* toggle);
23 // Gets info about a particular setting.
24 // MUTEXES: Locks imutex during operation. Unlocks on close.
25 void cmd_get(usbdevice* kb, usbmode* mode, int nnumber, int dummy, const char* setting);
26 
27 // Just for debugging puposes. Should echo the given string to stderr ([I]) and all open notify channels.
28 // At last it does a restart of the daemon
29 void cmd_restart(usbdevice* kb, usbmode* mode, int nnumber, int dummy, const char* content);
30 
31 #endif // NOTIFY_H
void cmd_restart(usbdevice *kb, usbmode *mode, int nnumber, int dummy, const char *content)
Definition: notify.c:225
void nprintf(usbdevice *kb, int nodenumber, usbmode *mode, const char *format,...)
Definition: notify.c:8
void cmd_notify(usbdevice *kb, usbmode *mode, int nnumber, int keyindex, const char *toggle)
Definition: notify.c:61
void cmd_get(usbdevice *kb, usbmode *mode, int nnumber, int dummy, const char *setting)
Definition: notify.c:215
void nprintkey(usbdevice *kb, int nnumber, int keyindex, int down)
Definition: notify.c:35
void nprintind(usbdevice *kb, int nnumber, int led, int on)
Definition: notify.c:43