forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathota.h
More file actions
31 lines (21 loc) · 728 Bytes
/
Copy pathota.h
File metadata and controls
31 lines (21 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef OTA_H
#define OTA_H
#include <Arduino.h>
#include <BLECharacteristic.h>
// Initialize OTA service and characteristics
void ota_init(BLEService *service);
// Set BLE characteristics (called after BLE init)
void ota_set_characteristics(BLECharacteristic *controlChar, BLECharacteristic *dataChar);
// Handle incoming OTA command
void ota_handle_command(uint8_t *data, size_t length);
// Process OTA in main loop (non-blocking)
void ota_loop();
// Get current OTA status
uint8_t ota_get_status();
// Check if OTA is in progress
bool ota_is_busy();
// Cancel any ongoing OTA operation
void ota_cancel();
// Notify status change via BLE
void ota_notify_status(uint8_t status, uint8_t progress = 0);
#endif // OTA_H