This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DLPNIRSCANEVM: Start scan characteristic

Part Number: DLPNIRSCANEVM

Hello,

I am developing a UWP (universal windows platform) to make a scan and receive the data. I am using the native BluetoothLe API of Windows to communicate with the DLPNIRScan. I can successfully get the GATT Scan Data Information Service (GSDIS) and StartScan characteristic. The problem is that Table J-7 states that the StartScan characteristic supports the notify property but when I want to set the cccd (client characteristic configuration description) I receive an error that I cannot write to that attribute. I need that notify in order to get the scan index of the current scan and use that one to get the correct data from the device.

Is there a workaround to get the index of the current scan or receive the current scan data? 

I hope I make my problem clear enough.

Best Regards,

Remco

  • Hi Remco,
    Welcome to DLP forum and thank you for your interest in DLP technology!

    I will get back early next week after discussing with out team.

    Regards,
    Vivek
  • Hi Remco,
    Thank you for your patience.

    Here is the iOS sample app source code. It does use the notifications from the start scan characteristic.

    github.com/.../NIRScanNano_iOS


    Could you please compare and review it ? This might help you identify the problem and resolve.

    Hope this works!
    regards,
    Vivek
  • Hi Vivek,

    Thanks for the replay and sharing the source code of the IOS app.

    I figured out my problem. The first thing I lke to mention is that in the Windows.Devices.Bluetooth.GenericAttributeProfile the GattCharacteristic can only have 1 property, for example the write property. When I request the StartScan characteristic by its Uuid, I get a list of GattCharacteristics in return. I always assumed that the first one in the list was the correct Characteristic to use. It turns out that the list was longer than I thought, it had two items. Apparently the API gives a GattCharacteristic instance with the same Uuid for every property the characteristic supports. So instead of using the first characteristic, I also have to use the second one in order to get the notification of the StartScan characteristic.

    Here is a piece of code and its output which shows, what I just tried to explain.

    var res = await service.GetCharacteristicsForUuidAsync(NirDeviceChracteristicUuids.StartScan);
    if (res.Status == GattCommunicationStatus.Success)
    {
      foreach(var characteristic in res.Characteristics)
      {
        System.Diagnostics.Debug.Write(characteristic.Uuid);
        System.Diagnostics.Debug.Write(" - ");
        System.Diagnostics.Debug.WriteLine(characteristic.CharacteristicProperties.ToString());
      }
    }

    Thanks for the help and time anyway!

    Regards,

    Remco