16 #define PI ( 3.14159265358979323846 ) 19 #define INV_DATE_TIME ( 0xFFFFFFFF ) 22 #define BASE_YEAR ( 1990 ) 25 #define DAYS_IN_4_YEARS ( 365 * 4 + 1 ) 28 #define DAYS_IN_1_YEAR ( 365 ) 31 #define DAYS_IN_1_WEEK ( 7 ) 34 #define SECONDS_PER_WEEK ( 60 * 60 * 24 * 7 ) 37 #define SECONDS_PER_DAY ( 60 * 60 * 24 ) 40 #define SECONDS_PER_HOUR ( 60 * 60 ) 43 #define SECONDS_PER_MINUTE ( 60 ) 46 #define FEBRUARY ( 2 ) 49 #define DECEMBER ( 12 ) 74 const char * aHexString,
88 const char * aHexString,
107 char * aResultString,
108 int aResultStringSize
114 char * aResultString,
115 int aResultStringSize
180 char * aCardinalDirection,
181 int aCardinalDirectionSize
double UTIL_calc_2d_speed(float32 aNorthVelocity, float32 aEastVelocity)
Determine the two-dimensional velocity.
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.
void UTIL_calc_2d_direction(float32 aNorthVelocity, float32 aEastVelocity, char *aCardinalDirection, int aCardinalDirectionSize)
Determine the nearest cardinal aCardinalDirection.
CString unzip(char *original)
This function will uncompress a file into a new file.
sint32 UTIL_convert_degrees_to_semicircles(double aDegrees)
Converts a latitude/longitude from degrees to semicircles.
void UTIL_convert_time_type_to_seconds(const date_time_data_type *aDateTime, time_type *aSeconds)
Converts a time_type to seconds since midnight.
void UTIL_convert_UTC_to_local(const time_type *aUtcTime, time_type *aLocalTime)
Converts a time_type from UTC to local time.
void UTIL_format_date_string(const date_time_data_type *aDateTime, char *aResultString, int aResultStringSize)
Format a date as a string.
double UTIL_convert_radians_to_degrees(double aRadians)
Converts a latitude/longitude from radians to degrees.
bool UTIL_data_is_printable(const char *aData, int aLength)
Determine whether an array of characters consists only of printable ASCII.
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.
double UTIL_convert_semicircles_to_degrees(sint32 aSemicircles)
Converts a latitude/longitude from semicircles to degrees.
Date & time data type with separate fields for month, day, year, hour, minute, and second...
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.
bool UTIL_data_is_uint32(const char *aData)
Determine whether an array of characters consists only of numeric, and that the value when converted ...
float float32
32-bit IEEE-format floating point data. (1 sign bit, 8 exponent bits, and 23 mantissa bits) ...
signed long int sint32
32-bit signed integer
unsigned short int uint16
16-bit unsigned integer
void write(CFile *catalog, char *text)
This function is a helper for writing text to a file.
time_type UTIL_get_current_garmin_time(void)
Get the current server time in Garmin format.
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).
uint8 UTIL_hex_to_uint16(const char *aHexString, uint16 *aBinaryData, uint8 aMaxWords)
Converts a null-terminated string in hexadecimal format to an array of uint16 numbers, assuming natural byte ordering in the hex. No prefix should be present in the hex string.
unsigned char uint8
8-bit unsigned integer
uint16 UTIL_hex_to_uint8(const char *aHexString, uint8 *aBinaryData, uint16 aMaxBytes)
Convert a hexadecimal ASCII string to an array of uint8.
void UTIL_convert_gps_time_to_seconds(const gps_time_type *aGpsTime, time_type *aSeconds)
Converts from gps_time to Garmin time.
time_type UTIL_get_garmin_time(tm aTimeTm)
Get the current server time in Garmin format.
uint32 time_type
Absolute time (number of seconds since 12/31/1989 12:00 am UTC)
void UTIL_convert_local_to_UTC(const time_type *aLocalTime, time_type *aUtcTime)
Converts a time_type from local to UTC time.
void UTIL_uint8_to_hex(const uint8 *aData, char *aOutput, uint8 aNumBytes)
Convert from binary to a hexadecimal string.
double UTIL_convert_degrees_to_radians(double aDegrees)
Converts a latitude/longitude from degrees to radians.
Encapsulates the fields of a GPS time for conversion.