Skip to content

Commit a64a7d1

Browse files
authored
Notify updated devicenames during scanning
ScanResult.getScanRecord().getDeviceName() returns the most up to date name from the latest scan while ScanResult.getDevice().getName() returns first name found after starting scan
1 parent 1e4681e commit a64a7d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/android/BluetoothLePlugin.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,6 +2905,9 @@ public void onScanResult(int callbackType, ScanResult result) {
29052905
JSONObject returnObj = new JSONObject();
29062906

29072907
addDevice(returnObj, result.getDevice());
2908+
if(result.getScanRecord().getDeviceName() != null){
2909+
addProperty(returnObj, keyName, result.getScanRecord().getDeviceName().replace("\0", ""));
2910+
}
29082911
addProperty(returnObj, keyRssi, result.getRssi());
29092912
addPropertyBytes(returnObj, keyAdvertisement, result.getScanRecord().getBytes());
29102913
addProperty(returnObj, keyStatus, statusScanResult);

0 commit comments

Comments
 (0)