Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ieee802154-radio-eval
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
ieee802154-radio-eval
Commits
73c038e3
Commit
73c038e3
authored
3 years ago
by
Torben Petersen
Browse files
Options
Downloads
Patches
Plain Diff
Adds serial ids for mapping, fixed some typos
parent
a2de98f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
software/coordinator2.py
+22
-9
22 additions, 9 deletions
software/coordinator2.py
with
22 additions
and
9 deletions
software/coordinator2.py
+
22
−
9
View file @
73c038e3
...
...
@@ -25,8 +25,21 @@ POWERS = [-17, -7, 3]
PAYLOADS
=
[
'
short
'
,
'
looooooooooooong
'
]
LOG_DIRECTORY
=
"
test
"
SERVER_ONE_NODES
=
{
'
-
'
:
(
'
INGA red
'
,
0x10
)
,
'
-
'
:
(
'
INGA blue
'
,
0x20
)
,
'
-
'
:
(
'
TelosB
'
,
0x30
)
,
'
-
'
:
(
'
SAMR21-Xpro
'
,
0x40
)
,
'
-
'
:
(
'
nrf52840dk
'
,
0x50
)
,
'
-
'
:
(
'
Universal Node
'
,
0x60
)
,
'
-
'
:
(
'
IBR-Node
'
,
0x70
)
}
SERVER_TWO_NODES
=
{
'
-
'
:
(
'
INGA red
'
,
0x10
)
,
'
-
'
:
(
'
INGA blue
'
,
0x20
)
,
'
-
'
:
(
'
TelosB
'
,
0x30
)
,
'
-
'
:
(
'
SAMR21-Xpro
'
,
0x40
)
,
'
-
'
:
(
'
nrf52840dk
'
,
0x50
)
,
'
-
'
:
(
'
Universal Node
'
,
0x60
)
,
'
-
'
:
(
'
IBR-Node
'
,
0x70
)
}
SERVER_ONE_NODES
=
{
'
A502C3WP
'
:
(
'
INGA red
'
,
0x10
)
,
'
A502C1PW
'
:
(
'
INGA blue
'
,
0x20
)
,
'
MFSLXP25
'
:
(
'
TelosB
'
,
0x30
)
,
'
ATML2127031800008867
'
:
(
'
SAMR21-Xpro
'
,
0x40
)
,
'
000683430717
'
:
(
'
nrf52840dk
'
,
0x50
)
,
'
A50285BI
'
:
(
'
Universal Node
'
,
0x60
)
,
'
B5DF8DFF
'
:
(
'
IBR-Node
'
,
0x70
)
}
SERVER_TWO_NODES
=
{
'
A502C3X3
'
:
(
'
INGA red
'
,
0x10
)
,
'
A502C1PF
'
:
(
'
INGA blue
'
,
0x20
)
,
'
MFT4LLAN
'
:
(
'
TelosB
'
,
0x30
)
,
'
ATML2127031800010891
'
:
(
'
SAMR21-Xpro
'
,
0x40
)
,
'
000683871093
'
:
(
'
nrf52840dk
'
,
0x50
)
,
'
A50285BI
'
:
(
'
Universal Node
'
,
0x60
)
,
'
B5DB8D0E
'
:
(
'
IBR-Node
'
,
0x70
)
}
#logger = Logger(__file__)
Base
=
declarative_base
()
...
...
@@ -235,7 +248,7 @@ class PRREvalClient(Thread):
self
.
file_formatter
=
logging
.
Formatter
(
'
%(message)s
'
)
self
.
logger
.
debug
(
"
Init done
"
)
def
get_code_id
(
server_name
,
node_serial_id
):
def
get_code_id
(
self
,
server_name
,
node_serial_id
):
if
server_name
==
self
.
server_one
:
id
=
0x01
...
...
@@ -244,7 +257,7 @@ class PRREvalClient(Thread):
(
node_type
,
node_id_offset
)
=
SERVER_ONE_NODES
[
serial_id
]
id
+=
node_id_offset
return
id
self
.
logger
.
w
r
aning
(
"
Unknown Node!
"
)
self
.
logger
.
wa
r
ning
(
"
Unknown Node!
"
)
return
-
1
elif
server_name
==
self
.
server_two
:
...
...
@@ -255,11 +268,11 @@ class PRREvalClient(Thread):
(
node_type
,
node_id_offset
)
=
SERVER_TWO_NODES
[
serial_id
]
id
+=
node_id_offset
return
id
self
.
logger
.
w
r
aning
(
"
Unknown Node!
"
)
self
.
logger
.
wa
r
ning
(
"
Unknown Node!
"
)
return
-
1
else
:
self
.
logger
.
w
r
aning
(
"
Unknown server!
"
)
self
.
logger
.
wa
r
ning
(
"
Unknown server!
"
)
return
-
1
def
on_disconnect
(
self
,
client
,
userdata
,
rc
):
...
...
@@ -296,8 +309,8 @@ class PRREvalClient(Thread):
self
.
logger
.
debug
(
"
Got nodes: {}
"
.
format
(
received_nodes
))
for
node_serial_id
in
received_nodes
:
#check if node is already known
if
node_serial_id
not
in
self
.
registered_nodes
.
keys
()
and
node_serial_id
is
not
''
:
#check if node is
not empty. ToDo: Check if node is
already known
!
if
node_serial_id
is
not
''
:
#set up logging components
#create dir for Logs files if it does not exist yet!
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment