@Test public void testScanFilterMatchingBeaconByUuidOnly() { final UUID proximityUuid = fromString("E56E1F2C-C756-476F-8323-8D1F9CD245EA"); final Region region = new Region .Builder() .addNullField() .addUuidField(proximityUuid) .build(); final List<ScanFilter> scanFilters = parser.asScanFilters( singletonList(region) ); assertEquals( singletonList( new ScanFilter .Builder() .setManufacturerData( 280, new byte[] { 0x00, 0x00, (byte) 0xE5, 0x6E, 0x1F, 0x2C, (byte) 0xC7, 0x56, 0x47, 0x6F, (byte) 0x83, 0x23, (byte) 0x8D, 0x1F, (byte) 0x9C, (byte) 0xD2, 0x45, (byte) 0xEA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, new byte[] { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 } ) .build() ), scanFilters ); }
@NonNull @Override public List<ScanFilter> asScanFilters(@NonNull List<Region> regions) { final List<ScanFilter> scanFilters = new ArrayList<>(); try { if (regions.isEmpty()) { scanFilters.add( getScanFilter(new Region.Builder().build()) ); } else { for (Region region : regions) { scanFilters.add(getScanFilter(region)); } } } catch (Exception e) { BeaconLogger.e( "Could not create scan filters based on the beacon layout and provided regions; " + "the scan filters to be used are: " + scanFilters.toString() ); } return scanFilters; }
BeaconParser implements IBeaconParser { @NonNull @Override public List<ScanFilter> asScanFilters(@NonNull List<Region> regions) { final List<ScanFilter> scanFilters = new ArrayList<>(); try { if (regions.isEmpty()) { scanFilters.add( getScanFilter(new Region.Builder().build()) ); } else { for (Region region : regions) { scanFilters.add(getScanFilter(region)); } } } catch (Exception e) { BeaconLogger.e( "Could not create scan filters based on the beacon layout and provided regions; " + "the scan filters to be used are: " + scanFilters.toString() ); } return scanFilters; } }
BeaconParser implements IBeaconParser { @NonNull @Override public List<ScanFilter> asScanFilters(@NonNull List<Region> regions) { final List<ScanFilter> scanFilters = new ArrayList<>(); try { if (regions.isEmpty()) { scanFilters.add( getScanFilter(new Region.Builder().build()) ); } else { for (Region region : regions) { scanFilters.add(getScanFilter(region)); } } } catch (Exception e) { BeaconLogger.e( "Could not create scan filters based on the beacon layout and provided regions; " + "the scan filters to be used are: " + scanFilters.toString() ); } return scanFilters; } BeaconParser(@NonNull List<IFieldConverter<?>> fieldConverters,
                 int beaconTypeIndex,
                 int manufacturerId,
                 Object beaconType,
                 int txPowerIndex); }
BeaconParser implements IBeaconParser { @NonNull @Override public List<ScanFilter> asScanFilters(@NonNull List<Region> regions) { final List<ScanFilter> scanFilters = new ArrayList<>(); try { if (regions.isEmpty()) { scanFilters.add( getScanFilter(new Region.Builder().build()) ); } else { for (Region region : regions) { scanFilters.add(getScanFilter(region)); } } } catch (Exception e) { BeaconLogger.e( "Could not create scan filters based on the beacon layout and provided regions; " + "the scan filters to be used are: " + scanFilters.toString() ); } return scanFilters; } BeaconParser(@NonNull List<IFieldConverter<?>> fieldConverters,
                 int beaconTypeIndex,
                 int manufacturerId,
                 Object beaconType,
                 int txPowerIndex); @Override @Nullable Beacon parse(@NonNull ScanResult scanResult); @NonNull @Override List<ScanFilter> asScanFilters(@NonNull List<Region> regions); }
BeaconParser implements IBeaconParser { @NonNull @Override public List<ScanFilter> asScanFilters(@NonNull List<Region> regions) { final List<ScanFilter> scanFilters = new ArrayList<>(); try { if (regions.isEmpty()) { scanFilters.add( getScanFilter(new Region.Builder().build()) ); } else { for (Region region : regions) { scanFilters.add(getScanFilter(region)); } } } catch (Exception e) { BeaconLogger.e( "Could not create scan filters based on the beacon layout and provided regions; " + "the scan filters to be used are: " + scanFilters.toString() ); } return scanFilters; } BeaconParser(@NonNull List<IFieldConverter<?>> fieldConverters,
                 int beaconTypeIndex,
                 int manufacturerId,
                 Object beaconType,
                 int txPowerIndex); @Override @Nullable Beacon parse(@NonNull ScanResult scanResult); @NonNull @Override List<ScanFilter> asScanFilters(@NonNull List<Region> regions);  }