Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
a3f committed Feb 21, 2017
0 parents commit ae933d5
Show file tree
Hide file tree
Showing 9 changed files with 594 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
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

65 changes: 65 additions & 0 deletions README.pod
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
25 changes: 25 additions & 0 deletions dist.ini
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

27 changes: 27 additions & 0 deletions eds2xdd
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
}

Loading

0 comments on commit ae933d5

Please sign in to comment.