Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita204c49

Browse files
committed
Added fixes for most public breaking changes
1 parent2df67d2 commita204c49

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

‎src/frame.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
//!
3232
3333
usecrate::{
34-
id::{id_from_raw, id_to_canid_t,CanId,FdFlags,IdFlags},
34+
id::CanId,
3535
CanError,ConstructionError,
3636
};
3737
use embedded_can::{ExtendedId,FrameasEmbeddedFrame,Id,StandardId};
@@ -42,10 +42,12 @@ use std::{
4242
mem::size_of,
4343
{convert::TryFrom, fmt, matches, mem},
4444
};
45+
4546
// TODO: Remove these on the next major ver update.
4647
pubusecrate::id::{
4748
CANFD_BRS,CANFD_ESI,CANFD_MAX_DLEN,CAN_EFF_FLAG,CAN_EFF_MASK,CAN_ERR_FLAG,CAN_ERR_MASK,
48-
CAN_MAX_DLEN,CAN_RTR_FLAG,CAN_SFF_MASK,
49+
CAN_MAX_DLEN,CAN_RTR_FLAG,CAN_SFF_MASK,ERR_MASK_ALL,ERR_MASK_NONE,
50+
FdFlags,IdFlags, id_from_raw, id_to_canid_t, id_is_extended,
4951
};
5052

5153
// ===== can_frame =====

‎src/id.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pub const ERR_MASK_NONE: u32 = 0;
3030

3131
bitflags!{
3232
/// Bit flags in the composite SocketCAN ID word.
33+
#[repr(transparent)]
34+
#[derive(Debug,Clone,Copy,PartialEq,Eq,PartialOrd,Ord,Hash)]
3335
pubstructIdFlags: canid_t{
3436
/// Indicates frame uses a 29-bit extended ID
3537
constEFF =CAN_EFF_FLAG;
@@ -40,6 +42,8 @@ bitflags! {
4042
}
4143

4244
/// Bit flags for the Flexible Data (FD) frames.
45+
#[repr(transparent)]
46+
#[derive(Debug,Clone,Copy,PartialEq,PartialOrd,Ord,Eq,Hash)]
4347
pubstructFdFlags:u8{
4448
/// Bit rate switch (second bit rate for payload data)
4549
constBRS =CANFD_BRSasu8;

‎src/socket.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515
as_bytes, as_bytes_mut,
1616
frame::{can_frame_default, canfd_frame_default,AsPtr},
1717
id::CAN_ERR_MASK,
18-
CanAddr,CanAnyFrame,CanFdFrame,CanFrame,CanRawFrame,IoError,IoErrorKind,IoResult,
18+
CanAnyFrame,CanFdFrame,CanFrame,CanRawFrame,IoError,IoErrorKind,IoResult,
1919
};
2020
use libc::{canid_t, socklen_t,AF_CAN,EINPROGRESS};
2121
use socket2::SockAddr;
@@ -36,6 +36,9 @@ pub use libc::{
3636
CAN_RAW_JOIN_FILTERS,CAN_RAW_LOOPBACK,CAN_RAW_RECV_OWN_MSGS,SOL_CAN_BASE,SOL_CAN_RAW,
3737
};
3838

39+
// TODO: This can be removed on the next major version update
40+
pubusecrate::CanAddr;
41+
3942
/// Check an error return value for timeouts.
4043
///
4144
/// Due to the fact that timeouts are reported as errors, calling `read_frame`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp