mirror of
https://github.com/mattintech/pyBTMCP.git
synced 2026-07-11 10:41:54 +00:00
- Fix HR variation to use smooth sinusoidal algorithm instead of erratic jumps - Clamp HR values to ±3 of target (was exceeding bounds) - Add Pydantic Field validation for device values in API - Add runtime BPM validation in MCP server - Add battery slider control for HR monitor - Add distance display and reset button for treadmill - Add UI/API version display in header - Firmware: web portal improvements, battery/distance controls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
41 lines
875 B
C
41 lines
875 B
C
#ifndef WEB_PORTAL_H
|
|
#define WEB_PORTAL_H
|
|
|
|
#include <Arduino.h>
|
|
|
|
/**
|
|
* Initialize and start the web portal
|
|
* Runs on AP interface at 192.168.4.1
|
|
*/
|
|
void setupWebPortal();
|
|
|
|
/**
|
|
* Handle web portal requests (call in loop)
|
|
*/
|
|
void handleWebPortal();
|
|
|
|
/**
|
|
* Get status info for web portal display
|
|
*/
|
|
struct PortalStatus {
|
|
bool wifiConnected;
|
|
bool mqttConnected;
|
|
String ipAddress;
|
|
String deviceType;
|
|
bool bleStarted;
|
|
uint32_t treadmillDistance;
|
|
uint8_t batteryLevel;
|
|
};
|
|
|
|
// Callback for resetting treadmill distance
|
|
typedef void (*ResetDistanceCallback)();
|
|
void setResetDistanceCallback(ResetDistanceCallback callback);
|
|
|
|
// Callback for setting battery level
|
|
typedef void (*SetBatteryCallback)(uint8_t level);
|
|
void setSetBatteryCallback(SetBatteryCallback callback);
|
|
|
|
void updatePortalStatus(const PortalStatus& status);
|
|
|
|
#endif // WEB_PORTAL_H
|