Error sending data: hidapi error: IOHIDDeviceSetReport failed: (0xE0005000) unknown error code #749

Open
opened 2025-06-02 05:27:25 -05:00 by aliduchuy-dev97 · 2 comments
aliduchuy-dev97 commented 2025-06-02 05:27:25 -05:00 (Migrated from github.com)

Hi, guys!
I have a problem when sending data to HID devices; it always returns an error: "Error sending data: hidapi error: IOHIDDeviceSetReport failed: (0xE0005000) unknown error code." This error only appears on macOS, while Windows is good.

This is my code:
**use hidapi::HidApi;

fn main() -> Result<(), Box> {
let api = HidApi::new()?;

let device = api.open(0x0909, 0x0053);

println!("Opening device...");

match device {
    Ok(dev) => {
        println!("Device opened successfully");

        let mut report: Vec<u8>= vec![0x00,0x40, 0x01, 0x01];
        report.resize(64, 0);

        println!("Report buffer: {:?}", report);

        println!("Sending report...");

        let result = dev.send_feature_report(&report);

        match result {
            Ok(_) => println!("Data sent successfully"),
            Err(e) => eprintln!("Error sending data: {}", e),
        }

        let mut buf = [0u8; 64];
        let bytes_read = dev.read_timeout(&mut buf, 500); // timeout 5 giây

        match bytes_read {
            Ok(bytes) => println!("Read {} bytes", bytes),
            Err(e) => eprintln!("Error reading data: {}", e),
        }

        
        println!("Device closed successfully");

    }
    Err(e) => {
        eprintln!("Failed to open device: {}", e);
        return Err(Box::new(e));
    }
}


Ok(())

}**

Please help me! Thanks, all.

Hi, guys! I have a problem when sending data to HID devices; it always returns an error: "Error sending data: hidapi error: IOHIDDeviceSetReport failed: (0xE0005000) unknown error code." This error only appears on macOS, while Windows is good. This is my code: **use hidapi::HidApi; fn main() -> Result<(), Box<dyn std::error::Error>> { let api = HidApi::new()?; let device = api.open(0x0909, 0x0053); println!("Opening device..."); match device { Ok(dev) => { println!("Device opened successfully"); let mut report: Vec<u8>= vec![0x00,0x40, 0x01, 0x01]; report.resize(64, 0); println!("Report buffer: {:?}", report); println!("Sending report..."); let result = dev.send_feature_report(&report); match result { Ok(_) => println!("Data sent successfully"), Err(e) => eprintln!("Error sending data: {}", e), } let mut buf = [0u8; 64]; let bytes_read = dev.read_timeout(&mut buf, 500); // timeout 5 giây match bytes_read { Ok(bytes) => println!("Read {} bytes", bytes), Err(e) => eprintln!("Error reading data: {}", e), } println!("Device closed successfully"); } Err(e) => { eprintln!("Failed to open device: {}", e); return Err(Box::new(e)); } } Ok(()) }** Please help me! Thanks, all.
mcuee commented 2025-06-02 06:13:34 -05:00 (Migrated from github.com)

You may want to provide more details about the device, macOS version and hidapi version.

It seems that you are not using hidapi directly but rather a language binding. You will need to mention that as well next time. Usually we will not be able to support the language binding and you need to post your application in C.

You may want to provide more details about the device, macOS version and hidapi version. It seems that you are not using hidapi directly but rather a language binding. You will need to mention that as well next time. Usually we will not be able to support the language binding and you need to post your application in C.
jedahan commented 2026-08-17 12:35:55 -05:00 (Migrated from github.com)

Same issue on macOS 26.5.2 with hidapi 0.15.0

Same issue on macOS 26.5.2 with hidapi 0.15.0
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi#749
No description provided.