|
|
@@ -41,9 +41,10 @@ namespace HBLConsole.Business |
|
|
|
/// <param name="alarmTable"></param> |
|
|
|
public void SendAlarmMessage(AlarmTable alarmTable) |
|
|
|
{ |
|
|
|
if (IOTDevServer.client != null && IOTDevServer.client.IsConnected) |
|
|
|
if (IOTDevServer.client != null && IOTDevServer.client.IsConnected && device!=null) |
|
|
|
{ |
|
|
|
alarmTable.ClientId = InternetInfo.ClientId.ToString(); |
|
|
|
alarmTable.devicename = device.devicename; |
|
|
|
string json = Tools.JsonConvertTools<IotModel<AlarmIOT>>(new IotModel<AlarmIOT> { @params = new AlarmIOT { GJXX = Tools.JsonConvertTools(alarmTable) } }); |
|
|
|
IOTDevServer.GetInstance().IOT_Publish(IOTDevServer.PubTopic,json); |
|
|
|
} |
|
|
@@ -56,8 +57,9 @@ namespace HBLConsole.Business |
|
|
|
/// <param name="logTable"></param> |
|
|
|
public void SendLogMessage(LogTable logTable) |
|
|
|
{ |
|
|
|
if (IOTDevServer.client != null && IOTDevServer.client.IsConnected) |
|
|
|
if (IOTDevServer.client != null && IOTDevServer.client.IsConnected && device != null) |
|
|
|
{ |
|
|
|
logTable.devicename = device.devicename; |
|
|
|
logTable.ClientId = InternetInfo.ClientId.ToString(); |
|
|
|
string json = Tools.JsonConvertTools<IotModel<LogIOT>>(new IotModel<LogIOT> { @params = new LogIOT { SZXX = Tools.JsonConvertTools(logTable) } }); |
|
|
|
IOTDevServer.GetInstance().IOT_Publish(IOTDevServer.PubTopic,json); |
|
|
@@ -71,7 +73,7 @@ namespace HBLConsole.Business |
|
|
|
/// <param name="json"></param> |
|
|
|
public void SendNodeStatusMessage(string json) |
|
|
|
{ |
|
|
|
if (IOTDevServer.client!=null && IOTDevServer.client.IsConnected) |
|
|
|
if (IOTDevServer.client!=null && IOTDevServer.client.IsConnected && device != null) |
|
|
|
{ |
|
|
|
string jsonstr = Tools.JsonConvertTools<IotModel<NodeStatusIOT>>(new IotModel<NodeStatusIOT> { @params = new NodeStatusIOT { NodeStatus = Tools.JsonConvertTools(json) } }); |
|
|
|
IOTDevServer.GetInstance().IOT_Publish(IOTDevServer.PubTopic,jsonstr); |
|
|
@@ -85,7 +87,7 @@ namespace HBLConsole.Business |
|
|
|
/// <param name="json"></param> |
|
|
|
public void SendTargetMessage() |
|
|
|
{ |
|
|
|
if (IOTDevServer.client != null && IOTDevServer.client.IsConnected) |
|
|
|
if (IOTDevServer.client != null && IOTDevServer.client.IsConnected && device != null) |
|
|
|
{ |
|
|
|
string kzsx = string.Empty; |
|
|
|
string jbsx = Tools.JsonConvertTools<DevSX>(new DevSX |
|
|
|