GSDeviceModel

@objcMembers
public class GSDeviceModel : NSObject

Model of a device.

Note

This class is only intended to be used in ObjC. In Swift, use DeviceModel.
  • Internal unique identifier.

    Declaration

    Swift

    public var internalId: Int { get }
  • Internal unique identifier.

    Declaration

    Swift

    public override var description: String { get }
  • Thells whether this device model is a drone.

    Declaration

    Swift

    public func isDrone() -> Bool

    Return Value

    true if the device model is a drone

  • Tells whether this device model is a remote control

    Declaration

    Swift

    public func isRemoteControl() -> Bool

    Return Value

    true if the device model is a remote control

  • Gets the drone raw value of this device model. To use the returned value, you can create a drone model with: Drone.Model(rawValue: self.droneValue())

    Declaration

    Swift

    public func droneValue() -> Int

    Return Value

    the raw value of the drone if isDrone() returns true, negative value otherwise.

  • Gets the remote control raw value of this device model To use the returned value, you can create a remote control model with: RemoteControl.Model(rawValue: self.remoteControlValueValue())

    Declaration

    Swift

    public func remoteControlValue() -> Int

    Return Value

    the raw value of the remote control if isRemoteControl() returns true, negative value otherwise.

  • All known device models.

    Declaration

    Swift

    public static var allDevices: Set<GSDeviceModel> { get }
  • Filters device models that support a given technology.

    Declaration

    Swift

    public static func supportingTechnology(
        models: Set<GSDeviceModel>, technology: DeviceConnectorTechnology) -> Set<GSDeviceModel>

    Parameters

    models

    set of device models to filter

    technology

    technology that must be supported

    Return Value

    a subset of the given device models that support this technology

  • Retrieves a device model by its name.

    Declaration

    Swift

    public static func fromName(_ name: String) -> GSDeviceModel?

    Parameters

    name

    name of the device model to retrieve

    Return Value

    the corresponding GSDeviceModel, or nil if no model with such a name exists

  • Retrieves the internal id of a drone model.

    Declaration

    Swift

    public static func internalIdOf(droneModel: Drone.Model) -> Int

    Parameters

    droneModel

    drone model

    Return Value

    internal id of the drone model

  • Retrieves the internal id of a remote control model.

    Declaration

    Swift

    public static func internalIdOf(remoteControlModel: RemoteControl.Model) -> Int

    Parameters

    remoteControlModel

    remote control model

    Return Value

    internal id of the remote control model

  • Retrieves the description of a drone model.

    Declaration

    Swift

    public static func descriptionOf(droneModel: Drone.Model) -> String

    Parameters

    droneModel

    drone model

    Return Value

    description of the drone model

  • Retrieves the description of a remote control model.

    Declaration

    Swift

    public static func descriptionOf(remoteControlModel: RemoteControl.Model) -> String

    Parameters

    remoteControlModel

    remote control model

    Return Value

    description of the remote control model