public static void Init() { Console.WriteLine("Please enter applicaiton details"); Console.Write("Enter your org id :"); orgId = Console.ReadLine(); Console.Write("Enter your app id :"); appId = Console.ReadLine(); Console.Write("Enter your api Key :"); apiKey = Console.ReadLine(); Console.Write("Enter your auth token :"); authToken = Console.ReadLine(); Console.WriteLine("Please enter device details to which you want to implement Infomation Mangement"); Console.Write("Enter your device type :"); deviceType = Console.ReadLine(); Console.Write("Enter your device id :"); deviceID = Console.ReadLine(); Console.Write("Enter your device event :"); deviceEvent = Console.ReadLine(); client = new ApplicationClient(orgId, appId, apiKey, authToken); client.connect(); cli = client.GetAPIClient(); cli.Timeout = 30000; //MQTT Topic subscription for IM State client.subscribeToIMState(deviceType, deviceID); client.IMStateCallback += processIM; }
public void ApplicationClientObjectCreation() { string orgId, appID, apiKey, authToken; Dictionary <string, string> data = IBMWIoTP.ApplicationClient.parseFile("../../Resource/AppProp.txt", "## Application Registration detail"); if (!data.TryGetValue("Organization-ID", out orgId) || !data.TryGetValue("App-ID", out appID) || !data.TryGetValue("Api-Key", out apiKey) || !data.TryGetValue("Authentication-Token", out authToken)) { throw new Exception("Invalid property file"); } testApp = new IBMWIoTP.ApplicationClient(orgId, appID, apiKey, authToken); }
public void ApplicationClientObjectCreationWithFilePathInvaidFile() { testApp = new IBMWIoTP.ApplicationClient("propInvalid.txt"); }
public void ApplicationClientObjectCreationWithFilePath() { testApp = new IBMWIoTP.ApplicationClient("../../Resource/AppProp.txt"); }
public void ApplicationClientObjectCreationWithException() { testApp = new IBMWIoTP.ApplicationClient("", "", "", ""); }
public void Setup() { IBMWIoTP.AbstractClient.AutoReconnect = false; testApp = new IBMWIoTP.ApplicationClient("../../Resource/AppProp.txt"); }
public void Setup() { testApp = new IBMWIoTP.ApplicationClient("../../Resource/AppProp.txt"); }