PilotingItfProvider
public protocol PilotingItfProvider
Protocol that provides functions to get piloting interfaces.
-
Gets a piloting interface.
Returns the requested piloting interface or
nil
if the drone doesn’t have the requested piloting interface, or if the piloting interface is not available in the current connection state.Declaration
Swift
func getPilotingItf<Desc>(_ desc: Desc) -> Desc.ApiProtocol? where Desc : PilotingItfClassDesc
Parameters
desc
requested piloting interface. See
PilotingItfs
api for available descriptors instances.Return Value
requested piloting interface
-
Gets a piloting interface and registers an observer notified each time it changes.
If the piloting interface is present, the observer will be called immediately with. If the piloting interface is not present, the observer won’t be called until the piloting interface is added to the drone. If the piloting interface or the drone are removed, the observer will be notified and referenced value is set to
nil
.Declaration
Swift
func getPilotingItf<Desc: PilotingItfClassDesc>(_ desc: Desc, observer: @escaping Ref<Desc.ApiProtocol>.Observer) -> Ref<Desc.ApiProtocol>
Parameters
desc
requested piloting interface. See
PilotingItfs
api for available descriptors instances.observer
observer to notify when the piloting interface changes
Return Value
reference to the requested piloting interface