File upload. Yeah
This commit is contained in:
@@ -15,6 +15,7 @@ enum buzz_frame_type
|
||||
BUZZ_FRAME_RESPONSE = 0x10,
|
||||
BUZZ_FRAME_ACK = 0x11,
|
||||
BUZZ_FRAME_ERROR = 0x12,
|
||||
BUZZ_FRAME_SUCCESS = 0x13,
|
||||
|
||||
BUZZ_FRAME_FILE_START = 0x20,
|
||||
BUZZ_FRAME_FILE_CHUNK = 0x21,
|
||||
@@ -37,6 +38,10 @@ enum buzz_data_type
|
||||
|
||||
BUZZ_DATA_FILE_GET = 0x20,
|
||||
BUZZ_DATA_FILE_PUT = 0x21,
|
||||
BUZZ_DATA_TAGS_GET = 0x22,
|
||||
BUZZ_DATA_TAGS_PUT = 0x23,
|
||||
|
||||
BUZZ_DATA_FW_UPDATE = 0x30,
|
||||
|
||||
BUZZ_DATA_LS = 0x40,
|
||||
};
|
||||
@@ -62,6 +67,11 @@ struct __attribute__((packed)) buzz_resp_error
|
||||
uint16_t error_code; /* Bis 0xFF reserviert für Standard-Fehler, 0x100+ für spezifische Fehler */
|
||||
};
|
||||
|
||||
struct __attribute__((packed)) buzz_resp_success
|
||||
{
|
||||
uint8_t data_type; /* Der Befehl, der erfolgreich war (z.B. BUZZ_DATA_FILE_PUT) */
|
||||
};
|
||||
|
||||
/* Payload für eine Standard-Anfrage (Request) */
|
||||
struct __attribute__((packed)) buzz_request_payload
|
||||
{
|
||||
@@ -142,4 +152,17 @@ void buzz_proto_buf_free(uint8_t **buf);
|
||||
/* Übergabe eines empfangenen Frames an den Protokoll-Thread */
|
||||
int buzz_proto_submit_frame(struct buzz_frame_msg *msg);
|
||||
|
||||
|
||||
/* Gibt die Anzahl der freien Slabs zurück (abzüglich Reserve) */
|
||||
uint16_t buzz_proto_get_free_rx_slabs(void);
|
||||
|
||||
/* Baut und sendet ein ACK Frame */
|
||||
void buzz_proto_send_ack(buzz_transport_reply_fn reply_cb, uint16_t credits);
|
||||
|
||||
/* Sendet einen Success-Frame unter Wiederverwendung eines bestehenden Slabs (Zero-Copy) */
|
||||
void buzz_proto_send_success_reusing_slab(buzz_transport_reply_fn reply_cb, uint8_t data_type, uint8_t *slab);
|
||||
|
||||
/* Sendet einen Error-Frame unter Wiederverwendung eines bestehenden Slabs (Zero-Copy) */
|
||||
void buzz_proto_send_error_reusing_slab(buzz_transport_reply_fn reply_cb, uint16_t error_code, uint8_t *slab);
|
||||
|
||||
#endif /* BUZZ_PROTO_H */
|
||||
Reference in New Issue
Block a user