mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 修改名称
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package com.jsowell.common.core.domain.ykc;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 云快充 帧类型码
|
||||
* FrameTypeCode
|
||||
@@ -126,11 +129,6 @@ public enum YKCFrameTypeCode {
|
||||
return BytesUtil.intToBytesLittle(code, 1);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
byte[] bytes = BytesUtil.intToBytesLittle(9999, 1);
|
||||
System.out.println(YKCUtils.frameType2Str(bytes));
|
||||
}
|
||||
|
||||
public static YKCFrameTypeCode fromCode(byte code) {
|
||||
for (YKCFrameTypeCode item : YKCFrameTypeCode.values()) {
|
||||
if (item.getCode() == code) {
|
||||
@@ -305,6 +303,10 @@ public enum YKCFrameTypeCode {
|
||||
this.responseFrameType = responseFrameType;
|
||||
}
|
||||
|
||||
public byte[] getRequestFrameBytes() {
|
||||
return BytesUtil.intToBytesLittle(requestFrameType, 1);
|
||||
}
|
||||
|
||||
PileAnswersRelation(int requestFrameType, int responseFrameType) {
|
||||
this.requestFrameType = requestFrameType;
|
||||
this.responseFrameType = responseFrameType;
|
||||
@@ -326,6 +328,15 @@ public enum YKCFrameTypeCode {
|
||||
return BytesUtil.intToBytes(getResponseFrameTypeByRequestFrameType(frameType), 1);
|
||||
}
|
||||
|
||||
// 需要获取应答的帧类型
|
||||
public static List<String> getRequestFrameTypeList() {
|
||||
List<String> resultList = Lists.newArrayList();
|
||||
for (PileAnswersRelation relation : PileAnswersRelation.values()) {
|
||||
resultList.add(YKCUtils.frameType2Str(relation.getRequestFrameBytes()));
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user