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
Commits
121c1a13
Commit
121c1a13
authored
9 months ago
by
Martin Teichmann
Browse files
Options
Downloads
Patches
Plain Diff
support RS232 terminal
this also adds support for terminals which have both PacketVars and ProcessVars
parent
e902ab06
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#142966
failed
9 months ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ebpfcat/ebpfcat.py
+2
-2
2 additions, 2 deletions
ebpfcat/ebpfcat.py
ebpfcat/ethercat.py
+8
-5
8 additions, 5 deletions
ebpfcat/ethercat.py
ebpfcat/terminals.py
+17
-5
17 additions, 5 deletions
ebpfcat/terminals.py
with
27 additions
and
12 deletions
ebpfcat/ebpfcat.py
+
2
−
2
View file @
121c1a13
...
...
@@ -92,7 +92,7 @@ class ProcessDesc:
def
__get__
(
self
,
instance
,
owner
):
if
instance
is
None
:
return
self
index
=
self
.
index
+
instance
.
position_offset
[
SyncManager
.
IN
]
index
=
self
.
index
+
instance
.
position_offset
[
None
]
if
isinstance
(
instance
,
Struct
):
terminal
=
instance
.
terminal
device
=
instance
.
device
...
...
@@ -276,7 +276,7 @@ class EBPFTerminal(Terminal):
product id of all supported terminal types.
"""
compatibility
=
None
position_offset
=
{
SyncManager
.
OUT
:
0
,
SyncManager
.
IN
:
0
}
position_offset
=
{
SyncManager
.
OUT
:
0
,
SyncManager
.
IN
:
0
,
None
:
0
}
use_fmmu
=
True
out_pdos
=
None
in_pdos
=
None
...
...
This diff is collapsed.
Click to expand it.
ebpfcat/ethercat.py
+
8
−
5
View file @
121c1a13
...
...
@@ -497,16 +497,19 @@ class Struct:
"""
device
=
None
def
__new__
(
cls
,
*
args
):
return
StructDesc
(
cls
,
*
args
)
def
__new__
(
cls
,
*
args
,
**
kwargs
):
return
StructDesc
(
cls
,
*
args
,
**
kwargs
)
class
StructDesc
:
def
__init__
(
self
,
struct
,
sm3
=
0
,
sm2
=
None
):
def
__init__
(
self
,
struct
,
sm3
=
0
,
sm2
=
None
,
coe
=
None
):
self
.
struct
=
struct
if
sm2
is
None
:
sm2
=
sm3
self
.
position_offset
=
{
SyncManager
.
OUT
:
sm2
,
SyncManager
.
IN
:
sm3
}
if
coe
is
None
:
coe
=
sm3
self
.
position_offset
=
{
SyncManager
.
OUT
:
sm2
,
SyncManager
.
IN
:
sm3
,
None
:
coe
}
def
__get__
(
self
,
instance
,
owner
):
if
instance
is
None
:
...
...
@@ -680,7 +683,7 @@ class Terminal:
await
self
.
read_object_entry
(
v
.
index
,
v
.
subidx
))
elif
isinstance
(
v
,
StructDesc
):
struct
=
getattr
(
self
,
k
)
offset
=
struct
.
position_offset
[
SyncManager
.
IN
]
offset
=
struct
.
position_offset
[
None
]
for
kk
,
vv
in
struct
.
__class__
.
__dict__
.
items
():
if
isinstance
(
vv
,
ServiceDesc
):
setattr
(
struct
,
kk
,
...
...
This diff is collapsed.
Click to expand it.
ebpfcat/terminals.py
+
17
−
5
View file @
121c1a13
...
...
@@ -45,7 +45,7 @@ class EL2212(EBPFTerminal):
compatibility
=
{(
2
,
0x8A43052
)}
class
Channel
(
Struct
):
output
=
ProcessDesc
(
0x7000
,
2
)
value
=
ProcessDesc
(
0x7000
,
2
)
boost_current
=
ServiceDesc
(
0x8000
,
1
)
hold_current
=
ServiceDesc
(
0x8000
,
2
)
...
...
@@ -169,8 +169,8 @@ class EL5042(EBPFTerminal):
channel2
=
Channel
(
0x10
)
class
EL60
2
2
(
EBPFTerminal
):
compatibility
=
{(
2
,
0x1786305
2
)}
class
EL60
0
2
(
EBPFTerminal
):
compatibility
=
{(
2
,
39335944
2
)}
class
Channel
(
Struct
):
transmit_accept
=
PacketDesc
(
SyncManager
.
IN
,
0
,
0
)
...
...
@@ -193,8 +193,20 @@ class EL6022(EBPFTerminal):
baudRate
=
ServiceDesc
(
0x8000
,
0x11
)
dataFrame
=
ServiceDesc
(
0x8000
,
0x15
)
channel1
=
Channel
(
0
)
channel2
=
Channel
(
0x10
)
channel1
=
Channel
(
0
,
0
,
0
)
channel2
=
Channel
(
24
,
24
,
0x10
)
class
EL6022
(
EBPFTerminal
):
compatibility
=
{(
2
,
0x17863052
)}
class
Channel
(
EL6002
.
Channel
):
enableHalfDuplex
=
ServiceDesc
(
0x8000
,
6
)
enablePointToPoint
=
ServiceDesc
(
0x8000
,
7
)
channel1
=
Channel
(
0
,
0
,
0
)
channel2
=
Channel
(
24
,
24
,
0x10
)
class
EL7041
(
EBPFTerminal
):
...
...
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