Skip to content

2 Writes give "Operation not supported on transport endpoint" #121

@fishrockz

Description

@fishrockz

I was trying to get the examples in https://github.com/alexeden/adafruit-seesaw to work on linux but i kept getting errors

I managed to track down the problem to this MVP example

use embedded_hal::i2c::{Error, I2c, Operation};
use linux_embedded_hal::{Delay, I2CError, I2cdev, i2cdev::core::I2CDevice};

fn main() {
    let mut i2c = I2cdev::new("/dev/i2c-10").unwrap();

    let regester_num: &[u8] = &[0x00, 0x7F];
    let mut data = [0xFF];
    let mut ops = [Operation::Write(regester_num), Operation::Write(&data)];
    i2c.transaction(0x36_u8, &mut ops).unwrap();
}
thread 'main' panicked at crates/rig/src/bin/gps.rs:10:40:
called `Result::unwrap()` on an `Err` value: I2CError { err: Errno(95) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

using https://www.adafruit.com/product/4471 and https://www.adafruit.com/product/5880 but i had the same issue with other i2c peripherals.

95 	EOPNOTSUPP 	Operation not supported on transport endpoint

Please note that a single write of a longer array does not cause the same error.

It should be noted that a single write operation with a longer array does run, let mut ops = [Operation::Write(&[0x00, 0x7F, 0xFF ])]

I cant tell if im doing something wrong or if there is a bug some were.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions