Subversion Repositories public

Rev

Rev 218 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 218 Rev 246
Line 32... Line 32...
32
/* --------------------------------------------------------------------------*/
32
/* --------------------------------------------------------------------------*/
33
 
33
 
34
static void
34
static void
35
garmin_pack_d100 ( D100 * wpt, uint8 ** pos )
35
garmin_pack_d100 ( D100 * wpt, uint8 ** pos )
36
{
36
{
-
 
37
  if (!wpt || !pos)
-
 
38
     return;
-
 
39
 
37
  PUTSTR(wpt->ident);
40
  PUTSTR(wpt->ident);
38
  PUTPOS(wpt->posn);
41
  PUTPOS(wpt->posn);
39
  SKIP(4);
42
  SKIP(4);
40
  PUTSTR(wpt->cmnt);
43
  PUTSTR(wpt->cmnt);
41
}
44
}
Line 46... Line 49...
46
/* --------------------------------------------------------------------------*/
49
/* --------------------------------------------------------------------------*/
47
 
50
 
48
static void
51
static void
49
garmin_pack_d101 ( D101 * wpt, uint8 ** pos )
52
garmin_pack_d101 ( D101 * wpt, uint8 ** pos )
50
{
53
{
-
 
54
  if (!wpt || !pos)
-
 
55
     return;
-
 
56
 
51
  PUTSTR(wpt->ident);
57
  PUTSTR(wpt->ident);
52
  PUTPOS(wpt->posn);
58
  PUTPOS(wpt->posn);
53
  SKIP(4);
59
  SKIP(4);
54
  PUTSTR(wpt->cmnt);
60
  PUTSTR(wpt->cmnt);
55
  PUTF32(wpt->dst);
61
  PUTF32(wpt->dst);
Line 62... Line 68...
62
/* --------------------------------------------------------------------------*/
68
/* --------------------------------------------------------------------------*/
63
 
69
 
64
static void
70
static void
65
garmin_pack_d102 ( D102 * wpt, uint8 ** pos )
71
garmin_pack_d102 ( D102 * wpt, uint8 ** pos )
66
{
72
{
-
 
73
  if (!wpt || !pos)
-
 
74
     return;
-
 
75
 
67
  PUTSTR(wpt->ident);
76
  PUTSTR(wpt->ident);
68
  PUTPOS(wpt->posn);
77
  PUTPOS(wpt->posn);
69
  SKIP(4);
78
  SKIP(4);
70
  PUTSTR(wpt->cmnt);
79
  PUTSTR(wpt->cmnt);
71
  PUTF32(wpt->dst);
80
  PUTF32(wpt->dst);
Line 78... Line 87...
78
/* --------------------------------------------------------------------------*/
87
/* --------------------------------------------------------------------------*/
79
 
88
 
80
static void
89
static void
81
garmin_pack_d103 ( D103 * wpt, uint8 ** pos )
90
garmin_pack_d103 ( D103 * wpt, uint8 ** pos )
82
{
91
{
-
 
92
  if (!wpt || !pos)
-
 
93
     return;
-
 
94
 
83
  PUTSTR(wpt->ident);
95
  PUTSTR(wpt->ident);
84
  PUTPOS(wpt->posn);
96
  PUTPOS(wpt->posn);
85
  SKIP(4);
97
  SKIP(4);
86
  PUTSTR(wpt->cmnt);
98
  PUTSTR(wpt->cmnt);
87
  PUTU8(wpt->smbl);
99
  PUTU8(wpt->smbl);
Line 94... Line 106...
94
/* --------------------------------------------------------------------------*/
106
/* --------------------------------------------------------------------------*/
95
 
107
 
96
static void
108
static void
97
garmin_pack_d104 ( D104 * wpt, uint8 ** pos )
109
garmin_pack_d104 ( D104 * wpt, uint8 ** pos )
98
{
110
{
-
 
111
  if (!wpt || !pos)
-
 
112
     return;
-
 
113
 
99
  PUTSTR(wpt->ident);
114
  PUTSTR(wpt->ident);
100
  PUTPOS(wpt->posn);
115
  PUTPOS(wpt->posn);
101
  SKIP(4);
116
  SKIP(4);
102
  PUTSTR(wpt->cmnt);
117
  PUTSTR(wpt->cmnt);
103
  PUTF32(wpt->dst);
118
  PUTF32(wpt->dst);
Line 111... Line 126...
111
/* --------------------------------------------------------------------------*/
126
/* --------------------------------------------------------------------------*/
112
 
127
 
113
static void
128
static void
114
garmin_pack_d105 ( D105 * wpt, uint8 ** pos )
129
garmin_pack_d105 ( D105 * wpt, uint8 ** pos )
115
{
130
{
-
 
131
  if (!wpt || !pos)
-
 
132
     return;
-
 
133
 
116
  PUTPOS(wpt->posn);
134
  PUTPOS(wpt->posn);
117
  PUTU16(wpt->smbl);
135
  PUTU16(wpt->smbl);
118
  PUTVST(wpt->wpt_ident);
136
  PUTVST(wpt->wpt_ident);
119
}
137
}
120
 
138
 
Line 124... Line 142...
124
/* --------------------------------------------------------------------------*/
142
/* --------------------------------------------------------------------------*/
125
 
143
 
126
static void
144
static void
127
garmin_pack_d106 ( D106 * wpt, uint8 ** pos )
145
garmin_pack_d106 ( D106 * wpt, uint8 ** pos )
128
{
146
{
-
 
147
  if (!wpt || !pos)
-
 
148
     return;
-
 
149
 
129
  PUTU8(wpt->wpt_class);
150
  PUTU8(wpt->wpt_class);
130
  PUTSTR(wpt->subclass);
151
  PUTSTR(wpt->subclass);
131
  PUTPOS(wpt->posn);
152
  PUTPOS(wpt->posn);
132
  PUTU16(wpt->smbl);
153
  PUTU16(wpt->smbl);
133
  PUTVST(wpt->wpt_ident);
154
  PUTVST(wpt->wpt_ident);
Line 140... Line 161...
140
/* --------------------------------------------------------------------------*/
161
/* --------------------------------------------------------------------------*/
141
 
162
 
142
static void
163
static void
143
garmin_pack_d107 ( D107 * wpt, uint8 ** pos )
164
garmin_pack_d107 ( D107 * wpt, uint8 ** pos )
144
{
165
{
-
 
166
  if (!wpt || !pos)
-
 
167
     return;
-
 
168
 
145
  PUTSTR(wpt->ident);
169
  PUTSTR(wpt->ident);
146
  PUTPOS(wpt->posn);
170
  PUTPOS(wpt->posn);
147
  SKIP(4);
171
  SKIP(4);
148
  PUTSTR(wpt->cmnt);
172
  PUTSTR(wpt->cmnt);
149
  PUTU8(wpt->smbl);
173
  PUTU8(wpt->smbl);
Line 158... Line 182...
158
/* --------------------------------------------------------------------------*/
182
/* --------------------------------------------------------------------------*/
159
 
183
 
160
static void
184
static void
161
garmin_pack_d108 ( D108 * wpt, uint8 ** pos )
185
garmin_pack_d108 ( D108 * wpt, uint8 ** pos )
162
{
186
{
-
 
187
  if (!wpt || !pos)
-
 
188
     return;
-
 
189
 
163
  PUTU8(wpt->wpt_class);
190
  PUTU8(wpt->wpt_class);
164
  PUTU8(wpt->color);
191
  PUTU8(wpt->color);
165
  PUTU8(wpt->dspl);
192
  PUTU8(wpt->dspl);
166
  PUTU8(wpt->attr);
193
  PUTU8(wpt->attr);
167
  PUTU16(wpt->smbl);
194
  PUTU16(wpt->smbl);
Line 186... Line 213...
186
/* --------------------------------------------------------------------------*/
213
/* --------------------------------------------------------------------------*/
187
 
214
 
188
static void
215
static void
189
garmin_pack_d109 ( D109 * wpt, uint8 ** pos )
216
garmin_pack_d109 ( D109 * wpt, uint8 ** pos )
190
{
217
{
-
 
218
  if (!wpt || !pos)
-
 
219
     return;
-
 
220
 
191
  PUTU8(wpt->dtyp);
221
  PUTU8(wpt->dtyp);
192
  PUTU8(wpt->wpt_class);
222
  PUTU8(wpt->wpt_class);
193
  PUTU8(wpt->dspl_color);
223
  PUTU8(wpt->dspl_color);
194
  PUTU8(wpt->attr);
224
  PUTU8(wpt->attr);
195
  PUTU16(wpt->smbl);
225
  PUTU16(wpt->smbl);
Line 215... Line 245...
215
/* --------------------------------------------------------------------------*/
245
/* --------------------------------------------------------------------------*/
216
 
246
 
217
static void
247
static void
218
garmin_pack_d110 ( D110 * wpt, uint8 ** pos )
248
garmin_pack_d110 ( D110 * wpt, uint8 ** pos )
219
{
249
{
-
 
250
  if (!wpt || !pos)
-
 
251
     return;
-
 
252
 
220
  PUTU8(wpt->dtyp);
253
  PUTU8(wpt->dtyp);
221
  PUTU8(wpt->wpt_class);
254
  PUTU8(wpt->wpt_class);
222
  PUTU8(wpt->dspl_color);
255
  PUTU8(wpt->dspl_color);
223
  PUTU8(wpt->attr);
256
  PUTU8(wpt->attr);
224
  PUTU16(wpt->smbl);
257
  PUTU16(wpt->smbl);
Line 247... Line 280...
247
/* --------------------------------------------------------------------------*/
280
/* --------------------------------------------------------------------------*/
248
 
281
 
249
static void
282
static void
250
garmin_pack_d120 ( D120 * cat, uint8 ** pos )
283
garmin_pack_d120 ( D120 * cat, uint8 ** pos )
251
{
284
{
-
 
285
  if (!cat || !pos)
-
 
286
     return;
-
 
287
 
252
  PUTSTR(cat->name);
288
  PUTSTR(cat->name);
253
}
289
}
254
 
290
 
255
 
291
 
256
/* --------------------------------------------------------------------------*/
292
/* --------------------------------------------------------------------------*/
Line 258... Line 294...
258
/* --------------------------------------------------------------------------*/
294
/* --------------------------------------------------------------------------*/
259
 
295
 
260
static void
296
static void
261
garmin_pack_d150 ( D150 * wpt, uint8 ** pos )
297
garmin_pack_d150 ( D150 * wpt, uint8 ** pos )
262
{
298
{
-
 
299
  if (!wpt || !pos)
-
 
300
     return;
-
 
301
 
263
  PUTSTR(wpt->ident);
302
  PUTSTR(wpt->ident);
264
  PUTSTR(wpt->cc);
303
  PUTSTR(wpt->cc);
265
  PUTU8(wpt->wpt_class);
304
  PUTU8(wpt->wpt_class);
266
  PUTPOS(wpt->posn);
305
  PUTPOS(wpt->posn);
267
  PUTS16(wpt->alt);
306
  PUTS16(wpt->alt);
Line 277... Line 316...
277
/* --------------------------------------------------------------------------*/
316
/* --------------------------------------------------------------------------*/
278
 
317
 
279
static void
318
static void
280
garmin_pack_d151 ( D151 * wpt, uint8 ** pos )
319
garmin_pack_d151 ( D151 * wpt, uint8 ** pos )
281
{
320
{
-
 
321
  if (!wpt || !pos)
-
 
322
     return;
-
 
323
 
282
  PUTSTR(wpt->ident);
324
  PUTSTR(wpt->ident);
283
  PUTPOS(wpt->posn);
325
  PUTPOS(wpt->posn);
284
  SKIP(4);
326
  SKIP(4);
285
  PUTSTR(wpt->cmnt);
327
  PUTSTR(wpt->cmnt);
286
  PUTF32(wpt->dst);
328
  PUTF32(wpt->dst);
Line 299... Line 341...
299
/* --------------------------------------------------------------------------*/
341
/* --------------------------------------------------------------------------*/
300
 
342
 
301
static void
343
static void
302
garmin_pack_d152 ( D152 * wpt, uint8 ** pos )
344
garmin_pack_d152 ( D152 * wpt, uint8 ** pos )
303
{
345
{
-
 
346
  if (!wpt || !pos)
-
 
347
     return;
-
 
348
 
304
  PUTSTR(wpt->ident);
349
  PUTSTR(wpt->ident);
305
  PUTPOS(wpt->posn);
350
  PUTPOS(wpt->posn);
306
  SKIP(4);
351
  SKIP(4);
307
  PUTSTR(wpt->cmnt);
352
  PUTSTR(wpt->cmnt);
308
  PUTF32(wpt->dst);
353
  PUTF32(wpt->dst);
Line 321... Line 366...
321
/* --------------------------------------------------------------------------*/
366
/* --------------------------------------------------------------------------*/
322
 
367
 
323
static void
368
static void
324
garmin_pack_d154 ( D154 * wpt, uint8 ** pos )
369
garmin_pack_d154 ( D154 * wpt, uint8 ** pos )
325
{
370
{
-
 
371
  if (!wpt || !pos)
-
 
372
     return;
-
 
373
 
326
  PUTSTR(wpt->ident);
374
  PUTSTR(wpt->ident);
327
  PUTPOS(wpt->posn);
375
  PUTPOS(wpt->posn);
328
  SKIP(4);
376
  SKIP(4);
329
  PUTSTR(wpt->cmnt);
377
  PUTSTR(wpt->cmnt);
330
  PUTF32(wpt->dst);
378
  PUTF32(wpt->dst);
Line 344... Line 392...
344
/* --------------------------------------------------------------------------*/
392
/* --------------------------------------------------------------------------*/
345
 
393
 
346
static void
394
static void
347
garmin_pack_d155 ( D155 * wpt, uint8 ** pos )
395
garmin_pack_d155 ( D155 * wpt, uint8 ** pos )
348
{
396
{
-
 
397
  if (!wpt || !pos)
-
 
398
     return;
-
 
399
 
349
  PUTSTR(wpt->ident);
400
  PUTSTR(wpt->ident);
350
  PUTPOS(wpt->posn);
401
  PUTPOS(wpt->posn);
351
  SKIP(4);
402
  SKIP(4);
352
  PUTSTR(wpt->cmnt);
403
  PUTSTR(wpt->cmnt);
353
  PUTF32(wpt->dst);
404
  PUTF32(wpt->dst);
Line 368... Line 419...
368
/* --------------------------------------------------------------------------*/
419
/* --------------------------------------------------------------------------*/
369
 
420
 
370
static void
421
static void
371
garmin_pack_d200 ( D200 * hdr, uint8 ** pos )
422
garmin_pack_d200 ( D200 * hdr, uint8 ** pos )
372
{
423
{
-
 
424
  if (!hdr)
-
 
425
     return;
-
 
426
 
373
  PUTU8(*hdr);
427
  PUTU8(*hdr);
374
}
428
}
375
 
429
 
376
 
430
 
377
/* --------------------------------------------------------------------------*/
431
/* --------------------------------------------------------------------------*/
Line 379... Line 433...
379
/* --------------------------------------------------------------------------*/
433
/* --------------------------------------------------------------------------*/
380
 
434
 
381
static void
435
static void
382
garmin_pack_d201 ( D201 * hdr, uint8 ** pos )
436
garmin_pack_d201 ( D201 * hdr, uint8 ** pos )
383
{
437
{
-
 
438
  if (!hdr || !pos)
-
 
439
     return;
-
 
440
 
384
  PUTU8(hdr->nmbr);
441
  PUTU8(hdr->nmbr);
385
  PUTSTR(hdr->cmnt);
442
  PUTSTR(hdr->cmnt);
386
}
443
}
387
 
444
 
388
 
445
 
Line 391... Line 448...
391
/* --------------------------------------------------------------------------*/
448
/* --------------------------------------------------------------------------*/
392
 
449
 
393
static void
450
static void
394
garmin_pack_d202 ( D202 * hdr, uint8 ** pos )
451
garmin_pack_d202 ( D202 * hdr, uint8 ** pos )
395
{
452
{
-
 
453
  if (!hdr || !pos)
-
 
454
     return;
-
 
455
 
396
  PUTVST(hdr->rte_ident);
456
  PUTVST(hdr->rte_ident);
397
}
457
}
398
 
458
 
399
 
459
 
400
/* --------------------------------------------------------------------------*/
460
/* --------------------------------------------------------------------------*/
Line 402... Line 462...
402
/* --------------------------------------------------------------------------*/
462
/* --------------------------------------------------------------------------*/
403
 
463
 
404
static void
464
static void
405
garmin_pack_d210 ( D210 * link, uint8 ** pos )
465
garmin_pack_d210 ( D210 * link, uint8 ** pos )
406
{
466
{
-
 
467
  if (!link || !pos)
-
 
468
     return;
-
 
469
 
407
  PUTU16(link->class);
470
  PUTU16(link->class);
408
  PUTSTR(link->subclass);
471
  PUTSTR(link->subclass);
409
  PUTVST(link->ident);
472
  PUTVST(link->ident);
410
}
473
}
411
 
474
 
Line 415... Line 478...
415
/* --------------------------------------------------------------------------*/
478
/* --------------------------------------------------------------------------*/
416
 
479
 
417
static void
480
static void
418
garmin_pack_d300 ( D300 * point, uint8 ** pos )
481
garmin_pack_d300 ( D300 * point, uint8 ** pos )
419
{
482
{
-
 
483
  if (!point || !pos)
-
 
484
     return;
-
 
485
 
420
  PUTPOS(point->posn);
486
  PUTPOS(point->posn);
421
  PUTU32(point->time);
487
  PUTU32(point->time);
422
  PUTU8(point->new_trk);
488
  PUTU8(point->new_trk);
423
}
489
}
424
 
490
 
Line 428... Line 494...
428
/* --------------------------------------------------------------------------*/
494
/* --------------------------------------------------------------------------*/
429
 
495
 
430
static void
496
static void
431
garmin_pack_d301 ( D301 * point, uint8 ** pos )
497
garmin_pack_d301 ( D301 * point, uint8 ** pos )
432
{ 
498
{ 
-
 
499
  if (!point || !pos)
-
 
500
     return;
-
 
501
 
433
  PUTPOS(point->posn);
502
  PUTPOS(point->posn);
434
  PUTU32(point->time);
503
  PUTU32(point->time);
435
  PUTF32(point->alt);
504
  PUTF32(point->alt);
436
  PUTF32(point->dpth);
505
  PUTF32(point->dpth);
437
  PUTU8(point->new_trk);
506
  PUTU8(point->new_trk);
Line 443... Line 512...
443
/* --------------------------------------------------------------------------*/
512
/* --------------------------------------------------------------------------*/
444
 
513
 
445
static void
514
static void
446
garmin_pack_d302 ( D302 * point, uint8 ** pos )
515
garmin_pack_d302 ( D302 * point, uint8 ** pos )
447
{
516
{
-
 
517
  if (!point || !pos)
-
 
518
     return;
-
 
519
 
448
  PUTPOS(point->posn);
520
  PUTPOS(point->posn);
449
  PUTU32(point->time);
521
  PUTU32(point->time);
450
  PUTF32(point->alt);
522
  PUTF32(point->alt);
451
  PUTF32(point->dpth);
523
  PUTF32(point->dpth);
452
  PUTF32(point->temp);
524
  PUTF32(point->temp);
Line 459... Line 531...
459
/* --------------------------------------------------------------------------*/
531
/* --------------------------------------------------------------------------*/
460
 
532
 
461
static void
533
static void
462
garmin_pack_d303 ( D303 * point, uint8 ** pos )
534
garmin_pack_d303 ( D303 * point, uint8 ** pos )
463
{
535
{
-
 
536
  if (!point || !pos)
-
 
537
     return;
-
 
538
 
464
  PUTPOS(point->posn);
539
  PUTPOS(point->posn);
465
  PUTU32(point->time);
540
  PUTU32(point->time);
466
  PUTF32(point->alt);
541
  PUTF32(point->alt);
467
  PUTU8(point->heart_rate);
542
  PUTU8(point->heart_rate);
468
}
543
}
Line 473... Line 548...
473
/* --------------------------------------------------------------------------*/
548
/* --------------------------------------------------------------------------*/
474
 
549
 
475
static void
550
static void
476
garmin_pack_d304 ( D304 * point, uint8 ** pos )
551
garmin_pack_d304 ( D304 * point, uint8 ** pos )
477
{
552
{
-
 
553
  if (!point || !pos)
-
 
554
     return;
-
 
555
 
478
  PUTPOS(point->posn);
556
  PUTPOS(point->posn);
479
  PUTU32(point->time);
557
  PUTU32(point->time);
480
  PUTF32(point->alt);
558
  PUTF32(point->alt);
481
  PUTF32(point->distance);
559
  PUTF32(point->distance);
482
  PUTU8(point->heart_rate);
560
  PUTU8(point->heart_rate);
Line 490... Line 568...
490
/* --------------------------------------------------------------------------*/
568
/* --------------------------------------------------------------------------*/
491
 
569
 
492
static void
570
static void
493
garmin_pack_d310 ( D310 * hdr, uint8 ** pos )
571
garmin_pack_d310 ( D310 * hdr, uint8 ** pos )
494
{
572
{
-
 
573
  if (!hdr || !pos)
-
 
574
     return;
-
 
575
 
495
  PUTU8(hdr->dspl);
576
  PUTU8(hdr->dspl);
496
  PUTU8(hdr->color);
577
  PUTU8(hdr->color);
497
  PUTVST(hdr->trk_ident);
578
  PUTVST(hdr->trk_ident);
498
}
579
}
499
 
580
 
Line 503... Line 584...
503
/* --------------------------------------------------------------------------*/
584
/* --------------------------------------------------------------------------*/
504
 
585
 
505
static void
586
static void
506
garmin_pack_d311 ( D311 * hdr, uint8 ** pos )
587
garmin_pack_d311 ( D311 * hdr, uint8 ** pos )
507
{
588
{
-
 
589
  if (!hdr)
-
 
590
     return;
-
 
591
 
508
  PUTU16(hdr->index);
592
  PUTU16(hdr->index);
509
}
593
}
510
 
594
 
511
 
595
 
512
/* --------------------------------------------------------------------------*/
596
/* --------------------------------------------------------------------------*/
Line 514... Line 598...
514
/* --------------------------------------------------------------------------*/
598
/* --------------------------------------------------------------------------*/
515
 
599
 
516
static void
600
static void
517
garmin_pack_d312 ( D312 * hdr, uint8 ** pos )
601
garmin_pack_d312 ( D312 * hdr, uint8 ** pos )
518
{
602
{
-
 
603
  if (!hdr)
-
 
604
     return;
-
 
605
 
519
  PUTU8(hdr->dspl);
606
  PUTU8(hdr->dspl);
520
  PUTU8(hdr->color);
607
  PUTU8(hdr->color);
521
  PUTVST(hdr->trk_ident);
608
  PUTVST(hdr->trk_ident);
522
}
609
}
523
 
610
 
Line 527... Line 614...
527
/* ------------------------------------------------------------------------- */
614
/* ------------------------------------------------------------------------- */
528
 
615
 
529
static void
616
static void
530
garmin_pack_d400 ( D400 * prx, uint8 ** pos )
617
garmin_pack_d400 ( D400 * prx, uint8 ** pos )
531
{
618
{
-
 
619
  if (!prx)
-
 
620
     return;
-
 
621
 
532
  garmin_pack_d100(&prx->wpt,pos);
622
  garmin_pack_d100(&prx->wpt,pos);
533
  SKIP(sizeof(D100));
623
  SKIP(sizeof(D100));
534
  PUTF32(prx->dst);
624
  PUTF32(prx->dst);
535
}
625
}
536
 
626
 
Line 540... Line 630...
540
/* ------------------------------------------------------------------------- */
630
/* ------------------------------------------------------------------------- */
541
 
631
 
542
static void
632
static void
543
garmin_pack_d403 ( D403 * prx, uint8 ** pos )
633
garmin_pack_d403 ( D403 * prx, uint8 ** pos )
544
{
634
{
-
 
635
  if (!prx)
-
 
636
     return;
-
 
637
 
545
  garmin_pack_d103(&prx->wpt,pos);
638
  garmin_pack_d103(&prx->wpt,pos);
546
  SKIP(sizeof(D103));
639
  SKIP(sizeof(D103));
547
  PUTF32(prx->dst);
640
  PUTF32(prx->dst);
548
}
641
}
549
 
642
 
Line 553... Line 646...
553
/* ------------------------------------------------------------------------- */
646
/* ------------------------------------------------------------------------- */
554
 
647
 
555
static void
648
static void
556
garmin_pack_d450 ( D450 * prx, uint8 ** pos )
649
garmin_pack_d450 ( D450 * prx, uint8 ** pos )
557
{
650
{
-
 
651
  if (!prx)
-
 
652
     return;
-
 
653
 
558
  PUTU32(prx->idx);
654
  PUTU32(prx->idx);
559
  garmin_pack_d150(&prx->wpt,pos);
655
  garmin_pack_d150(&prx->wpt,pos);
560
  SKIP(sizeof(D150));
656
  SKIP(sizeof(D150));
561
  PUTF32(prx->dst);
657
  PUTF32(prx->dst);
562
}
658
}
Line 567... Line 663...
567
/* ------------------------------------------------------------------------- */
663
/* ------------------------------------------------------------------------- */
568
 
664
 
569
static void
665
static void
570
garmin_pack_d500 ( D500 * alm, uint8 ** pos )
666
garmin_pack_d500 ( D500 * alm, uint8 ** pos )
571
{
667
{
-
 
668
  if (!alm)
-
 
669
     return;
-
 
670
 
572
  PUTU16(alm->wn);
671
  PUTU16(alm->wn);
573
  PUTF32(alm->toa);
672
  PUTF32(alm->toa);
574
  PUTF32(alm->af0);
673
  PUTF32(alm->af0);
575
  PUTF32(alm->af1);
674
  PUTF32(alm->af1);
576
  PUTF32(alm->e);
675
  PUTF32(alm->e);
Line 588... Line 687...
588
/* ------------------------------------------------------------------------- */
687
/* ------------------------------------------------------------------------- */
589
 
688
 
590
static void
689
static void
591
garmin_pack_d501 ( D501 * alm, uint8 ** pos )
690
garmin_pack_d501 ( D501 * alm, uint8 ** pos )
592
{
691
{
-
 
692
  if (!alm)
-
 
693
     return;
-
 
694
 
593
  PUTU16(alm->wn);
695
  PUTU16(alm->wn);
594
  PUTF32(alm->toa);
696
  PUTF32(alm->toa);
595
  PUTF32(alm->af0);
697
  PUTF32(alm->af0);
596
  PUTF32(alm->af1);
698
  PUTF32(alm->af1);
597
  PUTF32(alm->e);
699
  PUTF32(alm->e);
Line 610... Line 712...
610
/* ------------------------------------------------------------------------- */
712
/* ------------------------------------------------------------------------- */
611
 
713
 
612
static void
714
static void
613
garmin_pack_d550 ( D550 * alm, uint8 ** pos )
715
garmin_pack_d550 ( D550 * alm, uint8 ** pos )
614
{
716
{
-
 
717
  if (!alm)
-
 
718
     return;
-
 
719
 
615
  PUTU8(alm->svid);
720
  PUTU8(alm->svid);
616
  PUTU16(alm->wn);
721
  PUTU16(alm->wn);
617
  PUTF32(alm->toa);
722
  PUTF32(alm->toa);
618
  PUTF32(alm->af0);
723
  PUTF32(alm->af0);
619
  PUTF32(alm->af1);
724
  PUTF32(alm->af1);
Line 632... Line 737...
632
/* ------------------------------------------------------------------------- */
737
/* ------------------------------------------------------------------------- */
633
 
738
 
634
static void
739
static void
635
garmin_pack_d551 ( D551 * alm, uint8 ** pos )
740
garmin_pack_d551 ( D551 * alm, uint8 ** pos )
636
{
741
{
-
 
742
  if (!alm)
-
 
743
     return;
-
 
744
 
637
  PUTU8(alm->svid);
745
  PUTU8(alm->svid);
638
  PUTU16(alm->wn);
746
  PUTU16(alm->wn);
639
  PUTF32(alm->toa);
747
  PUTF32(alm->toa);
640
  PUTF32(alm->af0);
748
  PUTF32(alm->af0);
641
  PUTF32(alm->af1);
749
  PUTF32(alm->af1);
Line 655... Line 763...
655
/* ------------------------------------------------------------------------- */
763
/* ------------------------------------------------------------------------- */
656
 
764
 
657
static void
765
static void
658
garmin_pack_d600 ( D600 * dt, uint8 ** pos )
766
garmin_pack_d600 ( D600 * dt, uint8 ** pos )
659
{
767
{
-
 
768
  if (!dt)
-
 
769
     return;
-
 
770
 
660
  PUTU8(dt->month);
771
  PUTU8(dt->month);
661
  PUTU8(dt->day);
772
  PUTU8(dt->day);
662
  PUTU16(dt->year);
773
  PUTU16(dt->year);
663
  PUTU16(dt->hour);
774
  PUTU16(dt->hour);
664
  PUTU8(dt->minute);
775
  PUTU8(dt->minute);
Line 671... Line 782...
671
/* ------------------------------------------------------------------------- */
782
/* ------------------------------------------------------------------------- */
672
 
783
 
673
static void
784
static void
674
garmin_pack_d650 ( D650 * fbr, uint8 ** pos )
785
garmin_pack_d650 ( D650 * fbr, uint8 ** pos )
675
{
786
{
-
 
787
  if (!fbr)
-
 
788
     return;
-
 
789
 
676
  PUTU32(fbr->takeoff_time);
790
  PUTU32(fbr->takeoff_time);
677
  PUTU32(fbr->landing_time);
791
  PUTU32(fbr->landing_time);
678
  PUTPOS(fbr->takeoff_posn);
792
  PUTPOS(fbr->takeoff_posn);
679
  PUTPOS(fbr->landing_posn);
793
  PUTPOS(fbr->landing_posn);
680
  PUTU32(fbr->night_time);
794
  PUTU32(fbr->night_time);
Line 707... Line 821...
707
/* ------------------------------------------------------------------------- */
821
/* ------------------------------------------------------------------------- */
708
 
822
 
709
static void
823
static void
710
garmin_pack_d800 ( D800 * pvt, uint8 ** pos )
824
garmin_pack_d800 ( D800 * pvt, uint8 ** pos )
711
{
825
{
-
 
826
  if (!pvt)
-
 
827
     return;
-
 
828
 
712
  PUTF32(pvt->alt);
829
  PUTF32(pvt->alt);
713
  PUTF32(pvt->epe);
830
  PUTF32(pvt->epe);
714
  PUTF32(pvt->eph);
831
  PUTF32(pvt->eph);
715
  PUTF32(pvt->epv);
832
  PUTF32(pvt->epv);
716
  PUTU16(pvt->fix);
833
  PUTU16(pvt->fix);
Line 730... Line 847...
730
/* --------------------------------------------------------------------------*/
847
/* --------------------------------------------------------------------------*/
731
 
848
 
732
static void
849
static void
733
garmin_pack_d906 ( D906 * lap, uint8 ** pos )
850
garmin_pack_d906 ( D906 * lap, uint8 ** pos )
734
{
851
{
-
 
852
  if (!lap)
-
 
853
     return;
-
 
854
 
735
  PUTU32(lap->start_time);
855
  PUTU32(lap->start_time);
736
  PUTU32(lap->total_time);
856
  PUTU32(lap->total_time);
737
  PUTF32(lap->total_distance);
857
  PUTF32(lap->total_distance);
738
  PUTPOS(lap->begin);
858
  PUTPOS(lap->begin);
739
  PUTPOS(lap->end);
859
  PUTPOS(lap->end);
Line 751... Line 871...
751
 
871
 
752
 
872
 
753
static void
873
static void
754
garmin_pack_d1000 ( D1000 * run, uint8 ** pos )
874
garmin_pack_d1000 ( D1000 * run, uint8 ** pos )
755
{
875
{
-
 
876
  if (!run)
-
 
877
     return;
-
 
878
 
756
  PUTU32(run->track_index);
879
  PUTU32(run->track_index);
757
  PUTU32(run->first_lap_index);
880
  PUTU32(run->first_lap_index);
758
  PUTU32(run->last_lap_index);
881
  PUTU32(run->last_lap_index);
759
  PUTU8(run->sport_type);
882
  PUTU8(run->sport_type);
760
  PUTU8(run->program_type);
883
  PUTU8(run->program_type);
Line 770... Line 893...
770
/* --------------------------------------------------------------------------*/
893
/* --------------------------------------------------------------------------*/
771
 
894
 
772
static void
895
static void
773
garmin_pack_d1001 ( D1001 * lap, uint8 ** pos )
896
garmin_pack_d1001 ( D1001 * lap, uint8 ** pos )
774
{
897
{
-
 
898
  if (!lap)
-
 
899
     return;
-
 
900
 
775
  PUTU32(lap->index);
901
  PUTU32(lap->index);
776
  PUTU32(lap->start_time);
902
  PUTU32(lap->start_time);
777
  PUTU32(lap->total_time);
903
  PUTU32(lap->total_time);
778
  PUTF32(lap->total_dist);
904
  PUTF32(lap->total_dist);
779
  PUTF32(lap->max_speed);
905
  PUTF32(lap->max_speed);
Line 793... Line 919...
793
static void
919
static void
794
garmin_pack_d1002 ( D1002 * wkt, uint8 ** pos )
920
garmin_pack_d1002 ( D1002 * wkt, uint8 ** pos )
795
{
921
{
796
  int i;
922
  int i;
797
 
923
 
-
 
924
  if (!wkt)
-
 
925
     return;
-
 
926
 
798
  PUTU32(wkt->num_valid_steps);
927
  PUTU32(wkt->num_valid_steps);
799
  for ( i = 0; i < 20; i++ ) {
928
  for ( i = 0; i < 20; i++ ) {
800
    PUTSTR(wkt->steps[i].custom_name);
929
    PUTSTR(wkt->steps[i].custom_name);
801
    PUTF32(wkt->steps[i].target_custom_zone_low);
930
    PUTF32(wkt->steps[i].target_custom_zone_low);
802
    PUTF32(wkt->steps[i].target_custom_zone_high);
931
    PUTF32(wkt->steps[i].target_custom_zone_high);
Line 817... Line 946...
817
/* --------------------------------------------------------------------------*/
946
/* --------------------------------------------------------------------------*/
818
 
947
 
819
static void
948
static void
820
garmin_pack_d1003 ( D1003 * occ, uint8 ** pos )
949
garmin_pack_d1003 ( D1003 * occ, uint8 ** pos )
821
{
950
{
-
 
951
  if (!occ)
-
 
952
     return;
-
 
953
 
822
  PUTSTR(occ->workout_name);
954
  PUTSTR(occ->workout_name);
823
  PUTU32(occ->day);
955
  PUTU32(occ->day);
824
}
956
}
825
 
957
 
826
 
958
 
Line 832... Line 964...
832
garmin_pack_d1004 ( D1004 * prof, uint8 ** pos )
964
garmin_pack_d1004 ( D1004 * prof, uint8 ** pos )
833
{
965
{
834
  int i;
966
  int i;
835
  int j;
967
  int j;
836
 
968
 
-
 
969
  if (!prof)
-
 
970
     return;
-
 
971
 
837
  for ( i = 0; i < 3; i++ ) {
972
  for ( i = 0; i < 3; i++ ) {
838
    for ( j = 0; j < 5; j++ ) {
973
    for ( j = 0; j < 5; j++ ) {
839
      PUTU8(prof->activities[i].heart_rate_zones[j].low_heart_rate);
974
      PUTU8(prof->activities[i].heart_rate_zones[j].low_heart_rate);
840
      PUTU8(prof->activities[i].heart_rate_zones[j].high_heart_rate);
975
      PUTU8(prof->activities[i].heart_rate_zones[j].high_heart_rate);
841
      SKIP(2);
976
      SKIP(2);
Line 862... Line 997...
862
/* --------------------------------------------------------------------------*/
997
/* --------------------------------------------------------------------------*/
863
 
998
 
864
static void
999
static void
865
garmin_pack_d1005 ( D1005 * limits, uint8 ** pos )
1000
garmin_pack_d1005 ( D1005 * limits, uint8 ** pos )
866
{
1001
{
-
 
1002
  if (!limits)
-
 
1003
     return;
-
 
1004
 
867
  PUTU32(limits->max_workouts);
1005
  PUTU32(limits->max_workouts);
868
  PUTU32(limits->max_unscheduled_workouts);
1006
  PUTU32(limits->max_unscheduled_workouts);
869
  PUTU32(limits->max_occurrences);
1007
  PUTU32(limits->max_occurrences);
870
}
1008
}
871
 
1009
 
Line 875... Line 1013...
875
/* --------------------------------------------------------------------------*/
1013
/* --------------------------------------------------------------------------*/
876
 
1014
 
877
static void
1015
static void
878
garmin_pack_d1006 ( D1006 * course, uint8 ** pos )
1016
garmin_pack_d1006 ( D1006 * course, uint8 ** pos )
879
{
1017
{
-
 
1018
  if (!course)
-
 
1019
     return;
-
 
1020
 
880
  PUTU16(course->index);
1021
  PUTU16(course->index);
881
  SKIP(2);
1022
  SKIP(2);
882
  PUTSTR(course->course_name);
1023
  PUTSTR(course->course_name);
883
  PUTU16(course->track_index);
1024
  PUTU16(course->track_index);
884
}
1025
}
Line 889... Line 1030...
889
/* --------------------------------------------------------------------------*/
1030
/* --------------------------------------------------------------------------*/
890
 
1031
 
891
static void
1032
static void
892
garmin_pack_d1007 ( D1007 * lap, uint8 ** pos )
1033
garmin_pack_d1007 ( D1007 * lap, uint8 ** pos )
893
{
1034
{
-
 
1035
  if (!lap)
-
 
1036
     return;
-
 
1037
 
894
  PUTU16(lap->course_index);
1038
  PUTU16(lap->course_index);
895
  PUTU16(lap->lap_index);
1039
  PUTU16(lap->lap_index);
896
  PUTU32(lap->total_time);
1040
  PUTU32(lap->total_time);
897
  PUTF32(lap->total_dist);
1041
  PUTF32(lap->total_dist);
898
  PUTPOS(lap->begin);
1042
  PUTPOS(lap->begin);
Line 909... Line 1053...
909
/* --------------------------------------------------------------------------*/
1053
/* --------------------------------------------------------------------------*/
910
 
1054
 
911
static void
1055
static void
912
garmin_pack_d1008 ( D1008 * wkt, uint8 ** pos )
1056
garmin_pack_d1008 ( D1008 * wkt, uint8 ** pos )
913
{
1057
{
-
 
1058
  if (!wkt)
-
 
1059
     return;
-
 
1060
 
914
  garmin_pack_d1002((D1002 *)wkt,pos);
1061
  garmin_pack_d1002((D1002 *)wkt,pos);
915
}
1062
}
916
 
1063
 
917
 
1064
 
918
/* --------------------------------------------------------------------------*/
1065
/* --------------------------------------------------------------------------*/
Line 920... Line 1067...
920
/* --------------------------------------------------------------------------*/
1067
/* --------------------------------------------------------------------------*/
921
 
1068
 
922
static void
1069
static void
923
garmin_pack_d1009 ( D1009 * run, uint8 ** pos )
1070
garmin_pack_d1009 ( D1009 * run, uint8 ** pos )
924
{
1071
{
-
 
1072
  if (!run)
-
 
1073
     return;
-
 
1074
 
925
  PUTU16(run->track_index);
1075
  PUTU16(run->track_index);
926
  PUTU16(run->first_lap_index);
1076
  PUTU16(run->first_lap_index);
927
  PUTU16(run->last_lap_index);
1077
  PUTU16(run->last_lap_index);
928
  PUTU8(run->sport_type);
1078
  PUTU8(run->sport_type);
929
  PUTU8(run->program_type);
1079
  PUTU8(run->program_type);
Line 940... Line 1090...
940
/* --------------------------------------------------------------------------*/
1090
/* --------------------------------------------------------------------------*/
941
 
1091
 
942
static void
1092
static void
943
garmin_pack_d1010 ( D1010 * run, uint8 ** pos )
1093
garmin_pack_d1010 ( D1010 * run, uint8 ** pos )
944
{
1094
{
-
 
1095
  if (!run)
-
 
1096
     return;
-
 
1097
 
945
  PUTU32(run->track_index);
1098
  PUTU32(run->track_index);
946
  PUTU32(run->first_lap_index);
1099
  PUTU32(run->first_lap_index);
947
  PUTU32(run->last_lap_index);
1100
  PUTU32(run->last_lap_index);
948
  PUTU8(run->sport_type);
1101
  PUTU8(run->sport_type);
949
  PUTU8(run->program_type);
1102
  PUTU8(run->program_type);
Line 960... Line 1113...
960
/* --------------------------------------------------------------------------*/
1113
/* --------------------------------------------------------------------------*/
961
 
1114
 
962
static void
1115
static void
963
garmin_pack_d1011 ( D1011 * lap, uint8 ** pos )
1116
garmin_pack_d1011 ( D1011 * lap, uint8 ** pos )
964
{
1117
{
-
 
1118
  if (!lap)
-
 
1119
     return;
-
 
1120
 
965
  PUTU16(lap->index);
1121
  PUTU16(lap->index);
966
  SKIP(2);
1122
  SKIP(2);
967
  PUTU32(lap->start_time);
1123
  PUTU32(lap->start_time);
968
  PUTU32(lap->total_time);
1124
  PUTU32(lap->total_time);
969
  PUTF32(lap->total_dist);
1125
  PUTF32(lap->total_dist);
Line 984... Line 1140...
984
/* --------------------------------------------------------------------------*/
1140
/* --------------------------------------------------------------------------*/
985
 
1141
 
986
static void
1142
static void
987
garmin_pack_d1012 ( D1012 * point, uint8 ** pos )
1143
garmin_pack_d1012 ( D1012 * point, uint8 ** pos )
988
{
1144
{
-
 
1145
  if (!point)
-
 
1146
     return;
-
 
1147
 
989
  PUTSTR(point->name);
1148
  PUTSTR(point->name);
990
  SKIP(1);
1149
  SKIP(1);
991
  PUTU16(point->course_index);
1150
  PUTU16(point->course_index);
992
  SKIP(2);
1151
  SKIP(2);
993
  PUTU32(point->track_point_time);
1152
  PUTU32(point->track_point_time);
Line 1000... Line 1159...
1000
/* --------------------------------------------------------------------------*/
1159
/* --------------------------------------------------------------------------*/
1001
 
1160
 
1002
static void
1161
static void
1003
garmin_pack_d1013 ( D1013 * limits, uint8 ** pos )
1162
garmin_pack_d1013 ( D1013 * limits, uint8 ** pos )
1004
{
1163
{
-
 
1164
  if (!limits)
-
 
1165
     return;
-
 
1166
 
1005
  PUTU32(limits->max_courses);
1167
  PUTU32(limits->max_courses);
1006
  PUTU32(limits->max_course_laps);
1168
  PUTU32(limits->max_course_laps);
1007
  PUTU32(limits->max_course_pnt);
1169
  PUTU32(limits->max_course_pnt);
1008
  PUTU32(limits->max_course_trk_pnt);
1170
  PUTU32(limits->max_course_trk_pnt);
1009
}
1171
}
Line 1014... Line 1176...
1014
/* --------------------------------------------------------------------------*/
1176
/* --------------------------------------------------------------------------*/
1015
 
1177
 
1016
static void
1178
static void
1017
garmin_pack_d1015 ( D1015 * lap, uint8 ** pos )
1179
garmin_pack_d1015 ( D1015 * lap, uint8 ** pos )
1018
{
1180
{
-
 
1181
  if (!lap)
-
 
1182
     return;
-
 
1183
 
1019
  PUTU16(lap->index);
1184
  PUTU16(lap->index);
1020
  SKIP(2);
1185
  SKIP(2);
1021
  PUTU32(lap->start_time);
1186
  PUTU32(lap->start_time);
1022
  PUTU32(lap->total_time);
1187
  PUTU32(lap->total_time);
1023
  PUTF32(lap->total_dist);
1188
  PUTF32(lap->total_dist);
Line 1046... Line 1211...
1046
static void
1211
static void
1047
garmin_pack_dlist ( garmin_list * list, uint8 ** pos )
1212
garmin_pack_dlist ( garmin_list * list, uint8 ** pos )
1048
{
1213
{
1049
  garmin_list_node * node;
1214
  garmin_list_node * node;
1050
 
1215
 
-
 
1216
  if (!list)
-
 
1217
     return;
-
 
1218
 
1051
  PUTU32(list->id);
1219
  PUTU32(list->id);
1052
  PUTU32(list->elements);
1220
  PUTU32(list->elements);
1053
  for ( node = list->head; node != NULL; node = node->next ) {
1221
  for ( node = list->head; node != NULL; node = node->next ) {
1054
    PUTU32(list->id);
1222
    PUTU32(list->id);
1055
    garmin_pack(node->data,pos);
1223
    garmin_pack(node->data,pos);
Line 1258... Line 1426...
1258
  uint8 * finish;
1426
  uint8 * finish;
1259
  uint8 * marker;
1427
  uint8 * marker;
1260
  uint32  bytes = 0;
1428
  uint32  bytes = 0;
1261
  char    hv0[256];
1429
  char    hv0[256];
1262
 
1430
 
1263
  if ( garmin_data_size(data) == 0 ) return 0;
1431
  if ( !data || garmin_data_size(data) == 0 ) return 0;
1264
 
1432
 
1265
  /* OK, we must know how to serialize this data.  Let's go for it. */
1433
  /* OK, we must know how to serialize this data.  Let's go for it. */
1266
 
1434
 
1267
#define CASE_DATA(x)                        \
1435
#define CASE_DATA(x)                        \
1268
  case data_D##x:                           \
1436
  case data_D##x:                           \