How to pull SensorDataAddress of BeWhere Bluetooth Beacons using the SDK

Applies To

  • MyGeotab SDK
  • IOX-BT
  • BeWhere

Procedure

Javascript

  1. Navigate to the MyGeotab API Runner.
  2. Run a modified version of the following script:
api.call("Get", {
	"typeName": "StatusData",
	"search": {
		"DeviceSearch": {
			"id": "<id>"
		}, 
		"DiagnosticSearch": {
			"id": "DiagnosticBluetoothBeaconLiveTemperature"
		},
		"fromDate": "<from date in following format: 2019-01-01T00:00:00.000Z>",
		"toDate": "<to date in following format: 2019-01-01T00:00:00.000Z>"  
	}
}, function (result) {
	console.log("Done: ", result);
}, function (e) {
	console.error("Failed:", e);
});

.Net

  1. Use a dynamic object to retrieve the address property like so:
DiagnosticSearch dsSearch = new DiagnosticSearch();
dsSearch.Id = Id.Create("DiagnosticBluetoothBeaconLiveTemperature");

DeviceSearch dsearch = new DeviceSearch();
dsearch.Id = Id.Create("<id>");

StatusDataSearch sdSearch = new StatusDataSearch();
sdSearch.DiagnosticSearch = dsSearch;
sdSearch.DeviceSearch = dsearch;

List<dynamic> data= api.Call<List<dynamic>>("Get", typeof(StatusData), new {
resultsLimit=5,
search = sdSearch });

Console.WriteLine(data[0]["address"]);
...

Additional Notes

The address property stores hexadecimal values and needs to be converted to decimal.

The address property corresponds to SensorDataAddress in the Advanced Engine Measurement report.