This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to Simply process Advertising Data

Hello to everyone,

My problem/question now is about the MasterEmulator. I´m working with the nRF51822(SoftDevice) and i have my own program already working more or less like I want. The main idea is that the device will send some information in the advertising data (my own data that don´t match with any existing Service).

But i´m trying to find out to make my own program for the PCA10000 that should only be scanning for Advertising devices, and process that advertising packets ( with processing it, i mean more or less store every data that see with the time stamp in a file).

I´m taking a look in the "nRFUart" and the "HeathThermoDemo" codes for the PCA1000 dongle but, i´m not so familiar with the "app programing" and I´m not be able to make only that "simply" part of scanning and have the data to work with.

Till now I´m only able to connect to the usb-dongle like in the "hello world" example, but not so much more. Any help like some other "easy start" codes, recommendation, etc.. will be so appreciated.

Thanks, Alvaro.

Parents
  • Thanks for the comment, but till now i can´t get the data, I see that usually i get the data from the advertising packet, and sometimes take the data from the scan response packet when i read from the DeviceInfoType.ManufacturerSpecificData, so how can I take both?

    That´s my small code for testing:

       MasterEmulator master = new MasterEmulator();       
                var usbdevices = master.EnumerateUsb(UsbDeviceType.AnyMasterEmulator);
                foreach (string usbdevice in usbdevices)
                {
                    master.Open(usbdevice);
                    Console.WriteLine("Device {0} Opened.",usbdevice);
                    master.Reset();
                    Console.WriteLine("MasterEmulator Reset.");
                }
                BtScanParameters scanParameters = new BtScanParameters();
                scanParameters.ScanType = BtScanType.ActiveScanning;
                master.Run();
    
                while (true)
                {
                    try
                    {
    
                        IEnumerable<BtDevice> devices;
                        devices = master.DiscoverDevices(1, scanParameters);
                
                        foreach (BtDevice dev in devices)
                        {
                            IDictionary<DeviceInfoType, string> deviceInfo = dev.DeviceInfo;
                            
                            var servData = dev.DeviceInfo[DeviceInfoType.ManufacturerSpecificData];
    
                            Console.WriteLine("Device found... {0}", dev);
                          
                            foreach (String test in dev.DeviceInfo.Values)
                            {
                                Console.WriteLine("... {0}", test);
                            }                 
    
                            ////Console.WriteLine(deviceInfo[DeviceInfoType.ServiceData]);
    
                        }
                        Console.WriteLine("---------------------------------");
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Exception in StartDeviceDiscovery {0}", ex.Message);
                    }
    

    I have put the UUID 0007 in the scandata info and the UUID 0008 in the response packet that i can know when I read one or the other. I get usually always the info from the scandata but not the response packet (that only appear sometimes).

    That´s the console output:

    http://i41.tinypic.com/xdxbhu.jpg

    ConsoleCapture.jpg

    DongleCapture3.jpg

  • Sorry about my terminology and my poor English, I have edit to attach the screenshot of the Master Control Panel.

Reply Children
No Data
Related