Several delbin improvements.

View: New views
5 Messages — Rating Filter:   Alert me  

Several delbin improvements.

by Robert Lipe-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm committing this to help prepare delbin for integration into GSAK. 

The firmware drops geocaches if the names aren't unique w/in the first 31 characters, contrary to the spec.   Fortunately, our mkshort makes that easy to fix.

Implement "-vs" so GSAK (indeed, others GUIs) can tick progress bars during waypoint send.  (Yes, I know it doesn't work in the general case, but neither do the other formats where we support this...)

Add 'nuketrk', 'nukerte', 'nukewpt' to erase points on the device before sending.  (Why three separate options?  To play nicer with our GUIs.

Add an option to move the hint to the end of the note, as Crash Register and Topo 7 do.   Don't worry, the GPS still finds the hint and makes it available in the 'hints' screen in the right place.

RJL


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
Gpsbabel-code@...
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code

delorme_tweaks (15K) Download Attachment

Re: Several delbin improvements.

by Paul Cornett-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Robert,
I've got a few tweaks for the changes you made:

It appears you got the wrong size for the delete message, my doc says
67.

The delete message isn't really a transfer, you could just send it with
message_write(), but I think it is OK to add it to the batch and let it
go out as the first message in the transfer.

add_to_batch() takes ownership of the messages, so you don't need to
free them.

And you used the wrong enum for deleting tracks and routes.

Index: delbin.c
===================================================================
--- delbin.c (revision 20)
+++ delbin.c (working copy)
@@ -144,6 +144,7 @@
 #define MSG_BREAK 0xaa02
 #define MSG_BREAK_SIZE 33
 #define MSG_DELETE 0xb005
+#define MSG_DELETE_SIZE 67
 #define MSG_NAVIGATION 0xa010
 #define MSG_REQUEST_ROUTES 0xb051
 #define MSG_REQUEST_ROUTES_SIZE 65
@@ -205,7 +206,7 @@
  gbuint8 type;
  gbuint8 mode;
  gbuint8 location;
- gbuint8 object_name[];
+ char object_name[64];
 } msg_delete_t;
 
 // Output Waypoint Message
@@ -1245,22 +1246,19 @@
 }
 
 static void
-add_nuke(nuke_type nuke_type)
+add_nuke(nuke_type type)
 {
  message_t m;
  msg_delete_t* p;
 
- message_init_size(&m, 63);
+ message_init_size(&m, MSG_DELETE_SIZE);
  p = m.data;
- p->type = nuke_type;
+ p->type = type;
  p->mode = nuke_mode_all;
  p->location = nuke_dest_internal;
- p->object_name[0] = '0';
+ memset(p->object_name, 0, sizeof(p->object_name));
 
  add_to_batch(MSG_DELETE, &m);
- send_batch(TRUE);
-
- message_free(&m);
 }
 
 static void
@@ -2109,8 +2107,6 @@
  }
 }
 
-
-
 static void
 delbin_rw_init(const char *fname)
 {
@@ -2203,11 +2199,11 @@
  write_waypoints();
  }
  if (doing_trks) {
- if (opt_nuke_trk) add_nuke(nuke_type_wpt);
+ if (opt_nuke_trk) add_nuke(nuke_type_trk);
  write_tracks();
  }
  if (doing_rtes) {
- if (opt_nuke_rte) add_nuke(nuke_type_wpt);
+ if (opt_nuke_rte) add_nuke(nuke_type_rte);
  write_routes();
  }
 }


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
Gpsbabel-code@...
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code

Re: Several delbin improvements.

by Robert Lipe-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sun, Aug 9, 2009 at 11:51 PM, Paul Cornett <pc-gpsb@...> wrote:
Hi Robert,
I've got a few tweaks for the changes you made:

It appears you got the wrong size for the delete message, my doc says
67.

The delete message isn't really a transfer, you could just send it with
message_write(), but I think it is OK to add it to the batch and let it
go out as the first message in the transfer.

add_to_batch() takes ownership of the messages, so you don't need to
free them.

And you used the wrong enum for deleting tracks and routes.

Thanx.  I'll confess that I originally was just going for "delete waypoints" and sketched in the rest as an afterthought.  Looks like I was pretty sloppy.

I originally ran the batch as I was having problems with AA04 acks sometimes showing up unexpectedly.  With your approach,  I get frequent "delbin: unexpected response message aa04 during send_batch" and "delbin: send_batch timed out" upon ./gpsbabel -vs -i gpx -f MyMiddleTN.gpx  -o delbin,nukewpt,logs -F usb:

I certainly couldn't fake shock if deleting 500 points took some time and the device prematurely acked it and just having that extra overhead of starting a new batch gave the device to really be done with the delete before we start filling it up again.

RJL



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
Gpsbabel-code@...
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code

Re: Several delbin improvements.

by Paul Cornett-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Robert Lipe wrote:

> I originally ran the batch as I was having problems with AA04 acks
> sometimes showing up unexpectedly.  With your approach,  I get
> frequent "delbin: unexpected response message aa04 during send_batch"
> and "delbin: send_batch timed out" upon ./gpsbabel -vs -i gpx -f
> MyMiddleTN.gpx  -o delbin,nukewpt,logs -F usb:
>
> I certainly couldn't fake shock if deleting 500 points took some time
> and the device prematurely acked it and just having that extra
> overhead of starting a new batch gave the device to really be done
> with the delete before we start filling it up again.
Looks like you were right to use the batch, I see now that the delete
message does generate an aa04 response, I wasn't seeing it probably
because my quick test case was finished before it showed up. Oops. So
lets put that back. Also, I built with the new Windows DK 7.0.0.7600
today, and it needs another include which seems to be OK for the older
one as well. Patch attached.

Index: delbin.c
===================================================================
--- delbin.c (revision 21)
+++ delbin.c (working copy)
@@ -1258,7 +1258,10 @@
  p->location = nuke_dest_internal;
  memset(p->object_name, 0, sizeof(p->object_name));
 
+ // MSG_DELETE generates a MSG_TRANSFER_COMPLETE,
+ // so use the batch facility to wait for it
  add_to_batch(MSG_DELETE, &m);
+ send_batch(TRUE);
 }
 
 static void
@@ -2249,6 +2252,7 @@
 // You need to install 'build environments' and 'tools' from the SDK and
 // follow the instructions in the Install.html to get MSVC to find the right
 // headers and libraries.
+#include <specstrings.h>
 #include <hidsdi.h>
 
 static HANDLE hid_handle;


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
Gpsbabel-code@...
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code

Re: Several delbin improvements.

by Robert Lipe-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Aug 10, 2009 at 11:27 PM, Paul Cornett <pc-gpsb@...> wrote:
Robert Lipe wrote:
> I originally ran the batch as I was having problems with AA04 acks
> sometimes showing up unexpectedly.  With your approach,  I get
> frequent "delbin: unexpected response message aa04 during send_batch"
> and "delbin: send_batch timed out" upon ./gpsbabel -vs -i gpx -f
> MyMiddleTN.gpx  -o delbin,nukewpt,logs -F usb:
>
Looks like you were right to use the batch, I see now that the delete
message does generate an aa04 response, I wasn't seeing it probably

Cool.   It's good we've iterated to agreement on this one as that means we're seeing the same thing.  I've applied this.   Thanx.


RJL

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gpsbabel-code mailing list  http://www.gpsbabel.org
Gpsbabel-code@...
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code