Mictronics / readsb-protobuf

Readsb is a Mode-S/ADSB/TIS decoder for RTLSDR, BladeRF, Modes-Beast and GNS5894 devices. Future development version with protocol buffer storage.
Other
86 stars 24 forks source link

Working towards libreadsb #10

Closed afk11 closed 3 years ago

afk11 commented 3 years ago

I was trying to call some functions from this project from a go application and ran into some issues. The functions I'm interested in are pretty much just decodeModeAMessage and decodeModeSMessage. Then I just want to probe the modesMessage structure that's returned.

Issues I ran into:

This PR is still WIP, but I think it's a start towards separating library code from the application code. Now that things are decoupled from readsb.h, it's more obvious what things depend on. There's still some coupling I'd like to fix between mode_s.c and station.h and the global variable. I also need to test this PR actually solves issues I ran into, but posting to seek feedback on the approach so far

The end goal is to build libreadsb.a so applications can decode messages without having to reimplement it for every language out there

wiseman commented 3 years ago

I love this. Creating a good reusable library could be one of the biggest, most important advances in this domain in years. There's a lot of fragmented effort and work that has to be duplicated by multiple people, multiple times that this could avoid.

afk11 commented 3 years ago

Thanks @wiseman. I can imagine the decode functions are useful to a lot of people, and enabling language bindings is also a big win for this. Kinda funny we know another person porting this library over to rust at the same time..

I just got a function call to decodeModesMessage to work with this branch https://github.com/afk11/airtrack/blob/compile-readsb/demo1090.go

Hopefully this PR is a decent start, or will lead to a discussion about what's required.

afk11 commented 3 years ago

Oh, also :) A library would be brilliant, because I had this PR prepared initially against Mictronics/readsb but realized this is the maintained version now - even though the only difference is in the application layer

Ideally this repo would just submodule in a libreadsb repository or something

Niall7459 commented 3 years ago

Good work on this look forward to the end result

Mictronics commented 3 years ago

Fails to build with any additional build profile enabled.

Mictronics commented 3 years ago

You may consider creating your own project/repo for this.

afk11 commented 3 years ago

I placed some value on doing it here because we'd be dogfooding (using our own code) from the very start, which is a good way to check nothing's going wrong. I see readsb as a viable open source project (not solely maintained by a company) so I'd hoped we could work together on delivering both together - a library that's a solid foundation for these kind of projects, and the readsb application, with databases and so on.

For my personal purposes this branch works for my project so there isn't much more I actually need here. But I'd love to see this repo depend on a pure library, and so future software can target a library as well. I can make a start and see how far I get - what are your thoughts on this in general?

Mictronics commented 3 years ago

...a library that's a solid foundation for these kind of projects, and the readsb application, with databases and so on.

And because of this a library deserves its own project and repo. Taking the existing readsb code as a base, then removing step by step code, which is not needed by a library. e.g. Web application, viewadsb etc.

However, I have no idea how a library should look like.

Mictronics commented 3 years ago

@afk11 @wiseman I close this PR in favor for https://github.com/Mictronics/libreadsb Basic build skeleton exists, needs code :wink:

afk11 commented 3 years ago

Great news :) Thanks a million, I'll take a look this evening!