Work with Bluetooth
Working with Bluetooth
VRMaze offers a data acquisition module using the Bluetooth Low Energy protocol. This protocol enables data acquisition from specific sensors such as respiration or heart rate sensors.
Bluetooth acquisition
Bluetooth acquisition is based on the Bluetooth Low Energy standard.
Bluetooth protocol support
In VRmaze version 2023, only 0x180d standard heart sensors are supported.
Connection to peripherals
The device must be paired with the computer before it can be used in VRmaze. VRmaze does not recognize unpaired devices.
To connect to a Bluetooth device, you need to know 3 of its parameters:
- Its name
- The service to be used
- The service feature to subscribe to.
VRmaze offers a generic Bluetooth management entity for which these 3 parameters are required.
In addition to these 3 parameters, a fourth allows you to assign an identifier in the form of an integer to the entity in question.
Device identification in VRMaze
In VRmaze, each device is assigned an integer identifier. The purpose of this identifier is to enable the specific device to be referenced in registration entities.
How do I obtain information about a device?
The device name is noted in the Windows Bluetooth device list.
The other two parameters are more complex to obtain and require the use of specific tools. InMind-VR offers a tool based on the BleWinrtDll
library, which scans devices, their services and service characteristics.
This tool is available here
This tool allows you to know the identifiers of services and features in order to integrate them into VRmaze. It should be noted that only a few services are usable in VRmaze, and these services comply with the Bluetooth Low Energy standard. These identifiers are also standardized (for example, a heart sensor will always have an identifier starting with 0000180d
, i.e. 0x180d).
Service and Feature Identifiers
The identifiers entered as parameters in VRmaze need not be the exact identifiers. For a cardiac sensor, the service identifier 180d
is sufficient to find the service whose complete identifier includes this character string.
Bluetooth service feature
Very often a service supported by VRmaze has only one or two characteristics.
Special Bluetooth instruction
VRmaze offers a special instruction to enable the Bluetooth manager to connect to all the devices required for experimentation. In fact, it can take up to 10 seconds to connect to a set of devices. This instruction is useful if you don't want to start a test until you're sure that all devices are connected.
Bluetooth connection instruction
The Bluetooth connection instruction will terminate automatically when all devices are connected. The default maximum time associated with the instruction is not taken into account.
Bluetooth connection instruction
The Bluetooth connection instruction is a simple text instruction with its own behavior.
Bluetooth data storage entities
A Bluetooth device driver does not, on its own, store the data it receives. To do this, as with all other devices, logging entities must be integrated into each trial.
Bluetooth recording
VRmaze version 2023 only supports the registration of heart sensor services to the 0x180d
standard. There are 2 entities, one for saving HR and the second for saving RR.
Each registration entity has a device identifier. This identifier must correspond to one of the protocol's Bluetooth device handlers.