I’ve already published data to the cloud but have some problems during use Windows SDK to get the data from the cloud.
And here’s my code.Totally follow the DOCS.
When I delete this sentence, still not working. Seems that I can’t Login.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Particle.SDK;
using System.Threading;
namespace RESTAPI_TEST
{
class Program
{
static async void AsyncMethod()
{
Console.WriteLine("Start");
bool success = await ParticleCloud.SharedCloud.LoginAsync("xxxx@xx.com", "xxxx");
ParticleDevice device =await ParticleCloud.SharedCloud.GetDeviceAsync("xxxxxxxx");
var variableResponse = device.GetVariableAsync("SensorValue");
int temperatureReading = (int)variableResponse.Result;
Console.WriteLine(variableResponse);
return;
}
static void Main()
{
Console.WriteLine("Login");
AsyncMethod();
Console.ReadLine();
}
}
}
How to use this SDK…?Could somebody help me?
Has anybody got the simple working demo about using the Windows SDK to get the data? Thanks a lot!!