UserStorage

public protocol UserStorage : Peripheral

User storage.

  • Information about the current media.

    nil if current media is not available.

    Declaration

    Swift

    var mediaInfo: UserStorageMediaInfo? { get }
  • Current physical state of user storage.

    Declaration

    Swift

    var physicalState: UserStoragePhysicalState { get }
  • Current file system state of user storage.

    Declaration

    Swift

    var fileSystemState: UserStorageFileSystemState { get }
  • Available free space on current media, in Bytes. Negative value if not known.

    Declaration

    Swift

    var availableSpace: Int64 { get }
  • Current ability to format the media. ‘true’ if the media can be formatted, otherwise ‘false’

    Declaration

    Swift

    var canFormat: Bool { get }
  • Supported formatting types.

    Declaration

    Swift

    var supportedFormattingTypes: Set<FormattingType> { get }
  • Tells whether a sd card encryption is supported. ‘true’ if the media can be encrypted, otherwise ‘false’

    Declaration

    Swift

    var isEncryptionSupported: Bool { get }
  • Tells whether the card is encrypted

    Declaration

    Swift

    var isEncrypted: Bool { get }
  • Formatting state.

    Declaration

    Swift

    var formattingState: FormattingState? { get }
  • Tells whether media failed being checked without error

    Declaration

    Swift

    var hasCheckError: Bool? { get }
  • Requests a format of the media.

    Should be called only when canFormat is true.

    When formatting starts, the current state becomes .formatting.

    The formatting result is indicated with the transient state .formattingSucceeded, .formattingFailed, or .formattingDenied.

    Declaration

    Swift

    func format(formattingType: FormattingType, newMediaName: String) -> Bool

    Parameters

    formattingType

    type of formatting

    newMediaName

    the new name that should be given to the media. If you pass an empty string, the a default name will be assigned.

    Return Value

    true if the format has been asked, false otherwise.

  • Requests a format of the media. The formatted media will get a default name.

    Should be called only when canFormat is true.

    Note

    If you want to set a name, use format(newMediaName:).

    When formatting starts, the current state becomes .formatting.

    The formatting result is indicated with the transient state .formattingSucceeded, .formattingFailed, or .formattingDenied.

    Declaration

    Swift

    func format(formattingType: FormattingType) -> Bool

    Parameters

    formattingType

    type of formatting for the current media

    Return Value

    true if the format has been asked, false otherwise

  • sdcard uuid.

    Declaration

    Swift

    var uuid: String? { get }
  • Requests a format with encryption of the media. The formatted media will get a default name.

    Should be called only when canFormat is true.

    When formatting starts, the current state becomes .formatting.

    The formatting result is indicated with the transient state .formattingSucceeded, .formattingFailed, or .formattingDenied.

    Declaration

    Swift

    func formatWithEncryption(password: String, formattingType: FormattingType) -> Bool

    Parameters

    password

    password used for encryption

    formattingType

    type of formatting

    Return Value

    true if the format has been asked, false otherwise

  • Requests a format with encryption of the media. The formatted media will get a default name.

    Should be called only when canFormat is true.

    When formatting starts, the current state becomes .formatting.

    The formatting result is indicated with the transient state .formattingSucceeded, .formattingFailed, or .formattingDenied.

    Declaration

    Swift

    func formatWithEncryption(password: String, formattingType: FormattingType, newMediaName: String) -> Bool

    Parameters

    password

    password used for encryption

    formattingType

    type of formatting

    newMediaName

    the new name that should be given to the media. If you pass an empty string, the a default name will be assigned.

    Return Value

    true if the format has been asked, false otherwise

  • Sends the password to the drone to access an encypted sd card.

    Declaration

    Swift

    func sendPassword(password: String, usage: PasswordUsage) -> Bool

    Parameters

    password

    password used to access encrypted card

    usage

    password usage

    Return Value

    true if the password has been sent, false otherwise