## 5 Devices
### The Viatom Checkme O2 Device  
The HealthTracker system is complemented by sensors for continuous monitoring and alerting of oxygen saturation level and heart rate, so both our devices together can monitor all the parameters reported as relevant in innovative telemedicine [19]. The Viatom Checkme O2 device is a wrist oximeter that can measure blood oxygen levels, heart rate, and movements (see Figure 5). It can send the values to a nearby smartphone in real time or store them locally in files that can later be downloaded on a smartphone. It can also  
Figure 4: Sequence diagram illustrating the interactions between the HDC device and a BLE client during the retrieval of real-time data. Figure 3: The HDC device block design. warn the user if the current readings are at a dangerous level by triggering the vibration of the device itself. This device can be used along with the ViHealth app provided by the manufacturer to take advantage of additional features. Concerning the hardware, the device uses a ring sensor to collect oxygen saturation and heart rate data, while the main unit is a bracelet containing a BLE 4.0 chip, a 3.7 v 130 mAh rechargeable battery, an accelerometer, and a small OLED display. The display can show the current oxygen saturation level, the heartbeat rate, and step count values. The device has an _Ingress Protection_ (IP) rating of 22, which protects the device from water spray IP22 is enough since the device is removed from patients during personal hygiene, and it has an internal memory able to store up to 40 h of recording data. Concerning the software, the device comes with a mobile app that, through a BLE connection, can download the files containing the data recorded offline, store them on the smartphone, and examine them, providing user-friendly charts. Since the source code of the ViHealth app was not available, the Viatom Checkme O2 device could not be easily integrated into the HealthTracker project. Therefore, we reverse-engineered the communication protocol between this device and the ViHealth app to exploit it in HealthTracker. To do so, we analyzed the Bluetooth data exchanged between the device and the app during operations such as downloading recordings and requesting the current values. This process allowed us to obtain enough information on how to receive real-time data about oxygen saturation and heart rate, how to receive files, and how this information is arranged while disregarding the acquisition of data pertaining to steps or movement because it is not important in our scenario. All the aforementioned functionalities are accessible through a single service, with UUID 14839 AC4-707E-415C-9A42-167340 Cf2339, within the GATT interface, which, in turn, has two characteristics: one for sending commands and one for receiving data after subscribing for notifications. To elaborate further, the former characteristic is identified by the UUID 8B00 ACE7-EB0B-49B0-BBE9-AEE0A26E1A3, while the latter is denoted by the UUID 0734594A-A8E7-4B1A-A6B1-CD5243059A57. The specifics of the protocol are beyond the scope of this paper, so the following is a summary of the behavior. The app acts as a client, and after subscribing for notifications, it can send commands containing different fields. An example of a command showcasing the full structure is shown in Figure 6. The first field is a one-byte preamble used to identify the start of a command, followed by a one-byte command identifier. Subsequently, an XOR operation between the previous byte and 0 xFF is performed. The fourth field is a two-byte acknowledgment used in specific operations to confirm received data on the client's end. Moreover, the structure involves a two-byte value represented in the little-endiian format, denoting the length of the subsequent field, which is a variable-size payload containing the necessary parameters when the command requires them. Lastly, the command concludes with a one-byte checksum computed using the CRC-8-CCITT algorithm.