Bluzone API Commands specific for Asset+

Device position API:

The device position API returns the current known position based on either sBeacon positioning or GNSS position (which ever is most resent).

 

If a device is out of range of BluFIs and reporting its GNSS position, the current position available in Bluzone may not match the current physical position of the device, this is known as a stale position. Stale positions will occur in the following scenarios

  • the device has started to move, the device sends a port 2 uplink to indicate movement has started however the device has not come to rest and therefore the last know position is now stale

  • the device has attempted to activate GNSS but is unable to acquire a GNSS position due to poor signal, possibly the device is indoors or the view of the sky is obscured, in this scenario the device will send its last know position and it will me marked a stale.

  • the device is in Breadcrumb trail mode it is updating its position while moving.

Example Position API:

curl --request GET \ --url ' https://bztest.bluzone.io/portal/papis/v1/search/locations/map/101426/873406957129566482?thresholdMinutes=0' \ --header 'Accept: application/json' \ --header 'BZID: nI3IJAR8h1S5RhaeR1zuxDJKuT2sJkUkAmOhiIRjk1Q9DnbN3y'

 

Example Response:

{ "BLUZONE": { "altitude": 0.0, "averageSourceDelayMillis": 0, "battery": 0, "beaconId": "873406957129566482", "blufiPeriodStats": [], "boundaryCorrected": false, "boundaryExclusionCorrected": false, "cellId": 5221313633393464867, "deviceName": "0C1EF70000100912", "direction": "", "displayRadius": 2.121320343559643, "error": "", "errorDescription": "", "fingerprintEstimate": null, "fingerprintLocations": [], "floorNumber": 0, "generatorType": "BLUZONE", "geoJsonMap": "", "gt": "BLUZONE", "intersectionGroup": [], "jobModeBlufis": [], "latitude": 51.31891603595628, "locationId": 28101, "longitude": -0.7269330319935421, "mac": "01:d3:49:07:a8:21:65", "maxTimestamp": 0, "meterChangeEstimate": 0.0, "motionStatic": false, "projectId": 0, "stale": false, "sunstoneDelayMillis": 0, "thresholdCorrected": false, "timestamp": 1719490948582, "type": "", "usingPreviousBestBlufi": false, "varianceX": 2.0, "varianceY": 0.0, "varianceZ": 0.0, "windowCalculationRange": 0, "windowCount": 0 } }

Note the Stale variable will either be true or false

LNS Downlink Commands:

Downlink commands can be sent to a device to change configuration, request position update or activate alert service.

Note when using Senet LNS:

  • If the Device is is in Class A, maximum of 3 downlinks can be queued for any one device at a time on Senet, if the device is in Class B only 1 can be scheduled per device.

  • Time out should be minimum 2x heart beat rate, this is because of the following reasons:

    • if the Asset + device is operating in Class A, it will open a RX window where the LNS will be able to send the downlink command to the device only after the next uplink from the device, if the device is stationary this will be at the next heart beat period.

    • there is no Senet API to inform Bluzone of downlink failure, Bluzone is monitoring confirmation of receipt of downlink from the Asset+, the Asset+ will sent the confirmation in the next uplink which worst case will be the next scheduled heartbeat.

Example API command for sending downlinks to asset+:

curl --request PUT \   --url 'https://bztest.bluzone.io/portal/papis/v1/projects/101400/devices/beacons/jobs/_create?=' \   --header 'Accept: application/json' \   --header 'BZID: g3FuGjC22jdt2g3GTx0FuG4e4k93uREiKExYYihqOW8584TIzZ' \   --header 'Content-Type: application/json' \   --data '{   "projectId": 101400,   "beaconId": 18014089475494937383,   "configType": "LNS_DOWNLINK",   "configData": {     "downlinkConfig": {       "request": {         "pdu": "0110",         "timeoutMinutes": 120       }     }   } }

 

Note: Replace Project ID, Beacon ID (SID in Dec), BZID, PDU and timeoutMinutes, PDU=the downlink command in this example 0110 activates the alert service, TimeoutMintes must be = to minimum 2x the heartbeat period for BZ to correctly be able to mark the job as saucerful or timeout.

 

Blink Job (activation of LED and Buzzer over BluFI):

 

Note: that Blink jobs take approx. 1min to be sent to the asset+ device, this is because Bluzone has to determine which BluFI to use to send the command to the device, then the BLUFI must imitate a connection to the device and activate the service.

Note: Replace Project ID, Beacon ID (SID in Dec), BZID,