mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 12:35:07 +08:00
uploadFirmware 上传固件接口
This commit is contained in:
@@ -24,6 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -291,8 +293,16 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Constants.updateServerPort);
|
||||
String numHex = Integer.toHexString(21);
|
||||
byte[] bytes = BytesUtil.hexString2Bytes(numHex);
|
||||
System.out.println(bytes);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pushUpdateFileCommand(UpdateFirmwareCommand command) {
|
||||
public void pushUpdateFileCommand(UpdateFirmwareCommand command) {
|
||||
List<String> pileSns = command.getPileSnList();
|
||||
if (CollectionUtils.isEmpty(pileSns)) {
|
||||
return;
|
||||
@@ -323,11 +333,12 @@ public class YKCPushCommandServiceImpl implements YKCPushCommandService {
|
||||
byte[] ratedPowerByteArr = BytesUtil.checkLengthAndBehindAppendZero(Constants.zeroByteArray, 4);
|
||||
|
||||
// 升级服务器地址
|
||||
byte[] updateServerAddressByteArr = BytesUtil.checkLengthAndBehindAppendZero(BytesUtil.str2Asc(Constants.updateServerIP), 32);
|
||||
// byte[] updateServerAddressByteArr = BytesUtil.checkLengthAndBehindAppendZero(BytesUtil.str2Asc(Constants.updateServerIP), 32);
|
||||
byte[] updateServerAddressByteArr = BytesUtil.checkLengthAndBehindAppendZero(BytesUtil.str2Asc(command.getServerAddress()), 32);
|
||||
|
||||
// 升级服务器端口
|
||||
byte[] updateServerPortByteArr = BytesUtil.checkLengthAndBehindAppendZero(Constants.updateServerPort, 4);
|
||||
// byte[] updateServerPortByteArr = BytesUtil.checkLengthAndBehindAppendZero(BytesUtil.str2Bcd("15"), 4);
|
||||
// byte[] updateServerPortByteArr = BytesUtil.checkLengthAndBehindAppendZero(Constants.updateServerPort, 4);
|
||||
byte[] updateServerPortByteArr = BytesUtil.checkLengthAndBehindAppendZero(BytesUtil.hexString2Bytes(Integer.toHexString(command.getPort())), 4);
|
||||
|
||||
// 用户名
|
||||
byte[] userNameByteArr = BytesUtil.checkLengthAndBehindAppendZero(BytesUtil.str2Asc(Constants.updateServerUserName), 32);
|
||||
|
||||
Reference in New Issue
Block a user