Hi, a brief update. This should be possible to achieve with the WolfSSL / WolfCrypt open source library which has an Android build. You can find some relevant libraries below & I’ll update my progress on this thread. Basic HomeKit API will eventually follow this pattern:
void setup() {
Bonjour.setUDP( &udp );
Bonjour.begin("particle");
Bonjour.addServiceRecord("particle._hap",
80,
MDNSServiceTCP,
"\x4sf=1\x14id=3C:33:1B:21:B3:00\x6pv=1.0\x04\c#=1\x04s#=1\x4\ff=0\x04sf=1\x0Bmd=particle");
Homekit homekit = Homekit( lightbulbType );
Characterist *light = homekit.newCharacteristic( onSetting );
homekit.begin();
}
void loop() {
Bonjour.run();
TCPClient client = server.available();
if (client) {
homekit.process( client );
uint8_t onOff = light->intValue;
Serial.println("Lightbulb is ", onOff );
if ( onOff ) {
digitalWrite(LED, HIGH); // sets the LED on
}
else {
digitalWrite(LED, LOW); // sets the LED off
}
}
}
HomeKit support will depend on a series of libraries, including a high-level HomeKit controller, UDP based Bonjour networking client, TCP based HTTP parser with Apple specific TLV8 codec, SRP based handshake protocol with Apple specific crypto (all supported within the WolfSSL Crypto library). The low-level Bonjour and TLV8 libraries have been tested on a Photon device. Currently trying to port the WolfSSL library to a Photon.
Main Particle Library:
https://github.com/moflo/homekit-particle
Particle EthernetBonjour Library:
https://github.com/moflo/EthernetBonjourParticle
Particle TLV8 Encoding Library:
https://github.com/moflo/tlv8-particle
WolfSSL Testing:
https://github.com/moflo/homekit-wolfssl-test
Original WolfSSL Library:
https://github.com/wolfSSL/wolfssl