Search in sources :

Example 1 with MDNSDiscoveryParticipant

use of org.eclipse.smarthome.config.discovery.mdns.MDNSDiscoveryParticipant in project smarthome by eclipse.

the class MDNSDiscoveryService method scan.

private void scan() {
    for (MDNSDiscoveryParticipant participant : participants) {
        ServiceInfo[] services = mdnsClient.list(participant.getServiceType());
        logger.debug("{} services found for {}", services.length, participant.getServiceType());
        for (ServiceInfo service : services) {
            DiscoveryResult result = participant.createResult(service);
            if (result != null) {
                thingDiscovered(result);
            }
        }
    }
    for (org.eclipse.smarthome.io.transport.mdns.discovery.MDNSDiscoveryParticipant participant : oldParticipants) {
        ServiceInfo[] services = mdnsClient.list(participant.getServiceType());
        logger.debug("{} services found for {}", services.length, participant.getServiceType());
        for (ServiceInfo service : services) {
            DiscoveryResult result = participant.createResult(service);
            if (result != null) {
                thingDiscovered(result);
            }
        }
    }
}
Also used : ServiceInfo(javax.jmdns.ServiceInfo) DiscoveryResult(org.eclipse.smarthome.config.discovery.DiscoveryResult) MDNSDiscoveryParticipant(org.eclipse.smarthome.config.discovery.mdns.MDNSDiscoveryParticipant)

Aggregations

ServiceInfo (javax.jmdns.ServiceInfo)1 DiscoveryResult (org.eclipse.smarthome.config.discovery.DiscoveryResult)1 MDNSDiscoveryParticipant (org.eclipse.smarthome.config.discovery.mdns.MDNSDiscoveryParticipant)1