|
@@ -264,7 +264,7 @@ void ups_status_response(char *data)
|
|
|
|
|
|
|
|
|
tmp = atof(value);
|
|
|
- if(tmp < 10){
|
|
|
+ if(tmp < 7){
|
|
|
UPS.SOC = round(100*(tmp - sSettings.UPS_Setting.Ucellmin)/(sSettings.UPS_Setting.Ucellmax - sSettings.UPS_Setting.Ucellmin));
|
|
|
}
|
|
|
else{
|
|
@@ -688,19 +688,10 @@ int ups_metac_service_pdu(cmdMegaTecEnums_t command)
|
|
|
if (ups_megatec_rx_pdu())
|
|
|
{
|
|
|
megatec_send = true;
|
|
|
- if(sSettings.UPS_Setting.type_ups == ups_kestar){
|
|
|
- if(strncmp(ups_pdu.data, "ACK", 3) == 0)
|
|
|
- return 1;
|
|
|
- else if(strncmp(ups_pdu.data, "NAK", 3) == 0)
|
|
|
- return 0;
|
|
|
- }
|
|
|
- else if(sSettings.UPS_Setting.type_ups == ups_voltronic){
|
|
|
- if(strncmp(ups_pdu.data, "(ACK", 4) == 0)
|
|
|
- return 1;
|
|
|
- else if(strncmp(ups_pdu.data, "(NAK", 4) == 0)
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
+ if(strncmp(ups_pdu.data, "ACK", 3) == 0 || strncmp(ups_pdu.data, "(ACK", 4) == 0)
|
|
|
+ return 1;
|
|
|
+ else if(strncmp(ups_pdu.data, "NAK", 3) == 0 || strncmp(ups_pdu.data, "(NAK", 4) == 0)
|
|
|
+ return 0;
|
|
|
}
|
|
|
megatec_send = true;
|
|
|
}
|
|
@@ -743,7 +734,7 @@ void request_task(void* params)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ if(megatec_send){
|
|
|
memset(ups_pdu.data, 0, UPS_PDU_MAX_LEN);
|
|
|
megatec_send= false;
|
|
|
UPS.Flag_Present = false;
|
|
@@ -752,7 +743,7 @@ void request_task(void* params)
|
|
|
ups_megatec_process_pdu(ups_protocol_id_req);
|
|
|
|
|
|
megatec_send=true;
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
switch(sSettings.UPS_Setting.type_ups){
|
|
|
case ups_kestar:
|