Languages

Menu
Sites
Language
[Wereable] BLE DeviceData.DeviceName is empty

Hi I'm fiddling with the BLE scanner example from the github <link> on the Gear S3 running on Tizen 4.0.0.x

In the method below I've added  a line to print the DeviceName :

public void ScanResultEventHandler(object sender, AdapterLeScanResultChangedEventArgs e)
        {
            if (e.DeviceData != null)
            {
                Device device = new Device
                {
                    Address = e.DeviceData.RemoteAddress,
                    Ledevice = e.DeviceData
                };

                Tizen.Log.Info("!BTAPP", String.Format("Scan Result dev name {0} address {1}", e.DeviceData.DeviceName, device.Address));

                if (!DeviceList.Any(d => d.Address == device.Address))
                {
                    DeviceList.Add(device);
                }
            }
        }

The problem is that the address of the device is being found the device's name is missing. I'm 100% sure the name is there (I can see in on nrfscanner, also I've got a native app that is working also, I'm trying implement it in .net)

am I doing something wrong, or there is something more that needs doing to get the DeviceName?

 

BR,

Pawel

Responses

2 Replies
Pyun DoHyun

Can you add next line before using Device name?

 

e.DeviceData.PacketType = BluetoothLePacketType.BluetoothLeAdvertisingPacket;

if (e.DeviceData.DeviceName == null)
    e.DeviceData.PacketType = BluetoothLePacketType.BluetoothLeScanResponsePacket;

 

Tizen.Log.Info("!BTAPP", String.Format("Scan Result dev name {0} address {1}", e.DeviceData.DeviceName, device.Address));
Paweł Kopalko

Thank you Pyun I forgot about the need to select the packet type.

Best Regards,
Pawel