*iOS - ELM API

Add a key to Info.plist file of your app with a description of the requirement why they need Bluetooth: Privacy - Bluetooth Peripheral Usage Description

In xCode, in the Signing & Capabilities project section, add the following items: Uses Bluetooth LE accesories Acts as a Bluetooth LE accessory

When initialisingRaxelPulse SDK library, be sure to call: [[RPCPermissionsWizard returnInstance] setupBluetoothEnabled]; [RPEntry enableELM: YES];

Search ELM Devices

[[RPELMEntry instance] getELMDevicesWithCompletion:^(id  _Nullable response, NSArray * _Nullable errors) {
    for(RPELMItem *item in response) {
        NSLog(@"item.tag = %@ item.uuid = %@", item.name, item.uuid);
    }
}];

Get Vehicles

[[RPELMEntry instance] getVehicles:^(id  _Nullable response, NSArray * _Nullable errors) {
    NSLog(@"%@",response);
}];

Connect ELM with Vehicle

[[RPELMEntry instance] connectDevice:@"92D29DC3-48C0-D6A6-3700-4264BEEB4762" vehicleToken:@"28e4f4ea-b495-40ec-875b-17b48c39bc07" withCompletion:^(BOOL response, NSArray * _Nullable errors) {
    if (response) {
        // Success
    } else {
        for error in errors {
            NSLog(@"error - %@", [error localizedDescription])
    }
}];

When connecting to ELM, you may experience difficulties getting a repetitive response in the [RPELMEntry instance] connectDevice method. We recommend doing DispatchQueue.once (token: "com.<YOURAPPNAME>.elm"). The example code is shown below.

At any time you can request the status of the connection to ELM (connected/not connected) and the timestamp date of the last connection.

Last updated

Was this helpful?