Skip to content

Commit

Permalink
import appropriate traits
Browse files Browse the repository at this point in the history
  • Loading branch information
TaKO8Ki committed Apr 26, 2023
1 parent 03861ad commit a08d0bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of https://github.com/SpringQL/SpringQL which is licensed under MIT OR Apache-2.0. See file LICENSE-MIT or LICENSE-APACHE for full license details.

use socketcan::CanFrame;
use socketcan::{CanFrame, EmbeddedFrame, Frame};

use crate::{
api::error::Result,
Expand Down Expand Up @@ -31,7 +31,7 @@ impl CANFrameSourceRow {
let can_frame = self.0;
let mut column_values = ColumnValues::default();

let can_id_value = SqlValue::NotNull(NnSqlValue::UnsignedInteger(can_frame.id()));
let can_id_value = SqlValue::NotNull(NnSqlValue::UnsignedInteger(can_frame.raw_id()));
column_values
.insert(ColumnName::new("can_id".to_string()), can_id_value)
.expect("can_id must not duplicate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::time::Duration;

use anyhow::{anyhow, Context};
use socketcan::{CanFrame, CanSocket, ShouldRetry};
use socketcan::{CanFrame, CanSocket, EmbeddedFrame, Frame, ShouldRetry, Socket};

use crate::{
api::{
Expand Down Expand Up @@ -97,7 +97,7 @@ impl CANSourceReader {
unimplemented!("RTR (remote transmission request) frames are not supported");
} else if frame.is_extended() {
unimplemented!("Extended frame format is not supported");
} else if frame.is_error() {
} else if frame.is_error_frame() {
Err(SpringError::ForeignIo {
source: anyhow!("got a error CAN frame (CAN ID: {})", frame.id()),
foreign_info: ForeignInfo::SocketCAN(self.interface.clone()),
Expand All @@ -124,7 +124,7 @@ mod tests {
let can_id = 1;
let can_data = &[0x00u8, 0x01];

let frame = CANFrame::new(can_id, can_data, false, false).unwrap();
let frame = CanFrame::new(can_id, can_data).unwrap();
let source_row = CANSourceReader::_can_frame_into_row(frame);
let row = SchemalessRow::try_from(source_row).unwrap();

Expand Down

0 comments on commit a08d0bf

Please sign in to comment.