Skip to content

UTBM-Alison/Bluetooth-POC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VitalBLE - Ultra-Fast Bluetooth LE Library

Tests et Coverage codecov License

🚀 Performance Breakthrough

VitalBLE delivers 4.5 Mbps throughput - a 67x improvement over standard implementations:

  • Before: 81KB in 10 seconds (0.067 Mbps)
  • After: 81KB in ~150ms (4.5 Mbps)

✨ Features

  • Ultra-High Performance: 4.5 Mbps BLE data transmission
  • Windows Native: C++/WinRT implementation with JNI bridge
  • Configurable UUIDs: Heart Rate Service by default, fully customizable
  • Modern Testing: JUnit 5 test suite with comprehensive coverage
  • Production Ready: Maven library with JaCoCo code coverage
  • Easy Integration: Simple Java API with singleton pattern

🏗️ Architecture

┌─────────────────┐    JNI     ┌──────────────────┐    BLE/GATT    ┌─────────────┐
│   Java API      │ ◄────────► │  C++/WinRT DLL   │ ◄─────────────► │   Mobile    │
│   VitalBLE      │            │   BLEServer      │                 │    App      │
└─────────────────┘            └──────────────────┘                 └─────────────┘

🚦 Quick Start

Maven Dependency

<dependency>
    <groupId>com.vital</groupId>
    <artifactId>vital-ble</artifactId>
    <version>1.0.0</version>
</dependency>

Basic Usage

import static com.vital.VitalBLE.*;

// Start BLE server with default Heart Rate Service
VitalBLE ble = VitalBLE.getInstance();
ble.configure("0000180D-0000-1000-8000-00805F9B34FB", 
              "00002A37-0000-1000-8000-00805F9B34FB");

// Send data at 4.5 Mbps
byte[] data = "Hello BLE World!".getBytes();
boolean success = ble.send(data);

// Shutdown when done
ble.shutdown();

Custom UUIDs

VitalBLE ble = VitalBLE.getInstance();
ble.configure("12345678-1234-1234-1234-123456789ABC",
              "87654321-4321-4321-4321-CBA987654321");

📊 Performance Metrics

Metric Value
Throughput 4.5 Mbps
Chunk Size 200 bytes (optimized)
Latency ~150ms for 81KB
Improvement 67x faster than baseline
DLL Size 409KB

🧪 Testing

The project uses modern JUnit 5 with JaCoCo code coverage:

# Run all tests
mvn test

# Run configuration tests only (no native DLL required)
mvn test -Dtest=VitalBLEConfigTest

# Generate coverage report
mvn jacoco:report

Test Categories

  • VitalBLEConfigTest: Configuration validation (9 tests)
  • VitalBLETest: High-level API testing
  • BLEServerTest: Native interface testing

🏗️ CI/CD Pipeline

Simple et efficace :

  • Tests automatiques : JUnit 5 avec JaCoCo coverage
  • Pull Request checks : Couverture de code sur les PRs
  • Artifacts : Rapports de couverture téléchargeables

📋 Requirements

Runtime

  • Java: 11 or higher
  • OS: Windows 10/11 with Bluetooth LE support
  • Runtime: Visual Studio 2022 C++ Runtime

Development

  • Java: 11+ (tested on 11, 17, 21, 25)
  • Maven: 3.6+
  • IDE: VS Code, IntelliJ, or Eclipse

🔧 Building from Source

# Clone repository
git clone https://github.com/UTBM-Alison/Bluetooth-POC.git
cd Bluetooth-POC/vital-ble

# Build and test
mvn clean compile test

# Package with dependencies
mvn clean package

# Generate coverage report
mvn jacoco:report

📁 Project Structure

vital-ble/
├── src/
│   ├── main/java/
│   │   ├── VitalBLE.java        # High-level API
│   │   └── BLEServer.java       # Native JNI interface
│   └── test/java/
│       ├── VitalBLEConfigTest.java    # Configuration tests
│       ├── VitalBLETest.java          # API tests
│       └── BLEServerTest.java         # Native tests
├── resources/
│   └── BLEServer.dll            # Windows native library
├── .github/workflows/           # CI/CD automation
├── target/site/jacoco/          # Coverage reports
└── pom.xml                      # Maven configuration

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make changes with tests: mvn test
  4. Commit changes: git commit -m 'Add amazing feature'
  5. Push to branch: git push origin feature/amazing-feature
  6. Open a Pull Request

📈 Code Coverage

Suivi de la couverture de code :

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🏆 Achievements

  • 67x Performance Improvement: From 0.067 Mbps to 4.5 Mbps
  • Modern Architecture: JUnit 5 + JaCoCo + GitHub Actions
  • Production Ready: Complete CI/CD pipeline with automated testing
  • Cross-Platform CI: Testing on Ubuntu and Windows
  • Security Focused: OWASP dependency scanning included

Made with ❤️ for ultra-fast BLE communication

About

Sending data with bluetooth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published