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
Todo List
Global _usbsend (usbdevice *kb, const uchar *messages, int count, const char *file, int line)

A lot of different conditions are combined in this code. Don't think, it is good in every combination...

Check whether this is the same in the macOS variant. It is not dramatic, but if errors occur, it can certainly irritate the devices completely if they receive incomplete data streams. Do we have errors with the messages "Wrote YY bytes (expected 64)" in the system logs? If not, we do not need to look any further.

Global closeusb (usbdevice *kb)
What is not yet comprehensible is the call to updateconnected() BEFORE os_closeusb(). Should that be in the other sequence? Or is updateconnected() not displaying the connected usb devices, but the representation which uinput devices are loaded? Questions about questions ...
Global devmain (usbdevice *kb)

Hope to find the need for dmutex usage later.
Should this function be declared as pthread_t* function, because of the defintion of pthread-create? But void* works also...

readcmd() gets a line, not lines. Have a look on that later.
Is the condition IS_CONNECTED valid? What functions change the condititon for the macro?

Global get_vtable (short vendor, short product)
Is the last point really a good decision and always correct?
Global inputupdate_keys (usbdevice *kb)
If we want to get all keys typed while a macro is played, add the code for it here.
Global Kb::Kb (QObject *parent, const QString &path)
Is adding notify2 to the notifypaths neccessary?
Global Kb::~Kb ()
I don't think, that notifypaths is used somewhere. So why do we have it? If we do not need it, searching for an ununsed notify channel can easy be refactored to a private member function.
Global macro_pt_enqueue ()
find a better exit strategy if no more mem available.
Global os_inputmain (void *context)
This function is a collection of many tasks. It should be divided into several sub-functions for the sake of greater convenience:
Global os_resetusb (usbdevice *kb, const char *file, int line)
it seems that no one wants to try the reset again. But I'v seen it somewhere...
Global os_setupusb (usbdevice *kb)
in these modules a pullrequest is outstanding
Global os_usbsend (usbdevice *kb, const uchar *out_msg, int is_recv, const char *file, int line)
Since the handling of endpoints has already led to problems elsewhere, this implementation is extremely hardware-dependent and critical!
Eg. the new keyboard K95PLATINUMRGB has a version number significantly less than 2.0 - will it run with this implementation?
Global product_str (short product)
There are macros defined in usb.h to detect all the combinations below. the only difference is the parameter: The macros need the kb*, product_str() needs the product ID
Global RebindWidget::applyChanges (const QStringList &keys, bool doUnbind)
There is still a bug in the state machine: If you record a macro in asTyped-mode, switch to another mode and change the vontent of the pteMacroBox manually, then the changes are not saved in the timing buffer. But anyhow, let's do more relevant things...
Global RebindWidget::on_btnClearMacro_clicked ()
I do not know what is the better solution with the delay-buttons in case of clicking clear: Reset the button to the default value or do not touch it? Not clear is ignored.
Global revertusb (usbdevice *kb)

Why is this useful? Are there problems seen with deactivating a device with older fw-version??? Why isn't this an error indicating reason and we return success (0)?

The return value of nk95cmd() is ignored (but sending the ioctl may produce an error and _nk95_cmd will indicate this), instead revertusb() returns success in any case.

Global udevthread
These two thread vasriables seem to be unused: usbtread, udevthread
Global udevthread
These two thread vasriables seem to be unused: usbtread, udevthread
Global usb_add_device (struct udev_device *dev)
So why the hell not a transformation between the string and the short presentation? Lets check if the string representation is used elsewhere.
Global usb_tryreset (usbdevice *kb)
Why does usb_tryreset() hide the information returned from resetusb()? Isn't it needed by the callers?
Global usbmain ()

Why isn't missing of uinput a fatal error?

lae. here the work has to go on...

Global usbmutex
We should have a look why this mutex is never used.