Device
public class Device
A Device
lists the characteristics of a device.
-
The
See moreField
enum defines the characteristics of a device.Declaration
Swift
public class Field : Hashable
-
Get the list of device models supported by this device.
Declaration
Swift
public func getDeviceModels() -> [String]
Return Value
A list of device model URN.
-
Get the value of the specified
field
or an empty String if the value is unknown.Declaration
Swift
public func getValue(field: Device.Field) -> String
Parameters
field
The field to look for
Return Value
The field value or an empty String.
-
Return whether the device is directly connected to the server or is connected through a gateway.
Declaration
Swift
public func isDirectlyConnected() -> Bool
Return Value
true
if the device is directly connected,false
otherwise. -
Get the device identifier.
Declaration
Swift
public func getId() -> String
Return Value
The device identifier.
-
Return the device metadata. Might be empty.
Declaration
Swift
public func getMetadata() -> [String : String]
Return Value
A map of device metadata
-
Return the value of the metadata field
key
.Declaration
Swift
public func getMetadata(key: String) -> String?
Parameters
key
The metadata key to return.
Return Value
Value for metadata
key
ornil
if not found. -
Return the device’s location.
Declaration
Swift
public func getLocation() -> Location?
Return Value
The device’s location.
-
The
See moreDevice.Location
class describing the location of a device.Declaration
Swift
public class Location