Comments (6)
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.
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.
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.
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.
Thank you.
Do you have an idea of how I could start the server in a different thread ?
from hap-rs.
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)
- Codegen for macOS 12
- Upgrade to Rust 2021
- Re-check whether deferring the `ControllerPaired` event emission is a good idea
- Creating custom characteristics, services & accessories HOT 4
- make API easier to use with concurrent programs HOT 1
- Battery's `charging_state` and `battery_level` characteristics are defined as optional even though they're required. HOT 3
- Status of this crate HOT 4
- FnMut instead of Fn for on_update_async HOT 1
- IOS Home App does not see accessories any longer HOT 1
- Raspbian speed HOT 2
- Multiple instances with same service HOT 2
- Value Type check for Characteristics HOT 2
- IOS Home App not showing accessory details HOT 2
- Pairing and Performance HOT 1
- Split up, or feature-gate HAP types vs other concepts (servers, storage, transport) HOT 1
- Issues Pairing
- How to pair with Apple Home app? HOT 1
- Examples are no longer working HOT 1
- Transport upgrade
- Crate status HOT 2
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 hap-rs.