Skip to content
Minimalistic C library for Apple's HomeKit Accessory Protocol
C C++ Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
Makefile
README.md

README.md

libhap

License: MIT

Minimalist C library for with Apple HomeKit accessories.

Note: This is still in active development, but works well enough for simple accessories such as a light bulb.

External dependencies

  • openssl >= 1.1.1
  • avahi-client

Note: OpenSSL 1.1.1 is relatively new and is only available on releases such as Ubuntu 18.04+, Raspbian Buster, etc.

libhap itself includes these excellent libraries:

Building

make

Running example

./hap

Building (and installing) a library

make solib
sudo make install # Installs in /usr/local

make install PREFIX=/some/other/path # Install in ${PREFIX} instead

Using

The API is documented in src/hap.h

The example in src/main.c contains an example for how to create a simple light-bulb accessory using the hap_light_builb_create() convenience function.

To create more complex accessories, please read Apple's Using the HomeKit Accessory Protocol Specification to understand the relationship between accessories, services and characteristics.

The plan is to add many more convenience functions to ease usage.

Made By

Andreas Smas - https://lonelycoder.com - https://twitter.com/andoma

You can’t perform that action at this time.