Class Discovery

The Discovery class handles discovery and interaction with Sony Alpha Camera's services. It employs UPnP (Universal Plug and Play) for service discovery and interaction.

Hierarchy

  • Discovery

Constructors

Properties

XPushListDetails: undefined | Service
assumedServiceDirectoryUrl: string = 'http://192.168.122.1:64321/dd.xml'
connectionManagerDetails: undefined | Service
contentDirectoryDetails: undefined | Service
digitalImagingDetails: undefined | Service
discoveredServiceDirectoryUrl: string = ''
discoveryAddr: string = '239.255.255.250'
discoveryMessage: Buffer = ...
discoveryPort: number = 1900
parser: XMLParser
serverDetails: string = ''
serverIP: string = '192.168.122.1'
serverPort: string = '64321'
serviceDirectoryObject: undefined | ServiceDirectoryObject = undefined
services: Service[] = []
socket: Socket = ...

Methods

  • Initiates the SSDP (Simple Service Discovery Protocol) process for service discovery.

    Parameters

    • waitFor: number

      The maximum wait time in milliseconds.

    • sendEvery: number

      The interval in milliseconds to send the discovery message.

    Returns Promise<void>

    Returns a promise that resolves when the SSDP process is finished.

    Throws

    Will throw an error if the SSDP process fails or if the camera is not found.

  • Initiates the service discovery process.

    Returns Promise<void>

    Returns a promise that resolves when the discovery process is finished.

    Throws

    Will throw an error if the discovery process fails.

  • Private

    Fetches the service directory object.

    Returns Promise<void>

    Returns a promise that resolves when the service directory object is fetched.

    Throws

    Will throw an error if fetching the service directory object fails.

  • Private

    Fetches the service list.

    Returns Promise<void>

    Returns a promise that resolves when the service list is fetched.

    Throws

    Will throw an error if the serviceDirectoryObject is undefined.

  • Sends a HTTP GET request to the provided URL and parses the response as XML.

    Parameters

    • url: string

      The URL to request from.

    Returns Promise<any>

    Returns a promise that resolves with the parsed XML object.

    Throws

    Will throw an error if the XML request fails.

  • Private

    Extracts the server IP and port from the provided URL.

    Parameters

    • url: string

      The URL to extract details from.

    Returns void

  • Private

    Sends a discovery message over the UDP socket.

    Returns Promise<void>

    Returns a promise that resolves when the discovery message is successfully sent.

    Throws

    Will throw an error if sending the discovery message fails.

Generated using TypeDoc