mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
update 电单车协议
This commit is contained in:
@@ -42,6 +42,8 @@ public abstract class AbsEBikeMessage {
|
||||
return new EBikeMessageCmd04(header, length, physicalId, messageId, command, null, checksum, new EBikeMessageCmd04.ConfirmOrder(dataBytes));
|
||||
case "06":
|
||||
return new EBikeMessageCmd06(header, length, physicalId, messageId, command, null, checksum, new EBikeMessageCmd06.PowerHeartbeat(dataBytes));
|
||||
case "12":
|
||||
return new EBikeMessageCmd12(header, length, physicalId, messageId, command, null, checksum);
|
||||
case "20":
|
||||
return new EBikeMessageCmd20(header, length, physicalId, messageId, command, null, checksum, new EBikeMessageCmd20.DeviceRegister(dataBytes));
|
||||
case "21":
|
||||
|
||||
@@ -9,8 +9,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public enum EBikeCommandEnum {
|
||||
// HEARTBEAT("01", "设备心跳包"),
|
||||
HOST_GET_SERVER_TIME("12", "主机获取服务器时间", EBikeMessageCmd12.class),
|
||||
REGISTRATION("20", "设备注册包", EBikeMessageCmd20.class),
|
||||
GET_SERVER_TIME("22", "设备获取服务器时间", EBikeMessageCmd22.class),
|
||||
DEVICE_GET_SERVER_TIME("22", "设备获取服务器时间", EBikeMessageCmd22.class),
|
||||
HEARTBEAT_2("21", "设备心跳包", EBikeMessageCmd21.class),
|
||||
CARD_OPERATION("02", "刷卡操作", EBikeMessageCmd02.class),
|
||||
SETTLEMENT_UPLOAD("03", "结算消费信息上传", EBikeMessageCmd03.class),
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.jsowell.pile.domain.ebike.deviceupload;
|
||||
|
||||
import com.jsowell.common.util.bean.SerializationUtil;
|
||||
import com.jsowell.pile.domain.ebike.AbsEBikeMessage;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 主机获取服务器时间(0x12)
|
||||
* 此命令主机每次上电后就会发送,直至服务器应答后就停止发送。如服务器无应答,则每隔3分钟发送一次请求
|
||||
* 每12小时从服务器获取一次时间,如服务器不应答则每隔3分钟发送一次请求
|
||||
* 不带RTC模块的主机不会发送此命令
|
||||
* DE 5C A9 5F,转小端模式,=0x5FA95CDE=1604934878=2020-11-09 23:14:38
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class EBikeMessageCmd12 extends AbsEBikeMessage {
|
||||
|
||||
public EBikeMessageCmd12(String header, int length, int physicalId, int messageId, String command, Object payload, int checksum) {
|
||||
super(header, length, physicalId, messageId, command, payload, checksum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parsePayload(byte[] dataBytes) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getMessageBytes() {
|
||||
byte[] serialize = SerializationUtil.serialize(this);
|
||||
return serialize;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user