Skip Menu |
 

This queue is for tickets about the Net-Frame-Simple CPAN distribution.

Report information
The Basics
Id: 118234
Status: resolved
Worked: 5 min
Priority: 0/
Queue: Net-Frame-Simple

People
Owner: gomor [...] cpan.org
Requestors: bobn.code [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.07



Subject: Net::Frame::Simple::dump() Does Not Emit Payload
Date: Sun, 2 Oct 2016 13:37:55 -0700
To: bug-Net-Frame-Simple [...] rt.cpan.org
From: Bob Newgard <bobn.code [...] gmail.com>
Download (untitled) / with headers
text/plain 1.2k
Not sure if this is a bug or a feature request. I'm using Net::Frame for hardware development, both in communicating with hardware and generating simulation test vectors. HW communication works great, but for vectors I need access to the raw packet and dump() fails to return a payload. With Perl5 I can work around this using $oSimple->raw. In this case, I'm importing Net::Frame::Simple into Perl6, and Perl6 can only access Perl5 object methods, not attributes. Here's what I did to get dump() to work for me (copied from the attachment): @@ -362,11 +362,21 @@ sub print { sub dump { my $self = shift; my $raw = ''; - $raw .= $_->raw for @{$self->[$__layers]}; + my $last; + + for my $l (@{$self->[$__layers]}) { + $raw .= $l->raw; + $last = $l; + } + + if ($last && defined($last->payload)) { + $raw .= $last->payload; + } + $raw .= $self->[$__padding] if $self->[$__padding]; CORE::unpack('H*', $raw); } Distribution name and version: Net-Frame-Simple version 1.06 Perl version: 5.22.2 Operating System vendor and version: Debian "stretch", Linux host 4.6.0-1-amd64 #1 SMP Debian 4.6.4-1 (2016-07-18) x86_64 GNU/Linux Regards, Bob
Download diff.txt
text/plain 418b

Message body is not shown because sender requested not to inline it.

This looks like a bug, and it looks like your patch is ok. I'll dig into that.
Subject: Re: [rt.cpan.org #118234] Net::Frame::Simple::dump() Does Not Emit Payload
Date: Mon, 3 Oct 2016 07:24:30 -0700
To: bug-Net-Frame-Simple [...] rt.cpan.org
From: Bob Newgard <bobn.code [...] gmail.com>
Thanks, much appreciated.
Download (untitled) / with headers
text/plain 102b
I integrated your patch. Thanks again. Regarding your Perl 6 version, will it be available somewhere?
Subject: Re: [rt.cpan.org #118234] Net::Frame::Simple::dump() Does Not Emit Payload
Date: Fri, 7 Oct 2016 07:14:57 -0700
To: bug-Net-Frame-Simple [...] rt.cpan.org
From: Bob Newgard <bobn.code [...] gmail.com>
Download (untitled) / with headers
text/plain 428b
On 10/05/2016 10:48 PM, Patrice Auffret via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=118234 > > > I integrated your patch. Thanks again. > > Regarding your Perl 6 version, will it be available somewhere?
Patrice, Sorry for being unclear. I'm not porting Net::Frame to Perl6, just importing Perl5 objects into a Perl6 application using Inline::Perl5 (https://github.com/niner/Inline-Perl5). Regards, Bob
Download (untitled) / with headers
text/plain 308b
On Fri Oct 07 10:15:14 2016, bobn.code@gmail.com wrote: Show quoted text
> Patrice, > > Sorry for being unclear. I'm not porting Net::Frame to Perl6, just > importing Perl5 objects into a Perl6 application using Inline::Perl5 > (https://github.com/niner/Inline-Perl5). > > Regards, > Bob
Oh, ok. Thanks for the update,


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.