Closed git-developer closed 4 years ago
Hi Christian,
thanks for your suggestion. Compared with Device::Firmata::IO::NetIO
the close()
method is missing in SerialIO
. I propose the following enhancement of your request:
=head2 data_read
Close serial connection to Firmata device.
=cut
sub close($) {
# --------------------------------------------------
my ( $self ) = @_;
if ($self->{handle}) {
$self->{handle}->close();
delete $self->{handle};
}
}
Please test this variant and give a feedback if it works for you. If it does, update your merge request, but add sub close()
after sub data_read()
. Also change the merge target branch to develop. There are some additional details that must be updated for a new release that I will take care of before updating the master branch.
Regards, Jens
Hi Jens,
thanks for your help. I successfully tried your proposal and applied it as suggested.
One more question: which is repo should be used for pull requests - ntruchsess/perl-firmata or jnsbyr/perl-firmata? It's not clear to me which one is the "official" main repo.
Thanks for your feedback, I will merge your request. It will take a few days until I can prepare and publish a new release on the master branch and on CPAN.
To your question regarding the "official" repo: It's stated in the project description:
Originally authored by Aki Mimoto (amimoto) ... transfered to Norbert Truchsess (ntruchsess) ...
So the "official" source code development takes place in the repo of ntruchsess. My own repo is "only" a fork. The reason I appear on both sides is that I also help to maintain the main repo. On the other hand one can say that the "official" repo is on CPAN, because CPAN is the official distribution point for Perl modules. And there are some people that assume that this Perl module is a inherent part of the FHEM project, but FHEM only distributes a copy of this project to avoid the additional installation step for end users.
Device::Firmata::Platform->close() is calling
close()
on the IO device being aDevice::Firmata::IO::SerialIO
when obtained from Firmata, butSerialIO
does not offer this sub.