Comments (1)
This is a challenging issue, as far as I can tell, the code in this package is correct and the issue arises with malformed messages and dependent libraries.
The panics appear to be caused by malformed UTC date response and binary application messages - I only care about vessel data, so in my case, I can safely discard these before decoding using the following function.
/// discard UTC date response and binary application payloads before decoding them
pub fn msgfilter(msg: &str) -> Option<&str> {
if &msg.chars().count() >= &15 && &msg[..12] == "!AIVDM,1,1,," {
match &msg[12..13] {
"0" | "1" | "2" | "3" | "A" | "B" => match &msg[14..15] {
";" | "I" | "J" => None,
_ => Some(msg),
},
_ => Some(msg),
}
} else {
Some(msg)
}
}
I imagine not everybody will need the binary application messages, would it make sense to skip these by default with an option to decode?
from nmea-parser.
Related Issues (14)
- Cannot access underlying data HOT 1
- Other NMEA Sentences HOT 2
- Merge revert on 0.8.0 release HOT 2
- Panic when parsing AIS messages HOT 1
- std::error::Errors HOT 1
- Parsed UTC timestamps using local date instead of GPS date HOT 1
- Incorrect shiptype on parse for Tanker and Other
- Fields of some parsed sentece structs are private HOT 1
- Panic when parsing incomplete sentences
- Lon lat inversion in ais vdm type 27
- Extending parser with proprietary sentences HOT 1
- error[E0635]: unknown feature `stdsimd`
- Thoughts on rustfmt HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nmea-parser.