Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
shastry
Node_Red LoRa
Commits
5969109f
Commit
5969109f
authored
Jun 26, 2020
by
shastry
Browse files
Upload New File
parent
d36adb1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Node Code/testnode.js
0 → 100644
View file @
5969109f
module
.
exports
=
function
(
RED
)
{
function
create_yaml
(
config
)
{
RED
.
nodes
.
createNode
(
this
,
config
);
var
node
=
this
;
node
.
on
(
'
input
'
,
function
(
msg
)
{
if
(
config
.
authentication_method
==
"
otaa
"
){
modified
=
"
'application key':
"
+
config
.
application_key
+
"
,'device eui':
"
+
config
.
device_eui
+
"
,'network key':
"
+
config
.
network_key
}
else
modified
=
"
'app session key':
"
+
config
.
app_session_key
+
"
,'device_address':
"
+
config
.
device_address
+
"
,'device eui':
"
+
config
.
device_eui
+
"
,'network key':
"
+
config
.
network_key
;
msg
.
payload
=
"
configuration: {'username':
"
+
config
.
username
+
"
,'password':
"
+
config
.
password
+
"
,'applications':{'application1':{'description application':
"
+
config
.
application_description
+
"
,'application name':
"
+
config
.
application_name
+
"
,'devices':{'device1':{'authentication method':
"
+
config
.
authentication_method
+
"
,'description device':
"
+
config
.
description_device
+
"
,'device eui':
"
+
config
.
device_eui
+
"
,'device name':
"
+
config
.
device_name
+
"
,'configuration':{
"
+
modified
+
"
}}}}}}
"
;
node
.
send
(
msg
);
});
}
RED
.
nodes
.
registerType
(
"
test_node_lora
"
,
create_yaml
);
}
\ No newline at end of file
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