feat: enhance RFID handling for Bambu tags and update API interactions
This commit is contained in:
1 parent
29e8b09c5a
commit
5f9ad13ea9
7 files changed
+155
-45
No files matched your search
+33
-8
@@ -57,12 +57,12 @@ Geräte sollten regelmäßig einen Heartbeat senden, um ihren Status auf "Online
|
||||
- **Request Body:**
|
||||
```json
|
||||
{
|
||||
"spool_id": 123, // Optional: Interne ID der Spule
|
||||
"tag_uuid": "E280...", // Optional: RFID Tag UID
|
||||
"tag_uuid": "sf:25:s5:...", // Optional: RFID Tag UID (bevorzugt)
|
||||
"spool_id": 123, // Optional: Interne ID der Spule (Fallback)
|
||||
"measured_weight_g": 850.5 // Aktuelles Gesamtgewicht in Gramm
|
||||
}
|
||||
```
|
||||
*Hinweis: Mindestens `spool_id` oder `tag_uuid` muss angegeben werden.*
|
||||
*Hinweis: Mindestens `tag_uuid` oder `spool_id` muss angegeben werden. `tag_uuid` hat Vorrang vor `spool_id`.*
|
||||
|
||||
- **Response:**
|
||||
```json
|
||||
@@ -80,12 +80,14 @@ Verknüpft eine Spule mit einem Lagerort.
|
||||
- **Request Body:**
|
||||
```json
|
||||
{
|
||||
"spool_id": 123, // Optional: ID der Spule
|
||||
"spool_tag_uuid": "E280...", // Optional: RFID UID der Spule
|
||||
"location_id": 1, // Optional: ID des Ortes
|
||||
"location_tag_uuid": "LOC-1" // Optional: RFID UID des Ortes
|
||||
"spool_tag_uuid": "sf:25:s5:...", // Optional: RFID UID der Spule (bevorzugt)
|
||||
"spool_id": 123, // Optional: ID der Spule (Fallback)
|
||||
"location_tag_uuid": "LOC-1" // Optional: RFID UID des Ortes (bevorzugt)
|
||||
"location_id": 1 // Optional: ID des Ortes (Fallback)
|
||||
}
|
||||
```
|
||||
*Hinweis: RFID UUIDs haben Vorrang vor IDs. Mindestens Spule und Standort müssen durch UUID oder ID identifiziert werden.*
|
||||
|
||||
- **Response:**
|
||||
```json
|
||||
{
|
||||
@@ -115,10 +117,33 @@ Das System sendet eine Anfrage an die IP des Geräts.
|
||||
- **Erwartete Response vom Gerät:**
|
||||
```json
|
||||
{
|
||||
"tag_uuid": "E2801234..." // Die UID des beschriebenen Tags
|
||||
"tag_uuid": "sf:25:s5:..." // Die UID des beschriebenen Tags
|
||||
}
|
||||
```
|
||||
|
||||
### RFID Ergebnis zurückmelden
|
||||
Das Device meldet das Ergebnis des Schreibvorgangs an das System zurück.
|
||||
|
||||
- **Endpunkt:** `POST /api/v1/devices/rfid-result`
|
||||
- **Request Body:**
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"tag_uuid": "sf:25:s5:a1:00",
|
||||
"spool_id": 123,
|
||||
"remaining_weight_g": 850.5
|
||||
}
|
||||
```
|
||||
*Hinweis: `remaining_weight_g` ist optional und wird beim erstmaligen Beschreiben einer neuen Spule benötigt.*
|
||||
|
||||
- **Felder:**
|
||||
- `success` (boolean): War der Schreibvorgang erfolgreich?
|
||||
- `tag_uuid` (string): Die UID des geschriebenen Tags
|
||||
- `spool_id` (int, optional): DB-ID der Spule falls vorhanden
|
||||
- `remaining_weight_g` (float, optional): Aktuelles Gewicht der Spule beim Schreibvorgang
|
||||
|
||||
- **Response:** `{"status": "ok", "message": "Processed successfully"}`
|
||||
|
||||
---
|
||||
|
||||
## 6. Fehlercodes
|
||||
|
||||
Reference in new issue
Block a user