Skip to content

Commit

Permalink
GroundSdk release 7.7.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-dragon committed Jun 7, 2023
1 parent 8734a5c commit 5715ed9
Show file tree
Hide file tree
Showing 27 changed files with 1,695 additions and 608 deletions.
6 changes: 3 additions & 3 deletions GroundSdk.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Pod::Spec.new do |s|
s.name = "GroundSdk"
s.version = "7.6.0"
s.version = "7.7.0-rc1"
s.summary = "Parrot Drone SDK"
s.homepage = "https://developer.parrot.com"
s.license = "{ :type => 'BSD 3-Clause License', :file => 'LICENSE' }"
s.author = 'Parrot Drone SAS'
s.source = { :git => 'https://github.com/Parrot-Developers/pod_groundsdk.git', :tag => "7.6.0" }
s.source = { :git => 'https://github.com/Parrot-Developers/pod_groundsdk.git', :tag => "7.7.0-rc1" }
s.platform = :ios
s.ios.deployment_target = '12.0'
s.source_files = 'GroundSdk/**/*.{swift,h,m}'
s.resources = 'GroundSdk/**/*.{vsh,fsh,txt,png}'
s.dependency 'SdkCore', '7.6.0'
s.dependency 'SdkCore', '7.7.0-rc1'
s.dependency 'SwiftProtobuf', '1.13.0'
s.public_header_files = ["GroundSdk/GroundSdk.h"]
s.swift_version = '5'
Expand Down
2 changes: 2 additions & 0 deletions GroundSdk/Device/Peripheral/Camera2/Camera2ConfigEnums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ public enum Camera2RecordingResolution: String, Camera2ConfigEnum {

/// Camera recording frame rates.
public enum Camera2RecordingFramerate: String, Camera2ConfigEnum {
/// 8.6 fps
case fps9
/// 23.97 fps.
case fps24
/// 25 fps.
Expand Down
56 changes: 56 additions & 0 deletions GroundSdk/Device/Peripheral/Camera2/ThermalCamera2.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Copyright (C) 2023 Parrot Drones SAS
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// * Neither the name of the Parrot Company nor the names
// of its contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.
//

import Foundation

/// Blended Thermal Camera2 peripheral.
///
/// Provides access to the thermal camera2 in order to take pictures and to record videos.
/// Also provides access to various camera2 settings, such as:
/// - Exposure,
/// - EV compensation,
/// - White balance,
/// - Recording mode, resolution and framerate selection,
/// - Photo mode, format and file format selection.
///
/// This peripheral can be retrieved by:
/// ```
/// drone.getPeripheral(Peripherals.thermalCamera2)
/// ```
public protocol BlendedThermalCamera2: Camera2, Peripheral {
}

/// :nodoc:
/// Blended thermal camera 2 description.
public class BlendedThermalCamera2Desc: NSObject, PeripheralClassDesc {
public typealias ApiProtocol = BlendedThermalCamera2
public let uid = PeripheralUid.blendedThermalCamera2.rawValue
public let parent: ComponentDescriptor? = nil
}
6 changes: 6 additions & 0 deletions GroundSdk/Device/Peripheral/Peripheral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class Peripherals: NSObject {
public static let beeper = BeeperDesc()
/// Blended thermal camera peripheral.
public static let blendedThermalCamera = BlendedThermalCameraDesc()
/// Blended thermal camera2 peripheral.
public static let blendedThermalCamera2 = BlendedThermalCamera2Desc()
/// Cellular.
public static let cellular = CellularDesc()
/// Certificate Uploader.
Expand Down Expand Up @@ -156,6 +158,8 @@ public class Peripherals: NSObject {
public static let wifiAccessPoint = WifiAccessPointDesc()
/// Wifi scanner peripheral.
public static let wifiScanner = WifiScannerDesc()
/// Wifi station peripheral.
public static let wifiStation = WifiStationDesc()

// Peripherals reserved for internal use.
/// Latest flight log (FDR) downloader.
Expand All @@ -170,6 +174,7 @@ enum PeripheralUid: Int {
case batteryGaugeUpdater
case beeper
case blendedThermalCamera
case blendedThermalCamera2
case cellular
case certificateUploader
case copilot
Expand Down Expand Up @@ -224,6 +229,7 @@ enum PeripheralUid: Int {
case virtualGamepad
case wifiAccessPoint
case wifiScanner
case wifiStation
}

/// Objective-C wrapper of Ref<Peripheral>. Required because swift generics can't be used from Objective-C.
Expand Down
105 changes: 105 additions & 0 deletions GroundSdk/Device/Peripheral/Wifi/ChannelSetting.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Copyright (C) 2023 Parrot Drones SAS
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// * Neither the name of the Parrot Company nor the names
// of its contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.

import Foundation

/// Wifi access point channel selection mode.
public enum ChannelSelectionMode: Int, CustomStringConvertible {
/// Channel has been selected manually.
case manual
/// Channel has been selected manually.
case auto2_4GhzBand
/// Channel has been selected automatically on the 5 GHz band.
case auto5GhzBand
/// Channel has been selected automatically on either the 2.4 or the 5 Ghz band.
case autoAnyBand

/// Debug description.
public var description: String {
switch self {
case .manual: return "manual"
case .auto2_4GhzBand: return "auto2.4GhzBand"
case .auto5GhzBand: return "auto5GhzBand"
case .autoAnyBand: return "autoAnyBand"
}
}
}

/// Setting providing access to the Wifi access point channel setup.
public protocol ChannelSetting: AnyObject {
/// Tells if the setting value has been changed and is waiting for change confirmation.
var updating: Bool { get }

/// Current selection mode of the access point channel.
var selectionMode: ChannelSelectionMode { get }

/// Set of channels to which the access point may be configured.
var availableChannels: Set<WifiChannel> { get }

/// Access point's current channel.
var channel: WifiChannel { get }

/// Changes the access point current channel.
///
/// - Parameter channel: new channel to use
func select(channel: WifiChannel)

/// Tells whether automatic channel selection on any frequency band is available.
///
/// Some devices, for instance remote controls, don't support auto-selection.
///
/// - Returns: `true` if `autoSelect()` can be called
func canAutoSelect() -> Bool

/// Requests the device to select the most appropriate channel for the access point automatically.
///
/// The device will run its auto-selection process and eventually may change the current channel.
/// The device will also remain in this auto-selection mode, that is, it will run auto-selection to setup
/// the channel on subsequent boots, until the application selects a channel manually (with `select(channel:)`)
func autoSelect()

/// Tells whether automatic channel selection on a given frequency band is available.
///
/// Depending on the country and environment setup, and the currently allowed channels, some auto-selection
/// modes may not be available to the application.
/// Also, some devices, for instance remote controls, don't support auto-selection.
///
/// - Parameter band: the frequency band
/// - Returns: `true` if `autoSelect()` can be called
func canAutoSelect(onBand band: Band) -> Bool

/// Requests the device to select the most appropriate channel for the access point automatically.
///
/// The device will run its auto-selection process and eventually may change the current channel.
/// The device will also remain in this auto-selection mode, that is, it will run auto-selection to setup
/// the channel on subsequent boots, until the application selects a channel manually (with `select(channel:)`)
///
/// - Parameter band: the frequency band on which the automatic selection should be done
func autoSelect(onBand band: Band)
}
66 changes: 66 additions & 0 deletions GroundSdk/Device/Peripheral/Wifi/EnvironmentSetting.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright (C) 2023 Parrot Drones SAS
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// * Neither the name of the Parrot Company nor the names
// of its contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.

import Foundation

/// Wifi indoor/outdoor environment modes.
public enum Environment: Int, CustomStringConvertible, CaseIterable {
/// Wifi is configured for indoor use.
case indoor
/// Wifi is configured for outdoor use.
case outdoor

/// Debug description.
public var description: String {
switch self {
case .indoor: return "indoor"
case .outdoor: return "outdoor"
}
}
}

/// Setting providing access to the Wifi environment setup.
public protocol EnvironmentSetting: AnyObject {

/// Tells if the setting value has been changed and is waiting for change confirmation.
var updating: Bool { get }

/// Tells whether the setting can be altered by the application.
///
/// Depending on the device, the current environment setup may not be changed.
/// For instance, on remote control devices, the environment is hard wired to the currently
/// or most recently connected drone, if any, and cannot be changed by the application.
var mutable: Bool { get }

/// Current environment mode of the access point.
///
/// - Note: Altering this setting may change the set of available channels, and even result in a device
/// disconnection since the channel currently in use might not be allowed with the new environment setup.
var value: Environment { get set }
}
55 changes: 55 additions & 0 deletions GroundSdk/Device/Peripheral/Wifi/SecurityMode.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright (C) 2023 Parrot Drones SAS
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
// * Neither the name of the Parrot Company nor the names
// of its contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// PARROT COMPANY BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE.

import Foundation

/// Wifi security mode.
public enum SecurityMode: Int, CustomStringConvertible, CaseIterable {
/// Connection is allowed without any security check.
case open
/// Connection is secured using WEP authentication and requires a password.
case wepSecured
/// Connection is secured using WPA authentication and requires a password.
case wpaSecured
/// Connection is secured using WPA2 authentication and requires a password.
case wpa2Secured
/// Connection is secured using WPA3 authentication and requires a password.
case wpa3Secured

/// Debug description.
public var description: String {
switch self {
case .open: return "open"
case .wepSecured: return "wep"
case .wpaSecured: return "wpaSecured"
case .wpa2Secured: return "wpa2Secured"
case .wpa3Secured: return "wpa3Secured"
}
}
}
Loading

0 comments on commit 5715ed9

Please sign in to comment.