Code Monkey home page Code Monkey logo

Comments (7)

lundmar avatar lundmar commented on May 30, 2024 1

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:

  1. Make meson search for Bonjour mDNS dependency in case of macOS
  2. Likewise, as you have a HAVE_AVAHI you need to introduce e.g. a HAVE_BONJOUR. See:
    #ifdef HAVE_AVAHI
  3. Same place, you simply need to call your implementation of bonjour_discover()
  4. Rename your example main() to bonjour_discover()
  5. Add full list of service types relevant for lxi. There are 5 types. See:
    /* Create the service browsers */
  6. 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().
  7. 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.

lundmar avatar lundmar commented on May 30, 2024 1

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.

lundmar avatar lundmar commented on May 30, 2024 1

@robcarruthers #40 is wrapped up and merged - good job! 👍🏻

from liblxi.

lundmar avatar lundmar commented on May 30, 2024 1

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.

lundmar avatar lundmar commented on May 30, 2024

FYI - for the Bonjour meson check you may find some inspiration here:
https://github.com/postgres/postgres/blob/c5b7f67fcc8c4a01c82660eb0996a3c697fac283/meson.build#L553

from liblxi.

lundmar avatar lundmar commented on May 30, 2024

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.

robcarruthers avatar robcarruthers commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.