Class DistinctPacketDetector


  • public class DistinctPacketDetector
    extends Object
    Created by dyoung on 4/8/17.

    This class tracks whether multiple distinct BLE packets have been seen, with the purpose of determining if the Android device supports detecting multiple distinct packets in a single scan. Some older devices are not capable of this (e.g. Nexus 4, Moto G1), so detecting multiple packets requires stopping and restarting scanning on these devices. This allows detecting if that is necessary.

    This class is not thread safe.

    • Constructor Detail

      • DistinctPacketDetector

        public DistinctPacketDetector()
    • Method Detail

      • clearDetections

        public void clearDetections()
      • isPacketDistinct

        public boolean isPacketDistinct​(@NonNull
                                        String originMacAddress,
                                        @NonNull
                                        byte[] scanRecord)