File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 sudo apt-get -y install clang gcc-mingw-w64-x86-64 libclang-dev
2020 - name : Build
2121 run : cargo build --verbose --target=x86_64-pc-windows-gnu --features=all
22+ - name : Build Examples
23+ run : cargo build --verbose --target=x86_64-pc-windows-gnu --features=all --examples
Original file line number Diff line number Diff line change 1919 scripts/set_up_vcan.sh
2020 - name : Build
2121 run : cargo build --verbose --features=serde
22+ - name : Build Examples
23+ run : cargo build --verbose --features=serde --examples
2224 - name : Run tests
2325 run : cargo test --features=test-vcan,serde --verbose
Original file line number Diff line number Diff line change 1313 - uses : actions/checkout@v3
1414 - name : Build
1515 run : cargo build --verbose --features=serde
16+ - name : Build Examples
17+ run : cargo build --verbose --features=serde --examples
1618 - name : Run tests
1719 run : cargo test --features=serde --verbose
Original file line number Diff line number Diff line change 1313 - uses : actions/checkout@v3
1414 - name : Build
1515 run : cargo build --verbose --features=all
16+ - name : Build Examples
17+ run : cargo build --verbose --features=all --examples
1618 - name : Run tests
1719 run : cargo test --features=all --verbose
Original file line number Diff line number Diff line change 1+ #[ cfg( all( target_os = "windows" , feature = "vector-xl" ) ) ]
2+ pub async fn run ( ) -> Result < ( ) > {
3+ use automotive:: can:: bitrate:: BitrateBuilder ;
4+ use automotive:: vector:: VectorCan ;
5+ tracing_subscriber:: fmt:: init ( ) ;
6+
7+ let bitrate_cfg = BitrateBuilder :: new :: < VectorCan > ( )
8+ . bitrate ( 500_000 )
9+ . sample_point ( 0.8 )
10+ . data_bitrate ( 2_000_000 )
11+ . data_sample_point ( 0.8 )
12+ . build ( )
13+ . unwrap ( ) ;
14+
15+ let adapter = VectorCan :: new_async ( 0 , & Some ( bitrate_cfg. into ( ) ) ) ?;
16+ let mut stream = adapter. recv ( ) ;
17+
18+ while let Some ( frame) = stream. next ( ) . await {
19+ println ! ( "{:?}" , frame) ;
20+ }
21+
22+ Ok ( ( ) )
23+ }
24+
25+ #[ cfg( all( target_os = "windows" , feature = "vector-xl" ) ) ]
26+ #[ tokio:: main]
27+ async fn main ( ) -> automotive:: Result < ( ) > {
28+ run ( ) . await
29+ }
30+
31+ #[ cfg( not( all( target_os = "windows" , feature = "vector-xl" ) ) ) ]
32+ fn main ( ) {
33+ eprintln ! ( "This example requires Windows and the `vector-xl` feature." ) ;
34+ }
You can’t perform that action at this time.
0 commit comments