Problems with libdivecomputer under OSX

Pascal Manchon pascal at diveboard.com
Fri Jul 6 21:21:49 UTC 2012


Jef, 

To follow your request, I just did 2 tries on compiling libdivecomputer on my native OSX 64bit environment :

First try without options (compiles for 64bit) :
$ ./configure
$ examples/vyper /dev/tty.usbserial-PtTFP8W4 
DEVICE=/dev/tty.usbserial-PtTFP8W4, DELAY=500
suunto_vyper_device_open
TRACE (serial_posix.c:684, ioctl): Inappropriate ioctl for device (25)
suunto_vyper.c:145: Failed to set the DTR line.
suunto_vyper_test.c:38: Error opening serial port.
suunto_vyper_device_open
TRACE (serial_posix.c:684, ioctl): Inappropriate ioctl for device (25)
suunto_vyper.c:145: Failed to set the DTR line.
suunto_vyper_test.c:71: Error opening serial port.

Second try with :
$ export CPPFLAGS=-m32
$ export LDFLAGS=-m32
$ ./configure --build=i686

and this seem indeed to work correctly (at least the computer starts dumping its memory)

What actually made me try the unsigned long type is the man page for ioctl : https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/ioctl.2.html#//apple_ref/doc/man/2/ioctl

Pascal

On 06 Jul 2012, at 23:13, Henrik wrote:

> On 06.07.12 22:34, Pascal Manchon wrote:
>> Hi,
>> 
>> I stumbled on that error previously, and I think it might come from a casting issue.
>> 
>> In the file serial_posix.c, can you try replacing the first line of the function serial_set_status, which is :
>>        int action = (level ? TIOCMBIS : TIOCMBIC);
>> by :
>>        unsigned long action = (level ? TIOCMBIS : TIOCMBIC);
>> 
>> I think it should not break the function for other OS, but it might be worth some more thorough testing...
> 
> My HelO2 has one of its "I don't want to show Data Transfer in the display" issues right now and has to rest a bit. So can't test a working connection right now.
> 
> But your fix has indeed done something anyway, it seems to actually try to contact the computer now:
> 
> $ examples/vyper2 /dev/tty.usbserial-ST000001 ## Before the fix
> DEVICE=/dev/tty.usbserial-ST000001
> suunto_vyper2_device_open
> TRACE (serial_posix.c:684, ioctl): Inappropriate ioctl for device (25)
> suunto_vyper2.c:123: Failed to set the DTR line.
> suunto_vyper2_test.c:77: Error opening serial port.
> suunto_vyper2_device_open
> TRACE (serial_posix.c:684, ioctl): Inappropriate ioctl for device (25)
> suunto_vyper2.c:123: Failed to set the DTR line.
> suunto_vyper2_test.c:37: Error opening serial port.
> 
> SUMMARY
> -------
> test_dump_memory: Input/output error
> test_dump_sdm:    Input/output error
> 
> $ vim src/serial_posix.c  ## replacing int with unsigned long
> $ make
> make  all-recursive
> [...]
> $ examples/vyper2 /dev/tty.usbserial-ST000001
> DEVICE=/dev/tty.usbserial-ST000001
> suunto_vyper2_device_open
> dc_device_version
> suunto_vyper2.c:194: Failed to receive the answer.
> suunto_vyper2.c:194: Failed to receive the answer.
> suunto_vyper2.c:194: Failed to receive the answer.
> suunto_vyper2_test.c:85: Cannot identify computer.
> suunto_vyper2_device_open
> dc_device_version
> suunto_vyper2.c:194: Failed to receive the answer.
> suunto_vyper2.c:194: Failed to receive the answer.
> suunto_vyper2.c:194: Failed to receive the answer.
> suunto_vyper2_test.c:45: Cannot identify computer.
> 
> SUMMARY
> -------
> test_dump_memory: Timeout
> test_dump_sdm:    Timeout
> 
> Henrik
> 




More information about the Devel mailing list