Skip to content

ArsElectronicaFuturelab/DeepSyncDataRelay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deep Sync Relay Server

The Deep Sync Relay is a C#/.NET 7 application designed to relay and manage real-time biometric data between wearable devices and a client application over TCP. It is receiving data from multiple wearables, and forwards it to a client app.

Features

  • TCP Communication: Listens to incoming data from wearables and the client app on configurable ports.
  • User Management: Tracks connected users (wearables), assigns unique IDs, and manages timeouts.
  • Data Relay: Receives, and forwards heart rate and SpO2 data.
  • Command Handling: Supports commands from the client app to wearables (e.g., assigning new IDs).
  • Debug Mode: Simulates multiple users and generates test data for development and testing (-d).
  • Threaded Architecture: Uses threads and async tasks for efficient, concurrent data handling.

Architecture Overview

  • Wearables connect to the server via TCP, sending JSON-formatted biometric data.
  • Client Application connects via TCP to receive user data and send commands.
  • The server maintains a concurrent dictionary of users and relays messages as needed.

Usage

Prerequisites

Running the Server

  1. Build the project in Visual Studio 2022.
  2. Run the server from the command line or within Visual Studio.

Command-Line Arguments

  • -d
    Enable debug mode (generates test users and data).
  • -ip <address>
    Set the TCP address for the client application (default: 192.168.101.223).

Example:

DeSyServer.exe -d -ip 192.168.19.203

TCP Ports

  • Wearable to Server: 53397
  • Server to Wearable: 53396
  • App to Server: 43396
  • Server to App: 43397

Data Format

All communication uses JSON. Example user data: { "userId": 1, "ip": "192.168.111.10", "heartRate": { "last": 75, "average": 72 }, "spO2": { "lastSpO2": 98.5, "averageSpO2": 98.0 }, "lastUpdate": "2025-11-25T12:34:56" }

Main Classes

  • DeSyDataRelay: Main server logic, TCP handling, user management.
  • UserData: Represents a user's biometric data and connection info.
  • NewIdCmd, DeepSyncCmd: Command structures for communication.

Extending

  • Add new sensor types by extending UserData and updating JSON handling.
  • Adjust timeouts and port numbers as needed in DeSyDataRelay.

License

???

About

The Deep Sync Data Relay allows connection to multiple Deep Sync wearables, manages the receives data and forwards it to a connected client.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages