djiuser_xvTmPyn1HtzQ
lvl.1
Australia
Offline
|
I am getting an error REQUEST_HANDLER_NOT_FOUND using the Windows SDK.
I have a basic page with one button on it.
Here is my simple code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using DJI.WindowsSDK.Components;
using DJI.WindowsSDK;
using System.Threading.Tasks;
namespace TestApp
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
DJISDKManager.Instance.SDKRegistrationStateChanged += Instance_SDKRegistrationEvent;
DJISDKManager.Instance.RegisterApp("xxxxxxxxxxxxxxx"); // my real key goes here
}
private void Instance_SDKRegistrationEvent(SDKRegistrationState state, SDKError resultCode)
{
System.Diagnostics.Debug.WriteLine("Registration: " + resultCode.ToString()); // NO_ERROR is printed to the debug window, so this seems ok.
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var handler = DJISDKManager.Instance.ComponentManager.GetBatteryHandler(0, 0);
var voltageResult = handler.GetVoltageAsync();
} // break point set on this line
}
}
Setting a break point after GetVoltageAsync gives me the following output in Intermediate window:
voltageResult
Id = 16, Status = RanToCompletion, Method = "{null}", Result = "DJI.WindowsSDK.ResultValue`1[System.Nullable`1[DJI.WindowsSDK.IntMsg]]"
AsyncState: null
CancellationPending: false
CreationOptions: None
Exception: null
Id: 16
Result: {DJI.WindowsSDK.ResultValue<DJI.WindowsSDK.IntMsg?>}
Status: RanToCompletion
voltageResult.Result
{DJI.WindowsSDK.ResultValue<DJI.WindowsSDK.IntMsg?>}
error: REQUEST_HANDLER_NOT_FOUND
value: null
Can anyone please assist and tell me what I'm missing to get the REQUEST_HANDLER_NOT_FOUND error??
I am connected to my Phantom 4 v2 Pro remote with the green light on the remote indicating connection to my Phantom 4 is ok.
|
|