Commit c2f37e6a by chenxi

实现功能:修改读取实时监测数据接口,增加异常打印

1 parent 3931d931
...@@ -38,14 +38,14 @@ public class GetDataController extends BaseController { ...@@ -38,14 +38,14 @@ public class GetDataController extends BaseController {
RealTimeReq req = new RealTimeReq(); RealTimeReq req = new RealTimeReq();
RealTimeDataReqData data = new RealTimeDataReqData(); RealTimeDataReqData data = new RealTimeDataReqData();
data.setPileId(Ocpp16Helper.strToBcd(pileId, data.getPileId())); data.setPileId(Ocpp16Helper.strToBcd(pileId, data.getPileId()));
data.setGunNumber(Ocpp16Helper.strToBcd(gunNumber, new byte[1])[0]); data.setGunNumber((byte) 1);
TcpCallback<TcpRsp> tcpRspTcpCallback = ServerMain.getServer().sendSync(req); TcpCallback<TcpRsp> tcpRspTcpCallback = ServerMain.getServer().sendSync(req);
TcpRsp tcpRsp = tcpRspTcpCallback.get(); TcpRsp tcpRsp = tcpRspTcpCallback.get();
return R.ok().data(tcpRsp); return R.ok().data(tcpRsp);
} catch (Exception e) { } catch (Exception e) {
log.error("读取实时监测数据error:{}", e.getMessage()); log.error("读取实时监测数据error:{}", e, e.getMessage());
return R.error();
} }
return R.ok();
} }
} }
...@@ -212,7 +212,8 @@ public class ByteUtils { ...@@ -212,7 +212,8 @@ public class ByteUtils {
* @date 2018年1月17日 上午9:36:49 * @date 2018年1月17日 上午9:36:49
* @since 1.0.0 * @since 1.0.0
*/ */
public static byte getByte(byte[] buff, int offset) { public static byte
getByte(byte[] buff, int offset) {
return buff[offset]; return buff[offset];
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!