public AppRespone icar_SendIOCommand(AppRequest appRequest_0) { AppRespone respone = new AppRespone(); base.logMsg.FunctionName = "icar_SendIOCommand"; this.method_5(appRequest_0); if (this.method_7(appRequest_0, respone)) { int newOrderId = -1; long num2 = -1L; object obj2 = this.method_12(appRequest_0, respone); foreach (CarInfo info in base.carInfoList) { newOrderId = SendBase.CarCmdSend.GetNewOrderId(); try { base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";"); this.method_10(newOrderId, info.CarNum, appRequest_0); num2 = SendBase.CarCmdSend.icar_SendIOCommand(base.WorkId, newOrderId, info.SimNum, CmdParam.IodeviceType.南京通用计价器, ref obj2); if (num2 != 0L) { this.method_6(base.logMsg.FunctionName, info.SimNum, num2, (int) appRequest_0.OrderCode); } } catch (Exception exception) { base.errMsg.ErrorText = "下发消息指令时发生错误!"; base.log.WriteError(base.errMsg, exception); this.method_8(respone, base.errMsg.ErrorText); } } } return respone; }
protected override void btnOK_Click(object sender, EventArgs e) { base.btnOK_Click(sender, e); if (!string.IsNullOrEmpty(base.sValue)) { this.getParam(); if (base.OrderCode == CmdParam.OrderCode.设置超速报警) { base.reResult = RemotingClient.DownData_SetSpeedAlarm(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_SpeedAlarm); if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); } else { base.DialogResult = DialogResult.OK; } } else { this.appRespone = RemotingClient.DownData_icar_SendRawPackage(this.appRequest, this.pvArg); if (this.appRespone.ResultCode != 0) { MessageBox.Show(this.appRespone.ResultMsg); } else { base.DialogResult = DialogResult.OK; } } } }
protected override void btnOK_Click(object sender, EventArgs e) { base.btnOK_Click(sender, e); if (!string.IsNullOrEmpty(base.sValue) && this.getParam()) { this.appRespone = RemotingClient.DownData_icar_SendRawPackage(this.appRequest, this.pvArg); if (this.appRespone.ResultCode != 0) { MessageBox.Show(this.appRespone.ResultMsg); } else { base.DialogResult = DialogResult.OK; } } }
private object method_12(AppRequest appRequest_0, AppRespone appRespone_0) { object obj3; try { Packer packer = new Packer(); return packer.packData(this.method_11(appRequest_0.ParamCont[0])); } catch (Exception exception) { base.errMsg.ErrorText = "打包发生错误!"; base.log.WriteError(base.errMsg, exception); this.method_8(appRespone_0, base.errMsg.ErrorText); obj3 = appRespone_0; } return obj3; }
public AppRespone icar_SendRawPackage(AppRequest appRequest_0, object object_0) { AppRespone respone = new AppRespone(); base.logMsg.FunctionName = "icar_SendRawPackage"; base.logMsg.Msg = "发送:类型-" + appRequest_0.ParamType.ToString() + ",车辆-" + appRequest_0.CarValues; string str = string.Empty; base.log.WriteLog(base.logMsg); if (!base.CheckCar(appRequest_0.ParamType, appRequest_0.CarValues, appRequest_0.CarPw)) { respone.ResultMsg = base.alarmMsg.AlarmText = base.ErrorMsg; base.log.WriteAlarm(base.alarmMsg); } if (!base.isStartCommon()) { respone.ResultMsg = base.ErrorMsg; return respone; } long num = -1L; foreach (Bussiness.CarInfo info in base.carInfoList) { try { int newOrderId = SendBase.CarCmdSend.GetNewOrderId(); base.SaveCmdParm(newOrderId.ToString() + "|" + info.CarId.ToString() + ";"); base.userInfo.DownCommd.AddCarNewLogData(newOrderId, info.CarNum, "发送", appRequest_0.OrderCode.ToString(), "等待", "", str); if (info.ProtocolName == SendBase.m_ProtocolName) { TrafficRawPackage package = new TrafficRawPackage { OrderCode = CmdParam.OrderCode.命令透传, SubOrderCode = appRequest_0.OrderCode }; StringBuilder builder = new StringBuilder(); byte[] buffer = (byte[]) object_0; if (buffer != null) { for (int i = 0; i < buffer.Length; i++) { builder.Append(buffer[i].ToString("X2")); } } package.strText = builder.ToString(); string conntent = ""; string str3 = package.ToXmlString(base.CalOrderId(base.WorkId, newOrderId), info.SimNum, SendBase.m_ProtocolName, -1, "SendRawPackage", ref conntent); num = SendBase.CarCmdSend.icar_SendCmdXML(base.WorkId, newOrderId, info.SimNum, SendBase.m_ProtocolName, (int) package.OrderCode, -1, str3); } else { num = SendBase.CarCmdSend.icar_SendRawPackage(base.WorkId, newOrderId, info.SimNum, appRequest_0.CmdCode, ref object_0, appRequest_0.CommMode); } if (num != 0L) { base.alarmMsg.FunctionName = "icar_SendRawPackage"; base.alarmMsg.AlarmText = string.Concat(new object[] { "workid-", base.WorkId, ",simNum-", info.SimNum, ",OrderCode-", appRequest_0.OrderCode }); base.alarmMsg.Code = respone.ResultCode.ToString(); base.log.WriteAlarm(base.alarmMsg); } } catch (Exception exception) { respone.ResultMsg = base.ErrorMsg = base.errMsg.ErrorText = "下发消息指令时发生错误!"; respone.ResultCode = -1; base.log.WriteError(base.errMsg, exception); } } return respone; }
static RemotingClient() { RemotingClient.m_iWorkId = -1; RemotingClient.reResult = new Response(); RemotingClient.appRespone = new AppRespone(); }
public static AppRespone DownData_icar_SendRawPackage(AppRequest pRequest, object pvArg) { AppRespone appRespone; if (RemotingClient.app == null) { return RemotingClient.appRespone; } try { appRespone = RemotingClient.app.DownData_icar_SendRawPackage(pRequest, pvArg); } catch (Exception exception) { Record.execFileRecord("通讯透传协议", exception.Message); appRespone = RemotingClient.appRespone; } return appRespone; }
public static AppRespone Car_SetCommonCmd_Pass(AppRequest pAppRequest) { AppRespone appRespone; AppRespone appRespone1 = new AppRespone(); if (RemotingClient.app == null) { return appRespone1; } try { appRespone = RemotingClient.app.DownData_icar_SetCommonCmd_Pass(pAppRequest); } catch (SocketException socketException1) { SocketException socketException = socketException1; Record.execFileRecord(pAppRequest.OrderCode.ToString(), socketException.Message); appRespone = appRespone1; } catch (Exception exception1) { Exception exception = exception1; Record.execFileRecord(pAppRequest.OrderCode.ToString(), exception.ToString()); appRespone = appRespone1; } return appRespone; }
private void method_8(AppRespone appRespone_0, string string_1) { appRespone_0.ResultCode = -1; if (!string.IsNullOrEmpty(string_1)) { appRespone_0.ResultMsg = string_1; } }
private bool method_7(AppRequest appRequest_0, AppRespone appRespone_0) { bool flag = true; if (!base.CheckCar(appRequest_0.ParamType, appRequest_0.CarValues, appRequest_0.CarPw)) { flag = false; } if (flag && !base.isStartCommon()) { flag = false; } if (!flag) { this.method_8(appRespone_0, base.ErrorMsg); } return flag; }