12 #include <QDataStream> 22 #define EARTH_RADIUS 6378137 23 #define LAT2METER 111132 27 #define zeroPtOneMicroDegreeToMeter 0.0111178 29 #define DEFAULT_VALUE_POSITION 0 31 #define GPS_CONF_LATITUDE "Latitude" 32 #define GPS_CONF_LONGITUDE "Longitude" 33 #define GPS_CONF_ALTITUDE "Altitude" 34 #define GPS_CONF_HEADING "Heading" 35 #define GPS_CONF_SEMI_MAJOR_CONFIDENCE "Semi major confidence" 36 #define GPS_CONF_SEMI_MINOR_CONFIDENCE "Semi minor confidence" 37 #define GPS_CONF_SEMI_MAJOR_ORIENTATION "Semi major orientation" 38 #define GPS_CONF_SPEED "Speed" 39 #define GPS_CONF_TIMESTAMP "Timestamp" 41 #define SWAP16(nb) (nb = (nb << 8) | (nb >> 8)) 42 #define SWAP32(nb) (nb = ((nb & 0x000f) << 24) | \ 43 ((nb & 0x00f0) << 16) | \ 44 ((nb & 0x0f00) >> 8) | \ 45 ((nb & 0xf000) >> 24)) 46 #define SWAP64(nb) (nb = ((nb & 0x0000000f) << 56) | \ 47 ((nb & 0x000000f0) << 48) | \ 48 ((nb & 0x00000f00) << 40) | \ 49 ((nb & 0x0000f000) << 32) | \ 50 ((nb & 0x000f0000) >> 8) | \ 51 ((nb & 0x00f00000) >> 24) | \ 52 ((nb & 0x0f000000) >> 40) | \ 53 ((nb & 0xf0000000) >> 56)) 78 void format(
unsigned char *msg,
unsigned long v,
int l);
87 unsigned long long int split(
const unsigned char *msg,
int begin,
int end);
96 void split(
const unsigned char *msg,
int begin,
int end,
char *out);
118 void print_hexa(
const unsigned char *msg,
int l, FILE* stream = stdout);
177 unsigned int diameter(
long begin,
long end, quint64 circ);
187 double dist(qint32 x1, qint32 y1, qint32 x2, qint32 y2);
205 double f(
long x,
long y,
double lengthA,
double lengthB,
e_shape shape);
220 int g(
double dist_r,
double dist_f,
double dist_fr,
int angleThreshold);
int validate_unsigned_int(cfg_t *cfg, cfg_opt_t *opt)
validate_unsigned_int Check if an option is an unsigned int
unsigned long long int split(const unsigned char *msg, int begin, int end)
split Extract number from byte array.
double dist(qint32 x1, qint32 y1, qint32 x2, qint32 y2)
dist This function calculate the euclidian distance between two points ([x1, y1], [x2...
void print_hexa(const unsigned char *msg, int l, FILE *stream=stdout)
print_hexa Print a byte array.
QString printBitString(BIT_STRING_t b)
printBitString Print a BIT_STRING into a QString.
BIT_STRING_t makeBitString(int nbits, cfg_t *cfg, const char *opt_name)
makeBitString Generate a BIT_STRING from configuration.
Constantes used everywhere.
int g(double dist_r, double dist_f, double dist_fr, int angleThreshold)
g Compute the g function.
e_shape
The e_shape enum defines the shapes type.
quint64 circAtLat(long l)
circAtLat Compute the circumference at a latitude.
double f(long x, long y, double lengthA, double lengthB, e_shape shape)
f Compute the f function.
unsigned int diameter(long begin, long end, quint64 circ)
diameter Compute the distance between two point on the same latitude.
void format(unsigned char *msg, unsigned long v, int l)
format Format a number in byte array.