NAME

Protocol::HAP::Bridge - HAP bridge accessory

SYNOPSIS

use Protocol::HAP::Bridge;

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

$bridge->add_bridged_accessory($accessory);

DESCRIPTION

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 LOGGER ARGUMENT

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.

SEE ALSO

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