Example #1
0
        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;
        }
Example #2
0
        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);
        }
Example #3
0
 public void ApplicationClientObjectCreationWithFilePathInvaidFile()
 {
     testApp = new IBMWIoTP.ApplicationClient("propInvalid.txt");
 }
Example #4
0
 public void ApplicationClientObjectCreationWithFilePath()
 {
     testApp = new IBMWIoTP.ApplicationClient("../../Resource/AppProp.txt");
 }
Example #5
0
 public void ApplicationClientObjectCreationWithException()
 {
     testApp = new IBMWIoTP.ApplicationClient("", "", "", "");
 }
Example #6
0
 public void Setup()
 {
     IBMWIoTP.AbstractClient.AutoReconnect = false;
     testApp = new IBMWIoTP.ApplicationClient("../../Resource/AppProp.txt");
 }
Example #7
0
 public void Setup()
 {
     testApp = new IBMWIoTP.ApplicationClient("../../Resource/AppProp.txt");
 }