Пример #1
0
/**
 * ReadSubfr3 function
 * The function decodes the 3rd subframe of the GPS navigation data
 * according to the IS-GPS-200E section IS-GPS-200E : 20.3.3.4.1 Content
 * of Subframes 2 and 3 and updates the Satellite structure,
 * identified by its pointer.
 * @param *Sat  The pointer of the Satellite structure
 * @param *data The pointer of the 300 bits
 */
void ReadSubfr3(Satellite * Sat, char * data)
{
	(*Sat).cic = get_cic((*Sat).subfr3);
	(*Sat).cis = get_cis((*Sat).subfr3);
	(*Sat).crc = get_crc((*Sat).subfr3);
	(*Sat).w = get_w((*Sat).subfr3);
	(*Sat).omega0 = get_omega0((*Sat).subfr3);
	(*Sat).omegadot = get_omegadot((*Sat).subfr3);
	(*Sat).i0 = get_i0((*Sat).subfr3);
	(*Sat).idot = get_idot((*Sat).subfr3);
	(*Sat).iode_s3 = get_iode_s3((*Sat).subfr3);
}
Пример #2
0
/* --------------------------------------------------------------- */
void R_sqlget( const int func )
{
	int col, bytes;

	if (ARGN==0) {
		Licpy(ARGR, sqlite3_column_count(sqlstmt));
		return;
	}
	if (ARGN>1) Lerror(ERR_INCORRECT_CALL,0);
	get_i0(1,col);
	col--;

	switch (sqlite3_column_type(sqlstmt, col)) {
		case SQLITE_INTEGER:
			Licpy(ARGR, sqlite3_column_int(sqlstmt, col));
			break;

		case SQLITE_FLOAT:
			Lrcpy(ARGR, sqlite3_column_double(sqlstmt, col));
			break;

		case SQLITE_TEXT:
			Lscpy(ARGR, (char*)sqlite3_column_text(sqlstmt, col));
			break;

		case SQLITE_BLOB:
			bytes = sqlite3_column_bytes(sqlstmt, col);
			Lfx(ARGR, bytes);
			LLEN(*ARGR) = bytes;
			LTYPE(*ARGR) = LSTRING_TY;
			MEMCPY(LSTR(*ARGR), sqlite3_column_blob(sqlstmt, col), bytes);
			break;

		case SQLITE_NULL:
			Lfx(ARGR,1);
			LTYPE(*ARGR)   = LSTRING_TY;
			LLEN(*ARGR)    = 1;
			LSTR(*ARGR)[0] = 0;
			break;

		default:
			Lfx(ARGR,0);
			LTYPE(*ARGR) = LSTRING_TY;
			LLEN(*ARGR)  = 0;
	}
} /* R_sqlget */