Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
ICS Control System Infrastructure
etherlabmaster
Commits
dc850123
Commit
dc850123
authored
17 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Introduced ec_datagram_type_string().
parent
9ba9d576
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
master/datagram.c
+35
-0
35 additions, 0 deletions
master/datagram.c
master/datagram.h
+2
-1
2 additions, 1 deletion
master/datagram.h
with
37 additions
and
1 deletion
master/datagram.c
+
35
−
0
View file @
dc850123
...
@@ -63,6 +63,30 @@
...
@@ -63,6 +63,30 @@
/*****************************************************************************/
/*****************************************************************************/
/** Array of datagram type strings used in ec_datagram_type_string().
*
* \attention This is indexed by ec_datagram_type_t.
*/
static
const
char
*
type_strings
[]
=
{
"?"
,
"APRD"
,
"APWR"
,
"APRW"
,
"FPRD"
,
"FPWR"
,
"FPRW"
,
"BRD"
,
"BWR"
,
"BRW"
,
"LRD"
,
"LWR"
,
"LRW"
,
"ARMW"
,
"FRMW"
};
/*****************************************************************************/
/** Constructor.
/** Constructor.
*/
*/
void
ec_datagram_init
(
ec_datagram_t
*
datagram
/**< EtherCAT datagram. */
)
void
ec_datagram_init
(
ec_datagram_t
*
datagram
/**< EtherCAT datagram. */
)
...
@@ -473,3 +497,14 @@ void ec_datagram_output_stats(
...
@@ -473,3 +497,14 @@ void ec_datagram_output_stats(
}
}
/*****************************************************************************/
/*****************************************************************************/
/** Returns a string describing the datagram type.
*/
const
char
*
ec_datagram_type_string
(
const
ec_datagram_t
*
datagram
/**< EtherCAT datagram. */
)
{
return
type_strings
[
datagram
->
type
];
}
/*****************************************************************************/
This diff is collapsed.
Click to expand it.
master/datagram.h
+
2
−
1
View file @
dc850123
...
@@ -138,7 +138,8 @@ int ec_datagram_lwr(ec_datagram_t *, uint32_t, size_t, uint8_t *);
...
@@ -138,7 +138,8 @@ int ec_datagram_lwr(ec_datagram_t *, uint32_t, size_t, uint8_t *);
int
ec_datagram_lrw
(
ec_datagram_t
*
,
uint32_t
,
size_t
,
uint8_t
*
);
int
ec_datagram_lrw
(
ec_datagram_t
*
,
uint32_t
,
size_t
,
uint8_t
*
);
void
ec_datagram_print_wc_error
(
const
ec_datagram_t
*
);
void
ec_datagram_print_wc_error
(
const
ec_datagram_t
*
);
void
ec_datagram_output_stats
(
ec_datagram_t
*
datagram
);
void
ec_datagram_output_stats
(
ec_datagram_t
*
);
const
char
*
ec_datagram_type_string
(
const
ec_datagram_t
*
);
/*****************************************************************************/
/*****************************************************************************/
...
...
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