hs.bonjour.machineServices(target, callback) -> none
target
- a string specifying the target host to query for advertised service typescallback
- a callback function which will be invoked when the service type query has completed. The callback should expect one argument which will either be an array of strings specifying the service types the target is advertising or a string specifying the error that occurred.hs.bonjour.networkServices(callback, [timeout]) -> none
callback
- a callback function which will be invoked when the services query has completed. The callback should expect one argument: an array of strings specifying the service types discovered on the local network.timeout
- an optional number, default 5, specifying the maximum number of seconds after the most recently received service type Hammerspoon should wait trying to identify advertised service types before finishing its query and invoking the callback.findServices
and returns them all at once to the callback function provided as an argument to this function.hs.bonjour.new() -> browserObject
hs.bonjour:findBrowsableDomains(callback) -> browserObject
callback
- a function which will be invoked as visible domains are discovered. The function should accept the following parameters and return none:browserObject
- the userdata object for the browserObject which initiated the searchtype
- a string which will be 'domain' or 'error'type
== 'domain', the remaining arguments will be:added
- a boolean value indicating whether this callback invocation represents a newly discovered or added domain (true) or that the domain has been removed from the network (false)domain
- a string specifying the name of the domain discovered or removedmoreExpected
- a boolean value indicating whether or not the browser expects to discover additional domains or not.type
== 'error', the remaining arguments will be:errorString
- a string specifying the error which has occurredhs.bonjour:findRegistrationDomains(callback) -> browserObject
callback
- a function which will be invoked as domains are discovered. The function should accept the following parameters and return none:browserObject
- the userdata object for the browserObject which initiated the searchtype
- a string which will be 'domain' or 'error'type
== 'domain', the remaining arguments will be:added
- a boolean value indicating whether this callback invocation represents a newly discovered or added domain (true) or that the domain has been removed from the network (false)domain
- a string specifying the name of the domain discovered or removedmoreExpected
- a boolean value indicating whether or not the browser expects to discover additional domains or not.type
== 'error', the remaining arguments will be:errorString
- a string specifying the error which has occurredhs.bonjour:findServices(type, [domain], [callback]) -> browserObject
type
- a string specifying the type of service to discover on your network. This string should be specified in the format of '_service._protocol.' where _protocol is one of '_tcp' or '_udp'. Examples of common service types can be found in hs.bonjour.serviceTypes.domain
- an optional string specifying the domain to look for advertised services in. The domain should end with a period. If you omit this parameter, the default registration domain will be used, usually "local."callback
- a callback function which will be invoked as service advertisements meeting the specified criteria are discovered. The callback function should expect 2-5 arguments as follows:hs.bonjour.service
)type
in domain
by marking the last argument to your callback function as false. This is a best guess and may not always be accurate if your network is slow or some servers on your network are particularly slow to respond.hs.bonjour:includesPeerToPeer([value]) -> current value | browserObject
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Get or set whether to also browse over peer-to-peer Bluetooth and Wi-Fi, if available. | | Parameters |value
- an optional boolean, default false, value specifying whether to also browse over peer-to-peer Bluetooth and Wi-Fi, if available.value
is provided, returns the browserObject; otherwise returns the current value for this propertyhs.bonjour:stop() -> browserObject