-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set_standard_filter doesn't seem to work #39
Comments
bjh-teleo
changed the title
can't get set_standard_filter to work
set_standard_filter doesn't seem to work
Jul 12, 2023
Came across this #35, could be related. |
Have you tried setting a reject all filter in a higher-numbered slot than your accept filter? That seems to be what I had to do from experimenting. |
No, that is a good idea! I will try that!
…On Fri, Jul 14, 2023 at 7:11 PM David-OConnor ***@***.***> wrote:
Have you tried setting a reject all filter in a higher-numbered slot than
your accept filter? That seems to be what I had to do from experimenting.
—
Reply to this email directly, view it on GitHub
<#39 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXYRBZSCULUUG5PMTUETBLLXQH355ANCNFSM6AAAAAA2H7YIWE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@David-OConnor been a few months and I'm finally getting back to this. Can you share an example for how to set a "reject all" filter? |
pub fn setup_protocol_filters(can: Can_) -> Can_ {
let mut can = can.into_config_mode();
// Node: H7 has up to 64 filters available. This is set up for G4's limitations.
// This `GetNodeInfo` also matches dynamic ID allocation.
let s = ServiceData {
dest_node_id: 0, // 7 bits
req_or_resp: RequestResponse::Request,
};
set_dronecan_filter(
&mut can,
ExtendedFilterSlot::_0,
FrameType::Service(s),
MsgType::GetNodeInfo.id(),
);
set_dronecan_filter(
&mut can,
ExtendedFilterSlot::_1,
FrameType::Message,
MsgType::IdAllocation.id(),
);
set_dronecan_filter(
&mut can,
ExtendedFilterSlot::_2,
FrameType::Service(s),
MsgType::GetSet.id(),
);
set_dronecan_filter(&mut can, ExtendedFilterSlot::_3, FrameType::Service(s), MsgType::Restart.id());
// Place this reject filter in the filal slot, rejecting all messages not explicitly accepted
// by our dronecan ID filters.
let reject_filter = ExtendedFilter::reject_all();
can.set_extended_filter(ExtendedFilterSlot::_7, reject_filter);
can.into_normal()
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to filter for arb ID 0x700 and still receiving all messages when I call
can1.receive0(msg)
later onHave tried this
and this
still receive all can messages
An example would be helpful. I came across this https://github.com/stm32-rs/stm32h7xx-hal/blob/master/examples/can-echo.rs example, but it only shows use of
accept_all_into_fifo0()
The text was updated successfully, but these errors were encountered: