source: pacpussensors/trunk/NMEA0183/src/STN.cpp@ 64

Last change on this file since 64 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.3 KB
RevLine 
[59]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: stn.cpp $
13** $Revision: 4 $
14** $Modtime: 10/10/98 2:40p $
15*/
16
17
18STN::STN()
19{
20 Mnemonic = "STN";
21 Empty();
22}
23
24STN::~STN()
25{
26 //Mnemonic.Empty();
27 Empty();
28}
29
30void STN::Empty( void )
31{
32 TalkerIDNumber = 0;
33}
34
35BOOL STN::Parse( const SENTENCE& sentence )
36{
37 /*
38 ** STN - Multiple Data ID
39 **
40 ** 1 2
41 ** | |
42 ** $--STN,x.x,*hh<CR><LF>
43 **
44 ** Field Number:
45 ** 1) Talker ID Number
46 ** 2) Checksum
47 */
48
49 /*
50 ** First we check the checksum...
51 */
52
53 if ( sentence.IsChecksumBad( 2 ) == True )
54 {
55 SetErrorMessage( "Invalid Checksum" );
56 return( FALSE );
57 }
58
59 TalkerIDNumber = sentence.Integer( 1 );
60
61 return( TRUE );
62}
63
64BOOL STN::Write( SENTENCE& sentence )
65{
66 /*
67 ** Let the parent do its thing
68 */
69
70 RESPONSE::Write( sentence );
71
72 sentence += TalkerIDNumber;
73
74 sentence.Finish();
75
76 return( TRUE );
77}
78
79const STN& STN::operator = ( const STN& source )
80{
81 TalkerIDNumber = source.TalkerIDNumber;
82
83 return( *this );
84}
Note: See TracBrowser for help on using the repository browser.