diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-06-07 01:40:32 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-12-02 04:05:15 +0300 |
commit | 3aed59276c2b7275603f6da18377b77718948667 (patch) | |
tree | 86816d82ab02b6e4761175d599f5749490706792 /src/protocol_17/defines.cc | |
parent | d86ca1e596b094cba101e0e3e6c8cdb71f8116e9 (diff) |
wipp17
Diffstat (limited to 'src/protocol_17/defines.cc')
-rw-r--r-- | src/protocol_17/defines.cc | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/src/protocol_17/defines.cc b/src/protocol_17/defines.cc new file mode 100644 index 0000000..2589861 --- /dev/null +++ b/src/protocol_17/defines.cc @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: BSD-3-Clause + +#include <iostream> + +#include "defines.h" +#include "types.h" + +namespace p17 { + +const std::map<CommandType, std::string> raw_commands = { + {CommandType::GetProtocolID, "PI"}, + {CommandType::GetSeriesNumber, "ID"}, + {CommandType::GetCPUVersion, "VFW"}, + {CommandType::GetSecondaryCPUVersion, "VFW2"}, + {CommandType::GetDeviceModel, "MD"}, + {CommandType::GetRatedInformation, "PIRI"}, + {CommandType::GetGeneralStatus, "GS"}, + {CommandType::GetPowerStatus, "PS"}, + {CommandType::GetWorkingMode, "MOD"}, + {CommandType::GetWarningStatus, "WS"}, + {CommandType::GetFlags, "FLAG"}, + {CommandType::GetCurrentTime, "T"}, + {CommandType::GetTotalGenerated, "ET"}, + {CommandType::GetYearGenerated, "EY"}, + {CommandType::GetMonthGenerated, "EM"}, + {CommandType::GetDayGenerated, "ED"}, + {CommandType::GetHourGenerated, "EH"}, + {CommandType::GetACInputVoltageRange, "GOV"}, + {CommandType::GetACInputFrequencyRange, "GOF"}, + {CommandType::GetMaximumOutputPower, "OPMP"}, + {CommandType::GetMaximumGridOutputPower, "GPMP"}, + {CommandType::GetSolarInputMPPTRange, "MPPTV"}, + {CommandType::GetSolarInputVoltageRange, "SV"}, + {CommandType::GetLCDSleepTimeout, "LST"}, + {CommandType::GetDefaults, "DI"}, + {CommandType::GetBatterySettings, "BATS"}, + {CommandType::GetMachineModel, "DM"}, + {CommandType::GetMachineAdjustableRanges, "MAR"}, + {CommandType::GetFaults, "CFS"}, + {CommandType::GetFaultsHistory, "HFS"}, + {CommandType::GetEnergyControlStatus, "HECS"}, + {CommandType::GetACInputLongTimeHighestAvgVoltage, "GLTHV"}, + {CommandType::GetFirstGeneratedEnergySavedTime, "FET"}, + {CommandType::GetFeedWaitTime, "FT"}, + {CommandType::GetACChargingTimeBucket, "ACCT"}, + {CommandType::GetACLoadsSupplyTimeBucket, "ACLT"}, + {CommandType::GetFeedingGridPowerCalibration, "FPADJ"}, + {CommandType::GetFeedInPowerFactor, "FPPF"}, + {CommandType::GetAutoAdjustPFWithPowerInformation, "AAPF"}, + {CommandType::GetAllowOneOfSTPhaseLossStatus, "PLE"}, + {CommandType::SetLoads, "LON"}, + {CommandType::SetFlag, "P"}, + {CommandType::SetDateTime, "DAT"}, + {CommandType::SetACInputHighestVoltageForFeedingPower, "GOHV"}, + {CommandType::SetACInputHighestFrequencyForFeedingPower, "GOHF"}, + {CommandType::SetACInputLowestVoltageForFeedingPower, "GOLV"}, + {CommandType::SetACInputLowestFrequencyForFeedingPower, "GOLF"}, + {CommandType::SetMaxOutputPower, "OPMP"}, + {CommandType::SetMaxFeedingGridPower, "GPMP"}, + {CommandType::SetSolarInputHighestVoltage, "SIHV"}, + {CommandType::SetSolarInputLowestVoltage, "SILV"}, + {CommandType::SetSolarInputHighestMPPTVoltage, "MPPTHV"}, + {CommandType::SetSolarInputLowestMPPTVoltage, "MPPTLV"}, + {CommandType::SetLCDSleepTimeout, "LST"}, + {CommandType::SetBatteryMaxChargingCurrent, "MCHGC"}, + {CommandType::SetBatteryMaxChargingVoltage, "MCHGV"}, + {CommandType::SetACInputLongTimeHighestAverageVoltage, "GLTHV"}, + {CommandType::SetBatteryDischargingVoltage, "BATDV"}, + {CommandType::SetSolarEnergyDistributionOfPriority, "SEP"}, + {CommandType::SetEnergyDistribution, "ED"}, + {CommandType::SetBatteryChargerApplicationInFloatingCharging, "BCA"}, + {CommandType::SetMachineModel, "DM"}, + {CommandType::SetDefaults, "PF"}, + {CommandType::SetACOutputFreq, "F"}, + {CommandType::SetACOutputRatedVoltage, "V"}, + {CommandType::SetFeedWaitTime, "FT"}, + {CommandType::SetACChargingTimeBucket, "ACCT"}, + {CommandType::SetACLoadsSupplyTimeBucket, "ACLT"}, + {CommandType::SetBatteryType, "BT"}, + {CommandType::SetBatteryInstallTime, "BIT"}, + {CommandType::SetLiFeBatterySelfTest, "BST"}, + {CommandType::SetACChargerKeepBatteryVoltageSetting, "ACCB"}, + {CommandType::SetBatteryTempSensorCompensation, "BTS"}, + {CommandType::SetBatteryMaxACChargingCurrent, "MUCHGC"}, + {CommandType::SetFeedingGridPowerCalibration, "FPADJ"}, + {CommandType::SetBatteryMaxDischargingCurrentInHybridMode, "BDCM"}, + {CommandType::SetFeedInPowerFactor, "FPPF"}, + {CommandType::SetParallelOutput, "PALE"}, + {CommandType::SetRPhaseFeedingGridPowerCalibration, "FPRADJ"}, + {CommandType::SetSPhaseFeedingGridPowerCalibration, "FPSADJ"}, + {CommandType::SetTPhaseFeedingGridPowerCalibration, "FPTADJ"}, + {CommandType::SetAutoAdjustPFWithPowerInformation, "AAPF"}, + {CommandType::SetAllowOneOfSTPhaseLoss, "PLE"}, + {CommandType::SetEmergencyPowerSupplyControl, "EPS"} +}; + +const std::map<int, std::string> fault_codes = { + {1, "BUS exceed the upper limit"}, + {2, "BUS dropp to the lower limit"}, + {3, "BUS soft start circuit timeout"}, + {4, "Inverter voltage soft start timeout"}, + {5, "Inverter current exceed the upper limit"}, + {6, "Temperature over"}, + {7, "Inverter relay work abnormal"}, + {8, "Current sample abnormal when inverter doesn't work"}, + {9, "Solar input voltage exceed upper limit"}, + {10, "SPS power voltage abnormal"}, + {11, "Solar input current exceed upper limit"}, + {12, "Leakage current exceed permit range"}, + {13, "Solar insulation resistance too low"}, + {14, "Inverter DC current exceed permit range when feed power"}, + {15, "The AC input voltage or frequency has been detected different between master CPU and slave CPU"}, + {16, "Leakage current detect circuit abnormal when inverter doesn't work"}, + {17, "Communication loss between master CPU and slave CPU"}, + {18, "Communicate data discordant between master CPU and slave CPU"}, + {19, "AC input ground wire loss"}, + {22, "Battery voltage exceed upper limit"}, + {23, "Over load"}, + {24, "Battery disconnected"}, + {26, "AC output short"}, + {27, "Fan lock"}, + {32, "Battery DC-DC current over"}, + {33, "AC output voltage too low"}, + {34, "AC output voltage too high"}, + {35, "Control board wiring error"}, + {36, "AC circuit voltage sample error"}, +}; + +const std::array<Flag, 6> flags = {{ + {"BUZZ", 'A', "Mute buzzer beep"}, + {"BUZS", 'B', "Mute buzzer beep in standby mode"}, + {"BUZB", 'C', "Mute buzzer beep only on battery discharged status"}, + {"GENI", 'D', "Generator as AC input"}, + {"WAIR", 'E', "Wide AC input range"}, + {"NGRF", 'F', "N/G relay function"}, +}}; + +}
\ No newline at end of file |