Loading...
Searching...
No Matches
NCMeasurementManager Class Reference

Class is used for managing measurement generators and notifying about sensor and signal measurements. More...

#include <com/navigine/idl/objc/NCMeasurementManager.h>

Inherits NSObject.

Instance Methods

(void) - addMeasurementListener:
 Method is used to add MeasurementListener class element which will notify about new sensor or signal measurements.
 
(void) - removeMeasurementListener:
 Method is used for removing previously added MeasurementListener class element.
 
(nonnull NSString *) - addBeaconGenerator:major:minor:power:timeout:rssiMin:rssiMax:
 Method adds a beacon generator for simulating BLE beacon signals.
 
(nonnull NSString *) - addEddystoneGenerator:instanceId:power:timeout:rssiMin:rssiMax:
 Method adds an Eddystone generator for simulating Eddystone beacon signals.
 
(void) - removeBleGenerators
 Method removes all BLE beacon generators.
 
(void) - removeBleGenerator:
 Method removes a specific BLE beacon generator by its identifier.
 
(nonnull NSString *) - addWifiGenerator:timeout:rssiMin:rssiMax:
 Method adds a Wi-Fi generator for simulating Wi-Fi signals.
 
(void) - removeWifiGenerator:
 Method removes a specific Wi-Fi generator by its identifier.
 
(void) - removeWifiGenerators
 Method removes all Wi-Fi generators.
 
(nonnull NSString *) - addWifiRttGenerator:timeout:distMin:distMax:stdDevMin:stdDevMax:rssiMin:rssiMax:
 Method adds a Wi-Fi RTT generator for simulating Wi-Fi Round-Trip Time signals.
 
(void) - removeWifiRttGenerator:
 Method removes a specific Wi-Fi RTT generator by its identifier.
 
(void) - removeWifiRttGenerators
 Method removes all Wi-Fi RTT generators.
 
(nonnull NSString *) - addLocationGenerator:latMax:lonMin:lonMax:accMin:accMax:timeout:
 Method adds a location generator for simulating location measurements.
 
(void) - removeLocationGenerator:
 Method removes a specific location generator by its identifier.
 
(void) - removeLocationGenerators
 Method removes all location generators.
 

Detailed Description

Class is used for managing measurement generators and notifying about sensor and signal measurements.

Referenced from NavigineSdk.

Definition at line 18 of file NCMeasurementManager.h.

Method Documentation

◆ addBeaconGenerator:major:minor:power:timeout:rssiMin:rssiMax:

- (nonnull NSString *) addBeaconGenerator: (nonnull NSString *) uuid
major: (int32_t) major
minor: (int32_t) minor
power: (int32_t) power
timeout: (int32_t) timeout
rssiMin: (int32_t) rssiMin
rssiMax: (int32_t) rssiMax 

Method adds a beacon generator for simulating BLE beacon signals.

Parameters
uuidUUID of the beacon.
majorMajor value of the beacon.
minorMinor value of the beacon.
powerTransmission power of the beacon (dBm).
timeoutDuration of the generator in milliseconds.
rssiMinMinimum RSSI value for the simulated signal.
rssiMaxMaximum RSSI value for the simulated signal.
Returns
Unique identifier of the created beacon generator.

Swift code snippet:

// Add beacon generator
let beaconId = manager.addBeaconGenerator(
uuid: "12345678-1234-1234-1234-123456789012",
major: 100,
minor: 200,
power: -60,
timeout: 5000,
rssiMin: -80,
rssiMax: -40
)
print("Added beacon generator with ID: \‍(beaconId)")

Objective C code snippet:

// Add beacon generator
NSString *beaconId = [self.measurementManager addBeaconGeneratorWithUuid:@"12345678-1234-1234-1234-123456789012"
major:100
minor:200
power:-60
timeout:5000
rssiMin:-80
rssiMax:-40];
NSLog(@"Added beacon generator with ID: %@", beaconId);

◆ addEddystoneGenerator:instanceId:power:timeout:rssiMin:rssiMax:

- (nonnull NSString *) addEddystoneGenerator: (nonnull NSString *) namespaceId
instanceId: (nonnull NSString *) instanceId
power: (int32_t) power
timeout: (int32_t) timeout
rssiMin: (int32_t) rssiMin
rssiMax: (int32_t) rssiMax 

Method adds an Eddystone generator for simulating Eddystone beacon signals.

Parameters
namespaceIdNamespace ID of the Eddystone beacon.
instanceIdInstance ID of the Eddystone beacon.
powerTransmission power of the beacon (dBm).
timeoutDuration of the generator in milliseconds.
rssiMinMinimum RSSI value for the simulated signal.
rssiMaxMaximum RSSI value for the simulated signal.
Returns
Unique identifier of the created Eddystone generator.

Swift code snippet:

// Add Eddystone generator
let eddystoneId = manager.addEddystoneGenerator(
namespaceId: "12345678901234567890",
instanceId: "1234567890123456",
power: -65,
timeout: 3000,
rssiMin: -85,
rssiMax: -45
)
print("Added Eddystone generator with ID: \‍(eddystoneId)")

Objective C code snippet:

// Add Eddystone generator
NSString *eddystoneId = [self.measurementManager addEddystoneGeneratorWithNamespaceId:@"12345678901234567890"
instanceId:@"1234567890123456"
power:-65
timeout:3000
rssiMin:-85
rssiMax:-45];
NSLog(@"Added Eddystone generator with ID: %@", eddystoneId);

◆ addLocationGenerator:latMax:lonMin:lonMax:accMin:accMax:timeout:

- (nonnull NSString *) addLocationGenerator: (double) latMin
latMax: (double) latMax
lonMin: (double) lonMin
lonMax: (double) lonMax
accMin: (float) accMin
accMax: (float) accMax
timeout: (int32_t) timeout 

Method adds a location generator for simulating location measurements.

Parameters
latMinMinimum latitude for the simulated location.
latMaxMaximum latitude for the simulated location.
lonMinMinimum longitude for the simulated location.
lonMaxMaximum longitude for the simulated location.
accMinMinimum accuracy for the simulated location (in meters).
accMaxMaximum accuracy for the simulated location (in meters).
timeoutDuration of the generator in milliseconds.
Returns
Unique identifier of the created location generator.

Swift code snippet:

// Add location generator
let locationId = manager.addLocationGenerator(
latMin: 55.7558,
latMax: 55.7559,
lonMin: 37.6176,
lonMax: 37.6177,
accMin: 1.0,
accMax: 5.0,
timeout: 7000
)
print("Added location generator with ID: \‍(locationId)")

Objective C code snippet:

// Add location generator
NSString *locationId = [self.measurementManager addLocationGeneratorWithLatMin:55.7558
latMax:55.7559
lonMin:37.6176
lonMax:37.6177
accMin:1.0
accMax:5.0
timeout:7000];
NSLog(@"Added location generator with ID: %@", locationId);

◆ addMeasurementListener:

- (void) addMeasurementListener: (nullable id< NCMeasurementListener >) listener

Method is used to add MeasurementListener class element which will notify about new sensor or signal measurements.

Note
Do not forget to remove listener if it is no longer needed!
Parameters
listenerCorresponding MeasurementListener class.

Swift code snippet:

// Add measurement listener
manager.addMeasurementListener(listener)
print("Added measurement listener")

Objective C code snippet:

// Add measurement listener
[self.measurementManager addMeasurementListener:self.measurementListener];
NSLog(@"Added measurement listener");

◆ addWifiGenerator:timeout:rssiMin:rssiMax:

- (nonnull NSString *) addWifiGenerator: (nonnull NSString *) mac
timeout: (int32_t) timeout
rssiMin: (int32_t) rssiMin
rssiMax: (int32_t) rssiMax 

Method adds a Wi-Fi generator for simulating Wi-Fi signals.

Parameters
macMAC address of the Wi-Fi access point.
timeoutDuration of the generator in milliseconds.
rssiMinMinimum RSSI value for the simulated signal.
rssiMaxMaximum RSSI value for the simulated signal.
Returns
Unique identifier of the created Wi-Fi generator.

Swift code snippet:

// Add Wi-Fi generator
let wifiId = manager.addWifiGenerator(
mac: "AA:BB:CC:DD:EE:FF",
timeout: 4000,
rssiMin: -90,
rssiMax: -50
)
print("Added Wi-Fi generator with ID: \‍(wifiId)")

Objective C code snippet:

// Add Wi-Fi generator
NSString *wifiId = [self.measurementManager addWifiGeneratorWithMac:@"AA:BB:CC:DD:EE:FF"
timeout:4000
rssiMin:-90
rssiMax:-50];
NSLog(@"Added Wi-Fi generator with ID: %@", wifiId);

◆ addWifiRttGenerator:timeout:distMin:distMax:stdDevMin:stdDevMax:rssiMin:rssiMax:

- (nonnull NSString *) addWifiRttGenerator: (nonnull NSString *) mac
timeout: (int32_t) timeout
distMin: (int32_t) distMin
distMax: (int32_t) distMax
stdDevMin: (int32_t) stdDevMin
stdDevMax: (int32_t) stdDevMax
rssiMin: (int32_t) rssiMin
rssiMax: (int32_t) rssiMax 

Method adds a Wi-Fi RTT generator for simulating Wi-Fi Round-Trip Time signals.

Parameters
macMAC address of the Wi-Fi access point.
timeoutDuration of the generator in milliseconds.
distMinMinimum distance for the simulated signal (in meters).
distMaxMaximum distance for the simulated signal (in meters).
stdDevMinMinimum standard deviation for the simulated signal.
stdDevMaxMaximum standard deviation for the simulated signal.
rssiMinMinimum RSSI value for the simulated signal.
rssiMaxMaximum RSSI value for the simulated signal.
Returns
Unique identifier of the created Wi-Fi RTT generator.

Swift code snippet:

// Add Wi-Fi RTT generator
let wifiRttId = manager.addWifiRttGenerator(
mac: "11:22:33:44:55:66",
timeout: 6000,
distMin: 1,
distMax: 10,
stdDevMin: 0,
stdDevMax: 2,
rssiMin: -70,
rssiMax: -30
)
print("Added Wi-Fi RTT generator with ID: \‍(wifiRttId)")

Objective C code snippet:

// Add Wi-Fi RTT generator
NSString *wifiRttId = [self.measurementManager addWifiRttGeneratorWithMac:@"11:22:33:44:55:66"
timeout:6000
distMin:1
distMax:10
stdDevMin:0
stdDevMax:2
rssiMin:-70
rssiMax:-30];
NSLog(@"Added Wi-Fi RTT generator with ID: %@", wifiRttId);

◆ removeBleGenerator:

- (void) removeBleGenerator: (nonnull NSString *) id

Method removes a specific BLE beacon generator by its identifier.

Parameters
idUnique identifier of the BLE generator to remove.

Swift code snippet:

// Remove specific BLE generator
manager.removeBleGenerator(id: beaconId)
print("Removed BLE generator: \‍(beaconId)")

Objective C code snippet:

// Remove specific BLE generator
[self.measurementManager removeBleGeneratorWithId:beaconId];
NSLog(@"Removed BLE generator: %@", beaconId);

◆ removeBleGenerators

- (void) removeBleGenerators

Method removes all BLE beacon generators.

Swift code snippet:

// Remove all BLE generators
manager.removeBleGenerators()
print("Removed all BLE generators")

Objective C code snippet:

// Remove all BLE generators
[self.measurementManager removeBleGenerators];
NSLog(@"Removed all BLE generators");

◆ removeLocationGenerator:

- (void) removeLocationGenerator: (nonnull NSString *) id

Method removes a specific location generator by its identifier.

Parameters
idUnique identifier of the location generator to remove.

Swift code snippet:

// Remove specific location generator
manager.removeLocationGenerator(id: locationId)
print("Removed location generator: \‍(locationId)")

Objective C code snippet:

// Remove specific location generator
[self.measurementManager removeLocationGeneratorWithId:locationId];
NSLog(@"Removed location generator: %@", locationId);

◆ removeLocationGenerators

- (void) removeLocationGenerators

Method removes all location generators.

Swift code snippet:

// Remove all location generators
manager.removeLocationGenerators()
print("Removed all location generators")

Objective C code snippet:

// Remove all location generators
[self.measurementManager removeLocationGenerators];
NSLog(@"Removed all location generators");

◆ removeMeasurementListener:

- (void) removeMeasurementListener: (nullable id< NCMeasurementListener >) listener

Method is used for removing previously added MeasurementListener class element.

Parameters
listenerCorresponding MeasurementListener class to remove.

Swift code snippet:

// Remove measurement listener
manager.removeMeasurementListener(listener)
print("Removed measurement listener")

Objective C code snippet:

// Remove measurement listener
[self.measurementManager removeMeasurementListener:self.measurementListener];
NSLog(@"Removed measurement listener");

◆ removeWifiGenerator:

- (void) removeWifiGenerator: (nonnull NSString *) id

Method removes a specific Wi-Fi generator by its identifier.

Parameters
idUnique identifier of the Wi-Fi generator to remove.

Swift code snippet:

// Remove specific Wi-Fi generator
manager.removeWifiGenerator(id: wifiId)
print("Removed Wi-Fi generator: \‍(wifiId)")

Objective C code snippet:

// Remove specific Wi-Fi generator
[self.measurementManager removeWifiGeneratorWithId:wifiId];
NSLog(@"Removed Wi-Fi generator: %@", wifiId);

◆ removeWifiGenerators

- (void) removeWifiGenerators

Method removes all Wi-Fi generators.

Swift code snippet:

// Remove all Wi-Fi generators
manager.removeWifiGenerators()
print("Removed all Wi-Fi generators")

Objective C code snippet:

// Remove all Wi-Fi generators
[self.measurementManager removeWifiGenerators];
NSLog(@"Removed all Wi-Fi generators");

◆ removeWifiRttGenerator:

- (void) removeWifiRttGenerator: (nonnull NSString *) hash

Method removes a specific Wi-Fi RTT generator by its identifier.

Parameters
hashUnique identifier of the Wi-Fi RTT generator to remove.

Swift code snippet:

// Remove specific Wi-Fi RTT generator
manager.removeWifiRttGenerator(hash: wifiRttId)
print("Removed Wi-Fi RTT generator: \‍(wifiRttId)")

Objective C code snippet:

// Remove specific Wi-Fi RTT generator
[self.measurementManager removeWifiRttGeneratorWithHash:wifiRttId];
NSLog(@"Removed Wi-Fi RTT generator: %@", wifiRttId);

◆ removeWifiRttGenerators

- (void) removeWifiRttGenerators

Method removes all Wi-Fi RTT generators.

Swift code snippet:

// Remove all Wi-Fi RTT generators
manager.removeWifiRttGenerators()
print("Removed all Wi-Fi RTT generators")

Objective C code snippet:

// Remove all Wi-Fi RTT generators
[self.measurementManager removeWifiRttGenerators];
NSLog(@"Removed all Wi-Fi RTT generators");

The documentation for this class was generated from the following file: