mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-05 02:19:56 +08:00
!23 0x61 地锁数据上送
* 0x61 地锁数据上送 * Merge remote-tracking branch 'origin/master' * 云快充协议上行命令处理类 - 地锁状态/报警信息帧 (V1.5.0版本) 命令码:0x61 (地锁状态/报警信息帧上行命令) * Merge remote-tracking branch 'origin/master' * Merge remote-tracking branch 'origin/master' * Merge remote-tracking branch 'origin/master' * Merge remote-tracking branch 'origin/master' * Revert "命令码:0x17 (参数配置帧上行命令)" * 命令码:0x17 (参数配置帧上行命令)
This commit is contained in:
@@ -122,9 +122,20 @@ public interface PileProtocolService {
|
||||
*/
|
||||
void onOtaResponse(UplinkQueueMessage uplinkQueueMessage, Callback callback);
|
||||
|
||||
/*
|
||||
* BMS充电握手
|
||||
/**
|
||||
* 处理BMS握手信息
|
||||
*
|
||||
* @param uplinkQueueMessage 上行消息
|
||||
* @param callback 回调
|
||||
*/
|
||||
void onBmsHandshake(UplinkQueueMessage uplinkQueueMessage, Callback callback);
|
||||
|
||||
/**
|
||||
* 处理地锁状态信息
|
||||
*
|
||||
* @param uplinkQueueMessage 上行消息
|
||||
* @param callback 回调
|
||||
*/
|
||||
void onLockStatus(UplinkQueueMessage uplinkQueueMessage, Callback callback);
|
||||
|
||||
}
|
||||
@@ -434,6 +434,25 @@ public class DefaultPileProtocolService implements PileProtocolService {
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockStatus(UplinkQueueMessage uplinkQueueMessage, Callback callback) {
|
||||
log.info("接收到地锁状态信息 {}", uplinkQueueMessage);
|
||||
GroundLockStatusProto groundLockStatusProto = uplinkQueueMessage.getGroundLockStatusProto();
|
||||
String pileCode = groundLockStatusProto.getPileCode();
|
||||
String gunCode = groundLockStatusProto.getGunCode();
|
||||
int lockStatus = groundLockStatusProto.getLockStatus();
|
||||
int parkStatus = groundLockStatusProto.getParkStatus();
|
||||
int lockBattery = groundLockStatusProto.getLockBattery();
|
||||
int alarmStatus = groundLockStatusProto.getAlarmStatus();
|
||||
|
||||
log.info("地锁状态信息: 桩编码: {}, 枪号: {}, 车位锁状态: {}, 车位状态: {}, 地锁电量: {}%, 报警状态: {}",
|
||||
pileCode, gunCode, lockStatus, parkStatus, lockBattery, alarmStatus);
|
||||
|
||||
// TODO 处理相关业务逻辑,比如保存地锁状态信息到数据库
|
||||
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
private static Period createPeriod(int sn, LocalTime beginTime, LocalTime endTime, PricingModelFlag flag) {
|
||||
Period period = new Period();
|
||||
period.setSn(sn);
|
||||
|
||||
@@ -220,6 +220,10 @@ public class ProtocolUplinkConsumerService extends AbstractConsumerService imple
|
||||
|
||||
pileProtocolService.onOtaResponse(uplinkQueueMsg, callback);
|
||||
|
||||
} else if (uplinkQueueMsg.hasGroundLockStatusProto()) {
|
||||
|
||||
pileProtocolService.onLockStatus(uplinkQueueMsg, callback);
|
||||
|
||||
} else {
|
||||
|
||||
callback.onSuccess();
|
||||
|
||||
Reference in New Issue
Block a user