linklayer / cantact

Drivers and Command Line Interface for CANtact tools
http://cantact.io
MIT License
46 stars 12 forks source link

bitrate can be changed but data_bitrate cannot? #10

Closed brainstorm closed 3 years ago

brainstorm commented 3 years ago

There's a -b bitrate flag, but I'm confused on what data_bitrate actually means ... plus it cannot be changed? Cannot find explanation in docs either.

% ./target/debug/can cfg -h
can-cfg
Set device configurations

USAGE:
    can cfg [FLAGS] [OPTIONS]

FLAGS:
    -d, --disable     Disable this channel
    -f, --fd          Enable CAN-FD mode
    -h, --help        Prints help information
    -l, --loopback    Enable hardware loopback mode
    -m, --monitor     Enable monitor (listen only) mode
    -V, --version     Prints version information

OPTIONS:
    -b, --bitrate <bitrate>    Channel bitrate in bits/second
    -c, --channel <channel>    Channel to configure

% ./target/debug/can cfg -c 0 -b 500000
Channels:
    0 -> Channel { bitrate: 500000, enabled: true, loopback: false, monitor: false, fd: false, data_bitrate: 500000 }
    1 -> Channel { bitrate: 500000, enabled: true, loopback: false, monitor: false, fd: false, data_bitrate: 500000 }

% ./target/debug/can cfg -c 0 -b 250000
Channels:
    0 -> Channel { bitrate: 250000, enabled: true, loopback: false, monitor: false, fd: false, data_bitrate: 500000 }
    1 -> Channel { bitrate: 500000, enabled: true, loopback: false, monitor: false, fd: false, data_bitrate: 500000 }
ericevenchick commented 3 years ago

Fixed by #15 in v0.1.1