|
@@ -102,13 +102,13 @@ void send_MegaTec_cmd(cmdMegaTecEnums_t command)
|
|
memset(req, 0, 10);
|
|
memset(req, 0, 10);
|
|
if(TimeParamFloat >= 1 && TimeParamFloat < 10)
|
|
if(TimeParamFloat >= 1 && TimeParamFloat < 10)
|
|
{
|
|
{
|
|
- sprintf(req, "%s0%f\r", MegaTecCMD[command], TimeParamFloat);
|
|
|
|
|
|
+ sprintf(req, "%s0%d\r", MegaTecCMD[command], (uint16_t)TimeParamFloat);
|
|
}
|
|
}
|
|
else if(TimeParamFloat < 1){
|
|
else if(TimeParamFloat < 1){
|
|
- sprintf(req, "%s.%f\r", MegaTecCMD[command], 10*TimeParamFloat);
|
|
|
|
|
|
+ sprintf(req, "%s.%d\r", MegaTecCMD[command], (uint16_t)(10*TimeParamFloat));
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- sprintf(req, "%s%f\r", MegaTecCMD[command], TimeParamFloat);
|
|
|
|
|
|
+ sprintf(req, "%s%d\r", MegaTecCMD[command], (uint16_t)TimeParamFloat);
|
|
}
|
|
}
|
|
ups_send_block(req, strlen(req));
|
|
ups_send_block(req, strlen(req));
|
|
}
|
|
}
|
|
@@ -355,7 +355,7 @@ int ups_metac_service_pdu(cmdMegaTecEnums_t command)
|
|
megatec_send = true;
|
|
megatec_send = true;
|
|
if(strncmp(ups_pdu.data, "ACK", 3) == 0)
|
|
if(strncmp(ups_pdu.data, "ACK", 3) == 0)
|
|
return 1;
|
|
return 1;
|
|
- else if(strncmp(ups_pdu.data, "NCK", 3) == 0)
|
|
|
|
|
|
+ else if(strncmp(ups_pdu.data, "NAK", 3) == 0)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
}
|
|
}
|