-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ae933d5
Showing
9 changed files
with
594 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.build/ | ||
*.sw* | ||
.DS_Store | ||
Convert-EDS-XDD-*/ | ||
Convert-EDS-XDD-*.tar.gz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
=pod | ||
|
||
=encoding utf8 | ||
|
||
=head1 NAME | ||
|
||
Convert::EDS::XDD - Convert CANopen EDS to XDD | ||
|
||
=head1 SYNOPSIS | ||
|
||
perl -MConvert::EDS::XDD=eds2xdd -e "eds2xdd 'profile.eds'" > profile.xdd | ||
|
||
=head1 DESCRIPTION | ||
|
||
EDS and XDD are device profile formats based on C<ini|Config::Tiny> and C<XML|XML::Writer> respectively and are specified by the CiA e.V. | ||
|
||
This module Takes in an EDS file or a string with its content and returns a XDD string. By default, The C<ISO15745Profile> section is B<Ethernet POWERLINK> specific, but can be adjusted by the user. A self-contained script is available L<at the Github releases page|http://github.com/epl-viz/Convert::EDS::XDD>. | ||
|
||
=head1 LIMITATIONS | ||
|
||
May not handle all details of the EDS. Pull requests and reports (issues on Github) welcome. | ||
|
||
=head1 METHODS AND ARGUMENTS | ||
|
||
=over 4 | ||
|
||
=item eds2xdd($filename, [$encoding]) | ||
|
||
Here, the [] indicate an optional parameter. | ||
|
||
Returns the EDS' content as XML string on success or C<undef> on error | ||
|
||
$encoding may be used to indicate the encoding of the file, e.g. 'utf8' or | ||
'encoding(iso-8859-1)'. | ||
|
||
Do not add a prefix to $encoding, such as '<' or '<:'. | ||
|
||
=item eds2xdd_string($string) | ||
|
||
Returns the EDS string as XML string | ||
|
||
=back | ||
|
||
=head1 GIT REPOSITORY | ||
|
||
L<http://github.com/epl-viz/Convert-EDS-XDD> | ||
|
||
=head1 SEE ALSO | ||
|
||
L<EPL-Viz - Visualization for Ethernet POWERLINK|http://github.com/epl-viz> | ||
|
||
L<App::eds2xdd> | ||
|
||
=head1 AUTHOR | ||
|
||
Ahmad Fatoum C<< <athreef@cpan.org> >>, L<http://a3f.at> | ||
|
||
=head1 COPYRIGHT AND LICENSE | ||
|
||
Copyright (C) 2017 Ahmad Fatoum | ||
|
||
This library is free software; you can redistribute it and/or modify | ||
it under the same terms as Perl itself. | ||
|
||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name = Convert-EDS-XDD | ||
author = Ahmad Fatoum <athreef@cpan.org> | ||
license = Perl_5 | ||
copyright_holder = Ahmad Fatoum | ||
copyright_year = 2017 | ||
|
||
[@Starter] | ||
|
||
[AutoPrereqs] | ||
|
||
[GithubMeta] | ||
issues = 1 | ||
user = athreef | ||
[@Git] | ||
[Git::Init] | ||
remote = origin git@github.com:athreef/%N.git | ||
[Git::NextVersion] | ||
[ChangelogFromGit] | ||
[OurPkgVersion] | ||
|
||
[ReadmeAnyFromPod / ReadmePodInRoot] | ||
type = pod | ||
filename = README.pod | ||
location = root | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
|
||
use Getopt::Std; | ||
use Convert::EDS::XDD qw(eds2xdd_string); | ||
|
||
$Getopt::Std::STANDARD_HELP_VERSION = 1; | ||
|
||
getopts '', \my %opts; | ||
|
||
local $/; | ||
while (<>) { | ||
print eds2xdd_string $_; | ||
} | ||
|
||
sub VERSION_MESSAGE() { print "eds2xdd $Convert::EDS::XDD::VERSION\n"; } | ||
sub HELP_MESSAGE() { | ||
print <<"EOT" | ||
Usage: $0 [eds_file] | ||
echo 'eds_content' | $0 | ||
Opens files passed as arguments and writes them to stdout as XDD. | ||
If there are no arguments, stdin is read | ||
EOT | ||
} | ||
|
Oops, something went wrong.