Exemple #1
0
    public void InitializeDataSource()
    {
        //Load your key & license either through reflection as shown in the User Guide, or by hardcoding it to these strings.
        string key     = "";
        string license = "";

        APIStatusText.text = "Creating device source . . . ";
        if (key.Equals("") || license.Equals(""))
        {
            APIStatusText.text = "Please add your license details from the code.";
        }
        var deviceSourceCreator = new DeviceSourcePortable(key, license);

        deviceSourceCreator.SetDebugOutputStream(TraceWriteline);
        DeviceSource         = deviceSourceCreator.GetDataSource(SourceType.TRIGNO_RF);
        APIStatusText.text   = "Device source created.";
        DeviceSource.Key     = key;
        DeviceSource.License = license;
        APIStatusText.text   = "Loading data source . . . ";

        try
        {
            LoadDataSource(DeviceSource);
        }
        catch (Exception exception)
        {
            APIStatusText.text = "Something went wrong: " + exception.Message;
            return;
        }
        APIStatusText.text = "Data source loaded and ready to Scan.";
    }
        public void InitializeDataSource()
        {
            var    assembly = Assembly.GetCallingAssembly();
            string key;

            using (Stream stream = assembly.GetManifestResourceStream("TrignoEmg.PublicKey.lic"))
            {
                StreamReader sr = new StreamReader(stream);
                key = sr.ReadLine();
            }
            string license;

            using (Stream stream = assembly.GetManifestResourceStream("TrignoEmg.OpenFeasyo.lic"))
            {
                StreamReader sr = new StreamReader(stream);
                license = sr.ReadToEnd();
            }

#if ANDROID
            var deviceSourceCreator = new DelsysAPI.Android.DeviceSourcePortable(key, license);
#else
            var deviceSourceCreator = new DelsysAPI.NET.DeviceSourcePortable(key, license);
#endif
            deviceSourceCreator.SetDebugOutputStream(Console.WriteLine);

            DeviceSource         = deviceSourceCreator.GetDataSource(SourceType.TRIGNO_BT);
            DeviceSource.Key     = key;
            DeviceSource.License = license;
            LoadDataSource(DeviceSource);
        }
Exemple #3
0
        public void InitializeDataSource()
        {
            int SUCCESS = 0;

            ActivityCompat.RequestPermissions(this, new String[] { Manifest.Permission.AccessCoarseLocation }, SUCCESS);

            // Load your license and key files
            // This tutorial assumes you have them contained in embedded resources named PublicKey.lic and License.lic, as part of
            // a solution with an output executable called AndroidSample.
            var    assembly = Assembly.GetExecutingAssembly();
            string key;

            using (Stream stream = assembly.GetManifestResourceStream("AndroidSample.APIKey.lic")) // Change the name of the .lic file accordingly
            {
                StreamReader sr = new StreamReader(stream);
                key = sr.ReadLine();
            }
            string lic;

            using (Stream stream = assembly.GetManifestResourceStream("AndroidSample.License.lic")) // Change the name of the .lic file accordingly
            {
                StreamReader sr = new StreamReader(stream);
                lic = sr.ReadToEnd();
            }

            // The API uses a factory method to create the data source of your application.
            // This creates the factory method, which will then give the data source for your platform.
            // In this case the platform is BT.
            var deviceSourceCreator = new DelsysAPI.Android.DeviceSourcePortable(key, lic);

            // Sets the output stream for debugging information from the API. This could be a file stream,
            // but in this example we simply use the Console.WriteLine output stream.
            deviceSourceCreator.SetDebugOutputStream(Console.WriteLine);
            // Here is where we tell the factory method what type of data source we want to receive,
            // which we then set a reference to for future use.
            DeviceSource = deviceSourceCreator.GetDataSource(SourceType.TRIGNO_BT);
            // Here we use the key and license we previously loaded.
            DeviceSource.Key     = key;
            DeviceSource.License = lic;
            //Load source
            LoadDataSource(DeviceSource);
            // Create a reference to the first Pipeline (which was generated by the factory method above)
            // for easier access to various objects within the API.
            BTPipeline       = PipelineController.Instance.PipelineIds[0];
            TransformManager = PipelineController.Instance.PipelineIds[0].TransformManager;

            // Just setting up some of the necessary callbacks from the API.
            BTPipeline.CollectionStarted                     += CollectionStarted;
            BTPipeline.CollectionDataReady                   += CollectionDataReady;
            BTPipeline.CollectionComplete                    += CollectionComplete;
            BTPipeline.TrignoBtManager.ComponentAdded        += ComponentAdded;
            BTPipeline.TrignoBtManager.ComponentLost         += ComponentLost;
            BTPipeline.TrignoBtManager.ComponentRemoved      += ComponentRemoved;
            BTPipeline.TrignoBtManager.ComponentScanComplete += ComponentScanComplete;

            // The component manager is how you reference specific / individual sensors so creating
            // a reference to it will shorten a lot of calls.
            var ComponentManager = PipelineController.Instance.PipelineIds[0].TrignoBtManager;
        }
        public void LoadDataSource(IDelsysDevice ds)
        {
            PipelineController.Instance.AddPipeline(ds);

            BTPipeline       = PipelineController.Instance.PipelineIds[0];
            TransformManager = PipelineController.Instance.PipelineIds[0].TransformManager;

            BTPipeline.CollectionStarted   += CollectionStarted;
            BTPipeline.CollectionDataReady += CollectionDataReady;
            BTPipeline.CollectionComplete  += CollectionComplete;

            BTPipeline.TrignoBtManager.ComponentScanComplete += ComponentScanComplete;
        }
        public void InitializeDataSource()
        {
            // Load your key & license either through reflection as shown in the User Guide, or by hardcoding it to these strings.
            string key     = "";
            string license = "";

            var deviceSourceCreator = new DelsysAPI.NET.DeviceSourcePortable(key, license);

            deviceSourceCreator.SetDebugOutputStream(Console.WriteLine);
            DeviceSource         = deviceSourceCreator.GetDataSource(SourceType.TRIGNO_BT);
            DeviceSource.Key     = key;
            DeviceSource.License = license;
            LoadDataSource(DeviceSource);
        }
Exemple #6
0
    public void LoadDataSource(IDelsysDevice ds)
    {
        PipelineController.Instance.AddPipeline(ds);

        RFPipeline       = PipelineController.Instance.PipelineIds[0];
        TransformManager = PipelineController.Instance.PipelineIds[0].TransformManager;

        RFPipeline.TrignoRfManager.ComponentScanComplete += ComponentScanComplete;
        RFPipeline.CollectionStarted                += CollectionStarted;
        RFPipeline.CollectionDataReady              += CollectionDataReady;
        RFPipeline.CollectionComplete               += CollectionComplete;
        RFPipeline.TrignoRfManager.ComponentAdded   += ComponentAdded;
        RFPipeline.TrignoRfManager.ComponentLost    += ComponentLost;
        RFPipeline.TrignoRfManager.ComponentRemoved += ComponentRemoved;
    }
        public void InitializeDataSource()
        {
            // Load your key & license either through reflection as shown in the User Guide, or by hardcoding it to these strings.
            string key     = "";
            string license = "";

            var deviceSourceCreator = new DeviceSourcePortable(key, license);

            deviceSourceCreator.SetDebugOutputStream(Console.WriteLine);
            DeviceSource         = deviceSourceCreator.GetDataSource(SourceType.SIMULATED);
            DeviceSource.Key     = key;
            DeviceSource.License = license;
            LoadDataSource(DeviceSource);
            Console.WriteLine("Data source loaded");
            SimulatedPipeline.Start();

            Console.ReadLine();
        }
Exemple #8
0
        public void LoadDataSource(IDelsysDevice ds)
        {
            PipelineController.Instance.AddPipeline(ds);

            BTPipeline       = PipelineController.Instance.PipelineIds[0];
            TransformManager = PipelineController.Instance.PipelineIds[0].TransformManager;

            // Device Filters allow you to specify which sensors to connect to
            foreach (var filter in DeviceFilters)
            {
                BTPipeline.TrignoBtManager.AddDeviceIDFilter(filter);
            }

            BTPipeline.CollectionComplete  += CollectionComplete;
            BTPipeline.CollectionStarted   += CollectionStarted;
            BTPipeline.CollectionDataReady += CollectionDataReady;

            BTPipeline.TrignoBtManager.ComponentScanComplete += ComponentScanComplete;
        }
        public void LoadDataSource(IDelsysDevice ds)
        {
            PipelineController.Instance.AddPipeline(ds);

            SimulatedPipeline = PipelineController.Instance.PipelineIds[0];
            TransformManager  = PipelineController.Instance.PipelineIds[0].TransformManager;

            SimulatedPipeline.CollectionStarted   += CollectionStarted;
            SimulatedPipeline.CollectionDataReady += CollectionDataReady;
            SimulatedPipeline.CollectionComplete  += CollectionComplete;
            SimulatedPipeline.TrignoSimulatedManager.ComponentAdded   += ComponentAdded;
            SimulatedPipeline.TrignoSimulatedManager.ComponentLost    += ComponentLost;
            SimulatedPipeline.TrignoSimulatedManager.ComponentRemoved += ComponentRemoved;


            SimulatedPipeline.TrignoSimulatedManager.ComponentScanComplete      += ComponentScanComplete;
            SimulatedPipeline.TrignoSimulatedManager.SimulatedTimeEventCallback += TrignoSimulatedManager_SimulatedTimeEventCallback;;
            SimulatedPipeline.Scan();
            // Scan time in seconds
            ConfigureDataSource();
        }
        public void LoadDataSource(IDelsysDevice ds)
        {
            PipelineController.Instance.AddPipeline(ds);

            BTPipeline       = PipelineController.Instance.PipelineIds[0];
            TransformManager = PipelineController.Instance.PipelineIds[0].TransformManager;

            // Device Filters allow you to specify which sensors to connect to
            foreach (var filter in DeviceFilters)
            {
                BTPipeline.TrignoBtManager.AddDeviceIDFilter(filter);
            }
            // This is an important line of code! It lets through peripherals that have Jamar in their name.
            BTPipeline.TrignoBtManager.AllowPeripheralDevice("Jamar");
            BTPipeline.CollectionStarted   += CollectionStarted;
            BTPipeline.CollectionDataReady += CollectionDataReady;
            BTPipeline.CollectionComplete  += CollectionComplete;

            // Our custom peripheral callback
            bleAdapter.DeviceConnected += BleAdapter_DeviceConnected;
            BTPipeline.TrignoBtManager.ComponentScanComplete += ComponentScanComplete;
        }