Comments (7)
Great. I was hoping the sample code would just work.
Yes, mDNS is not lxi or instrument specific. mDNS is a modern way of advertising and discovering any type of network enabled device. The LXI consortium decided to make use of this feature in their newer standards.
With liblxi we typically only fire up the mDNS for as long as we need. You decide how long via the timeout parameter.
I appreciate your effort to try make this work. And yes, Avahi can get a bit long in the tooth with all its async callbacks etc.
I think you basically need to do the following:
- Make meson search for Bonjour mDNS dependency in case of macOS
- Likewise, as you have a HAVE_AVAHI you need to introduce e.g. a HAVE_BONJOUR. See:
Line 40 in 91bb485
- Same place, you simply need to call your implementation of bonjour_discover()
- Rename your example main() to bonjour_discover()
- Add full list of service types relevant for lxi. There are 5 types. See:
Line 196 in 91bb485
- In your example codes resolve_callback() you then call the liblxi service callback with the following information: address, id, service, and port. The callback is passed via the lxi_info_t structure as a parameter to bonjour_discover().
- Use the timeout parameter from bonjour_discover() in the
timeval tv
structure.
I may be forgetting some details but I think that is the gist of it.
from liblxi.
Oh, by the way. I forgot. Regarding your question of long running service discovery. I said we only fire up mDNS for as long as we need via timeout. That is true in a certain sense. To be more precise, Avahi and Bonjour are actually running as background system services always picking up on devices reporting their presence. We simply query e.g. the Avahi daemon for it's latest discoveries and discoveries within the timeout.
This is also the exact reason a contributor failed to implement mDNS for macOS because he tried to implement it as a standalone mDNS mechanism which of course conflicted with the existing Bonjour service. Whichever system one uses, the correct way is to consult the systems mDNS service if any.
from liblxi.
@robcarruthers #40 is wrapped up and merged - good job! 👍🏻
from liblxi.
Thank you - I'm glad you like it.
I do my best to make a clean cut open source solution for instrument automation. I originally created lxi-tools exactly because I couldn't fathom the fact that I had to literally install gigabytes of instrument vendor bloatware just to manage my test instruments. It just seems wrong when it can be made so much simpler and still get the job done.
I'm a sw/hw engineer and I have many colleagues who need the same as I and we agree that stitching together test configuration for your DUT using various vendor components oftentimes becomes quite messy. I see you are an electronics engineer so I expect you know exactly what I'm talking about.
My goal is to try LXI enable my entire test environment. lxi-tools solved the software side of things. There is still stuff to improve like added HiSlip support and maybe even server support to liblxi. However, I'm also working on creating some open source LXI compatible HW so that I can literally do all my testing and interfacing to DUT via LXI compatible devices. Imagine how simple, clean, and flexible your test setup can become when you can do everything via liblxi/lxi-tools.
from liblxi.
FYI - for the Bonjour meson check you may find some inspiration here:
https://github.com/postgres/postgres/blob/c5b7f67fcc8c4a01c82660eb0996a3c697fac283/meson.build#L553
from liblxi.
If you feel like giving a shot at creating a homebrew formula for lxi-tools that would be great. I mean, since you have now added full support for liblxi on mac, it should be low hanging fruit to get lxi-tools running, at least it's command-line tool without the gui.
The gui may also be buildable. Brew has gtk4 etc. but I think I remember vaguely that one component may be missing in brew.
from liblxi.
Agreed, the CLI is an immediate priority fro me as it is needed for several ongoing projects, but the broader objective of extending macOS support for LXI tools should come together quickly, with a brew formula to start.
For me, and I suspect many others, Liblxi stands out as an excellent solution for instrument automation, surpassing many commercial alternatives. I Appreciate your guidance, @lundmar. Your expertise truly shines through!
from liblxi.
Related Issues (20)
- Fresh build on OSX complains about avahi-client being missing HOT 9
- lxi-tools on Raspberry Pi HOT 1
- server code or client code ? HOT 1
- Use alternative RPC library? HOT 1
- Undefined reference error despite linking library HOT 1
- Request: iOS Compatibility HOT 1
- Build help on Ubuntu HOT 1
- Missing liblxi-1.14.tar.xz.asc HOT 2
- Publish mail address of signing public key of liblxi at keys.openpgp.org? HOT 2
- CMake Support HOT 3
- Refactor pthread_timedjoin_np usage? HOT 2
- warning: cast between incompatible function types HOT 1
- lxilua.c needs a change otherwise it may get conflict with other lua "connect" functions. HOT 2
- lib-tools support on windows? HOT 2
- MacOS (arm64) build support HOT 20
- Avahi-client issue when installing from source on Ubuntu 23.04 HOT 7
- gethostbyname() obsolete HOT 2
- liblxi.so should link against libtirpc HOT 1
- lxi_send fails to send more than 1500 Bytes HOT 1
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 liblxi.