Kernel Modul for c++ based usb hid driver?

Martin312

New Member
Joined
Sep 12, 2020
Messages
2
Reaction score
0
Credits
34
Hi everyone,
I have got to communicate between a linux system and a battery charger which can receive uart commands over usb to e. g. read or adjust battery charging voltage, read battery temperature, capacity etc.. The thing is that the charger device (icharger X6) is recognized as a HID device, not as Serial port. Luckily, there is a c++ GUI application which can communicate with the device as HID with the Modbus protocol. There is a .cpp source file in this GUI project which contains the necessary connect(), disconnect(), writeRegister(), readRegister() functions. HURREY. It also includes a cpp standard library and two other #pragma libs. Now, as i mentioned, i need this driver to work for linux system. I had the idea to write a Kernel Module. I have seen an example where someone wrote a C based kernel module which could receive parameters from the command line and print them out. Do you think my .cpp hid driver kernel modul would work that way as well? Or do you have any other ideas how i can communicate between the linux system (command line) and the cpp application?
I am asking so stupidly because I don't want to waste time working on something which will definitely not work.
Thank you a lot for your support!
Best Regards, Martin
 


DPSees

New Member
Joined
Jan 19, 2022
Messages
1
Reaction score
0
Credits
7
Hi everyone,
I have got to communicate between a linux system and a battery charger which can receive uart commands over usb to e. g. read or adjust battery charging voltage, read battery temperature, capacity etc.. The thing is that the charger device (icharger X6) is recognized as a HID device, not as Serial port. Luckily, there is a c++ GUI application which can communicate with the device as HID with the Modbus protocol. There is a .cpp source file in this GUI project which contains the necessary connect(), disconnect(), writeRegister(), readRegister() functions. HURREY. It also includes a cpp standard library and two other #pragma libs. Now, as i mentioned, i need this driver to work for linux system. I had the idea to write a Kernel Module. I have seen an example where someone wrote a C based kernel module which could receive parameters from the command line and print them out. Do you think my .cpp hid driver kernel modul would work that way as well? Or do you have any other ideas how i can communicate between the linux system (command line) and the cpp application?
I am asking so stupidly because I don't want to waste time working on something which will definitely not work.
Thank you a lot for your support!
Best Regards, Martin
Did you manage to make any progress with this? I was hoping to do more or less the same thing with an iCharger but am new to ModBus so would love any tips/help/source code to get an idea of how to implement it if possible!
No problem if not though
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Staff online

Members online


Latest posts

Top