Bluetooth Behavior
Native iOS ==> Bluetooth framework
Most supported Bluetooth devices function similarly and you can follow the instructions in Bluetooth Operations and Passive Read to work with them.
However, a few of our supported devices have additional requirements and/or considerations that you need to be aware of. Those are covered below:
Agamatrix
Approval Required from i-SENS
The Agamatrix Jazz Wireless 2 glucose meter, supported via a custom Bluetooth integration (peripheralID = 32
), requires an authentication key, which is provided by Agamatrix, in order to communicate with the meter. To configure your Agamatrix authentication key for use with the Agamatrix meter in the Validic Mobile SDK:
- Create a file named
agamatrix-authkey.json
- File contents should be a JSON dictionary with the key "
key
" and the value of your Agamatrix key without the hex prefix notation0x
. For example, if your key is0x011234567890987654321
, then the file should contain{"key": "011234567890987654321"}
. - Add the
agamatrix-authkey.json
file to the root of your mobile project.
CVS Health
Approval Required from i-SENS
The CVS Health Advanced Bluetooth Glucose Meter, supported via a custom Bluetooth integration (peripheralID = 33
), requires an authentication key, which is provided by Agamatrix, in order to communicate with the meter. To configure your Agamatrix authentication key for use with the CVS Health meter in the Validic Mobile SDK:
- Create a file named
cvshealth-authkey.json
- File contents should be a JSON dictionary with the key "
key
" and the value of your Agamatrix key without the hex prefix notation0x
. For example, if your key is0x055234567890987654987
then the file should contain{"key": "055234567890987654987"}
. - Add the
cvshealth-authkey.json
file to the root of your mobile project.
The CVS Health Digital Glass Body Analysis Scale is supported in an alpha state in the Validic Mobile SDKs. Body weight is the only metric that can be retrieved from the scale and a new user profile will be created on the scale during pairing. Users cannot pair to an existing user profile and historical readings (readings captured prior to pairing) will not be synced.
Roche CoaguChek INR Meters
Approval Required from Roche
Interaction with Roche CoaguChek INR meters, supported via a custom Bluetooth integration (peripheralID = 51
), requires a Validic License file, provided by Validic Support. The license file (named validic.license
) must be included in the root of the main app bundle; to do so, add it to the Xcode project and make sure validic.license
is listed in the "Copy Bundle Resources" section of the app target's "Build Phases".
Roche CoaguChek INR meters have an uncommon reading workflow, which requires that the end user provide their meter's unique encryption key. That encryption key is required to decrypt the reading values captured from the user's meter. Without a valid encryption key, foreground and passive reads with the INR meter will fail. Because this workflow is specific to the Roche INR meter, any Validic clients implementing the INR meter Bluetooth integration must build a user experience (modal or screen) to capture the meter's encryption key from the user. This key must then be passed by the client to the Validic SDK where it will be stored and used to decrypt readings.
Note: the key is a long string of hexadecimal characters, so it is recommended to implement a QR code reading to capture the code displayed on the meter.
One way to do this would be to request it during the pairing process:
- Initiate pairing with peripheral ID 51
- Upon successful pair, the
VLDBluetoothPeripheralDelegate
callback (bluetoothPeripheralController:didPairPeripheral:metadata:
) will be fired. Store themetadata
object'speripheralUUID
string to a variable - it will be used to store the encryption key into the Validic SDK. - Prompt the user for the encryption key, found in the device's menu at "Other" > "About" (possibly by using a QR code reader).
- Store the encryption key into the SDK. To do this, pass the user's encryption key, the constant
kVLDBluetoothPeripheralDataKeyEncryptionKey
, and the peripheral's UUID (frommetadata.peripheralUUID
in the pairing success delegate callback) to the CoaguChekVLDPeripheral
'sstoreData:forKey:ofPeripheralUUID:
method.
Example code:
// This example requests the encryption key from inside the pairing success callback for simplicity. Note that the only requirement is that the `metadata.peripheralUUID` value is captured from this callback so it can be used in the `storeData:forKey:ofPeripheralUUID:` call.
// This example uses a UIAlertController text field to collect the encryption key from the user. It is recommended to use a QR code reader to reduce the likelihood of errors.
- (void)bluetoothPeripheralController:(VLDBluetoothPeripheralController *)controller didPairPeripheral:(VLDBluetoothPeripheral *)peripheral metadata:(VLDBluetoothOperationMetadata *)metadata {
if (peripheral.peripheralID == 51) {
// Peripheral is CoaguChek, ask for encryption key
UIAlertController *coaguChekEncryptionKeyAlertController = [UIAlertController alertControllerWithTitle:@"Enter Encryption Key" message:@"Please enter the CoaguChek's encryption key." preferredStyle:UIAlertControllerStyleAlert];
[coaguChekEncryptionKeyAlertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"Encryption Key";
}];
[coaguChekEncryptionKeyAlertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSString *encryptionKey = [[coaguChekEncryptionKeyAlertController textFields][0] text];
// Note: it is recommended to perform validation on the length and contents of the provided encryption key (if not scanned via QR code) to reduce the possibility of uncaught input error. The entered encryption key should be a 32-character hexadecimal string.
// Store the encryption key into the Validic SDK
[peripheral storeData:encryptionKey forKey:kVLDBluetoothPeripheralDataKeyEncryptionKey ofPeripheralUUID:metadata.peripheralUUID];
}]];
[coaguChekEncryptionKeyAlertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"Encryption key entry canceled.");
}]];
[self presentViewController:coaguChekEncryptionKeyAlertController animated:YES completion:nil];
}
}
Passive Read Considerations
There's some specific behavior you need to be aware of related to passive read. Please review Passive Read for more details.
Updated 18 days ago