Skip to content

Commit

Permalink
feat: resolves #949 - add additional information with raw scan record
Browse files Browse the repository at this point in the history
  • Loading branch information
gmiszewski-intent committed Nov 2, 2023
1 parent baf25a9 commit beba31b
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface Metadata {
String LOCAL_NAME = "localName";
String TX_POWER_LEVEL = "txPowerLevel";
String SOLICITED_SERVICE_UUIDS = "solicitedServiceUUIDs";
String RAW_SCAN_RECORD = "rawScanRecord";
String IS_CONNECTABLE = "isConnectable";
String OVERFLOW_SERVICE_UUIDS = "overflowServiceUUIDs";
}
Expand Down Expand Up @@ -88,6 +89,12 @@ public WritableMap toJSObject(@NonNull ScanResult scanResult) {
result.putNull(Metadata.SOLICITED_SERVICE_UUIDS);
}

if (advData.getRawScanRecord() != null) {
result.putString(Metadata.RAW_SCAN_RECORD, Base64Converter.encode(advData.getRawScanRecord()));
} else {
result.putNull(Metadata.RAW_SCAN_RECORD);
}

// Attributes which are not accessible on Android
result.putNull(Metadata.OVERFLOW_SERVICE_UUIDS);
return result;
Expand Down

0 comments on commit beba31b

Please sign in to comment.