Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ebpfCAT
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
Model registry
Operate
Environments
Monitor
Incidents
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
Martin Teichmann
ebpfCAT
Merge requests
!1
General overhaul
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
General overhaul
docs
into
master
Overview
0
Commits
21
Pipelines
2
Changes
1
Merged
Martin Teichmann
requested to merge
docs
into
master
4 years ago
Overview
0
Commits
21
Pipelines
2
Changes
1
Expand
documentation and make many things work
0
0
Merge request reports
Viewing commit
03b4a9e8
Prev
Next
Show latest version
1 file
+
5
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
03b4a9e8
fix setting SDOs
· 03b4a9e8
Martin Teichmann
authored
4 years ago
ebpfcat/ethercat.py
+
5
−
5
Options
@@ -116,7 +116,7 @@ class ObjectEntry:
if
self
.
dataType
in
(
ECDataType
.
VISIBLE_STRING
,
ECDataType
.
UNICODE_STRING
):
return
ret
.
decode
(
"
utf8
"
)
elif
self
.
dataType
.
fmt
is
None
:
elif
isinstance
(
self
.
dataType
,
int
)
or
self
.
dataType
.
fmt
is
None
:
return
ret
else
:
return
unpack
(
"
<
"
+
self
.
dataType
.
fmt
,
ret
)[
0
]
@@ -125,7 +125,7 @@ class ObjectEntry:
if
self
.
dataType
in
(
ECDataType
.
VISIBLE_STRING
,
ECDataType
.
UNICODE_STRING
):
d
=
data
.
encode
(
"
utf8
"
)
elif
self
.
dataType
.
fmt
is
None
:
elif
isinstance
(
self
.
dataType
,
int
)
or
self
.
dataType
.
fmt
is
None
:
d
=
data
else
:
d
=
pack
(
"
<
"
+
self
.
dataType
.
fmt
,
data
)
@@ -569,9 +569,9 @@ class Terminal:
async
def
sdo_write
(
self
,
data
,
index
,
subindex
=
None
):
if
len
(
data
)
<=
4
and
subindex
is
not
None
:
await
self
.
mbx_send
(
MBXType
.
COE
,
"
HBHB
"
,
CoECmd
.
SDOREQ
.
value
<<
12
,
ODCmd
.
DOWN_EXP
.
value
|
((
4
-
len
(
data
))
<<
2
),
index
,
subindex
,
data
=
data
)
MBXType
.
COE
,
"
HBHB
4s
"
,
CoECmd
.
SDOREQ
.
value
<<
12
,
ODCmd
.
DOWN_EXP
.
value
|
((
(
4
-
len
(
data
))
<<
2
)
&
0xc
)
,
index
,
subindex
,
data
)
type
,
data
=
await
self
.
mbx_recv
()
if
type
is
not
MBXType
.
COE
:
raise
RuntimeError
(
f
"
expected CoE, got
{
type
}
"
)
Loading