Skip to content

Commit

Permalink
glonass special sign support
Browse files Browse the repository at this point in the history
  • Loading branch information
ahupowerdns committed Aug 25, 2019
1 parent 661a7e0 commit c0e13d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bits.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions bits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit c0e13d3

Please sign in to comment.