owntracks / android

OwnTracks Android App
http://owntracks.org
Eclipse Public License 1.0
1.36k stars 475 forks source link

Eddystone Support #491

Closed unixweb closed 7 years ago

unixweb commented 7 years ago

Hello Team

please implement the Eddystone Protocol and Functionality into the Owntracks App. More information about this here: https://developers.google.com/beacons/

Many thanks , Joachim

binarybucks commented 7 years ago

Region setup is a bit different than on other beacons. Relevant code.

BeaconManager beaconManager = BeaconManager.getInstanceForApplication(this.getApplicationContext());
// Detect the main identifier (UID) frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
    setBeaconLayout(BeaconParser.EDDYSTONE_UID_LAYOUT));
// Detect the telemetry (TLM) frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
    setBeaconLayout(BeaconParser.EDDYSTONE_TLM_LAYOUT));
// Detect the URL frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
    setBeaconLayout(BeaconParser.EDDYSTONE_URL_LAYOUT));

        // Set the two identifiers below to null to detect any beacon regardless of identifiers
        Identifier myBeaconNamespaceId = Identifier.parse("0x2f234454f4911ba9ffa6");
        Identifier myBeaconInstanceId = Identifier.parse("0x000000000001");
        Region region = new Region("my-beacon-region", myBeaconNamespaceId, myBeaconInstanceId, null);

Could you please check if your Eddystone also supports the iBeacon format with the below format?

In addition to the above, Eddystone-compatible beacons also transmit a standard iBeacon frame. This is generally used on iOS devices to wake up an application in the background as quickly as possible, at which time the other Eddystone frames can be detected and decoded. However, you may also use the iBeacon frame for application-specific purposes.

The identifiers of the iBeacon frame are algorithmically derived from the UID frame. The ProximityUUID is the full 16-byte UUID used as an input to generating the namespace identifier described above. The minor is set to the two least significant bytes of the instance identifier. The major is set to the two middle bytes of the instance identifier. (The two most significant bytes of the instance identifier are not included in the iBeacon frame.)