Skip to content

Commit

Permalink
Added error 11 to getCanError
Browse files Browse the repository at this point in the history
  • Loading branch information
Bing-Rover committed Sep 27, 2023
1 parent 54e2110 commit 06e96d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/can/ffi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export "package:subsystems/src/generated/can_ffi_bindings.dart";
final nativeLib = CanBindings(DynamicLibrary.open("src/burt_can/burt_can.so"));

/// These values come from the [BurtCanStatus] enum.
String? getCanError(int value) => switch(value) {
String? getCanError(int value) => switch (value) {
1 => null,
2 => "Could not create socket",
3 => "Could not parse interface",
Expand All @@ -22,5 +22,6 @@ String? getCanError(int value) => switch(value) {
8 => "Could not switch to CAN FD",
9 => "Could not write data",
10 => "Could not read data",
11 => "Frame was not fully read",
_ => throw ArgumentError.value(value, "CanStatus", "Unknown CAN status"),
};

0 comments on commit 06e96d0

Please sign in to comment.