glonass special sign support

pull/1/head
bert hubert 2019-08-26 00:17:41 +02:00
parent 661a7e0e23
commit c0e13d3a42
2 changed files with 9 additions and 0 deletions

View File

@ -15,6 +15,14 @@ int getbits(const unsigned char *buff, int pos, int len)
return (int)(bits|(~0u<<len)); /* extend sign */
}
int getbitsglonass(const unsigned char *buff, int pos, int len)
{
int val = getbitu(buff,pos+1,len-1);
return getbitu(buff,pos,1) ? - val : val;
}
void setbitu(unsigned char *buff, int pos, int len, unsigned int data)
{
unsigned int mask=1u<<(len-1);

View File

@ -3,5 +3,6 @@
unsigned int getbitu(const unsigned char *buff, int pos, int len);
int getbits(const unsigned char *buff, int pos, int len);
int getbitsglonass(const unsigned char *buff, int pos, int len);
void setbitu(unsigned char *buff, int pos, int len, unsigned int data);
unsigned int rtk_crc24q(const unsigned char *buff, int len);