[Xastir] length of serial port fields

Curt Mills curt.we7u at gmail.com
Mon Feb 8 11:32:11 EST 2016


Here's the diff if you want to try it yourself in the meantime:

Index: interface_gui.c
===================================================================
RCS file: /cvsroot/xastir/xastir/src/interface_gui.c,v
retrieving revision 1.127
diff -u -w -r1.127 interface_gui.c
--- interface_gui.c     22 Oct 2012 23:59:55 -0000      1.127
+++ interface_gui.c     8 Feb 2016 16:30:13 -0000
@@ -826,7 +826,7 @@
                                       XmNshadowThickness,    1,
                                       XmNcolumns, 15,
                                       XmNwidth, ((15*7)+2),
-                                      XmNmaxLength, 40,
+                                      XmNmaxLength, MAX_DEVICE_NAME,
                                       XmNbackground, colors[0x0f],
                                       XmNtopAttachment,XmATTACH_WIDGET,
                                       XmNtopWidget, TNC_active_on_startup,
@@ -2145,7 +2145,7 @@
             XmNshadowThickness,    1,
             XmNcolumns, 25,
             XmNwidth, ((25*7)+2),
-            XmNmaxLength, 40,
+            XmNmaxLength, MAX_DEVICE_NAME,
             XmNbackground, colors[0x0f],
             XmNtopAttachment,XmATTACH_FORM,
             XmNtopOffset, 5,
@@ -2729,7 +2729,7 @@
                                       XmNshadowThickness,    1,
                                       XmNcolumns, 15,
                                       XmNwidth, ((15*7)+2),
-                                      XmNmaxLength, 40,
+                                      XmNmaxLength, MAX_DEVICE_NAME,
                                       XmNbackground, colors[0x0f],
                                       XmNtopAttachment,XmATTACH_FORM,
                                       XmNtopOffset, 5,
@@ -3423,7 +3423,7 @@
                                       XmNshadowThickness,    1,
                                       XmNcolumns, 25,
                                       XmNwidth, ((25*7)+2),
-                                      XmNmaxLength, 40,
+                                      XmNmaxLength, MAX_DEVICE_NAME,
                                       XmNbackground, colors[0x0f],
                                       XmNtopAttachment,XmATTACH_FORM,
                                       XmNtopOffset, 5,
@@ -3950,7 +3950,7 @@
                                       XmNshadowThickness,    1,
                                       XmNcolumns, 25,
                                       XmNwidth, ((25*7)+2),
-                                      XmNmaxLength, 40,
+                                      XmNmaxLength, MAX_DEVICE_NAME,
                                       XmNbackground, colors[0x0f],
                                       XmNtopAttachment,XmATTACH_FORM,
                                       XmNtopOffset, 5,
@@ -4471,7 +4471,7 @@
                                       XmNshadowThickness,    1,
                                       XmNcolumns, 15,
                                       XmNwidth, ((15*7)+2),
-                                      XmNmaxLength, 40,
+                                      XmNmaxLength, MAX_DEVICE_NAME,
                                       XmNbackground, colors[0x0f],
                                       XmNtopAttachment,XmATTACH_WIDGET,
                                       XmNtopWidget, AX25_active_on_startup,
@@ -5088,7 +5088,7 @@
                                       XmNshadowThickness,    1,
                                       XmNcolumns, 25,
                                       XmNwidth, ((25*7)+2),
-                                      XmNmaxLength, 30,
+                                      XmNmaxLength, MAX_DEVICE_NAME,
                                       XmNbackground, colors[0x0f],
                                       XmNtopAttachment,XmATTACH_WIDGET,
                                       XmNtopWidget, Inet_transmit_data,
@@ -5591,7 +5591,7 @@
                                       XmNshadowThickness,    1,
                                       XmNcolumns, 25,
                                       XmNwidth, ((25*7)+2),
-                                      XmNmaxLength, 30,
+                                      XmNmaxLength, MAX_DEVICE_NAME,
                                       XmNbackground, colors[0x0f],
                                       XmNtopAttachment,XmATTACH_WIDGET,
                                       XmNtopWidget, Database_transmit_data,
@@ -7268,7 +7268,7 @@
                                       XmNshadowThickness,    1,
                                       XmNcolumns, 25,
                                       XmNwidth, ((25*7)+2),
-                                      XmNmaxLength, 30,
+                                      XmNmaxLength, MAX_DEVICE_NAME,
                                       XmNbackground, colors[0x0f],
                                       XmNtopAttachment,XmATTACH_WIDGET,
                                       XmNtopWidget, AGWPE_transmit_data,


On Mon, Feb 8, 2016 at 8:18 AM, Curt Mills <curt.we7u at gmail.com> wrote:

> Starting in the config file, looking for port names/lengths on my own
> machine:
>
>   DEVICE3_NAME:/dev/ttyS0
>
> Couldn't find that label in xastir/src, but did a search like this:
>
>   grep DEVICE *.h *.c | grep NAME
>
> and found:
>
>   db_gis.h:   char name[MAX_DEVICE_NAME+1]; // name of connection to
> display to user  - ioparam device_name
>   interface.h:#define MAX_DEVICE_NAME 128
>   interface.h:    char   device_name[MAX_DEVICE_NAME+1];        /* device
> name                             */
>   interface.h:    char   device_name[MAX_DEVICE_NAME+1];        /* device
> name                             */
>
> Your device name is only 63 characters. So...  It is probably a limitation
> in the GUI code rather than the interface code.
>
> The "iface" struct is where device_name[MAX_DEVICE_NAME+1] is used.
>
> Looking a bit further, interface_gui.c has "TNC_device_name_data" with a
> max length of 40. That's probably your limitation, but would be in multiple
> places throughout that file for different types of interfaces, i.e.
>
>   TNC_device_name_data
>   GPS_device_name_data
>   WX_device_name_data
>   AX25_device_name_data
>   NWX_host_name_data
>   NGPS_host_name_data
>   Inet_host_data
>   Database_host_data
>   AGWPE_host_data
>
> There are probably more. that XmNmaxLength should be set to
> MAX_DEVICE_NAME, instead of 40.
>
> These get assigned to variables such as these, which are all in structs
> defined from the "iface" struct:
>
>   devices[TNC_port].device_name
>   devices[GPS_port].device_name
>   devices[WX_port].device_name
>   devices[AX25_port].device_name
>
> I made the changes to XmNmaxLength in 9 places, recompiled, and Xastir is
> running nicely. I'll check in the changes later today if everything appears
> normal.
>
>
> On Sun, Feb 7, 2016 at 10:17 AM, Jason KG4WSV <kg4wsv at gmail.com> wrote:
>
>> I've started using device special file names that look like
>>
>> /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AD025GYZ-if00-port0
>>
>> because they're unique no matter where i plug them in, and it's a result
>> of
>> standard udev rules.  (once upon a time I started writing some udev rules
>> to make them look like OS X, but it isn't worth it because I use too many
>> different systems and i may not have root privs to hack at udev).
>>
>> I just tried to do this with xastir for the first time, and it seems the
>> field isn't big enough.
>>
>> can i stick a long name in the config file and expect it to work?
>>
>> Consider this a change request to make the field larger to accommodate
>> these forms of device special file name.
>>
>> thanks,
>> Jason
>> kg4wsv
>> _______________________________________________
>> Xastir mailing list
>> Xastir at lists.xastir.org
>> http://xastir.org/mailman/listinfo/xastir
>>
>
>
>
> --
> Curt, WE7U
> http://wetnet.net/~we7u
> http://www.sarguydigital.com
>



-- 
Curt, WE7U
http://wetnet.net/~we7u
http://www.sarguydigital.com


More information about the Xastir mailing list