This project is a Progressive Web Application (PWA) that allows users to scan for Bluetooth Low Energy (BLE) devices and initiate a self-destruction sequence on a selected device. The application is built using HTML, CSS, and JavaScript, with support for service workers to enable offline functionality.
- Scan for nearby BLE devices
- Display a list of discovered devices
- Connect to a selected BLE device
- Send a self-destruction command to the device
- Offline support via service workers
-
Clone the repository:
git clone https://github.com/AUTOMAGICKNIGHT/ble-self-destruction-pwa.git cd ble-self-destruction-pwa
-
Open the project directory in your code editor.
-
Serve the application using a local web server. For example, using Python:
python -m http.server
-
Open your browser and navigate to
http://localhost:8000
.
- Click the "Scan for BLE Devices" button to start scanning for nearby BLE devices.
- Select a device from the list by clicking on it.
- The application will connect to the selected device and send the self-destruction command.
pwa/
├── index.html
├── style.css
├── app.js
├── service-worker.js
└── manifest.json
- index.html: The main HTML file that contains the structure of the application.
- style.css: The CSS file for styling the application.
- app.js: The JavaScript file that handles BLE scanning and device communication.
- service-worker.js: The service worker file for offline support.
- manifest.json: The web app manifest file that defines the PWA metadata.
- Manifest File: The
manifest.json
file provides metadata for the PWA, including the name, short name, start URL, display mode, background color, theme color, and icons. - Service Worker: The
service-worker.js
file enables offline support by caching essential files and serving them when the network is unavailable.
Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or new features to suggest.
This project was inspired by the potential of PWA technology and BLE applications.