Files
bolar_1/main/boards/board.h

40 lines
1.2 KiB
C++

#ifndef _BOARD_H_
#define _BOARD_H_
#include <string>
#include "audio/audio_codec.h"
#include "led/led.h"
#include <network_interface.h>
class Board {
public:
virtual ~Board() = default;
static Board& GetInstance();
virtual std::string GetBoardType() const = 0;
virtual AudioCodec* GetAudioCodec() = 0;
virtual Led* GetLed() = 0;
virtual NetworkInterface* GetNetwork() = 0;
virtual void StartNetwork() = 0;
virtual bool IsNetworkConnected() const = 0;
//2026-6-24 ckkj debug (关闭射频)
virtual void StopNetwork() {}
virtual int GetBatteryLevel() const { return -1; }
// Whether USB is currently charging the battery. Default false for boards
// without charge detection. Used by Application to skip low-battery
// warnings when the device is plugged in.
virtual bool IsCharging() const { return false; }
virtual void SetPowerSaveMode(bool enabled) {}
// Light-sleep shutdown equivalent to long-press power off. Default no-op
// for boards that don't implement low-power shutdown. BorlaS3Board
// overrides to drive the EXT1-wakeup light-sleep loop. Called by
// IdleWatchdog after the 10-minute idle goodbye prompt finishes.
virtual void EnterSoftOff() {}
};
#endif // _BOARD_H_