[fpc-pascal] Re: Help needed with interfacing to C-object-files.

Koenraad Lelong fpascal at brouwerij.homelinux.net
Wed Mar 16 21:20:27 CET 2005


Koenraad Lelong wrote:
> Jeff Pohlmeyer wrote:
> 
...
> About the beer, it's pretty close.
> 1-wire devices are devices like termometers, AD-converters and other 
> devices that can be accessed over 1-wire (actually two : gnd).
> And I would like to use these thermometer-devices with my Zaurus PDA to 
> measure tempratures of my brewing sessions : I make my own beer. I still 
> have to fetch it myself though ;-).
> I'm going to try your unit, but how did you do this ? You must have 
> worked for hours to make that "header" file. Thank you very, very much !
> 
> Koenraad.
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

I'm trying this and it seems to work, partly.
I wrote a clone in fpc of the temp-program, and encountered some strange 
things.
The library successfully detects the interface, and one device (only one 
  connected at the time). But when the serialnumber of the device is 
written with the library-function, this does not work. I wrote a routine 
in fpc to write 8 bytes (=serialnumber) to the screen in hex, and then 
the serialnumber of the connected device is written on the screen. So 
the communication-part seems to work.
What I did see is that after I stop the application there is extra text 
on the screen. This contains the serialnumber of the device. When I 
comment out the library-calls to write the serialnumber, this is gone.
Is it possible that fpc 'monopolises' the standard output, and after the 
program terminates, the text, written with c-routines while the program 
was running, finally apears on the screen ?
Second question : are c-double types and fpc-double types compatible ?
Last question to Jeff Pohlmeyer : could you explain how you made that 
unit ? Did you convert all h-files with h2pas, and merged them ?
I ask this because that 'library' deals with serial devices (ttyS*). I 
have a similar one, for USB-devices. I would like to make a unit for 
this also.

Thanks,
Koenraad.




More information about the fpc-pascal mailing list