Garmin Fleet Management Controller  2.19.0
FmiLogParser.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * HEADER NAME:
4 * FmiLogParser.h
5 *
6 * Copyright 2008-2011 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #ifndef FmiLogParser_H
11 #define FmiLogParser_H
12 
13 #include "LogParser.h"
14 #include "fmi.h"
15 
16 //----------------------------------------------------------------------
21 //----------------------------------------------------------------------
22 class FmiLogParser : public LogParser
23 {
24 public:
25  FmiLogParser();
26  virtual ~FmiLogParser();
27 
28  virtual CString getPacketDetail
29  (
30  int aLineNumber
31  );
32 
33  virtual CString getPacketTitle
34  (
35  int aLineNumber
36  );
37 
38  virtual void resendPacket
39  (
40  int aLineNumber
41  );
42 
43 private:
44  CString formatBoolean
45  (
46  boolean aBool
47  );
48 
49  CString formatFmiPacket
50  (
51  BOOL transmitted,
52  uint16 aFmiPacketId,
53  uint8 * aFmiPayload,
54  uint8 aFmiPayloadSize
55  );
56 
58  (
59  sint32 aSemicircles
60  );
61 
63  (
64  sint32 aSemicircles
65  );
66 
67  CString formatMessageId
68  (
69  const uint8 * aMessageId,
70  uint8 aMessageIdSize
71  );
72 
73  CString formatText
74  (
75  const char * aText,
76  int aMaxLength
77  );
78 
80  (
81  time_type aTimestamp
82  );
83 
84  CString getFmiPacketName
85  (
86  uint16 aPacketId
87  );
88 
89 #if( FMI_SUPPORT_A615 )
90  CString getHosartPacketName
91  (
92  uint16 aPacketId
93  );
94 
95  CString formatHosartPacket
96  (
97  BOOL transmitted,
98  uint16 aPacketId,
99  uint8 * aPayload,
100  uint8 aPayloadSize
101  );
102 #endif
103 
104 #if( CDT_SUPPORT )
105  CString getCdtPacketName
106  (
107  uint8 aPacketId
108  );
109 
110  CString formatCdtPacket
111  (
112  BOOL transmitted,
113  uint8 aPacketId,
114  uint8 * aPayload,
115  uint8 aPayloadSize
116  );
117 #endif
118 
119  CString getGarminPacketName
120  (
121  uint8 aPacketId
122  );
123 
124  CString getGarminCommandName
125  (
126  uint16 aCommandId
127  );
128 
129  void initGarminCommandNames();
130  void initGarminPacketNames();
131 
132 #if( FMI_SUPPORT_A602 )
133  void initFmiPacketNames();
134 #endif
135 
136 #if( FMI_SUPPORT_A607 )
137  void initFmiFeatureNames();
138 #endif
139 
140 #if( FMI_SUPPORT_A615 )
142  (
143  CString & packet,
144  uint8 result_code
145  );
146 #endif
147 
149  std::map<uint16, CString> mGarminCommandNames;
150 
152  std::map<uint8, CString> mGarminPacketNames;
153 
154 #if( FMI_SUPPORT_A602 )
155  std::map<uint16, CString> mFmiPacketNames;
157 #endif
158 
159 #if( FMI_SUPPORT_A607 )
160  std::map<uint16, CString> mFmiFeatureNames;
162 #endif
163 
164 #if( FMI_SUPPORT_A615 )
165  std::map<uint16, CString> mHosartPacketNames;
167 #endif
168 
169 #if( CDT_SUPPORT )
170  std::map<uint16, CString> mCdtPacketNames;
172 #endif
173 };
174 
175 #endif
virtual CString getPacketTitle(int aLineNumber)
Construct a packet title for the given log logLine.
CString formatLatitude(sint32 aSemicircles)
Format latitude.
CString formatLongitude(sint32 aSemicircles)
Format longitude.
void initGarminCommandNames()
Initialize the map of Garmin command IDs to text strings.
Abstract base class for log item parsers.
Definition: LogParser.h:23
void initFmiPacketNames()
Initialize the map of FMI packet IDs to text strings.
CString formatText(const char *aText, int aMaxLength)
Format a text string, with up to 29 characters per line.
std::map< uint16, CString > mHosartPacketNames
Map of HOSART packet IDs to display names for formatting.
Definition: FmiLogParser.h:166
CString formatBoolean(boolean aBool)
Translate a boolean to an equivalent string.
void initFmiFeatureNames()
Initialize the map of FMI packet IDs to text strings.
CString getGarminCommandName(uint16 aCommandId)
Translate a Garmin command ID into a string describing the command name.
std::map< uint16, CString > mFmiPacketNames
Map of FMI packet IDs to display names for formatting.
Definition: FmiLogParser.h:156
std::map< uint8, CString > mGarminPacketNames
Map of Garmin packet IDs to display names for formatting.
Definition: FmiLogParser.h:152
std::map< uint16, CString > mFmiFeatureNames
Map of FMI feature IDs to display names for formatting.
Definition: FmiLogParser.h:161
CString formatMessageId(const uint8 *aMessageId, uint8 aMessageIdSize)
Format a message ID in hex, with up to 8 bytes per line.
signed long int sint32
32-bit signed integer
Definition: garmin_types.h:59
void initGarminPacketNames()
Initialize the map of Garmin packet IDs to text strings.
virtual ~FmiLogParser()
Destructor.
std::map< uint16, CString > mGarminCommandNames
Map of Garmin command IDs to display names for formatting.
Definition: FmiLogParser.h:149
unsigned short int uint16
16-bit unsigned integer
Definition: garmin_types.h:64
CString formatFmiPacket(BOOL transmitted, uint16 aFmiPacketId, uint8 *aFmiPayload, uint8 aFmiPayloadSize)
Interpret an FMI packet; appending the information to the text in the packet window.
LogParser for packets sent/received by the FmiApplicationLayer.
Definition: FmiLogParser.h:22
virtual CString getPacketDetail(int aLineNumber)
Print a particular packet to the packet view.
CString formatTime(time_type aTimestamp)
Format Garmin UTC timestamp.
CString getGarminPacketName(uint8 aPacketId)
Translate a Garmin packet ID into a string describing the packet name.
unsigned char uint8
8-bit unsigned integer
Definition: garmin_types.h:62
void appendIFTADataModResultCode(CString &packet, uint8 result_code)
virtual void resendPacket(int aLineNumber)
Resend a packet to the client.
CString getFmiPacketName(uint16 aPacketId)
Translate an FMI packet ID into a string describing the packet name.
CString getHosartPacketName(uint16 aPacketId)
FmiLogParser()
Constructor.
uint32 time_type
Absolute time (number of seconds since 12/31/1989 12:00 am UTC)
Definition: garmin_types.h:97
CString formatHosartPacket(BOOL transmitted, uint16 aPacketId, uint8 *aPayload, uint8 aPayloadSize)
Interpret an HOSART packet; appending the information to the text in the packet window.