Accept advertising packets without flags

Hello,

i have written an App that evaluates data from advertisement of different sensors. When using the simulator everything works fine and I can see the readings from my sensors. But when running on my watch (fenix 6 pro) I can see advertising devices but not my sensors. I logged the raw advertisment data and compared it to the output from the simulator and noticed that there seems to be a filter on the data on the real device. On the watch I can only see advertisment data that starts with  "[2, 1, ...]" or "[2, 1, ...]. So these packets contain flags at the beginning.

Unfortunately my sensors advertisment data start with "[Len, 0xFF, ..."] (you can't connect to them, they just advertise) and seems not to be recognized by the watch. But I don't see any information why this is the case or how to switch of this filter. Any suggestions from your side?

Thanks and best regards!

  • It's a fenix 6 pro, range between watch, BLE-Module in the PC for the sim and the sensor are <1m. With ble scan I see three devices (I think that are the [2, 1,6, 26, ...], [2, 1, 26, 2, ...] and the [2, 1, 6, 3, ...])

  • When you see the counts in blescan, understand that's not the number of scan results seen, but the number of devices.  When it sees a scan result, it checks if it's a device it's seen before vs a new device, and adjusts accordingly.  That's why you'll see RSSI change as you walk around, for example.  Pressing select for a specific device shows you the last raw data seen, and that too can change.

    Are you using the dongle or the DK with the sim?  With the dongle, what I see in the sim is nearly identical to blescan on a watch.  The other variable is the sensors themselves and not all work the same.  There are some things you can't see at all in CIQ, and it sounds like  what you see in the sim may differ from a real device.  Always go by what you see on a real watch.

  • Yes, I'm using the dongle. And I have noticed that the results from Simulator and real world differs, but I would like to understand why and if there is a possibility to see the data from the advertisment.

  • Is it that you aren't seeing the raw data, or that you aren't seeing the scan result?  CIQ is a very minimal implementation, and it sounds like one of your sensors is doing something that's not being accepted.

    Unless you have access to the code in the sensor, there may be nothing you can do.  Like I said for me, I see the same things in both the sim and real device.

    What are you hoping to do with this data? There are things you might not see in the scan results - UUID and name I mentioned, but the BLE Mac address can't be seen, and maybe other things.

  • I do not see the data in the scan result. There is data in the manufactur specific data I want to analyze (what already works in the simulator) to show the data on the watch. 

  • Ok, so I added the following code to blescan (the store has not been updated) to show the companyId snf it's working the same in the sim and on a real device.  On some sensors, the iterator is null (my raspberry pi devices for example), but I see it on others.

    var mIT=scanResults[currentIdx].getManufacturerSpecificDataIterator();
    var cID=null;
    if(mIT!=null) {
    	var mN=mIT.next();
    	while(mN!=null) {
    		cID=mN[:companyId];
    		mN=mIT.next();
    	}
    }

    I then display cID on the screen. For example:

    I've not looked at "BLE Core Specification V4.0 Volume 3 Part C Section 18.11", nor tried getManufacturerSpecificData()

     Not sure what you are running into. Post the actual code you are using.

  • Ok, so calling getManufacturerSpecificData() with cID just returns the same thing as mN[:data] in the code I posted

    In this case:

    		cID=mN[:companyId];
    		System.println("d="+mN[:data]);
    		System.println("x="+scanResults[currentIdx].getManufacturerSpecificData(cID));

    what is shown for d= and x= is the same.

  • Hi,

    this is the code I'm currently using:

    function onScanResults(scanResults) {
        for (var scanResult = scanResults.next(); scanResult != null; scanResult = scanResults.next()) 
        {
            var packageData = scanResult.getRawData();
            System.println(packageData);
        }
    }

    So I'm just printing the data from the scan results. Nothing else - I have currently deleted everything around this. As already shown, this is the data I get from teh Simulator with the Dongle printed on my debug console:

    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 42, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 6, 3, 3, 241, 255, 23, 22, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202, 100]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [7, 255, 76, 0, 18, 2, 0, 0]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202]
    [2, 1, 6, 3, 3, 241, 255, 23, 22, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202, 100]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [7, 255, 76, 0, 18, 2, 0, 0]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 6]
    [2, 1, 6]
    [2, 1, 6]
    [12, 255, 190, 20, 193, 1, 0, 0, 100, 175, 1, 17, 71]
    [2, 1, 6, 3, 3, 241, 255, 23, 22, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202, 100]
    [12, 255, 190, 20, 193, 1, 0, 0, 100, 175, 1, 17, 71]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [12, 255, 190, 20, 193, 1, 0, 0, 100, 175, 1, 17, 71]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [12, 255, 190, 20, 193, 1, 0, 0, 100, 175, 1, 17, 71]
    [28, 255, 190, 20, 193, 1, 49, 49, 19, 0, 0, 36, 116, 72, 161, 161, 102, 102, 208, 208, 23, 183, 209, 56, 0, 207, 207, 96, 96]
    I'm interested in the packages starting with [12, 255, 190, 20] and [28, 255, 190, 20]. When I'm running the this on my watch (didn't change anything on the sensors), and log the data on the watch to a file (with the same println command), I get this log:

    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    [2, 1, 6, 3, 3, 241, 255, 23, 22, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202, 100]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 55, 202]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 6, 3, 3, 241, 255, 23, 22, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202, 100]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 6, 3, 3, 241, 255, 23, 22, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 41, 202, 100]
    [2, 1, 6, 3, 3, 241, 255, 23, 22, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202, 100]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 43, 202]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    [2, 1, 6, 26, 255, 76, 0, 2, 21, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 50, 202]
    [2, 1, 6, 3, 3, 241, 255, 23, 22, 211, 203, 214, 205, 180, 21, 65, 149, 157, 166, 152, 75, 176, 31, 47, 69, 7, 97, 1, 55, 202, 100]
    [2, 1, 26, 2, 10, 12, 12, 255, 76, 0, 16, 7, 32, 31, 202, 111, 40, 166, 8]
    This is just a snippet of the log, but it contains absoluty no data from my sensors. It seems that the watch (Fenix 6 Pro at least) filters everything out that doesn't start with the first advertising data element with the flags (e.g. [2, 1, 6]).

  • If I show raw, in addition to d= and x= from above, I see

    d=[66, 4, 1, 128, 96, 104, 39, 55, 161, 213, 82, 106, 39, 55, 161, 213, 81, 1, 35, 228, 69, 65, 0, 0]
    x=[66, 4, 1, 128, 96, 104, 39, 55, 161, 213, 82, 106, 39, 55, 161, 213, 81, 1, 35, 228, 69, 65, 0, 0]
    raw=[27, 255, 117, 0, 66, 4, 1, 128, 96, 104, 39, 55, 161, 213, 82, 106, 39, 55, 161, 213, 81, 1, 35, 228, 69, 65, 0, 0]

    So 4 extra bytes at the beginning of raw.  The amount of data varies, and with some sensors, no d=/x=

    I suspect the companyId is in those first 4 bytes.

  • The sim and a real device show the same amount of raw data for a sensor.  There could be variations as to what sensors are seen, and some things you may not see - BLE Mac Address is hidden for security.

    In both the sim and real device, I see between 8 and 31 bytes of raw data, depending on the specific sensor.

    Here's what I see for a thingy52, for both the sim and a real watch.  For it, you see the name.

    Again, for me, I might not see the same number of sensors, but what I see in the sim matches what I see for that sensor on a real watch.