On Wednesday 23 May 2001 00:11, you wrote:
> Ned Konz wrote:
> > Hi folks,
> >
> > I'm a new user of the wonderful Inline modules. I've shied away from XS
> > and SWIG in the past after some frustration with each, but am happy to
> > say that I got my first Inline-using module together in two hours!
>
> Wow. The world-famous Ned Konz is using little old Inline! I'm honored.
> Were not you the same guy who rode all over the place with lots of
> computing devices attatched to your recumbant steed? Nice to meet you.
No, you're getting me confused with my good friend and neighbor Steve Roberts
(http://www.microship.com). I just rode all over the place on a recumbent
bike with a handheld PC and a digital camera <g>. I ended up at Steve's house
at the end of a 1999 4000 mile tour of the west. I lived with him and Natasha
for 3 months. I've also ridden from Florida to Oregon on an upright.
The application, though, is one that I'm working on with Steve. We have a bit
of an NSF grant to develop a proof-of-concept wireless data collection
device, and we're using a single board computer, Linux, and Perl. And Inline.
> I can't actually say I've followed your story as a fanatic, but there is
> a relation. I raced rode bikes as a CAT2 in the Seattle area for the
> last 6 years. I've done many a six hour training in the Stanwood area.
> (I'm now in retirement, rolling in all the cash that us CPAN authors
> rake in.) Do you happen to know local crazy people like Dan Woods or
> Glen Bunselmeyer? Guys that, like you I assume, get into riding 600K at
> a go.
I'm not good with names, but if they're CAT2 I almost certainly have never
ridden with them. My riding strategy: pile lots of stuff on the trailer, ride
till it feels right to stop. I tend to average 60 miles or so per day when
I'm touring.
> > What I was hoping to do in _readBlockData is to use the "output" argument
> > as a data buffer in which to write data (like the buffer argument to
> > sysread() for instance).
>
> I'm right in the middle of trying to resolve the remaining issues for
> getting the uber-release 0.40 out to CPAN, otherwise I'd cook you up
> some examples. But that's why I wrote the Inline::C-Cookbook; so you
> could help yourself.
I read that; good work! I just didn't find what I was looking for.
> I'll try to comment here:
> > I tried this, but I don't know if it's right (the call won't return more
> > than 32 characters):
> >
> > int _readBlockData(int file, int command, SV* output)
> > {
> > char buf[ 32 ];
> > int retval = i2c_smbus_read_block_data(file, command, buf);
> > if (retval == -1)
> > return retval;
> > sv_setpvn(output, buf, retval); /* retval is # of bytes read */
> > return retval;
> > }
>
> I usually discourage the modification of input parameters in favor of
> returning multiple values on the Perl stack. But I have a question for
> you. "Does it work?" If so, it seems reasonable. If not, it may be
> getting messed up by the transparent typemapping. Sorry to be
> wishywashy, but I'm just strapped for time right now.
>
> If it works, I'll probably add it as an example in the Cookbook, with
> credit to you of course.
>
> > And then I'm doing this on the write side:
> >
> > int _writeBlockData(int file, int command, SV* value)
> > {
> > STRLEN len;
> > char *buf = SvPV(value, len);
> > return i2c_smbus_write_block_data(file, command, len, buf);
> > }
> >
> > Do these look like the right way to do the job?
>
> Again, seems reasonable if it works.
>
> Cheers, Brian
>
> PS I noticed you said that you are writing a *module* with Inline.
> You'll be very interested in the changes being rolled out with 0.40. If
> you're brand new to the mailing list, you may wish to review the last 10
> days correspondence in the archives:
>
> http://www.mail-archive.com/[email protected]/
Will check it out, thanks.
> PPS If you ever ride up to Vancouver BC, I'd be glad to buy you a
> beverage of your choice :)
I may take you up on that sometime! I had a consulting client in the area
(well, in Richmond) that I visited a couple of times on my motorcycle...
I talked to Dick Hardt for a while on the Perl Whirl and actually considered
joining ActiveState, but decided against it.
--
Ned Konz
currently: Stanwood, WA
email: [EMAIL PROTECTED]
homepage: http://bike-nomad.com