25 #if( FMI_SUPPORT_A610 ) 32 #if( FMI_SUPPORT_A603 ) 33 #define SAVE_STOPS "a603_stops.dat" 38 #if( FMI_SUPPORT_A604 ) 39 #define SAVE_CAN_RESP "canned_responses.dat" 45 #define SAVE_CAN_MSG "canned_messages.dat" 49 #define SAVE_STATUS "driver_status.dat" 53 #define SAVE_SENT_CAN "sent_canned_response_messages.dat" 56 #define GZIPPED_TRANSFER_FILENAME "transfer_file.gz" 59 #if( FMI_SUPPORT_A607 ) 60 #define SAVE_CATEGORIES "categories.dat" 66 #define SAVE_WAYPOINTS "waypoints.dat" 70 #define SAVE_DRIVER_LOGINS "drivers.dat" 73 #if( FMI_SUPPORT_A610 ) 74 #define SAVE_AOBRD_DRIVERS "aobrd_drivers.dat" 109 , mLongTextMessageInProgress( false )
112 , mBaudRateSyncRateType( 0 )
118 #if( FMI_SUPPORT_A604 ) 148 #if( FMI_SUPPORT_A602 ) 152 #if( FMI_SUPPORT_A603 ) 160 #if( FMI_SUPPORT_A604 ) 173 #if( FMI_SUPPORT_A607 ) 178 #if( FMI_SUPPORT_A610 ) 212 ASSERT( garminPacket != NULL );
223 double latitudeDegrees;
224 double longitudeDegrees;
226 memset( &pvt, 0,
sizeof( pvt ) );
262 if( latitudeDegrees < 0 )
263 sprintf(
mPvtLatitude,
"%08.6f °S", latitudeDegrees * -1 );
268 if( longitudeDegrees < 0 )
269 sprintf(
mPvtLongitude,
"%08.6f °W", longitudeDegrees * -1 );
299 memset( &unitIdData, 0,
sizeof( unitIdData ) );
310 memset( &productIdPacket, 0,
sizeof( productIdPacket ) );
321 cdt_id_type cdtPacketId = *(cdt_id_type *) garminPacket->
mPayload;
322 uint8 const * cdtPayload = &garminPacket->
mPayload[
sizeof( cdtPacketId ) ];
325 switch( cdtPacketId )
327 case CDT_DATA_TRANSFER:
329 Event::post( EVENT_CDT_PACKET_RECEIVED, cdtPayloadSize, (
void* ) cdtPayload,
TRUE );
332 case CDT_PING_RECEIPT:
334 Event::post( EVENT_CDT_PING_RECEIVED, cdtPayloadSize, (
void* ) cdtPayload,
TRUE );
341 #if( FMI_SUPPORT_A602 ) 343 #if( FMI_SUPPORT_A615 ) 348 uint8 const * fmiPayload = &garminPacket->
mPayload[
sizeof( fmiPacketId ) ];
352 switch( fmiPacketId )
357 memset( &productIdPacket, 0,
sizeof( productIdPacket ) );
358 memcpy( &productIdPacket, fmiPayload,
minval(
sizeof( productIdPacket ), fmiPayloadSize ) );
368 for(
unsigned int i = 0; i < fmiPayloadSize -
sizeof( protocol ); i +=
sizeof( protocol ) )
371 memset( &protocol, 0,
sizeof( protocol ) );
372 memcpy( &protocol, &fmiPayload[i],
sizeof( protocol ) );
373 int offset = ( 5 * ( i /
sizeof( protocol ) ) );
381 #if( FMI_SUPPORT_A604 && UNICODE_ENABLED ) 393 #if( FMI_SUPPORT_A604 ) 394 BOOL cannedResponse =
FALSE;
397 memset( &data, 0,
sizeof( data ) );
398 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
403 #if( FMI_SUPPORT_A604 ) 406 memset( &receipt, 0,
sizeof( receipt ) );
415 cannedResponse =
TRUE;
428 sprintf( ackEvent->
ack_text,
"%s", str );
431 sprintf( ackEvent->
ack_text,
"%s",
"invalid" );
435 #endif //FMI_SUPPORT_A604 440 strcpy( ackEvent->
ack_text,
"Okay" );
443 strcpy( ackEvent->
ack_text,
"Yes" );
449 strcpy( ackEvent->
ack_text,
"invalid" );
457 #if( FMI_SUPPORT_A603 ) 464 memset( &textMessage, 0,
sizeof( textMessage ) );
465 memcpy( &textMessage, fmiPayload,
minval(
sizeof( textMessage ), fmiPayloadSize ) );
470 memset( textMessageEvent, 0,
sizeof( textMessageEvent ) );
479 #if( FMI_SUPPORT_A607 ) 487 memset( &textMessage, 0,
sizeof( textMessage ) );
488 memcpy( &textMessage, fmiPayload,
minval(
sizeof( textMessage ), fmiPayloadSize ) );
506 #if( FMI_SUPPORT_A604 ) 510 memset( &receipt, 0,
sizeof( receipt ) );
511 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
524 #if( FMI_SUPPORT_A611 ) 556 #if( FMI_SUPPORT_A607 ) 560 memset( &response, 0,
sizeof( response ) );
561 memcpy( &response, fmiPayload,
minval( fmiPayloadSize,
sizeof( response ) ) );
568 #if( FMI_SUPPORT_A604 ) 572 map<uint32, ClientListItem>::iterator iter;
573 memset( &receipt, 0,
sizeof( receipt ) );
574 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
591 memset( &receipt, 0,
sizeof( receipt ) );
592 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
604 memset( &request, 0,
sizeof( request ) );
605 memcpy( &request, fmiPayload,
minval( fmiPayloadSize,
sizeof( request ) ) );
614 if( iter->second.isValid() )
643 memset( &status, 0,
sizeof( status ) );
644 memcpy( &status, fmiPayload,
minval(
sizeof( status ), fmiPayloadSize ) );
656 memset( &receipt, 0,
sizeof( receipt ) );
657 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
675 memset( &receipt, 0,
sizeof( receipt ) );
676 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
689 if( iter->second.isValid() )
699 #if( FMI_SUPPORT_A611 ) 733 #if( FMI_SUPPORT_A604 ) 749 memset( &receipt, 0,
sizeof( receipt ) );
750 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
769 memset( &receipt, 0,
sizeof( receipt ) );
770 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
787 boolean listChanged =
FALSE;
789 memset( &receipt, 0,
sizeof( receipt ) );
790 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
792 for(
int i = 0; i < 16; i++ )
810 memset( &receipt, 0,
sizeof( receipt ) );
811 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
826 #if( FMI_SUPPORT_A603 ) 831 memset( &etaDataPacket, 0,
sizeof( etaDataPacket ) );
832 memcpy( &etaDataPacket, fmiPayload,
minval(
sizeof( etaDataPacket ), fmiPayloadSize ) );
839 double latitudeDegrees;
840 double longitudeDegrees;
845 if( latitudeDegrees < 0 )
847 sprintf(
mEtaLatitude,
"%08.6f °S", latitudeDegrees * -1 );
855 if( longitudeDegrees < 0 )
857 sprintf(
mEtaLongitude,
"%08.6f °W", longitudeDegrees * -1 );
896 map<uint32, StopListItem>::iterator iter;
898 memcpy( &stopStatus, fmiPayload,
minval(
sizeof( stopStatus ), fmiPayloadSize ) );
964 eventData |=
setbit( 16 );
971 #if( FMI_SUPPORT_A604 ) 976 memset( &receipt, 0,
sizeof( receipt ) );
977 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
988 memset( &response, 0,
sizeof( response ) );
989 memcpy( &response, fmiPayload,
minval(
sizeof( response ), fmiPayloadSize ) );
1000 #if( FMI_SUPPORT_A605 ) 1005 memset( &list, 0,
sizeof( list ) );
1006 memcpy( &list, fmiPayload,
minval(
sizeof( list ), fmiPayloadSize ) );
1009 for(
uint16 i = 0; i < throttleCount; ++i )
1019 #if( FMI_SUPPORT_A604 ) 1039 #if( FMI_SUPPORT_A610 ) 1044 memset( &file, 0,
sizeof( file ) );
1045 memcpy( &file, fmiPayload,
minval(
sizeof( file ), fmiPayloadSize ) );
1057 memset( &data_packet, 0,
sizeof( data_packet ) );
1058 memcpy( &data_packet, fmiPayload,
minval(
sizeof( data_packet ), fmiPayloadSize ) );
1072 memset( &file_end, 0,
sizeof( file_end ) );
1073 memcpy( &file_end, fmiPayload,
minval(
sizeof( file_end ), fmiPayloadSize ) );
1085 memset( &receipt, 0,
sizeof( receipt ) );
1086 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1092 if ( file.Open( CString(
mFilePath ), CFile::modeRead ) )
1097 memset( &data, 0,
sizeof( data ) );
1117 memset( &receipt, 0,
sizeof( receipt ) );
1118 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1165 if( file.Open( CString(
mFilePath ), CFile::modeRead ) )
1170 memset( &data, 0,
sizeof( data ) );
1194 memset( &receipt, 0,
sizeof( receipt ) );
1195 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1211 memset( &fileInfo, 0,
sizeof( fileInfo ) );
1212 memcpy( &fileInfo, fmiPayload,
minval(
sizeof( fileInfo ), fmiPayloadSize ) );
1225 memset( &receipt, 0,
sizeof( receipt ) );
1226 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1246 memset( &receipt, 0,
sizeof( receipt ) );
1247 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1264 if( iter->second.isValid() )
1275 memset( &data, 0,
sizeof( data ) );
1276 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1279 memset( &receipt, 0,
sizeof( receipt ) );
1291 memset( &receipt, 0,
sizeof( receipt ) );
1292 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1302 #if( FMI_SUPPORT_A607 ) 1306 memset( &data, 0,
sizeof( data ) );
1307 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1310 memset( &receipt, 0,
sizeof( receipt ) );
1319 else if( 0 == strlen( data.
driver_id ) )
1329 char actualPassword[
sizeof( data.
password ) ];
1330 WideCharToMultiByte( CP_UTF8, 0, login.
getPassword().GetBuffer(), -1, actualPassword,
sizeof( actualPassword ), NULL, NULL );
1331 if( 0 != strcmp( data.
password, actualPassword ) )
1359 memset( &status, 0,
sizeof( status ) );
1360 memcpy( &status, fmiPayload,
minval(
sizeof( status ), fmiPayloadSize ) );
1361 memset( &receipt, 0,
sizeof( receipt ) );
1373 memset( &receipt, 0,
sizeof( receipt ) );
1374 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1382 #endif // FMI_SUPPORT_A604 1383 #if( FMI_SUPPORT_A606 ) 1387 memset( &receipt, 0,
sizeof( receipt ) );
1389 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1396 #endif // FMI_SUPPORT_A606 1397 #if( FMI_SUPPORT_A607 ) 1403 memset( &status, 0,
sizeof( status ) );
1404 memcpy( &status, fmiPayload,
minval(
sizeof( status ), fmiPayloadSize ) );
1405 memset( &receipt, 0,
sizeof( receipt ) );
1414 #endif // FMI_SUPPORT_A607 1415 #if( FMI_SUPPORT_A608 ) 1420 memset( &receipt, 0,
sizeof( receipt ) );
1421 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1432 memset( &alert, 0,
sizeof( alert ) );
1433 memcpy( &alert, fmiPayload,
minval(
sizeof( alert ), fmiPayloadSize ) );
1440 #endif //FMI_SUPPORT_A608 1442 #if( FMI_SUPPORT_A610 ) 1447 memset( &data, 0,
sizeof( data ) );
1448 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1451 memset( &receipt, 0,
sizeof( receipt ) );
1464 WideCharToMultiByte( CP_UTF8, 0, driver.
getPassword().GetBuffer(), -1, actualPassword,
sizeof( actualPassword ), NULL, NULL );
1487 memset( &data, 0,
sizeof( data ) );
1488 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1490 #if( FMI_SUPPORT_A615 ) 1500 memset( &receipt, 0,
sizeof( receipt ) );
1548 memset( &data, 0,
sizeof( data ) );
1549 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1552 memset( &receipt, 0,
sizeof( receipt ) );
1555 char file[MAX_PATH];
1557 fstream open_file( file, ios_base::binary | ios_base::in );
1558 if( open_file.good() )
1600 memset( &data, 0,
sizeof( data ) );
1601 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1604 memset( &receipt, 0,
sizeof( receipt ) );
1634 memset( &data, 0,
sizeof( data ) );
1635 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1646 memset( &data, 0,
sizeof( data ) );
1647 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1650 memset( &record, 0,
sizeof( record ) );
1662 char source[_MAX_PATH];
1683 memset( &data, 0,
sizeof( data ) );
1684 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1692 #endif //FMI_SUPPORT_A610 1693 #if FMI_SUPPORT_A612 1697 memset( &data, 0,
sizeof( data ) );
1698 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1711 memset( &data, 0,
sizeof( data ) );
1712 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1721 #if FMI_SUPPORT_A621 1725 memset( &data, 0,
sizeof( data ) );
1726 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1739 #endif //FMI_SUPPORT_A621 1740 #endif //FMI_SUPPORT_A612 1741 #if( FMI_SUPPORT_A614 ) 1745 memset( &data, 0,
sizeof( data ) );
1746 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1749 memset( &receipt, 0,
sizeof( receipt ) );
1751 uint8 receiptSize =
sizeof( receipt );
1760 #endif //FMI_SUPPORT_A614 1761 #if( FMI_SUPPORT_A616 ) 1765 memset( &data, 0,
sizeof( data ) );
1766 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1775 memset( &sync, 0,
sizeof( sync ) );
1822 #endif //FMI_SUPPORT_A616 1823 #if FMI_SUPPORT_A622 1827 memset( &data, 0,
sizeof( data ) );
1828 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1837 memset( &data, 0,
sizeof( data ) );
1838 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1847 memset( &data, 0,
sizeof( data ) );
1848 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1859 memset( &data, 0,
sizeof( data ) );
1860 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1869 memset( &data, 0,
sizeof( data ) );
1870 memcpy( &data, fmiPayload,
minval(
sizeof( data ), fmiPayloadSize ) );
1885 memset( &incident_info, 0,
sizeof( incident_info ) );
1886 memcpy( &incident_info, fmiPayload,
minval(
sizeof( incident_info ), fmiPayloadSize ) );
1913 #endif //FMI_SUPPORT_A622 1914 #if FMI_SUPPORT_A623 1918 memset( &receipt, 0,
sizeof( receipt ) );
1919 memcpy( &receipt, fmiPayload,
minval(
sizeof( receipt ), fmiPayloadSize ) );
1931 #endif //FMI_SUPPORT_A623 1938 #endif // FMI_SUPPORT_A602 1960 ASSERT( packet != NULL );
1962 #if( FMI_SUPPORT_A602 ) 1966 #if( FMI_SUPPORT_A615 ) 1974 switch( fmiPacketId )
1979 #if( FMI_SUPPORT_A604 ) 2021 #if( FMI_SUPPORT_LEGACY ) 2030 void FmiApplicationLayer::sendLegacyProductRequest()
2048 void FmiApplicationLayer::sendLegacyStop
2050 double aDegreesLatitude,
2051 double aDegreesLongitude,
2055 legacy_stop_data_type stopPacket;
2059 memset( &stopPacket, 0,
sizeof( stopPacket ) );
2061 _snprintf( stopPacket.text,
2062 sizeof( stopPacket.text ), aStopName );
2067 stopPacket.stop_position = stopPosition;
2069 payloadSize =
offset_of( legacy_stop_data_type, text ) + (
uint8)strlen( stopPacket.text ) + 1;
2080 void FmiApplicationLayer::sendLegacyTextMessage
2087 uint8 payloadSize =
minval( 200, strlen( aMessageText ) + 1);
2112 #if( FMI_SUPPORT_A602 ) 2127 double aDegreesLatitude,
2128 double aDegreesLongitude,
2133 uint8 stopPayloadSize;
2136 memset( &stopData, 0,
sizeof( stopData ) );
2138 _snprintf( stopData.
text,
2139 sizeof( stopData.
text ), aStopName );
2169 char * aMessageText,
2181 memset( &textMessage, 0,
sizeof( textMessage ) );
2192 txFmi( aFmiPacketId, (
uint8*)&textMessage, payloadSize );
2197 memset( &textMessage, 0,
sizeof( textMessage ) );
2200 memmove( textMessage.
id, aMessageId.
getId(), textMessage.
id_size );
2210 txFmi( aFmiPacketId, (
uint8*)&textMessage, payloadSize );
2233 if( aFeatureCount > 126 )
2235 aFeatureCount = 126;
2241 memcpy( features.
features, aFeatureCodes, aFeatureCount *
sizeof(
uint16 ) );
2274 uint8 aFmiPayloadSize
2277 txFmi( aFmiPacketId, aFmiPayload, aFmiPayloadSize );
2283 uint8 const *
const aFmiPayload,
2284 uint8 const aFmiPayloadSize
2292 payloadSize = aFmiPayloadSize;
2294 #if( FMI_SUPPORT_A615 ) 2299 memcpy( &buffer[ 0 ], aFmiPayload, aFmiPayloadSize );
2304 payloadSize +=
sizeof( fmiPacketId );
2305 fmiPacketId = aFmiPacketId;
2306 memcpy( &buffer[ 0 ], &fmiPacketId,
sizeof( fmiPacketId ) );
2307 memcpy( &buffer[
sizeof( fmiPacketId ) ], aFmiPayload, aFmiPayloadSize );
2323 #if( FMI_SUPPORT_A603 ) 2339 if( iter->first != uniqueId )
2341 uniqueId = iter->first - 1;
2345 uniqueId = iter->first + 1;
2402 if( aStopIndex + 1 < size )
2412 if( aStopIndex + i + 1 < size )
2444 uint8 stopPayloadSize;
2447 TCHAR stopNameWide[200];
2449 memset( &stopData, 0,
sizeof( stopData ) );
2454 minval(
sizeof( stopData.
text ) - 1, strlen( aStopName ) ),
2459 position.
lat = aLatitude;
2460 position.
lon = aLongitude;
2489 uint32 aAutoArrivalDistance
2494 autoArrival.
stop_time = aAutoArrivalTime;
2498 #if( FMI_SUPPORT_A606 ) 2513 memset( &data, 0,
sizeof( data ) );
2515 data.
speed = aSpeed;
2517 data_size =
sizeof( aSpeed );
2539 switch( aDelDataType )
2541 #if FMI_SUPPORT_A603 2547 #if FMI_SUPPORT_A604 2569 #if( FMI_SUPPORT_A607 ) 2575 #if( FMI_SUPPORT_A607 ) 2634 if( aMoveFromIndex < aMoveToIndex )
2639 for(
int i = 0; i <= aMoveToIndex - aMoveFromIndex; i++ )
2643 if( i != aMoveToIndex - aMoveFromIndex )
2647 else if( aMoveToIndex < aMoveFromIndex )
2652 for(
int i = 0; i <= aMoveFromIndex - aMoveToIndex; i++ )
2656 if( i != aMoveFromIndex - aMoveToIndex )
2680 switch( aStopStatus )
2701 #if( FMI_SUPPORT_A611 ) 2716 const char * aMessageText,
2745 const char * aMessageText,
2768 memmove(
mLongTextMessage[i].text_message, aMessageText + position, textLength );
2779 #if( FMI_SUPPORT_A604 ) 2793 const char * aMessageText,
2804 memset( &textMessage, 0,
sizeof( textMessage ) );
2835 const char * aMessageText,
2837 uint8 aResponseCount,
2838 const uint32 * aResponseList,
2845 #if( FMI_SUPPORT_A611 ) 2863 memset( &data, 0,
sizeof( data ) );
2884 CString aResponseText
2897 memset( &data, 0,
sizeof( data ) );
2899 WideCharToMultiByte(
mClientCodepage, 0, aResponseText.GetBuffer(), -1, temp, 50, NULL, NULL );
2917 CString aMessageText
2927 listItem.
setId( aMessageId );
2931 memset( &data, 0,
sizeof( data ) );
2932 WideCharToMultiByte(
mClientCodepage, 0, aMessageText.GetBuffer(), -1, temp, 50, NULL, NULL );
2995 #if( FMI_SUPPORT_A607 ) 3007 memset( &request, 0,
sizeof( request ) );
3024 memset( &request, 0,
sizeof( request ) );
3048 memset( &data, 0,
sizeof( data ) );
3073 char statusText[50];
3082 memset( &data, 0,
sizeof( data ) );
3083 WideCharToMultiByte(
mClientCodepage, 0, aStatusText.GetBuffer(), -1, statusText, 50, NULL, NULL );
3084 statusText[49] =
'\0';
3087 strcpy( data.
status, statusText );
3118 memset( &status, 0,
sizeof( status ) );
3166 uint8 aVersionLength,
3173 CString strFilename( aFilename );
3174 if ( CFile::GetStatus( strFilename, status) )
3177 memset( &fileInfo, 0,
sizeof( fileInfo ) );
3188 gzFile zipFile = gzopen(
mFilePath,
"wb" );
3189 if ( NULL != zipFile )
3192 if ( original.Open( strFilename, CFile::modeRead ) )
3196 while ( ( len = original.Read( (
void * ) buf, 1024 ) ) > 0 )
3198 gzwrite( zipFile, buf, len );
3218 #if( FMI_SUPPORT_A610 ) 3288 memset( &request, 0,
sizeof( request ) );
3313 memset( &uiText, 0,
sizeof( uiText ) );
3318 textLength =
minval( (
uint8) strlen( aNewText ) + 1, 49 );
3319 memcpy( uiText.
new_text, aNewText, textLength );
3329 #if( FMI_SUPPORT_A608 ) 3360 #if( FMI_SUPPORT_A605 ) 3371 #if FMI_SUPPORT_A607 3399 waypoint.
symbol = aSymbol;
3407 waypoint.
cat = aCat;
3409 WideCharToMultiByte(
mClientCodepage, 0, aName.GetBuffer(), -1, waypoint.
name, 30, NULL, NULL );
3410 waypoint.
name[30] =
'\0';
3447 bool update =
false;
3451 if( iter->second.getCategories() & aCatIdx )
3483 category.
id = aCatId;
3485 WideCharToMultiByte(
mClientCodepage, 0, aCatName.GetBuffer(), -1, category.
name, 16, NULL, NULL );
3486 category.
name[16] =
'\0';
3508 memset( &request, 0,
sizeof( request ) );
3516 #if( FMI_SUPPORT_A610 ) 3529 memset( &data, 0,
sizeof( data ) );
3549 memset( &receipt, 0,
sizeof( receipt ) );
3614 #if( FMI_SUPPORT_A615 ) 3625 memset( &receipt, 0,
sizeof( receipt ) );
3673 memset( &record, 0,
sizeof( record ) );
3702 char source[_MAX_PATH];
3706 mAOBRDCurrentAnnotationTxIndex++;
3721 switch ( file_type )
3723 #if( FMI_SUPPORT_A610 ) 3729 #if( FMI_SUPPORT_A612 ) 3735 #if( FMI_SUPPORT_A615 ) 3761 if( CFile::GetStatus( filename, status ) )
3763 CFile::Remove( filename );
3768 memset( &receipt, 0,
sizeof( receipt ) );
3790 memset( &receipt, 0,
sizeof( receipt ) );
3796 ofstream destinationFile( filename, ios_base::binary | ios_base::app );
3797 if( !destinationFile.good() )
3799 destinationFile.close();
3808 destinationFile.close();
3814 destinationFile.seekp( offset, ios::beg );
3816 if( !destinationFile.good() )
3819 destinationFile.close();
3825 destinationFile.write( (
char*)data, length );
3827 if( !destinationFile.good() )
3830 destinationFile.close();
3836 destinationFile.close();
3850 memset( &receipt, 0,
sizeof( receipt ) );
3859 #if( FMI_SUPPORT_A610 ) 3866 #if( FMI_SUPPORT_A612 ) 3873 #if( FMI_SUPPORT_A615 ) 3886 #if( FMI_SUPPORT_A615 ) 3900 memset( &receipt, 0,
sizeof( receipt ) );
3941 const char * driverId
3947 memset( &receipt, 0,
sizeof( receipt ) );
3949 if( 0 == strlen( driverId ) )
4006 memset( &packet, 0,
sizeof( packet ) );
4054 #if( FMI_SUPPORT_A602 ) 4070 uint8 const *
const aData,
4081 fmiPacketId = aFmiPacketId;
4082 memcpy( &buffer[ 0 ], &fmiPacketId,
sizeof( fmiPacketId ) );
4083 memcpy( &buffer[
sizeof( fmiPacketId ) ], aData, aSize );
4088 #endif // FMI_SUPPORT_A602 4103 void FmiApplicationLayer::txCdt
4105 cdt_id_type
const aCdtPacketId,
4106 uint8 const *
const aData,
4114 cdt_id_type cdtPacketId;
4117 cdtPacketId = aCdtPacketId;
4118 memcpy( &buffer[ 0 ], &cdtPacketId,
sizeof( cdtPacketId ) );
4119 memcpy( &buffer[
sizeof( cdtPacketId ) ], aData, aSize );
4124 #endif // FMI_SUPPORT_CDT 4126 #if( FMI_SUPPORT_A603 ) 4138 #if( FMI_SUPPORT_A607 ) 4154 #if( FMI_SUPPORT_A604 ) 4198 #if FMI_SUPPORT_A607 4218 memset( &data, 0,
sizeof( data ) );
4248 memset( &status, 0,
sizeof( status ) );
4261 #if( FMI_SUPPORT_A604 ) 4275 boolean result =
FALSE;
4306 #if( FMI_SUPPORT_A609 ) 4316 #if( FMI_SUPPORT_A616 ) 4331 memset( &sync, 0,
sizeof( sync ) );
char text_message[200]
Message text (variable length, null-terminated string)
fmi_A604_message_status message_status
The status of the text message.
file_info_data_type mCurrentReceiptFile
Current file being received.
void sendAOBRDDriverDownloadResponseV2(const char *driverId)
Send an AOBRD driver profile V2 to the device per request from device.
time_type origination_time
Time when the message was created by the client.
void sendAutoArrival(uint32 aArrivalTime, uint32 aArrivalDistance)
Send a request to update the auto-arrival preferences.
uint32 status_change_id
unique identifier
double UTIL_calc_2d_speed(float32 aNorthVelocity, float32 aEastVelocity)
Determine the two-dimensional velocity.
BOOL isValid() const
Check whether this item is valid.
char mEtaTime[13]
String containing the ETA time from the client, or "invalid".
boolean result_code
TRUE if the operation was successful, FALSE otherwise.
uint32 msg_ack_type
The response selected by the user.
Data type for the Server to Client Open Text Message Receipt Packet ID.
uint8 mCannedResponseMessageType
The message_type for the server to client canned text message.
uint8 id[16]
The message ID.
sint32 UTIL_convert_degrees_to_semicircles(double aDegrees)
Converts a latitude/longitude from degrees to semicircles.
sint32 longitude
Longitude of the device sending the message.
Data type for the Set Odometer Request Packed ID (0X1100) from server to client.
Payload of FMI_ID_SERVER_OPEN_TXT_MSG packet.
uint32 response_id[50]
List of responses that are allowed.
Data type for Get Dashcam Notification Settings Packet ID (0X1609) from client to server...
void sendA607DriverIdRequest(uint8 aDriverIndex)
Ask the client for the current Driver ID.
CString getPassword() const
Get item's password.
Payload for FMI_ID_ENABLE.
#define INVALID16
Placeholder for an invalid 16-bit value.
void resetSavedStops()
Clear the stop list on the server.
#define SAVE_DRIVER_LOGINS
File name of the saved driver IDs/passwords.
void sendProductRequest()
Send an FMI Product ID request.
void UTIL_convert_gps_time_to_seconds(const gps_time_type *aGpsTime, time_type *aSeconds)
Converts from gps_time to Garmin time.
uint8 id_size
Number of significant bytes in the message ID.
#define SAVE_CAN_RESP
File name of the saved canned response data.
Data type for the Annotation Download Receipt Packet ID (0X110E) from client to server.
bool mUsePasswords
If true, driver password support is enabled.
int mAOBRDCurrentShipmentTxIndex
Iterator for shipments being sent to device.
uint16 response_count
Number of protocols in the response_list.
void setId(const key_type &aId)
Set item's ID.
void calculate2DVelocity(float32 aNorthVelocity, float32 aEastVelocity)
Calculate and format a 2D velocity given the north and east components.
void sendAOBRDDriverProfileV2(const AobrdDriverItem &driver)
Push an AOBRD driver profile V2 to the device.
const_iterator begin()
Iterator positioned at the first element in the map.
char name[16+1]
Category name, null terminated.
uint8 file_type
File type.
char name[30+1]
Waypoint name, null-terminated.
void beginA611LongTextMessage(const char *aMessageText, const MessageId &aMessageId, uint8 aMessageType)
Send the first packet of an A611 server to client long text message.
void sendA607DriverStatusRequest(uint8 aDriverIndex)
Ask the client for the current Driver Status.
uint16 fmi_id_type
Fleet Management packet ID (first two bytes of payload when Garmin packet ID == ID_FMI_PACKET) ...
sc_position_type stop_position
Location of the stop.
char server_shipper_name[40]
char text_message[200]
Message text, variable length, null-terminated string, 200 bytes max.
void sendUnitIdRequest()
Request the Unit ID (ESN) from the client.
virtual bool setBaudRate(uint32 aBaudRate)
Set the baud rate.
uint8 mLongTextMessagePayloadSize[10]
Indicates the lengths of the long text message packets.
uint8 id_size
id_size from the canned_response_list_data_type
void txFmi(fmi_id_type const aFmiPacketId, uint8 const *const aFmiPayload, uint8 const aFmiPayloadSize, bool const aSendNow=false)
Transmit FMI packet (packet ID = ID_FMI_BYTE)
Element of the array returned in Garmin ID_PROTOCOL_ARRAY (A001) or FMI_ID_PROTOCOL_DATA (A602) packe...
Data type for the Delete Message Status Packet ID.
char mPvtLongitude[14]
Longitude in degrees from the last PVT packet, as an ASCII null-terminated string.
char tag
Type of protocol (e.g., 'A', D')
char server_commodity[40]
sc_position_type posn
Waypoint position.
Data type for Driver ID Update Packet ID.
time_type timestamp
Time the alert was generated.
Data structure to holds an AOBRD shipment info. Used by the FmiApplicationLayer to provision shipment...
Data type for the Message Status Packet ID.
uint8 result_code
Result code, a valid speed_limit_alert_result_data_type.
boolean result_code
True if the update was successful.
uint8 id[16]
Message ID from the canned_response_list_data_type.
Data type for File Transfer End.
sint16 mClientSoftwareVersion
Raw software version reported by the client.
void put(T &aValue)
Add (or replace) an item in the map.
int mAOBRDCurrentAnnotationTxIndex
Iterator for annotations being sent to device.
time_type getServerTimestamp() const
Get item's server timestamp.
aobrd_download_receipt_result_code result_code
Payload of FMI_ID_A602_STOP packet.
void endFileReceive()
Save received file chunk.
uint8 id_size
Number of significant bytes in the message ID.
uint16 getTimeZone() const
Get item's time zone.
char text[51]
Text/description of the stop. Variable length, null-terminated string.
uint32 status_change_id
unique identifier
uint16 unique_id
Server-assigned unique ID from the FMI_ID_WAYPOINT packet.
Data type for the Driver Profile Data Packet ID (0X1103) from client to server.
Data type for Dashcam Notification Packet ID (0X160C) from client to server (request) ...
uint32 mFileTransferBytesDone
Number of bytes of the file that have been transferred so far.
uint32 status_id
status_id from the driver_status_list_item_data_type or driver_status_list_item_delete_data_type ...
double_position_type position
Current position of the client.
void sendDriverIdRequest()
Ask the client for the current Driver ID.
char mSentDriverId[50]
The last driver ID that was sent to the client.
Data type for the FMI Safe Mode setup Packet ID.
#define FMI_SUPPORT_A623
If true, app was built with support for A622 protocols.
FileBackedMap< DriverLoginItem > mDriverLogins
Map of allowed driver IDs and passwords.
bool sendCannedResponseTextMessage(const char *aMessageText, const MessageId &aMessageId, uint8 aResponseCount, const uint32 *aResponseList, uint8 aMessageType)
Initiate the canned response text message protocol.
uint32 crc
CRC of entire file as computed by UTL_calc_crc32.
void UTIL_format_date_string(const date_time_data_type *aDateTime, char *aResultString, int aResultStringSize)
Format a date as a string.
uint32 unique_id
Unique ID of the A603 stop.
char driver_id[50]
New driver ID (null terminated string)
uint8 response_count
Number of elements in response_id array.
uint32 UTL_calc_crc32(uint8 const *const data, uint32 const size, uint32 const initial_value)
Compute and finalize a 32-bit in one shot.
char new_text[50]
Text to display.
sint32 latitude
Latitude of the device sending the message.
char mDriverStatus[FMI_DRIVER_COUNT][50]
Last driver status received from the client.
uint8 message_type
Message type, a valid a604_message_type.
uint32 status_change_id
status_change_id from the driver_status_data_type
uint16 cat_id
Category that was deleted (0-15)
void startFileReceive(const file_info_data_type &file_size)
Save received file chunk.
uint8 time_over
Seconds until speeding event begins.
CString getDriverId() const
Get the driver ID as a CString.
CString getFirstName() const
Get item's first name.
Payload of FMI_ID_CLIENT_TXT_MSG_RCPT packet.
uint16 features[126]
Array of feature IDs.
char driver_id[50]
New driver ID (null terminated string, 50 bytes max)
Payload of FMI_ID_A607_CLIENT_OPEN_TXT_MSG packet.
#define SAVE_AOBRD_LOG
File name of the compressed AOBRD log.
boolean result_code
True if the update was successful.
boolean result_code
True if the update was successful.
uint8 id_type
Garmin packet ID.
uint8 driver_idx
Index of driver changed.
char mEtaLatitude[14]
String representing the latitude in decimal degrees (and N or S)
void sendStopMoveRequest(uint16 aMoveToIndex, uint16 aMoveFromIndex)
Send a stop move request.
char message[50]
Message text, variable length, null terminated (50 bytes max)
void sendA607DriverIdUpdate(char *aDriverId, uint8 aIndex)
Send an A607 Driver ID Update to the client.
FMI_eta_setting_rcode return_code
uint16 symbol
Waypoint symbol.
Data type for Dashcam Notification Packet ID (0X1606) from client to server (request) ...
FileBackedMap< ClientListItem > mCannedResponses
Map of canned response IDs to names.
char comment[50+1]
Waypoint comment, null-terminated.
CTime mLastClientPingTime
Last time when a client to server ping was received.
CString getCurrentName() const
Get the current name of this item.
uint32 next_offset
offset of next data the server should send, or 0xFFFFFFFF for an error
void sendNextAOBRDShipment(char *driver_id)
Send next AOBRD shipment to device.
void sendFmiPacket(uint16 aFmiPacketId, uint8 *aFmiPayload, uint8 aFmiPayloadSize)
Send an arbitrary FMI packet.
Data type for Route Calculation ACK Receipt Packet ID (0X1221) from server to client.
uint32 status_change_id
Unique ID for this driver ID change.
bool convertAnnotation(std::vector< std::string > &record, fmi_driver_annotation_data_type *annotation)
Convert an Annotation record to structure sent to FMI device.
uint8 mFileVersionLength
Number of significant bytes in mFileVersion.
#define maxval(_x, _y)
The larger of _x and _y.
uint32 message_id
The message ID.
uint32 mActiveStopId
Unique ID of the active stop.
Payload for Garmin ID_UNIT_ID packet.
Data type for File Data Packet ID.
void UTIL_format_time_string(const date_time_data_type *aDateTime, char *aResultString, int aResultStringSize)
Converts a time structure (date_time_data_type) to a time string representation.
uint8 result_code
Result of operation.
uint8 id[16]
Message ID that this list is for.
uint8 file_version_length
Number of significant bytes in file_version.
uint16 product_id
Product ID of the client.
CString mAOBRDAnnotationDriverId
Driver ID for annotations being sent to device.
bool mLongTextMessageInProgress
Indicates whether a long text message is in progress.
uint16 stop_index_in_list
The stop index in list.
uint32 response_id[50]
Canned response IDs.
Data type for the User Interface Text Packet ID.
void sendMessageThrottlingUpdate(uint16 aPacketId, uint16 aNewState)
Sends an update to the client to tell it whether to enable or disable a protocol. ...
uint8 id_size
ID size of message being responded to.
const_iterator end()
Iterator positioned after the last element in the map.
MessageId message_id
The message ID that was ACKed.
bool contains(const key_type &aKey)
Check whether the specified key is in the map.
uint16 new_state
New state, see message_throttling_state_type for valid values.
#define cnt_of_array(_a)
The number of elements in _a.
time_type status_change_time
timestamp of status change
time_type origination_time
char mEtaDistance[13]
Null-terminated ASCII string containing the distance to the current destination, including units...
uint32 unique_id
unique_id from client_to_server_open_text_msg_data_type
Packet receipt for Packet Receipt Packet ID.
#define offset_of(_s, _m)
The offset of _m from the beginning of _s.
uint32 status_id
ID for the driver status list item to delete.
const key_type & getId() const
Get item's ID.
void sendDriverIdUpdate(char *aDriverId)
Send a Driver ID Update to the client.
uint16 countRecords(const char *source, evt_log_reason type)
Count records by type.
Data type for the User Interface Text Receipt Packet ID.
void sendCreateWaypointCat(uint8 aCatId, CString &aCatName)
Create waypoint category.
Data type for the A604 Server to Client Open Text Message Packet ID.
Utility for converting between raw AOBRD data to human- readable CSV file. Used to attempt to auto-co...
void sendEnable(uint16 *aFeatureCodes=NULL, uint8 aFeatureCount=0)
Transmit an FMI Enable packet, and clear any error state.
void commitName()
Commit the item name.
void sendA602TextMessage(fmi_id_type aFmiPacketId, char *aMessageText, const MessageId &aMessageId)
Send a server to client text message, for all A602 FMI protocols.
double UTIL_convert_radians_to_degrees(double aRadians)
Converts a latitude/longitude from radians to degrees.
void sendDeleteCannedMessageRequest(uint32 aMessageId)
Send a request to the client to delete a canned message.
bool sendA611LongTextMessage(const char *aMessageText, const MessageId &aMessageId, uint8 aMessageType)
Send an A611 server to client long text message.
Data type for the Shipment Download Receipt Packet ID (0X110B) from client to server.
FileBackedMap< StopListItem > mA603Stops
Map of unique ID to stop details for all A603 stops on the client.
boolean result_code
Result code. TRUE if success, FALSE otherwise.
uint8 id_size
Number of significant bytes in the message ID.
void sendTextMessageStatusRequest(const MessageId &aMessageId)
Ask the server for the aStopStatus of a text message.
bool mRefreshingCannedResponses
If TRUE, FmiApplicationLayer is handling a request to refresh the canned response list...
void sendAOBRDOdometerValue(uint32 aOdometer)
Send AOBRD Odometer value to device.
uint32 unique_id
Unique ID of the stop for use with the Stop Status protocol.
uint8 status_code
Message status, see fmi_A604_message_status for valid values.
float32 altitude
Altitude above the WGS84 ellipsoid, in meters.
MessageId msg_id
The message ID.
uint16 getLoadTypeRuleset() const
Get item's load type ruleset.
void setValid(BOOL aValid=TRUE)
Set this item as valid.
virtual bool rx(const Packet *aPacket)
Handle a packet received from the client.
Data type for the Driver Status Update Receipt packet.
void sendWaypoint(uint16 aUniqueId, double aLat, double aLon, uint16 aSymbol, CString &aName, uint16 aCat, CString &aComment)
Send a waypoint.
Data type for the Text Message Ack Receipt Packet ID.
Data structure to hold details of an A603 stop that the server needs to keep.
bool mStopFileTransfer
Flag to indicate that the user wants to stop the file transfer.
Data type for the Delete Canned Message Packet ID.
Data type for Driver ID Update Packet ID.
message_throttling_data_type response_list[60]
One element for each protocol with ID and state.
uint32 unit_id
Unit ID (ESN) of the client.
Data type for the ETA Data Receipt Packet ID.
id_type mFreeformFmiPacketId
Defaults to ID_FMI_PACKET unless overridden on command line.
void sendA602Stop(double aLatitude, double aLongitude, char *aStopName)
Initiates the A602 stop protocol.
uint32 status_change_id
Unique ID for this driver ID change.
uint32 mFileTransferSize
Total number of bytes in the file being transferred.
List of canned responses that the client requests updated text for.
FileBackedMap< InboxListItem > mSentCannedResponseMessages
List of message IDs for canned response text messages.
time_type origination_time
Time when the stop was originated by the server.
Payload of FMI_ID_STOP_STATUS and FMI_ID_STOP_STATUS_REQUEST packets.
CTime mLastServerPingTime
Last time when a server to client ping was received.
Data type for the Driver Login Data Packet ID (0X1101) from client to server.
FileBackedMap< AobrdDriverItem > mAOBRDDrivers
Map of allowed driver IDs and passwords.
Data type for Driver ID Request Packet ID.
char mClientUnitId[11]
Null-terminated ASCII string containing the Unit ID (ESN) of the client.
void UTIL_convert_seconds_to_time_type(const time_type *aSeconds, date_time_data_type *aDateTime)
Converts from a Garmin time to a structure containing separate members for hour, minute, and second (time_type).
void removeStopByIndex(uint16 aDeletedStopIndex)
Remove a deleted stop.
signed short int sint16
16-bit signed integer
void continueFileReceive(uint32 offset, uint8 length, uint8 const *data)
Save received file chunk.
void sendEtaRequest()
Send a request for ETA data.
Date & time data type with separate fields for month, day, year, hour, minute, and second...
TransportLayer * mTransportLayer
The next layer down in the stack.
float32 up_velocity
Up velocity in m/s, negative is down.
double UTIL_convert_semicircles_to_degrees(sint32 aSemicircles)
Converts a latitude/longitude from semicircles to degrees.
Data type for the User Interface Text Receipt Packet ID.
char ack_text[50]
Text of the ack (OK, Yes, No, or a canned response)
void sendDeleteDriverStatusListItem(uint32 aDriverStatusId)
Initiate the Delete Driver Status List Item protocol.
uint32 response_id
Unique ID of this canned response.
sint32 lat
latitude in semicircles
time_type status_change_time
Time when the driver ID changed.
#define MAX_THROTTLED_PROTOCOLS
Maximum number of protocols that can be throttled.
#define INVALID32
Placeholder for an invalid 32-bit value.
void sendSetSpeedLimitAlerts(uint8 aMode, uint8 aTimeOver, uint8 aTimeUnder, boolean aAlertUser, float aThreshold)
Set FMI speed limit alerts.
char mPvtDate[11]
Date from the last PVT packet, as an ASCII null-terminated string of the form MM/DD/YYYY.
bool mActiveRoute
If TRUE, the client has a stop active.
time_type getServerStartTime() const
Get item's server start time.
uint8 id[16]
The message ID from the server to client open text message.
time_type status_change_time
timestamp of status change
float64 lat
latitude in radians, positive is north
uint16 packet_id
First packet ID in the protocol to throttle.
message_throttling_data_type mThrottledProtocols[60]
Response from the last Message Throttling Query Protocol.
void setCurrentName(CString aName)
Set the current name of the stop.
Data type for the Message Status Request Packet ID.
CString getCarrierName() const
Get item's carrier name.
Payload of server to client messages requiring a response (A602)
time_type origination_time
Time when the message was sent by the client.
FMI_eta_mode_type new_setting
char text_message[200]
The message text (variable length, null terminated, 200 bytes max)
Payload of FMI_ID_TEXT_MSG_ACK packet.
CString getShipperName() const
Get item's shipper name.
#define SAVE_AOBRD_DRIVERS
File name of the saved AOBRD driver info.
#define minval(_x, _y)
The smaller of _x and _y.
codepage_type mClientCodepage
Code page used for encoding of text fields when communicating with the client.
uint8 time_under
Seconds until speeding event ends.
time_type adverse_condition_time
time_type timestamp
Timestamp of the alert that is being acknowledged.
uint16 UTIL_hex_to_uint8(const char *aHexString, uint8 *aBinaryData, uint16 aMaxBytes)
Convert a hexadecimal ASCII string to an array of uint8.
char server_doc_number[40]
#define SAVE_STOPS
File name of the saved stops data.
uint8 data_length
length of file_data (0..245)
uint16 getLongTermRuleset() const
Get item's long term ruleset.
uint8 id_size
Number of significant bytes of the message ID.
void clear()
Remove all elements from the map.
char mPvtEastWestVelocity[15]
East-west velocity in meters per second from the last PVT packet, as an ASCII null-terminated string...
uint32 stop_time
Minimum stop time before auto-arrival is activated, in seconds.
bool empty()
Check whether the map is empty.
Data type for Dashcam Get Settings Packet ID (0X1605) from client to server.
uint32 unique_id
Unique ID generated by client.
FmiApplicationLayer(id_type freeformFmiPacketId)
Constructor.
int mAOBRDStopShipmentTxIndex
Iterator end for shipments being sent to device.
float float32
32-bit IEEE-format floating point data. (1 sign bit, 8 exponent bits, and 23 mantissa bits) ...
#define setbit(_b)
A bit mask with one bit set and the rest cleared.
Data type for the Set Canned Message Packet ID.
uint32 driver_status
ID corresponding to the new driver status.
char mProtocols[PROTOCOL_SIZE]
Null-terminated ASCII string containing the protocols supported by the client.
Data type for the Message Status Request Packet ID.
bool mUseMultipleDrivers
If true, multiple driver support is enabled.
#define FMI_SUPPORT_A607
If true, app was build with support for A607 protocols.
Data type for FMI_ID_WAYPOINT packet.
char mPvtTime[13]
Time from the last PVT packet.
void sendStopStatusRequest(uint32 aStopId, stop_status_status_type aStopStatus, uint16 aMoveToIndex=INVALID16)
Initiate the Stop Status protocol to update an A603 stop.
int mServerPingCount
Number of server-to-client pings sent; can be reset by the user.
#define SAVE_SENT_CAN
File name of the saved sent canned response message data.
char mHorizontalVelocity[15]
2-D velocity in the horizontal plane in meters per second from the last PVT packet, as an ASCII null-terminated string
void sendUserInterfaceText(uint32 aElementId, char *aText)
Request that the text of a particular user interface text element be changed.
sint32 week_number_days
Days since December 31st, 1989 to beginning of week (i.e., this is a Sunday)
Payload of FMI_ID_CLIENT_OPEN_TXT_MSG packet.
void setUpdateName(CString aName)
Set pending name.
#define SAVE_RECEIVED_AOBRD_LOG
#define FMI_DRIVER_COUNT
Number of supported drivers.
void sendFreeformFmiPacket(fmi_id_type const aFmiPacketId, uint8 const *const aFmiPayload, uint8 const aFmiPayloadSize)
float32 east_velocity
East velocity in m/s, negative is west.
#define SAVE_CAN_MSG
File name of the saved canned message data.
Data type for Long Text Message Request Packet ID (0X0055) from server to client. ...
uint8 driver_idx
Driver index to change.
Payload of FMI_ID_A603_STOP packet.
char text[200]
Text (description) of stop. Variable length, null-terminated string.
void remove(const key_type &aKey)
Remove an item from the map.
static SerialPort * getInstance()
Get the one and only serial port object.
void txCommand(command_type const aCommandId)
Transmit Garmin command packet (packet ID = ID_COMMAND_BYTE)
bool mRefreshingCannedMessages
If TRUE, FmiApplicationLayer is handling a request to refresh the canned message list.
#define FMI_SUPPORT_A616
If true, app was built with support for A616 protocols.
int mAOBRDStopAnnotationTxIndex
Iterator end for annotations being sent to device.
sc_position_type position_of_destination
Location of destination.
time_type origination_time
void sendCannedMessage(uint32 aMessageId, CString aMessageText)
Transmit a new or updated canned message to the client.
Data type for Baud Rate Change Receipt Packet ID (0x0012) from client to server.
void UTIL_convert_seconds_to_date_type(const time_type *aSeconds, date_time_data_type *aDateTime)
Converts a Garmin date to a structure containing year, month, and day.
#define FMI_SUPPORT_A603
If true, app was build with support for A603 protocols.
uint8 driver_idx
Index of the driver to update.
char mDriverId[FMI_DRIVER_COUNT][50]
Last driver ID received from the client.
bool mStopListInitialized
If TRUE, the stop list has been initialized.
void sendDeleteCannedResponseRequest(uint32 aResponseId)
Send a request to the client to delete a canned response.
#define FMI_SUPPORT_A602
If true, app was build with support for A602 protocols.
#define FMI_SUPPORT_A611
If true, app was built with support for A611 protocols.
signed long int sint32
32-bit signed integer
uint32 getNextStopId()
Find an available stop ID.
void sendNextAOBRDAnnotation(char *driver_id)
Send next AOBRD annotation to device.
uint8 mPayload[MAX_PAYLOAD_SIZE]
The payload, before DLE stuffing.
uint8 file_version[16]
Server-defined version string.
Data type for the Shipment Download Response Packet ID (0X110A) from server to client.
uint8 result_code
Enum indicating result code, see canned_response_list_result for valid values.
Data type for the Speed Limit Alert Receipt Packet ID.
uint8 mFileVersion[16]
file version (FMI_GPI_FILE_INFORMATION)
uint8 id[16]
ID of message being responded to.
Data type for the Annotation Download Response Packet ID (0X110D) from server to client.
static bool convertAnnotationRecord(AobrdEventLogConverter *converter, std::vector< std::string > &record, void *data)
CString getLastName() const
Get item's last name.
Data type for AOBRD Driver Logoff Request Packet ID (0X1310) from server to client.
Data type for Delete Driver Status List Item Receipt.
#define SAVE_RECEIVED_FORM_SUBMIT
File name of the saved custom form submission file.
uint8 mBaudRateSyncRateType
Mark which baud rate is currently being synced.
Data type for Driver ID Receipt packet.
#define FMI_SUPPORT_A610
If true, app was build with support for A610(AOBRD) protocols.
char status[50]
Text displayed for the item (variable length, null terminated, 50 bytes max)
CString getCommodity() const
Get item's commodity.
#define INVALID_LAT
placeholder for invalid latitude value
Data type for the Speed Limit Alert Packet ID.
uint32 mFileSize
file size (FMI_GPI_FILE_INFORMATION)
uint32 offset
offset of data received
FileBackedMap< ClientListItem > mDriverStatuses
Map of driver status IDs to names.
unsigned short int uint16
16-bit unsigned integer
boolean alert_user
Audibly alert the driver.
Data type for the A607 Driver Status Update packet.
void sendDriverStatusListItem(uint32 aDriverStatusId, CString aDriverStatusText)
Initiate the Set Driver Status List Item protocol.
void rebootDevice()
Send a command to the attached device to reboot it.
time_type server_timestamp
id_type mPacketId
A complete serial packet.
Data type for Baud Rate Change Request Packet ID (0x0011) from server to client.
float32 speed
FMI safe mode speed.
Abstract base class for a packet of data.
char mCannedResponseMessageBody[TEXT_MSG_BUFFER_MAX_SIZE]
The message text for the server to client canned text message.
char mPVTFixType[9]
GPS fix type from the last PVT packet, interpreted as an null-terminated ASCII string.
void resetCannedResponseMessages()
Clear the canned response text messages on the server.
boolean result_code
True if the update was successful.
time_type origination_time
Origination time on the client.
Payload for Garmin ID_PVT_DATA packet.
CString mAOBRDShipmentDriverId
Driver ID for shipments being sent to device.
virtual void tx(Packet *aPacket, bool aSendNow)=0
Transmit a packet.
void sendEnablePvtCommand(bool aEnable)
Send an Enable PVT or Disable PVT command.
uint8 id_size
Number of significant bytes of the message ID.
void sendDeleteWaypointCat(uint16 aCatIdx)
Delete waypoint category.
void resetCannedMessages()
Clear the canned messages on the server.
void sendA603Stop(double aLatitude, double aLongitude, char *aStopName, uint32 aStopId)
Initiates the A603 stop protocol.
uint16 stop_status
The stop status.
void sendDriverStatusRequest()
Asks the client for the current driver status.
char message_text[200]
Message sent by the client.
Stores the name associated with a list item that is sent to the client.
sc_position_type scposn
Position when the text message was created by the client.
uint32 offset
offset of this data from the beginning of the file
Data type for the Set Driver Status List Item and Delete Driver Status List Item Receipt packets...
Data type for the Set Driver Status List Item packet.
Data type for the Driver Profile Data Packet ID (0X1104) from server to client.
MessageId link_id
ID of server-to-client message that this is a reply for.
time_type status_change_time
Time when the driver ID changed.
bool mEnablePending
If true, the FMI Enable protocol is in progress.
void sendDriverStatusUpdate(uint32 aDriverStatusId)
Initiate the Driver Status Update protocol.
Data type for the Message Throttling Command Packet ID and Message Throttling Response Packet ID...
Data type for the FMI_ID_WAYPOINT_RCPT packet.
Data structure to holds an AOBRD driver info. Used by the FmiApplicationLayer to validate logins when...
#define SAVE_WAYPOINTS
File name of the saved waypoint data.
void setCategories(uint16 val)
Set the waypoint's categories.
uint32 data_type
Type of data to delete, see del_data for valid values.
void clearError()
Clear any communication error.
Data type for the File Transfer Start Packet ID.
sint16 software_version
Software version * 100 (312 means version 3.12)
uint32 distance_to_destination
Distance to destination, in meters, or 0xFFFFFFFF if no active destination.
Data type for Dashcam Notifictation Packet ID (0X160A) from server to client (receipt) ...
Structure containing details for a client to server text message.
uint32 unique_id
Uniquely identifies the ETA message.
uint32 unique_id
Unique ID from eta_data_type.
transfer_state mFileTransferState
State of the current file transfer (in progress, completed, etc.)
sc_position_type stop_position
Location of the stop.
const char * getReceiveFilename(uint8 file_type) const
Determine which filename to store a received file under.
boolean result_code
TRUE if the operation was successful, FALSE otherwise.
virtual void onAck(const Packet *aPacket)
Callback when a packet is ACKed by the client.
Data type for the Annotation Download Request Packet ID (0X110C) from client to server.
Data type for Long Test Message Receipt Packet ID (0X0056) from client to server. ...
Transport layer in the OSI communication model.
Data type for the Speed Limit Alerts setup Receipt Packet ID.
int mClientPingCount
Number of client-to-server pings received; can be reset by the user.
void sendAOBRDDriverProfile(const AobrdDriverItem &driver)
Send an AOBRD driver profile to the device.
char mPvtNorthSouthVelocity[15]
North-south velocity in meters per second from the last PVT packet, as an ASCII null-terminated strin...
Data type for the ETA Data Packet ID.
uint8 id_size
Size of the message ID.
Map whose contents are also saved to a file.
const std::vector< AobrdShipment > & getShipments() const
Get the list of shipments.
virtual ~FmiApplicationLayer()
Destructor.
Data type for the Set Canned Response Packet ID.
uint16 stop_status_status_type
Enumeration for Stop Status protocol.
char password[20]
Driver password (null terminated string). Optional if driver password support is not enabled...
uint8 id_size
Size of the message ID.
Indicates a latitude and longitude in semicircles.
time_type origination_time
Origination time of the message.
#define GZIPPED_TRANSFER_FILENAME
Name of transient file for storing the gzipped version of a file to transfer.
FileBackedMap< ClientListItem > mCategories
Map of waypoint category IDs to names.
const uint8 * getId() const
Return a reference to the bytes of the message ID.
void sendDeleteWaypoint(uint16 aUniqueId)
Delete a waypoint.
bool mRefreshingDriverStatusList
If TRUE, FmiApplicationLayer is handling a request to refresh the driver status list.
uint32 text_element_id
ID of the user interface element being changed.
void setStopStatus(stop_status_status_type aStatus)
Set the stop status.
Data type for the Driver Profile Data Packet ID (0X1110) from server to client and Driver Profile Dat...
uint8 id[16]
The message ID.
unsigned char uint8
8-bit unsigned integer
Data type for Route Calculation ACK Packet ID (0X1220) from client to server.
time_type origination_time
Origination time when the server sent the stop to the client.
uint32 message_id
ID of the canned message.
uint8 mPayloadSize
Size of the payload, before DLE stuffing.
uint8 getIdSize() const
Return the size of the message ID.
void sendMessageDeleteRequest(const MessageId &aMessageId)
Ask the server to delete a text message.
void sendCannedResponse(uint32 aResponseId, CString aResponseText)
Transmit a new or updated canned response to the client.
Data type for the FMI_ID_CREATE_WAYPOINT_CAT packet.
#define LONG_TEXT_MSG_CHUNK_SIZE
Maximum number of bytes in one segment of an A611 Long Text Message.
Payload for Garmin ID_PRODUCT_DATA (A000) and FMI FMI_ID_PRODUCT_ID_DATA (A602) packet.
void resetDriverStatusList()
Clear the driver statuses on the server.
char mEtaLongitude[14]
String representing the longitude in decimal degrees (and E or W)
sint16 leap_seconds
Number of leap seconds as of the current time.
uint32 message_id
ID of the canned message to delete.
uint16 unique_id
Server-assigned unique ID for the waypoint.
virtual void retry()=0
Retry the last transmit.
Data type for the ETA Data Receipt Packet ID.
uint32 message_id
Unique identifier and sort key for this canned message.
Data type for the Driver Status Log response Packet ID (0X1107) from server to client.
char mPvtUpDownVelocity[15]
Up-down velocity in meters per second from the last PVT packet, as an ASCII null-terminated string...
void sendEtaModeRequest(FMI_eta_mode_type aModeType)
Send an ETA mode request.
uint8 id
Waypoint category (0-15)
time_type eta_time
Estimated time of arrival, or 0xFFFFFFFF if no active destination.
boolean result_code
Result (true if successful, false otherwise)
void sendFile(char *aFilename, uint8 aVersionLength, uint8 *aVersion, uint8 aFileType, BOOL gzipIt=FALSE)
Start a file transfer protocol.
time_type UTIL_get_current_garmin_time()
Get the current server time in Garmin format.
void sendStopSortRequest()
Sends a sort stop list request to the client.
uint32 unique_id
unique_id from the stop_status_data_type.
boolean result_code
True if the update was successful.
Abstract base class for the application layer in the OSI model.
sint16 data
Protocol number.
uint32 mSentDriverStatus
The last driver status that was sent to the client.
Data type for the Message Throttling Query Response Packet ID.
uint32 status_id
Unique identifier and sort key for the status item.
FileBackedMap< ClientListItem > mCannedMessages
Map of canned message IDs to names.
uint16 mClientProductId
Numeric product ID reported by the client.
Structure containing details for a text message status from the client.
uint8 id_size
Size of the message ID.
Data type for the Driver Status Log Update Data Packet ID (0X1106) from client to server...
char response_text[50]
Response text to display on client (variable length, null terminated string)
void sendDataDeletionRequest(del_data aDataType)
Send a data deletion request and remove the appropriate data from the server.
uint32 file_size
Size of the file, in bytes.
Data type for the Set Canned Message Receipt Packet ID and Delete Canned Message Receipt Packet ID...
boolean result_code
TRUE if message was deleted, FALSE if message was not found.
Data type for the Delete Canned Response Packet ID.
time_type getServerEndTime() const
Get item's server end time.
void UTIL_calc_2d_direction(float32 aNorthVelocity, float32 aEastVelocity, char *aCardinalDirection, int aCardinalDirectionSize)
Determine the nearest cardinal aCardinalDirection.
time_type origination_time
Time the message was sent from the server.
#define FMI_SUPPORT_A604
If true, app was build with support for A604 protocols.
time_type server_start_time
Data type for the FMI_ID_CREATE_WAYPOINT_CAT_RCPT packet.
uint8 driver_idx
Driver index to change.
uint32 status_change_id
status_change_id from the driver_id_data_type
Data type for File Start Receipt Packet ID and File End Receipt Packet ID.
float64 lon
longitude in radians, positive is east
void resetWaypoints()
Clear the waypoint and waypoint category lists on the server.
bool findRecordAt(const char *source, evt_log_reason type, uint16 index, bool(*visitor)(AobrdEventLogConverter *converter, std::vector< std::string > &record, void *data), void *data)
Visit records by type and index.
void removeStopById(uint32 aStopId)
Find the index of the deleted stop corresponding to a stop ID.
boolean result_code
True if the operation was successful.
std::vector< uint32 > mStopIndexInList
Vector relating the stop list to unique_ids.
char mPvtLatitude[14]
Latitude in degrees from the last PVT packet, as an ASCII null-terminated string. ...
void stopFileTransfer()
Stop a file transfer protocol.
sint32 time_of_week
Seconds since 12:00 AM Sunday.
uint8 id[16]
The message ID.
file_packet_data_type mLastFilePacketSent
The last file packet that was sent.
T & get(const key_type &aKey)
Get the item by key.
void sendGpiFileInfoRequest()
Send a GPI File Information Request to the client.
uint16 command_type
Garmin command ID (payload when packet ID == ID_COMMAND_BYTE)
Structure containing details for a text message ACK from the client.
void sendPing()
Send a ping packet to the client.
Tracks a waypoint that has been sent to the client.
CString getPassword() const
Set the ID (key) of this item.
uint8 file_type
File type.
time_type server_end_time
void UTIL_convert_UTC_to_local(const time_type *aUtcTime, time_type *aLocalTime)
Converts a time_type from UTC to local time.
uint32 response_id
The canned response ID from the set or delete.
fmi_A604_message_status
Enum for A604 message status protocol.
Payload of FMI_ID_AUTO_ARRIVAL packet.
void sendA607DriverStatusUpdate(uint32 aDriverStatusId, uint8 aIndex)
Initiate the A607 Driver Status Update protocol.
del_data
Enumeration for Data Deletion protocol.
void sendA604TextMessage(const char *aMessageText, const MessageId &aMessageId, uint8 aMessageType=A604_MESSAGE_TYPE_NORMAL)
Send an A604 server to client open text message.
time_type origination_time
Time when the client sent the message.
#define SAVE_STATUS
File name of the saved driver status list data.
unsigned long int uint32
32-bit unsigned integer
char text_message[200]
Message text (variable length, null-terminated string)
Data type for the Driver Status Update packet.
uint32 convertToRaw(const char *source, const char *dest)
Convert CSV file to raw.
sint32 lon
longitude in semicircles
boolean procDriverStatusUpdate(uint32 aDriverStatusId, uint8 aDriverIndex=0)
Process a Driver Status Update from the client.
uint8 result_code
Result of operation.
Data type for the FMI_ID_DELETE_WAYPOINT_CAT_RCPT packet.
uint32 time_type
Absolute time (number of seconds since 12/31/1989 12:00 am UTC)
FileBackedMap< WaypointListItem > mWaypoints
Map of waypoint IDs to names.
Data type for the Driver Login Data Packet ID (0X1102) from server to client.
uint8 id_size
Number of significant bytes in the message ID.
Data type for the Canned Response List Packet ID.
uint32 response_count
Number of responses in the array; if 0, all responses need refresh.
char mPvtAltitude[13]
Altitude in meters from the last PVT packet, as an ASCII null-terminated string.
#define SAVE_CATEGORIES
File name of the saved category data.
uint32 response_id
The canned response ID to delete.
uint8 feature_count
Number of feature IDs in features[].
time_type origination_time
Data type for Canned Response List Packet ID.
#define SAVE_RECEIVED_IFTA_FILE
Data type for the Data Deletion Packet ID.
long_text_msg_data_type mLongTextMessage[10]
Contains the data for the most recent long text message.
void sendFmiSafeModeSpeed(float speed)
Set FMI safe mode speed.
char mFilePath[200]
Path to the file that is being transferred to the client.
uint8 driver_idx
Index of driver to change.
Encapsulation of a message ID.
#define MAX_PAYLOAD_SIZE
Maximum payload size, before DLE stuffing.
Payload of FMI_ID_STOP_STATUS_RCPT packet.
uint8 mCurrentSendFileType
Current file type for file being sent.
void sendMessageThrottlingQuery()
Initiate the Message Throttling Query protocol.
#define SAVE_CONVERTED_AOBRD_LOG
File name of the saved AOBRD driver event log.
Data structure to holds an allowed driver login (ID and password). Used by the FmiApplicationLayer to...
uint16 type_of_gps_fix
Enum for type of GPS fix, see gps_fix_type.
float32 north_velocity
North velocity in m/s, negative is south.
uint8 mEtaMode
Unique ID of the active stop.
uint8 file_data[245]
file data, variable length
uint32 week_number_days
Days from UTC December 31st, 1989 to beginning of current week.
Data type for the Set Canned Response Receipt Packet ID and Delete Canned Response Receipt Packet ID...
float64 time_of_week
Seconds since Sunday 12:00 AM (excludes leap seconds)
char text_message[200]
Text message (variable length, null-terminated string, 200 bytes max)
Data type for Dashcam Settings Packet ID (0X1601, 0X1603, 0x1607) from client to server.
uint32 driver_status
ID corresponding to the new driver status.
void sendAOBRDDriverLogoff(const AobrdDriverItem &driver)
Send an AOBRD driver logoff command to the device.
uint32 unique_id
Unique ID generated by client.
uint32 stop_distance
Minimum distance to destination before auto-arrival is activated, in meters.
uint8 id
Waypoint category.
Data type for File Start Receipt Packet ID and File End Receipt Packet ID when sent from Server...
uint16 cat
Waypoint categories, bit-mapped.
static void post(EventId aEventId, uint32 aEventData=0, void *aEventDataPtr=NULL, BOOL handleNow=FALSE)
Posts a message to all windows that have registered to get events.
float threshold
Speed over speed limit when speeding event begins.
uint8 mode
Mode, a valid speed_limit_alert_mode_type.
void resetCannedResponses()
Clear the canned responses on the server.
CString getDocNumber() const
Get item's document number.
Encapsulates the fields of a GPS time for conversion.
CString getCarrierID() const
Get item's carrier ID.
Data type for the Speed Limit Alerts setup Packet ID.