source: pacpussensors/trunk/NMEA0183/src/OLN.cpp

Last change on this file was 59, checked in by DHERBOMEZ Gérald, 10 years ago

Integration of new modules:

  • GPS NMEA0183 decoder
  • Span CPT Decoder

Update of:

File size: 1.6 KB
Line 
1#include "nmea0183.h"
2#pragma hdrstop
3
4/*
5** Author: Samuel R. Blackburn
6** Internet: sam_blackburn@pobox.com
7**
8** You can use it any way you like as long as you don't try to sell it.
9**
10** Copyright, 1996, Samuel R. Blackburn
11**
12** $Workfile: oln.cpp $
13** $Revision: 4 $
14** $Modtime: 10/10/98 2:42p $
15*/
16
17
18OLN::OLN()
19{
20 Mnemonic = "OLN";
21 Empty();
22}
23
24OLN::~OLN()
25{
26 //Mnemonic.Empty();
27 Empty();
28}
29
30void OLN::Empty( void )
31{
32 Pair1.Empty();
33 Pair2.Empty();
34 Pair3.Empty();
35}
36
37BOOL OLN::Parse( const SENTENCE& sentence )
38{
39 /*
40 ** OLN - Omega Lane Numbers
41 **
42 ** 1 2 3 4
43 ** |--------+ |--------+ |--------+ |
44 ** $--OLN,aa,xxx,xxx,aa,xxx,xxx,aa,xxx,xxx*hh<CR><LF>
45 **
46 ** 1) Omega Pair 1
47 ** 2) Omega Pair 1
48 ** 3) Omega Pair 1
49 ** 4) Checksum
50 */
51
52 /*
53 ** First we check the checksum...
54 */
55
56 if ( sentence.IsChecksumBad( 10 ) == True )
57 {
58 SetErrorMessage( "Invalid Checksum" );
59 return( FALSE );
60 }
61
62 Pair1.Parse( 1, sentence );
63 Pair2.Parse( 4, sentence );
64 Pair3.Parse( 7, sentence );
65
66 return( TRUE );
67}
68
69BOOL OLN::Write( SENTENCE& sentence )
70{
71 /*
72 ** Let the parent do its thing
73 */
74
75 RESPONSE::Write( sentence );
76
77 Pair1.Write( sentence );
78 Pair2.Write( sentence );
79 Pair3.Write( sentence );
80
81 sentence.Finish();
82
83 return( TRUE );
84}
85
86const OLN& OLN::operator = ( const OLN& source )
87{
88 Pair1 = source.Pair1;
89 Pair2 = source.Pair2;
90 Pair3 = source.Pair3;
91
92 return( *this );
93}
Note: See TracBrowser for help on using the repository browser.