Add J1939 decoder
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
import argparse
|
||||||
|
import polars as pl
|
||||||
|
|
||||||
|
def get_j1939_mask() -> pl.Expr:
|
||||||
|
id_int = pl.col("ID").str.to_integer(base=16).cast(pl.UInt32)
|
||||||
|
return (
|
||||||
|
(id_int > 0x7FF) &
|
||||||
|
((id_int & 0x02000000) == 0) &
|
||||||
|
(pl.col("DLC") <= 8)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
Reference in New Issue
Block a user