cordova-plugin-ssdp
v1.0.0-alpha.1
Published
Discover other devices in the same network. 用udp发现网络内的其他设备
Downloads
5
Readme
cordova-plugin-ssdp
listen
:
ssdp.listen(searchTarget, successCallback, errorCallback)
ex:
ssdp.listen('urn:domain-name:device:deviceType:ver', (message1, message2) => {
console.log('listen success:', message1, message2);
}, (error) => {
console.warn('listen error:', error);
});
search
:
ssdp.search(searchTarget, successCallback, errorCallback)
ex:
ssdp.search('urn:domain-name:device:deviceType:ver', (message) => {
try {
let response = JSON.parse(message);
console.log(response)
} catch (e) {
console.warn(e);
}
}, (error) => {
console.log('search error:', error);
});
Supported Platforms
- Android