a47e20cb64
2. 稍微优化了一下系统配置类 3. 增加了系统版本号,便于区分系统版本,方便OTA 4. 重写OTA的逻辑,完成了Cpp的OTA封装,测试通过
48 lines
960 B
C++
48 lines
960 B
C++
//
|
|
// Created by misaki on 2025/9/2.
|
|
//
|
|
#pragma once
|
|
#include <string>
|
|
/**
|
|
* 本模块提供各种杂项工具类,基本都来源于对底层驱动的封装
|
|
*
|
|
*
|
|
*/
|
|
class ToolsClass {
|
|
public:
|
|
/**
|
|
* 获取当前时间
|
|
* @return 当前时间
|
|
*/
|
|
static std::string getCurrentTime();
|
|
|
|
/**
|
|
* 获取esp32s3的芯片序列号
|
|
* @return 芯片序列号
|
|
*/
|
|
static std::string getChipSerialNumber();
|
|
|
|
/**
|
|
* 获取esp32s3的MAC地址
|
|
* @return MAC地址
|
|
*/
|
|
static std::string getChipMAC();
|
|
|
|
|
|
/**
|
|
* 生成SN码
|
|
* @param mac mac地址
|
|
* @param chipID 芯片ID
|
|
* @return 生成的SN码
|
|
*/
|
|
static std::string GenerateSN(const std::string& mac, const std::string& chipID);
|
|
|
|
/**
|
|
* 获取设备版本
|
|
* @return 设备版本
|
|
*/
|
|
static std::string getDeviceVersion();
|
|
static std::string device_version; // 设备版本
|
|
};
|
|
|