|
Service Discovery API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--DeviceDescriptor
Metadata about a device
A device is most commonly a computer, but can also be cell phones, media centre consoles and the likes. Objects of this class give you access to meta information about the device, such as a name and description and the URL the device is exposed on.
Devices are exposed in a DeviceList object through the opera.nearbyDevices property.
Each device can run zero or more services, exposed in a ServiceList object in the services property.
| Field Summary | |
String |
description
Human-readable description of this device. |
String |
id
Unique identifier of this device. |
String |
name
Human-readable name of this device. |
int |
OFFLINE
Constant for whether a device is offline. |
int |
ONLINE
Constant for whether a device is online. |
ServiceList |
services
Services running on this device. |
int |
status
The availability status of this device. |
String |
uniteDeviceName
Opera Unite device name for this device. |
String |
uniteUser
Opera Unite username of the owner of this device. |
String |
url
URL this device is exposed on. |
| Constructor Summary | |
DeviceDescriptor()
This class has no public constructor. |
|
| Field Detail |
String description
String id
String name
int OFFLINE
int ONLINE
ServiceList services
If this device is not running any services, the list is empty.
Example:
for ( i = 0, service; device.services[i] i++ )
{
li = list.appendChild(document.createElement('li'));
a = li.appendChild(document.createElement(a));
a.href = service.url;
a.textContent = service.name;
}
int status
Typically whether the device is on- or offline. The value of this property is one of ONLINE or OFFLINE. The list of constants expanded may be included in the future to include statuses like "Busy".
Example:
if ( device.status == device.OFFLINE )
{
widget.showNotification(device.name + ' has been been switched off.');
}
String uniteDeviceName
String uniteUser
String url
Example:
a = document.createElement('a');
a.href = device.url;
a.textContent = device.name
| Constructor Detail |
DeviceDescriptor()
|
Service Discovery API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||