rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
can_filter.h
Go to the documentation of this file.
1// can_filter.h
2
3#pragma once
4
5#define FILTER_SPECIFIC 0x1FFFFFFF
6#define ANY_BUS -1
7#define NO_CALLBACK -1
8
9struct CanFilter {
10 int32_t Id;
11 int32_t Mask;
12
13 int Bus;
15
16 bool accept(int p_Id) {
17 return (p_Id & this->Mask) == Id;
18 }
19};
20
21// Called when the user script is unloaded, resets any CAN rx filters
22void resetLuaCanRx();
23// Adds a frame ID to listen to
24void addLuaCanRxFilter(int32_t eid, uint32_t mask, int bus, int callback);
25
26CanFilter* getFilterForId(size_t busIndex, int Id);
void addLuaCanRxFilter(int32_t eid, uint32_t mask, int bus, int callback)
CanFilter * getFilterForId(size_t busIndex, int Id)
void resetLuaCanRx()
int32_t Id
Definition can_filter.h:10
int Callback
Definition can_filter.h:14
int32_t Mask
Definition can_filter.h:11
bool accept(int p_Id)
Definition can_filter.h:16