Comments (1)
That looks like JSON output from the examples in tools/
? obuparse is a C library, and intended to be used as such.
As per the doc (https://github.com/dwbuiten/obuparse/blob/master/obuparse.h#L542C40-L542C40), offset
is the OBU's offset into the buffer you pass to obp_get_next_obu()
, not the offset into whole packet. obu_size
is the size excluding the OBU header.
Each call to obp_get_next_obu()
will have a different buffer pointer, so the offset can be the same, as it points to the start of that OBU's data inside the buffer, after the OBU header. You can see that it changes here in the example file: https://github.com/dwbuiten/obuparse/blob/master/tools/obudump.c#L232.
In your example above, the first packet contains:
- OBU of type 2, with size
0
, offset of2
. (It's empty) - OBU of type 1, with size
11
, offset of2
. - OBU of type 6, wiith size
4224
, offset of3
.
2 + 0 + 2 + 11 + 3 + 4224 = 4242.
Example diagram of that packet:
-----------------------------------------------------------------------------------------------------------------------------------------
| Header 1 (2 bytes) | OBU Data 1 (0 bytes) | Header 2 (2 bytes) | OBU Data 2 (11 bytes) | Header 3 (3 bytes) | OBU Data 3 (4224 bytes) |
-----------------------------------------------------------------------------------------------------------------------------------------
from obuparse.
Related Issues (4)
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 obuparse.