-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgpsLogger.html
707 lines (678 loc) · 31.5 KB
/
gpsLogger.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=macintosh">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="gpsLogger_files/filelist.xml">
<title>gpsLogger</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>R. Brian Adamson</o:Author>
<o:Keywords>GPS, time synchronization, mobile networking, MGEN, test tool</o:Keywords>
<o:LastAuthor> Jeff Weston</o:LastAuthor>
<o:Revision>2</o:Revision>
<o:TotalTime>134</o:TotalTime>
<o:Created>2005-06-17T15:25:00Z</o:Created>
<o:LastSaved>2005-06-17T15:25:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>1002</o:Words>
<o:Characters>5714</o:Characters>
<o:Company>Naval Research Laboratory (NRL)</o:Company>
<o:Lines>47</o:Lines>
<o:Paragraphs>13</o:Paragraphs>
<o:CharactersWithSpaces>6703</o:CharactersWithSpaces>
<o:Version>11.6408</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:ActiveWritingStyle Lang="EN-US" VendorID="6" DLLVersion="2" NLCheck="0">1</w:ActiveWritingStyle>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
<w:DisplayVerticalDrawingGridEvery>0</w:DisplayVerticalDrawingGridEvery>
<w:UseMarginsForDrawingGridOrigin/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:SpaceForUL/>
<w:ULTrailSpace/>
<w:DoNotExpandShiftReturn/>
<w:AdjustLineHeightInTable/>
<w:SelectEntireFieldWithStartOrEnd/>
<w:UseWord2002TableStyleRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:3 0 0 0 1 0;}
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;
mso-font-alt:"Courier New";
mso-font-charset:0;
mso-generic-font-family:modern;
mso-font-format:other;
mso-font-pitch:fixed;
mso-font-signature:3 0 0 0 1 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
{font-family:Times;
panose-1:2 2 6 3 5 4 5 2 3 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:3 0 0 0 1 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin-top:6.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:10.0pt;
font-family:Times;
mso-fareast-font-family:Times;
mso-bidi-font-family:"Times New Roman";
color:windowtext;}
h1
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:1;
font-size:16.0pt;
mso-bidi-font-size:10.0pt;
font-family:Helvetica;
mso-fareast-font-family:Times;
color:windowtext;
mso-font-kerning:16.0pt;
font-weight:bold;
mso-bidi-font-weight:normal;}
h2
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:2;
font-size:14.0pt;
mso-bidi-font-size:10.0pt;
font-family:Helvetica;
mso-fareast-font-family:Times;
color:windowtext;
font-weight:bold;
mso-bidi-font-weight:normal;
font-style:italic;
mso-bidi-font-style:normal;}
h4
{mso-style-next:Normal;
margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:4;
font-size:14.0pt;
mso-bidi-font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:windowtext;
font-weight:bold;
mso-bidi-font-weight:normal;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin-top:6.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
font-size:12.0pt;
mso-bidi-font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:windowtext;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{margin-top:6.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 3.0in right 6.0in;
font-size:12.0pt;
mso-bidi-font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
color:windowtext;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
{margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
text-align:center;
mso-pagination:widow-orphan;
mso-outline-level:1;
font-size:16.0pt;
mso-bidi-font-size:10.0pt;
font-family:Helvetica;
mso-fareast-font-family:Times;
mso-bidi-font-family:"Times New Roman";
color:windowtext;
mso-font-kerning:14.0pt;
font-weight:bold;
mso-bidi-font-weight:normal;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
p.MsoDocumentMap, li.MsoDocumentMap, div.MsoDocumentMap
{mso-style-noshow:yes;
margin-top:6.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
background:navy;
font-size:12.0pt;
mso-bidi-font-size:10.0pt;
font-family:Tahoma;
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";
color:windowtext;}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
mso-bidi-font-size:10.0pt;
font-family:Arial;
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";
color:black;}
pre
{margin-top:6.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
font-size:10.0pt;
font-family:"Courier New";
mso-fareast-font-family:"Courier New";
mso-bidi-font-family:"Times New Roman";
color:windowtext;}
p.Usage, li.Usage, div.Usage
{mso-style-name:Usage;
margin-top:6.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:1.0in;
margin-bottom:.0001pt;
text-indent:-1.0in;
mso-pagination:widow-orphan;
tab-stops:1.0in;
font-size:12.0pt;
mso-bidi-font-size:10.0pt;
font-family:Courier;
mso-fareast-font-family:Times;
mso-bidi-font-family:"Times New Roman";
color:windowtext;}
span.SpellE
{mso-style-name:"";
mso-spl-e:yes;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:1006054569;
mso-list-type:hybrid;
mso-list-template-ids:1719413098;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:.75in;
mso-level-number-position:left;
margin-left:.75in;
text-indent:-.5in;}
@list l1
{mso-list-id:2058311913;
mso-list-type:hybrid;
mso-list-template-ids:-2036177748;}
@list l1:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:.75in;
mso-level-number-position:left;
margin-left:.75in;
text-indent:-.5in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:Times;
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
<div class=Section1>
<p class=MsoTitle><span class=GramE>gpsLogger</span> 1.8</p>
<p><span class=GramE><i style='mso-bidi-font-style:normal'>gpsLogger</i></span>
is a simple program which monitors a serial port for data from a Global
Positioning System (GPS) receiver (NMEA format).<span
style='mso-spacerun:yes'> </span><span class=GramE><i style='mso-bidi-font-style:
normal'>gpsLogger</i></span> "publishes" the current position to
shared memory where other client applications can "subscribe" to read
the current GPS position.<span style='mso-spacerun:yes'> </span>A
publish/subscribe application program interface API is defined in the "<span
class=SpellE>gpsPub.h</span>" file in the <i style='mso-bidi-font-style:
normal'>gpsLogger</i> source code distribution.<span
style='mso-spacerun:yes'> </span>The NRL Multi-Generator (MGEN) test tool
set uses this methodology for embedding GPS position information in messages it
generates.<span style='mso-spacerun:yes'> </span>This tool set has been
used for mobile wireless network performance evaluation and is available from <a
href="https://www.nrl.navy.mil/itd/ncs/products/mgen">https://www.nrl.navy.mil/itd/ncs/products/mgen</a>.<span
style='mso-spacerun:yes'> </span>By default, <i style='mso-bidi-font-style:
normal'>gpsLogger</i> will also log position information to <span class=SpellE><span
style='font-family:Courier'>stdout</span></span> in the comma-delimited lines
of the format:</p>
<p><span class=GramE>time</span>><i style='mso-bidi-font-style:normal'><hr>:<min>:<sec></i>
position><i style='mso-bidi-font-style:normal'><longitude>,<latitude>,<altitude></i></p>
<p>The time logged is the computer system time in Greenwich Mean Time
(GMT).<span style='mso-spacerun:yes'> </span>The <latitude> and
<longitude> are given in units of degrees. Positive <latitude>
indicates North, negative <latitude> indicates South, positive
<longitude> indicates East, negative <latitude> indicates West, and
<altitude> is in units of meters.</p>
<p>Note that <i style='mso-bidi-font-style:normal'>gpsLogger</i> can optionally
set the system time and synchronize it to GPS.<span
style='mso-spacerun:yes'> </span>When <i style='mso-bidi-font-style:normal'>gpsLogger</i>
is used to set the system time, it can work in one of two ways:</p>
<p style='margin-left:.75in;text-indent:-.5in;mso-list:l1 level1 lfo2;
tab-stops:list .75in'><![if !supportLists]><span style='mso-fareast-font-family:
Arial;mso-bidi-font-family:Arial'><span style='mso-list:Ignore'>1)<span
style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]>If the <span class=SpellE><u>pps</u></span>
option is <b style='mso-bidi-font-weight:normal'>not</b> specified, the system
time is set once (and only once) upon the first valid timestamp received from
the GPS device.<span style='mso-spacerun:yes'> </span>This time set is
accurate to within approximately +/- one second, with subsequent system clock
drift eventually diverging the system time from GPS time.</p>
<p style='margin-left:.75in;text-indent:-.5in;mso-list:l1 level1 lfo2;
tab-stops:list .75in'><![if !supportLists]><span style='mso-fareast-font-family:
Arial;mso-bidi-font-family:Arial'><span style='mso-list:Ignore'>2)<span
style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]>If the <span class=SpellE><u>pps</u></span>
option is specified, <i style='mso-bidi-font-style:normal'>gpsLogger</i> will
accurately (often within 1 <span class=SpellE>msec</span>) set and adjust the
system time to track GPS time.<span style='mso-spacerun:yes'> </span>The <span
class=SpellE><span class=GramE><span style='font-family:Courier'>adjtime</span></span></span><span
class=GramE><span style='font-family:Courier'>(</span></span><span
style='font-family:Courier'>)</span> system call is used to keep the system
time in sync with GPS while preserving a monotonically increasing system clock
time.<span style='mso-spacerun:yes'> </span>However, if the system time
diverges more than one second from GPS time, the <span class=SpellE><span
class=GramE><span style='font-family:Courier'>settimeodday</span></span></span><span
class=GramE><span style='font-family:Courier'>(</span></span><span
style='font-family:Courier'>)</span> call is used to force the system time in
sync with GPS (which may result in a negative system time shift).<span
style='mso-spacerun:yes'> </span></p>
<p>An explicit <u>force</u> command-line option is provided so that if the
system time is already within one second of GPS time when gpsLogger is started,
it will immediately "force" the system time into sync with GPS using
the <span class=SpellE><span class=GramE><span style='font-family:Courier'>settimeofday</span></span></span><span
class=GramE><span style='font-family:Courier'>(</span></span><span
style='font-family:Courier'>)</span> call on its first time adjustment instead
of <span class=SpellE><span style='font-family:Courier'>adjtime</span></span><span
style='font-family:Courier'>()</span> which could possibly take a long period
of time to converge towards GPS if the time delta is close to one second.<span
style='mso-spacerun:yes'> </span>The <u>force</u> option is provided for
applications where the user doesn't care about an initial negative system time
shift and wants to quickly get system time in sync with GPS rather than waiting
for a possibly lengthy convergence to GPS time.<span
style='mso-spacerun:yes'> </span>After the initial "forced"
hard time adjustment, <i style='mso-bidi-font-style:normal'>gpsLogger</i>
behaves normally, generally using the <span class=SpellE><span class=GramE><span
style='font-family:Courier'>adjtime</span></span></span><span class=GramE><span
style='font-family:Courier'>(</span></span><span style='font-family:Courier'>)</span>
call to keep the system time in sync with GPS, and only invoking <span
class=SpellE><span style='font-family:Courier'>settimeofday</span></span><span
style='font-family:Courier'>()</span> when the system time strays more than one
second from GPS time.<span style='mso-spacerun:yes'> </span></p>
<p>The<i style='mso-bidi-font-style:normal'> gpsLogger</i> utility was created
as a light-weight alternative to the Network Time Protocol daemon (<span
class=SpellE><i style='mso-bidi-font-style:normal'>ntpd</i></span>), also
providing the GPS position information in shared memory for use by other
applications or processes.<span style='mso-spacerun:yes'> </span>The <span
class=SpellE><i style='mso-bidi-font-style:normal'>ntpd</i></span> program
offers much more flexibility when time synchronization is the only concern.</p>
<h1 style='tab-stops:228.0pt'>Download<span style='mso-tab-count:1'> </span></h1>
<p>The gpsLogger package is available at: <a
href="https://github.com/USNavalResearchLaboratory/gpsLogger">https://github.com/USNavalResearchLaboratory/gpsLogger</a></p>
<h2>Files:</h2>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
style='width:100.0%;border-collapse:collapse;mso-padding-alt:0in 5.4pt 0in 5.4pt'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
<td width="23%" valign=top style='width:23.9%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span class=SpellE><span style='font-family:Arial;
mso-bidi-font-family:"Times New Roman"'>gpsLogger.cpp</span></span><span
style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
</td>
<td width="76%" valign=top style='width:76.1%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>gpsLogger
source code<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:1'>
<td width="23%" valign=top style='width:23.9%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span class=SpellE><span style='font-family:Arial;
mso-bidi-font-family:"Times New Roman"'>nmeaParse.h</span></span><span
style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'><br>
<span class=SpellE>nmeaParse.cpp</span><o:p></o:p></span></p>
</td>
<td width="76%" valign=top style='width:76.1%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Routines
for parsing NMEA sentences<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:2'>
<td width="23%" valign=top style='width:23.9%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span class=SpellE><span style='font-family:Arial;
mso-bidi-font-family:"Times New Roman"'>gpsPub.h</span></span><span
style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'><br>
<span class=SpellE>gpsPub.cpp</span><o:p></o:p></span></p>
</td>
<td width="76%" valign=top style='width:76.1%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Routines
for GPS position publish/ subscribe (using shared memory)<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:3'>
<td width="23%" valign=top style='width:23.9%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span class=SpellE><span style='font-family:Arial;
mso-bidi-font-family:"Times New Roman"'>gpsClient.cpp</span></span><span
style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
</td>
<td width="76%" valign=top style='width:76.1%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Example
C++ source code for using <span class=SpellE>GPSSubscribe</span>()<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:4;mso-yfti-lastrow:yes'>
<td width="23%" valign=top style='width:23.9%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span class=SpellE><span style='font-family:Arial;
mso-bidi-font-family:"Times New Roman"'>gpsFaker.cpp</span></span><span
style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
</td>
<td width="76%" valign=top style='width:76.1%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Program
to publish "fake" GPS position.<o:p></o:p></span></p>
</td>
</tr>
</table>
<h1>To Build</h1>
<p class=Usage><span class=SpellE><span class=GramE>gcc</span></span> -o
gpsLogger <span class=SpellE>gpsLogger.cpp</span> <span class=SpellE>nmeaParse.cpp</span>
<span class=SpellE>gpsPub.cpp</span></p>
<h1>Usage:</h1>
<p class=Usage>gpsLogger<span style='mso-tab-count:1'> </span>[set][<span
class=SpellE>pps</span>][force][check][gps35][<span class=SpellE>noLog</span>]<br>
[log <<span class=SpellE>logFile</span>>][device <<span class=SpellE>serialDevice</span>>]<br>
[speed <<span class=SpellE>baudRate</span>>][debug]<br style='mso-special-character:
line-break'>
<![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
<![endif]></p>
<h2>Options:</h2>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width="100%"
style='width:100.0%;border-collapse:collapse;mso-yfti-tbllook:16;mso-padding-alt:
0in 5.4pt 0in 5.4pt'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>set<o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Cause
<i style='mso-bidi-font-style:normal'>gpsLogger</i> to set and synchronize
the system time to GPS time.<span style='mso-spacerun:yes'>
</span>Should be used with the <span class=SpellE><u>pps</u></span> option
for the best accuracy.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:1'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span class=SpellE><span style='font-family:Arial;
mso-bidi-font-family:"Times New Roman"'>pps</span></span><span
style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Causes
<i style='mso-bidi-font-style:normal'>gpsLogger</i> to look for a
pulse-per-second (PPS) signal on the serial port data carrier detect (DCD)
line to use as a reference for accurate sync of system time to GPS time.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:2'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoHeader style='tab-stops:.5in'><span style='font-family:Arial;
mso-fareast-font-family:Times;mso-bidi-font-family:"Times New Roman"'>force<o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Causes
<i style='mso-bidi-font-style:normal'>gpsLogger</i> to hard sync the system
time of day to GPS time using a call to "<span class=SpellE><span
class=GramE>settimeofday</span></span><span class=GramE>(</span>)" on
the first time read from the GPS device.<span style='mso-spacerun:yes'>
</span>This speeds up convergence of system time to GPS time, but may result
in the system's time moving backwards on the first sync to GPS time.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:3'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>check<o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Causes
<i style='mso-bidi-font-style:normal'>gpsLogger</i> to <u>require</u> valid
checksums on NMEA sentences from the GPS device.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:4'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>gps35<o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Causes
<i style='mso-bidi-font-style:normal'>gpsLogger</i>, at startup, to attempt
to configure a <span class=SpellE>Garmin</span> GPS-35, GPS-16 (and possibly
other <span class=SpellE>Garmin</span> or other models) for PPS
operation.<span style='mso-spacerun:yes'> </span>The <span
class=SpellE><u>pps</u></span> option must also be used for PPS operation.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:5'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span class=SpellE><span style='font-family:Arial;
mso-bidi-font-family:"Times New Roman"'>noLog</span></span><span
style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'><o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Cause
<i style='mso-bidi-font-style:normal'>gpsLogger</i> to not output logged
position information.<span style='mso-spacerun:yes'> </span>The
position information is only available via the published shared memory
location.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:6'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>log
<<span class=SpellE>logFile</span>><o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Causes
<i style='mso-bidi-font-style:normal'>gpsLogger</i> to output position
information as described above to the file named <<span class=SpellE>logFile</span>>.<span
style='mso-spacerun:yes'> </span>The <span class=SpellE><u>noLog</u></span><u>
</u>option overrides this behavior.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:7'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>debug<o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Causes
<i style='mso-bidi-font-style:normal'>gpsLogger</i> to output debugging
information to <span class=SpellE>stderr</span> while running.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:8'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>device
<<span class=SpellE>serialDevice</span>><o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>This
option allows the user to specify the serial port to be monitored.<span
style='mso-spacerun:yes'> </span>By default, the device
"/dev/ttyS0" is monitored.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:9'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>speed
<<span class=SpellE>baudRate</span>><o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>This
option determines the baud rate configuration of the serial port.<span
style='mso-spacerun:yes'> </span>Valid values include 4800 and
9600.<span style='mso-spacerun:yes'> </span>By default, the <<span
class=SpellE>baudRate</span>> is 4800.<o:p></o:p></span></p>
</td>
</tr>
<tr style='mso-yfti-irow:10;mso-yfti-lastrow:yes'>
<td width="32%" valign=top style='width:32.26%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>debug<o:p></o:p></span></p>
</td>
<td width="67%" valign=top style='width:67.74%;padding:0in 5.4pt 0in 5.4pt'>
<p class=MsoNormal><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>This
option causes <i style='mso-bidi-font-style:normal'>gpsLogger</i> to output
debugging information to <span class=SpellE>stderr</span> including NMEA
sentences read from the GPS device, etc.<o:p></o:p></span></p>
</td>
</tr>
</table>
<h2><span style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'>Notes:<o:p></o:p></span></h2>
<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><span style='font-family:Arial;
mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>1)<span
style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span style='font-family:Arial;mso-bidi-font-family:
"Times New Roman"'>For the <u>gps35</u> option, <i style='mso-bidi-font-style:
normal'>gpsLogger</i> uses the NMEA "PGRMC" configuration
sentence.<span style='mso-spacerun:yes'> </span>This may work with other
GPS device manufacturers and models which support PPS operation.<span
style='mso-spacerun:yes'> </span>PPS operation may be available without
use of this option if the device has already been configured for PPS operation.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><span style='font-family:Arial;
mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>2)<span
style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span style='font-family:Arial;mso-bidi-font-family:
"Times New Roman"'>When the <span class=SpellE><u>pps</u></span> option is
invoked, the GPS <altitude> information may be unavailable or
unreliable.<span style='mso-spacerun:yes'> </span>This is because the
serial port is flushed to properly read the NMEA sentence containing time
information associated with the corresponding pulse.<span
style='mso-spacerun:yes'> </span>As a result, the NMEA "GPGGA"
sentences containing the <altitude> information may be missed.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.75in;text-indent:-.5in;mso-list:l0 level1 lfo1;
tab-stops:list .75in'><![if !supportLists]><span style='font-family:Arial;
mso-fareast-font-family:Arial'><span style='mso-list:Ignore'>3)<span
style='font:7.0pt "Times New Roman"'>
</span></span></span><![endif]><span style='font-family:Arial;mso-bidi-font-family:
"Times New Roman"'>With regards to setting and synchronizing the computer
system time to GPS time, <i style='mso-bidi-font-style:normal'>gpsLogger</i>
uses the </span><span class=SpellE><span class=GramE><span style='font-family:
Courier'>settimeofday</span></span></span><span class=GramE><span
style='font-family:Courier'>(</span></span><span style='font-family:Courier'>)</span><span
style='font-family:Arial;mso-bidi-font-family:"Times New Roman"'> system
function to abruptly adjust the time when the time differential is greater than
one second.<span style='mso-spacerun:yes'> </span>Otherwise, the </span><span
class=SpellE><span class=GramE><span style='font-family:Courier'>adjtime</span></span></span><span
class=GramE><span style='font-family:Courier'>(</span></span><span
style='font-family:Courier'>)</span><span style='font-family:Arial;mso-bidi-font-family:
"Times New Roman"'> system call is use to preserve a monotonically increasing
system clock.<o:p></o:p></span></p>
</div>
</body>
</html>