Release:5.20灰测

This commit is contained in:
2026-05-21 10:01:28 +08:00
parent 8a5a32b139
commit fd65e9c6a2
68 changed files with 4329 additions and 1489 deletions

View File

@@ -5,42 +5,46 @@ ChargerManager g_charger_manager = {0};
/*充电桩序列号*/
const uint8_t piles_serial[6][7] = {
// {0x88, 0x26, 0x01, 0x13, 0x12, 0x00, 0x01},
{0x32, 0x01, 0x06, 0x01, 0x16, 0x92, 0x45},
{0x32, 0x01, 0x06, 0x01, 0x16, 0x92, 0x44},
{0x32, 0x01, 0x06, 0x01, 0x16, 0x92, 0x43},
{0x32, 0x01, 0x06, 0x01, 0x16, 0x92, 0x42},
{0x32, 0x01, 0x06, 0x01, 0x11, 0x15, 0x58},
{0x32, 0x01, 0x06, 0x01, 0x11, 0x16, 0x54},
{0x88, 0x26, 0x01, 0x13, 0x12, 0x00, 0x01},
{0x88, 0x26, 0x01, 0x13, 0x12, 0x00, 0x02},
{0x88, 0x26, 0x01, 0x13, 0x12, 0x00, 0x03},
{0x88, 0x26, 0x01, 0x13, 0x12, 0x00, 0x04},
{0x88, 0x26, 0x01, 0x13, 0x12, 0x00, 0x05},
{0x32, 0x01, 0x06, 0x01, 0x11, 0x15, 0x54},
};
/**
* @brief 初始化充电桩管理器
* @note 初始化充电桩管理器,设置充电桩数量和每个充电桩的初始状态
*/
void init_chargers(void) {
void init_chargers(void)
{
g_charger_manager.charger_count = MAX_CHARGER_COUNT;
for (int i = 0; i < g_charger_manager.charger_count; i++) {
for (int i = 0; i < g_charger_manager.charger_count; i++)
{
ChargerPile *ctx = &g_charger_manager.charger_piles[i];
memcpy(ctx->login_info.charger_serial, piles_serial[i], 7);
memcpy(ctx->charger_serial, piles_serial[i], CHARGER_SERIAL_LENGTH);
memcpy(ctx->login_info.charger_serial, piles_serial[i], CHARGER_SERIAL_LENGTH);
ctx->get_model = false;
ctx->is_udp_online = false;
ctx->step = 0;
ctx->step_tick = 0;
ctx->login_info.charger_type = CHARGER_TYPE_DC;
ctx->login_info.gun_num = MAX_GUN_PER_CHARGER;
ctx->login_info.protocol_ver = 0x10; // V1.6
strcpy((char*)ctx->login_info.software_ver, "V4.1.50");
strcpy((char *)ctx->login_info.software_ver, "V4.1.50");
ctx->login_info.net_conn_type = 0; // SIM
memset(ctx->login_info.sim, 0, 10);
ctx->login_info.tele_factory = 0x00; // 移动
// 初始化枪
for (int g = 0; g < ctx->login_info.gun_num; g++) {
for (int g = 0; g < ctx->login_info.gun_num; g++)
{
ctx->guns[g].gun_index = g + 1;
ctx->guns[g].gun_step = 0;
ctx->guns[g].gun_step_tick = 0;
ctx->guns[g].real_time_data.status = 0; // 离线
}
}