#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include "ISUtilities.h"
#include "ISPose.h"
#include "ISEarth.h"
#include <unistd.h>
#include <sys/time.h>
Go to the source code of this file.
Functions | |
string | base64Decode (const string &encoded_string) |
string | base64Encode (const unsigned char *bytes_to_encode, unsigned int in_len) |
void | bootloadStatusInfo (const void *port, const char *str) |
int | bootloadUploadProgress (const void *port, float percent) |
int | bootloadVerifyProgress (const void *port, float percent) |
int32_t | convertDateToMjd (int32_t year, int32_t month, int32_t day) |
void | convertGpsToHMS (int32_t gpsSeconds, int32_t *hour, int32_t *minutes, int32_t *seconds) |
int32_t | convertGpsToMjd (int32_t gpsWeek, int32_t gpsSeconds) |
void | convertMjdToDate (int32_t mjd, int32_t *year, int32_t *month, int32_t *day) |
int | current_timeMs () |
int | current_timeSec () |
uint64_t | current_timeUs () |
uint32_t | dateToWeekDay (uint32_t ul_year, uint32_t ul_month, uint32_t ul_day) |
gen_1axis_sensor_t | gen1AxisSensorData (double time, const float val) |
gen_3axis_sensor_t | gen3AxisSensorData (double time, const float val[3]) |
gen_3axis_sensord_t | gen3AxisSensorDataD (double time, const double val[3]) |
gen_dual_3axis_sensor_t | genDual3AxisSensorData (double time, const float val1[3], const float val2[3]) |
const unsigned char * | getHexLookupTable () |
uint8_t | getHexValue (unsigned char hex) |
uint64_t | getTickCount (void) |
static bool | is_base64 (unsigned char c) |
void * | mutexCreate (void) |
void | mutexFree (void *handle) |
void | mutexLock (void *handle) |
void | mutexUnlock (void *handle) |
FILE * | openFile (const char *path, const char *mode) |
size_t | splitString (const string &s, const string &delimiter, vector< string > &result) |
float | step_sinwave (float *sig_gen, float freqHz, float amplitude, float periodSec) |
Initialize signal generator. More... | |
const char * | tempPath () |
void * | threadCreateAndStart (void(*function)(void *info), void *info) |
void | threadJoinAndFree (void *handle) |
uint64_t | timerRawEnd (uint64_t start) |
uint64_t | timerRawStart () |
uint64_t | timerUsEnd (uint64_t start) |
uint64_t | timerUsStart () |
Variables | |
static const string | s_base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" |
string base64Decode | ( | const string & | encoded_string | ) |
Definition at line 105 of file ISUtilities.cpp.
string base64Encode | ( | const unsigned char * | bytes_to_encode, |
unsigned int | in_len | ||
) |
Definition at line 53 of file ISUtilities.cpp.
void bootloadStatusInfo | ( | const void * | port, |
const char * | str | ||
) |
Definition at line 418 of file ISUtilities.cpp.
int bootloadUploadProgress | ( | const void * | port, |
float | percent | ||
) |
Definition at line 388 of file ISUtilities.cpp.
int bootloadVerifyProgress | ( | const void * | port, |
float | percent | ||
) |
Definition at line 403 of file ISUtilities.cpp.
int32_t convertDateToMjd | ( | int32_t | year, |
int32_t | month, | ||
int32_t | day | ||
) |
Definition at line 642 of file ISUtilities.cpp.
void convertGpsToHMS | ( | int32_t | gpsSeconds, |
int32_t * | hour, | ||
int32_t * | minutes, | ||
int32_t * | seconds | ||
) |
Definition at line 676 of file ISUtilities.cpp.
int32_t convertGpsToMjd | ( | int32_t | gpsWeek, |
int32_t | gpsSeconds | ||
) |
Definition at line 654 of file ISUtilities.cpp.
void convertMjdToDate | ( | int32_t | mjd, |
int32_t * | year, | ||
int32_t * | month, | ||
int32_t * | day | ||
) |
Definition at line 660 of file ISUtilities.cpp.
int current_timeMs | ( | ) |
System time in milliseconds
Definition at line 225 of file ISUtilities.cpp.
int current_timeSec | ( | ) |
Definition at line 205 of file ISUtilities.cpp.
uint64_t current_timeUs | ( | ) |
System time in milliseconds
Definition at line 247 of file ISUtilities.cpp.
uint32_t dateToWeekDay | ( | uint32_t | ul_year, |
uint32_t | ul_month, | ||
uint32_t | ul_day | ||
) |
Definition at line 687 of file ISUtilities.cpp.
gen_1axis_sensor_t gen1AxisSensorData | ( | double | time, |
const float | val | ||
) |
Definition at line 704 of file ISUtilities.cpp.
gen_3axis_sensor_t gen3AxisSensorData | ( | double | time, |
const float | val[3] | ||
) |
Definition at line 712 of file ISUtilities.cpp.
gen_3axis_sensord_t gen3AxisSensorDataD | ( | double | time, |
const double | val[3] | ||
) |
Definition at line 735 of file ISUtilities.cpp.
gen_dual_3axis_sensor_t genDual3AxisSensorData | ( | double | time, |
const float | val1[3], | ||
const float | val2[3] | ||
) |
Definition at line 722 of file ISUtilities.cpp.
const unsigned char* getHexLookupTable | ( | ) |
Return a pointer to 16 elements to map nibbles to for converting to hex
Definition at line 475 of file ISUtilities.cpp.
uint8_t getHexValue | ( | unsigned char | hex | ) |
Get numberic value of a hex code - no bounds check is done, so non-hex chars will return undefined values
hex | the hex digit, i.e. 'A' |
Definition at line 481 of file ISUtilities.cpp.
uint64_t getTickCount | ( | void | ) |
Definition at line 364 of file ISUtilities.cpp.
|
inlinestatic |
Definition at line 48 of file ISUtilities.cpp.
void* mutexCreate | ( | void | ) |
Definition at line 540 of file ISUtilities.cpp.
void mutexFree | ( | void * | handle | ) |
Free a mutex
handle | the mutex handle to free |
Definition at line 613 of file ISUtilities.cpp.
void mutexLock | ( | void * | handle | ) |
Lock a mutex - mutex cannot be locked until mutexUnlock is called
handle | the mutex handle to lock |
Definition at line 567 of file ISUtilities.cpp.
void mutexUnlock | ( | void * | handle | ) |
Unlock a mutex
handle | the mutex handle to unlock |
Definition at line 590 of file ISUtilities.cpp.
FILE* openFile | ( | const char * | path, |
const char * | mode | ||
) |
Definition at line 437 of file ISUtilities.cpp.
size_t splitString | ( | const string & | s, |
const string & | delimiter, | ||
vector< string > & | result | ||
) |
Definition at line 157 of file ISUtilities.cpp.
float step_sinwave | ( | float * | sig_gen, |
float | freqHz, | ||
float | amplitude, | ||
float | periodSec | ||
) |
Initialize signal generator.
param float loopPeriodSec Timestep interval in seconds param float freqHz Frequency of output sin wave param float amplitude Amplitude (peak to center/mean) of output sin wave
Step the signal generator output
Definition at line 424 of file ISUtilities.cpp.
const char* tempPath | ( | ) |
Definition at line 455 of file ISUtilities.cpp.
void* threadCreateAndStart | ( | void(*)(void *info) | function, |
void * | info | ||
) |
Create a thread and execute a function
function | the function to execute in a background thread |
info | the parameter to pass to the thread function |
Definition at line 486 of file ISUtilities.cpp.
void threadJoinAndFree | ( | void * | handle | ) |
Join a thread with this thread, waiting for it to finish, then free the thread
handle | the thread handle to join, wait for finish and then to free |
Definition at line 510 of file ISUtilities.cpp.
uint64_t timerRawEnd | ( | uint64_t | start | ) |
Definition at line 343 of file ISUtilities.cpp.
uint64_t timerRawStart | ( | ) |
Definition at line 324 of file ISUtilities.cpp.
uint64_t timerUsEnd | ( | uint64_t | start | ) |
Definition at line 295 of file ISUtilities.cpp.
uint64_t timerUsStart | ( | ) |
Definition at line 275 of file ISUtilities.cpp.
|
static |
Definition at line 47 of file ISUtilities.cpp.