Giter VIP home page Giter VIP logo

Comments (6)

ewilken avatar ewilken commented on August 17, 2024 2

Thanks for your interest! :)

The library is already fully functional except for camera streams.

Gonna add proper docs, examples and a readme explaining the core concepts of the HAP as well as this particular implementation tomorrow and publish the project to crates.io soon.

If you want to dive deeper into how the protocol works you can obtain the full non-commercial specification from Apple's HomeKit developer page. But this library really should abstract quite a lot of the complex parts of it away.

from hap-rs.

laibulle avatar laibulle commented on August 17, 2024

Thanks for the example.

Is there a way to dynamically add devices or should I restart IpTransport every time I add device?

from hap-rs.

ewilken avatar ewilken commented on August 17, 2024

Good point! Dynamically adding/removing devices is a feature that still has to be implemented, as well as a way to persistently associate the AIDs/IIDs.

from hap-rs.

ewilken avatar ewilken commented on August 17, 2024

So I implemented add_accessory() and remove_accessory() methods to add/remove Accessories dynamically. An example is provided in the readme. Let me know if this helps and please feel free to open more specific issues if you run into any quirks or missing features.

from hap-rs.

laibulle avatar laibulle commented on August 17, 2024

Thank you.

Do you have an idea of how I could start the server in a different thread ?

from hap-rs.

ewilken avatar ewilken commented on August 17, 2024

With v0.0.4, the HAP server is now thread-safe. So you can do stuff like this now:

let mut ip_transport = IpTransport::new(Config::default()).unwrap();
ip_transport
    .add_accessory(outlet::new(Information::default()).unwrap())
    .unwrap();

std::thread::spawn(move || {
    ip_transport.start().unwrap();
});

It's still lacking a convenient API for inter-thread operations on the server tho. I'm thinking of overhauling this crate's public API for v0.1 into something like what Actix does (or just integrating Actix).

Closing this for now, as there's no concrete actionability left in this issue.

from hap-rs.

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.