SSDPServiceDiscovery

@interface SSDPServiceDiscovery : NSObject

A class for discovering UPnP devices supporting a particular service type in the local network. This class listens for service advertisments on the UPnP multicast address/port and, maintains soft -state e.g. discovered service descriptions. All discovered services are held in an internal services table. Changes in services table membership are notified to a delegate via the SSDPServiceDiscoveryDelegate protocol.

  • Type of UPnP service to discover. See SSDPServiceTypes for appropriate service names

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *serviceType;

    Swift

    var serviceType: String! { get }
  • Network interface to bind internal socket to

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *networkInterface;

    Swift

    var networkInterface: String! { get }
  • A delegate object to receive callbacks

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) id<SSDPServiceDiscoveryDelegate>
        delegate;

    Swift

    unowned(unsafe) var delegate: SSDPServiceDiscoveryDelegate! { get set }
  • Initialisation routines. To start listening to SSDP messages, call start() - parameter: service_type UPnP service type

    Declaration

    Objective-C

    - (id)initWithServiceType:(NSString *)serviceType
                  onInterface:(NSString *)networkInterface;

    Swift

    init!(serviceType: String!, onInterface networkInterface: String!)

    Parameters

    service_type

    UPnP service type

  • Undocumented

    Declaration

    Objective-C

    @interface SSDPServiceDiscovery : NSObject
  • Start listening and handling SSDP messages.

    Declaration

    Objective-C

    - (void)start;

    Swift

    func start()
  • Send an M-Search SSDP message on UPnP multicast address to look for available services

    Declaration

    Objective-C

    - (void)launchSSDPSearch;

    Swift

    func launchSSDPSearch()
    • Stop this component from listening to service advertisements. Also stops ongoing service searches. To resume operations, call start() method.

    Declaration

    Objective-C

    - (void)stop;

    Swift

    func stop()
  • Look for a service in discovered services table. - parameter: usn unique service name, UPnP-stack- generated service name (containing the service GUID) - returns: a SSDPService instance if lookup gets a hit, else nil.

    Declaration

    Objective-C

    - (SSDPService *)serviceLookUp:(NSString *)usn;

    Swift

    func serviceLookUp(_ usn: String!) -> SSDPService!

    Parameters

    usn

    unique service name, UPnP-stack- generated service name (containing the service GUID)

    Return Value

    a SSDPService instance if lookup gets a hit, else nil.

  • Return all discovered services of the specified type - parameter: service_type, String representing the service type. - returns: List of services

    Declaration

    Objective-C

    - (NSArray *)servicesByType:(NSString *)service_type;

    Swift

    func services(byType service_type: String!) -> [Any]!

    Parameters

    service_type,

    String representing the service type.

    Return Value

    List of services

  • Return all discovered services

    Declaration

    Objective-C

    - (NSArray *)getAllServices;

    Swift

    func getAllServices() -> [Any]!
  • Get info about all available network interfaces on the device.

    Declaration

    Objective-C

    + (NSDictionary *)availableNetworkInterfaces;

    Swift

    class func availableNetworkInterfaces() -> [AnyHashable : Any]!