## 4 Concept of a DAid(r) Smart Socks-Based Biofeedback System
### System Activities and Fragments  
Activities of the system consist of Main Activity and Statistics Fragment. Main Activity acts as the main entry point that displays the dashboard with current training sessions and connection status to smart socks. It initializes Bluetooth service and connects to sensors on creation, while additionally checking the connection status and refreshing UI. Statistics Fragment displays real time analyses of players' movements; it receives live data from the sensors and handles the UI updates with graphs and tables. The system's architecture has been developed according to the chosen connection types, Figure 5.  
1. DAid(r) smart socks--Wireless sensors that collect plantar pressure data and transmit it over Bluetooth to the server, which is represented by the computer.
2. Server--Computer acts as a server that receives the sensor data over Bluetooth. It performs initial data receiving by opening Bluetooth serial connection, sending the command to start sending data for the sensors. In each iteration, the server checks if any data have been received (serialPort. BytesToRead > 0). If data are available, it reads the data, processes each packet, validates it, and stores the normalized results. Since the server and the client (step 3) are both on the same computer, the data remains on the same machine, simplifying communication.  
Client--Client periodically requests the latest data from the server on the same computer. The client acts as an intermediary for the Graphical User Interface, enabling it to visualize the data like pressure readings, center of pressure and calibration status, or any warnings that the server may have found. The client raises an event every time new data are received, which can be used for real-time feedback and updates in the GUI application (step 4) and MR application.
4. Application--The Graphical User Interface (GUI) on the same computer displays an application, which is the initial part of the biofeedback solution. The GUI initializes and establishes a connection with the client-server system. It offers controls that allow users to start or stop data collection from the socks. This interface allows users to insert their data and choose the complexity level of their workout as well as starting it. It sends the data needed for the feedback in the HMD. The input data of the application are sent back to the client side, which proceeds with sending them to the HMD.
5. MR application--Receives data from the computer's application. It uses the processed data to create an immersive environment where the feedback is being visualized, providing engaging and interactive experiences, such as VR-based training simulations. It gives details on the changed foot plantar pressure, helping to correct it.
6. Data transfer over Bluetooth--The DAid(r) smart socks device is connected to the server via the COM port by Bluetooth. The server begins by sending a command over the serial connection \"BT'START\". This command instructs the smart socks to start streaming data packets. Each data packet is sent 10-15 times per second, containing around 3-4 data points. The server continuously listens for incoming data on the COM port and reads them into the buffer. Then, it scans the buffer to detect packets that start with the Start Byte and end with the Stop Byte. Each sensor's value can be represented by two bytes, so for six sensors, the data section would be around 12 bytes.
7. Data Transfer over WiFi--The client side establishes a connection over TCP/IP with the head-mounted device and by the command received from the GUI application side (e.g., \"Start\"), starts to send sensor data such as the COP to the HMD.