Protocol::HAP::Bridge(3p) Perl Library Manual Protocol::HAP::Bridge(3p)

Protocol::HAP::Bridge - HAP bridge accessory

    use Protocol::HAP::Bridge;
    my $bridge = Protocol::HAP::Bridge->new(
        name => 'My Home Bridge',
    );
    $bridge->add_bridged_accessory($accessory);

This module supplies the HAP bridge. The bridge can hold many bridged accessories. The bridge accessory holds the necessary AccessoryInformation and ProtocolInformation services. Bridged accessories hold only the AccessoryInformation service.

The bridge forwards change notifications from bridged accessories to its own event callbacks. Each notification keeps the aid of the source accessory. Thus the server can send EVENT/1.0 notifications for changes on the device side.

The constructor takes an optional "logger" argument: an object with "debug", "info", "warning", and "error" methods that take printf-style arguments. The default is the null logger of Protocol::HAP. The bridge passes its logger to its own ProtocolInformation service. "add_bridged_accessory" never touches the logger of an accessory it receives.

Protocol::HAP, Protocol::HAP::Accessory, spec/HAP.md, spec/HAP-Categories.md

2026-08-18 OpenBSD