Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
flowagent
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node-red
flowagent
Commits
74489dc2
Commit
74489dc2
authored
May 09, 2020
by
Chavee Issariyapat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset flowchannel when channel endpoint is updated
parent
f6b95010
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
2 deletions
+23
-2
coordinator.js
+13
-0
flowagent.js
+5
-0
mqttclient.js
+4
-1
package.json
+1
-1
No files found.
coordinator.js
View file @
74489dc2
...
@@ -208,8 +208,21 @@ Coordinator.prototype.start = function() {
...
@@ -208,8 +208,21 @@ Coordinator.prototype.start = function() {
return
true
;
return
true
;
}
}
else
{
else
{
return
true
;
}
}
Coordinator
.
prototype
.
stop
=
function
()
{
if
(
this
.
started
)
{
this
.
started
=
false
;
this
.
mqttclient
.
disconnect
();
return
false
;
return
false
;
}
}
else
{
return
false
;
}
}
}
function
create
(
param
)
{
function
create
(
param
)
{
...
...
flowagent.js
View file @
74489dc2
...
@@ -65,6 +65,11 @@ FlowAgent.prototype.start = function() {
...
@@ -65,6 +65,11 @@ FlowAgent.prototype.start = function() {
else
return
false
;
else
return
false
;
}
}
FlowAgent
.
prototype
.
stop
=
function
()
{
this
.
started
=
this
.
coordinator
.
stop
();
}
FlowAgent
.
prototype
.
getInfo
=
function
()
{
FlowAgent
.
prototype
.
getInfo
=
function
()
{
return
{
return
{
broker_uri
:
this
.
option
.
broker_uri
,
broker_uri
:
this
.
option
.
broker_uri
,
...
...
mqttclient.js
View file @
74489dc2
...
@@ -22,7 +22,7 @@ function sleep(ms) {
...
@@ -22,7 +22,7 @@ function sleep(ms) {
MQTTClient
.
prototype
.
__proto__
=
EventEmitter
.
prototype
;
MQTTClient
.
prototype
.
__proto__
=
EventEmitter
.
prototype
;
MQTTClient
.
prototype
.
connect
=
function
()
{
MQTTClient
.
prototype
.
connect
=
function
()
{
var
that
=
this
;
let
that
=
this
;
if
(
this
.
client
)
delete
this
.
client
;
if
(
this
.
client
)
delete
this
.
client
;
...
@@ -49,7 +49,10 @@ MQTTClient.prototype.connect = function() {
...
@@ -49,7 +49,10 @@ MQTTClient.prototype.connect = function() {
console
.
log
(
'MQClient Error:'
);
console
.
log
(
'MQClient Error:'
);
console
.
log
(
error
);
console
.
log
(
error
);
});
});
}
MQTTClient
.
prototype
.
disconnect
=
function
()
{
this
.
client
.
end
();
}
}
MQTTClient
.
prototype
.
resetbroker
=
function
(
topic
,
payload
)
{
MQTTClient
.
prototype
.
resetbroker
=
function
(
topic
,
payload
)
{
...
...
package.json
View file @
74489dc2
{
{
"name"
:
"
flowagent
"
,
"name"
:
"
flowagent
"
,
"version"
:
"1.2.
1
"
,
"version"
:
"1.2.
2
"
,
"description"
:
""
,
"description"
:
""
,
"main"
:
"flowagent.js"
,
"main"
:
"flowagent.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
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