17 #pragma comment(lib, "shell32.lib") 19 #if( FMI_SUPPORT_A615 ) 33 , mStartDate(COleDateTime::GetCurrentTime())
34 , mStartTime(COleDateTime::GetCurrentTime())
35 , mEndDate(COleDateTime::GetCurrentTime())
36 , mEndTime(COleDateTime::GetCurrentTime())
47 CDialog::DoDataExchange(pDX);
74 timestamp = date + time;
103 memset( &message, 0,
sizeof( message ) );
132 memset( &message, 0,
sizeof( message ) );
145 TCHAR tmpPath[ MAX_PATH-14 ];
146 TCHAR tmpFileName[ MAX_PATH ];
148 memset( tmpPath, 0,
sizeof( tmpPath ) );
149 memset( tmpFileName, 0,
sizeof( tmpFileName ) );
151 GetTempPath( MAX_PATH-14, tmpPath );
152 GetTempFileName( tmpPath, _T(
"IFTA" ), 0, tmpFileName );
154 CString tmpFile( tmpFileName );
155 tmpFile += _T(
".csv" );
159 if( IDYES == MessageBox(
160 _T(
"An IFTA data file has been received from the device.\nWould you like to view the contents?" ),
161 _T(
"IFTA Data Fetch" ), MB_YESNO | MB_ICONQUESTION
166 TCHAR myDocs[ MAX_PATH ];
167 if( S_OK == SHGetFolderPath( NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, myDocs ) )
169 ShellExecute( NULL, _T(
"open" ), tmpFile, NULL, myDocs, SW_SHOW );
172 ShellExecute( NULL, _T(
"open" ), tmpFile, NULL, NULL, SW_SHOW );
struct date_time_data_type::_date date
uint8 second
second (0-59)
uint8 minute
minute (0-59)
Data type for the IFTA Data Delete Request Packet ID (0X0008) from server to client.
#define IDC_IFTA_DATA_DELETE
void sendFmiPacket(uint16 aFmiPacketId, uint8 *aFmiPayload, uint8 aFmiPayloadSize)
Send an arbitrary FMI packet.
afx_msg void OnBnClickedDataFetch()
Attempt to fetch IFTA data from the device.
afx_msg LRESULT OnEventIftaFileTransferReceived(WPARAM, LPARAM)
Attempt to unzip received file and shell open the result.
struct date_time_data_type::_time time
void UTIL_convert_time_type_to_seconds(const date_time_data_type *aDateTime, time_type *aSeconds)
Converts a time_type to seconds since midnight.
signed short int sint16
16-bit signed integer
Date & time data type with separate fields for month, day, year, hour, minute, and second...
#define IDC_IFTA_END_TIME
Form for interacting with IFTA data on the device.
Serial communication controller for Garmin and FMI packets.
CString unzip(char *original)
This function will uncompress a file into a new file.
boolean UTIL_convert_date_time_to_seconds(const date_time_data_type *aDateTime, time_type *aSeconds)
Converts a date from from a structure to a Garmin date.
virtual void DoDataExchange(CDataExchange *pDX)
unsigned short int uint16
16-bit unsigned integer
#define IDC_IFTA_START_TIME
FmiApplicationLayer & mCom
Reference to the FMI communication controller.
static time_type convertDateTime(int year, int month, int day, int hour, int minute, int second)
uint16 year
Real year (1990 means 1990!)
unsigned char uint8
8-bit unsigned integer
#define IDC_IFTA_START_DATE
#define IDC_IFTA_END_DATE
#define IDC_IFTA_DATA_FETCH
Data type for the IFTA Data Fetch Request Packet ID (0X0006) from server to client.
afx_msg void OnBnClickedDataDelete()
Attempt to delete IFTA data on the device.
#define WM_EVENT(_event)
Translation from an application event to the corresponding Windows message.
uint32 time_type
Absolute time (number of seconds since 12/31/1989 12:00 am UTC)
#define SAVE_RECEIVED_IFTA_FILE
sint16 hour
hour (0-65535), range required for correct ETE conversion
void UTIL_convert_local_to_UTC(const time_type *aLocalTime, time_type *aUtcTime)
Converts a time_type from local to UTC time.