OP-BTS/OP-BT Bluetooth Optical Probe supports Bluetooth 5.0 BLE/SPP dual mode, compatible with platforms such as Windows, Android, and iOS. However, the connection methods may vary across different platforms, which can be confusing to new users.
Windows
On Windows, it’s easy and similar to USB or RS232 optical probes. All you need is to complete the Bluetooth pairing successfully and assign a virtual COM port to the newly paired OP-BTS/OP-BT. Then, select the corresponding COM port in your application to use it normally.
iOS/Android and Other Handheld Device Operating Systems
If you plan to use a meter reading application on Android/iOS, things might not be that straightforward. It’s because iOS/Andorid does not have virtual COM port likes computer OS. Your meter reading application must be modified to connect to the OP-BTS/OP-BT Bluetooth optical head using Bluetooth API.
Two Types of Bluetooth Connections:
A common miss-understanding of Bluetooth is there is only one Bluetooth protocal. But actually there are two types of Bluetooth. Though they share same communcation protocal, but the way it operates are quite different.
- Bluetooth Classic (BR/EDR): Commonly known as SPP (Serial Port Profile), suitable for Windows and Android platforms. Using SPP Bluetooth, you need to enter a pairing code to pair with the device.
- Bluetooth Low Energy (BLE): Uses the GATT protocol for reading/writing characteristics and subscribing to notifications, supported by Windows, MacOS, Android, and iOS platforms. Often, devices are selected directly in the application without the need for pairing.
The latest versions of Android support both SPP and BLE. However, iOS only supports BLE for Bluetooth connections. Therefore, to reduce development effort and ensure compatibility, we recommend using BLE for pairing, connecting, and communication.
BLE Service and Characteristic
In Bluetooth communication, a Primary Service UUID (Universally Unique Identifier) is a fundamental concept that defines the core functionality a Bluetooth device offers.
OP-BT / OP-BTS provide services and characteristics by GATT protocal.
Primary Service UUID: 18F0
Characteristic UUID | Property | Description |
---|---|---|
2AF0 |
Read/Notification | For receiving data from device |
2AF1 |
Write | For sending commands to device |
Example
// Enable notifications for the data transfer characteristic
BluetoothCharacteristic dataCharacteristic = ...; // Characteristic 2AF0
BluetoothDescriptor cccd = await dataCharacteristic.descriptors.firstWhere(
(d) => d.uuid.toString() == '00002902-0000-1000-8000-00805f9b34fb'
);
// Enable notifications
await cccd.write([0x01, 0x00]);
// Set up notification callback
dataCharacteristic.value.listen((value) {
// Process received data
print('Received data: ${String.fromCharCodes(value)}');
});
// Disable notifications (when no longer needed)
await cccd.write([0x00, 0x00]);
Demos
To assistant you on development, we prepared a couple of guides and demos to guides you. If you already familiar with iOS/Andorid development, it won’t be anything hard.
Flutter on Windows
Python on Windows
C/C++ on Windows
Reference Documents
Contact for Assistant
When you have any quetions, please don’t hesitate to contact us. We will be very happy to provide any assistant.