00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __Augmented_Reality_Tractor_Maintenance__JDDownloadObject__
00010 #define __Augmented_Reality_Tractor_Maintenance__JDDownloadObject__
00011
00012
00014 #define MTGDATASOURCESIZE 45
00015
00016
00018 #define SERIALNUMBERSIZE 13
00019 #define ENGINE_HOURS_LOCATION 13
00020 #define MACHINE_ID_LOCATION 17
00021 #define ENGINE_TURN_ON_COUNT_LOCATION 21
00022 #define KEY_TURN_ON_COUNT_LOCATION 25
00023 #define GPS_AVAILABLE_LOCATION 29
00024 #define RDA_LICENSE_AVAILABLE_LOCATION 30
00025 #define FUEL_LEVEL_LOCATION 31
00026 #define TIRE_PRESSURE_LOCATION 35
00027 #define TIME_SINCE_LAST_CALL_IN_LOCATION 39
00028 #define LAST_REPROGRAMMING_STATUS_LOCATION 43
00029 #define GSM_REGISTRATION_STATE_LOCATION 44
00030
00031 #include <stdio.h>
00032
00033
00034
00035 struct MTGData {
00036 char TerminalSerialNumber[SERIALNUMBERSIZE+1];
00037 unsigned long EngineHours;
00038 unsigned long MachineID;
00039 unsigned long EngineTurnOnCount;
00040 unsigned long KeyTurnOnCount;
00041 bool GPSAvailable;
00042 bool RDALicenseAvailable;
00043 unsigned long FuelLevel;
00044 unsigned long TirePressure;
00045
00046
00047 unsigned long TimeSinceLastCallIn;
00048 bool LastReprogrammingStatus;
00049
00050
00051 bool GSMRegistrationState;
00052 };
00053
00054 typedef struct MTGData *JDDownloadBlock;
00055
00056 JDDownloadBlock new_download_block( void );
00057
00058 void destroy_download_block( JDDownloadBlock dlb );
00059
00060 void download_block_ntoh( JDDownloadBlock dlb );
00061
00062 void download_block_adjust_byte_order( JDDownloadBlock dlb );
00063
00064 void download_block_from_raw_data( JDDownloadBlock dlb, unsigned char* raw );
00065
00066 const char *download_block_serial( JDDownloadBlock dlb );
00067
00068 unsigned long download_block_engine_hours( JDDownloadBlock dlb );
00069
00070 unsigned long download_block_machine_id( JDDownloadBlock dlb );
00071
00072 unsigned long download_block_engine_turn_on_count( JDDownloadBlock dlb );
00073
00074 unsigned long download_block_key_turn_on_count( JDDownloadBlock dlb );
00075
00076 bool download_block_is_gps_available( JDDownloadBlock dlb );
00077
00078 bool download_block_is_rda_license_available( JDDownloadBlock dlb );
00079
00080 unsigned long download_block_fuel_level( JDDownloadBlock dlb );
00081
00082 unsigned long download_block_tire_pressure( JDDownloadBlock dlb );
00083
00084 unsigned long download_block_last_call_in_time( JDDownloadBlock dlb );
00085
00086 bool download_block_last_reprogramming_status( JDDownloadBlock dlb );
00087
00088 bool download_block_gsm_registration_state( JDDownloadBlock dlb );
00089
00090
00091 #endif