Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
PastureGateway
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
steven.sha
PastureGateway
Commits
a510cf6a
Commit
a510cf6a
authored
Jun 20, 2019
by
leon.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add nothing
parent
918658a8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
189 deletions
+70
-189
ModualAlarm.cs
ModbusDemo/Common/ModualAlarm.cs
+10
-7
Form1.cs
ModbusDemo/windows/Form1.cs
+60
-182
No files found.
ModbusDemo/Common/ModualAlarm.cs
View file @
a510cf6a
...
...
@@ -49,13 +49,16 @@ namespace ModbusDemo.Common
}
public
static
async
Task
vPublishAlarmPackageJson
(
IMqttClient
mqttClient
)
{
var
message
=
new
MqttApplicationMessageBuilder
()
.
WithTopic
(
Form1
.
sAlarmTopic
)
.
WithPayload
(
sAlarmJson
)
.
WithAtMostOnceQoS
()
.
WithRetainFlag
(
false
)
.
Build
();
await
mqttClient
.
PublishAsync
(
message
);
if
(
mqttClient
.
IsConnected
==
true
)
{
var
message
=
new
MqttApplicationMessageBuilder
()
.
WithTopic
(
Form1
.
sAlarmTopic
)
.
WithPayload
(
sAlarmJson
)
.
WithAtMostOnceQoS
()
.
WithRetainFlag
(
false
)
.
Build
();
await
mqttClient
.
PublishAsync
(
message
);
}
}
public
static
void
vSet_Modual_Alarm
(
byte
byModbusID
,
ushort
usAlarmCodde
,
bool
bSetAlarm
,
byte
byCommFailTimes
,
params
string
[]
strChannalList
)
{
...
...
ModbusDemo/windows/Form1.cs
View file @
a510cf6a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment