Step 7 — Battery¶
Purpose¶
Assign a battery to the customer's new subscription. The salesperson scans and connects to the battery via Bluetooth, the app reads its energy level and identity, calculates the initial electricity cost, and reports the service completion to the backend.
Workflow¶
- Scan the QR code on the battery.
- Connect to the battery via Bluetooth Low Energy (BLE).
-
Read the battery's data from its BLE services:
BLE Service Data Read Description ATT (Attribute) Battery ID Unique identifier of the battery DTA (Data) Energy level Energy stored in the battery (kWh) -
The app calculates the initial electricity cost based on the energy level and the customer's subscription rate.
- The app reports the service completion to the backend system.
What Gets Recorded¶
| Field | Description |
|---|---|
| Battery ID | Unique identifier read from the ATT service |
| Energy level | Energy stored in the battery (kWh) from the DTA service |
| Initial electricity cost | Calculated based on energy level and per-kWh rate |
| Service report | Sent to the backend confirming battery assignment |
UI Behavior¶
- A scan area with clear visual guidance for QR placement
- Once connected via BLE, the battery ID and energy reading are displayed
- The calculated initial electricity cost is shown for confirmation
- A success indicator confirms the battery has been assigned and reported
Error Handling¶
- QR code unreadable — retry scan or enter battery ID manually
- BLE connection failed — ensure Bluetooth is enabled and the battery is in range; retry
- Energy read timeout — the app retries automatically; if it persists, re-scan
- Backend report failed — the app queues the report and retries when connectivity is restored
Actions¶
- Continue proceeds to Step 8 — Done
- Back returns to Step 6 — Vehicle