Logo Search packages:      
Sourcecode: hamlib version File versions  Download package

unsigned long long HAMLIB_API from_bcd_be ( const unsigned char  bcd_data[],
unsigned  bcd_len 
)

Convert 4-bit BCD digits to binary, big-endian.

Parameters:
bcd_data 
bcd_len 
Returns:
binary result
Same as from_bcd, but in big-endian order (e.g. byte order 12 34 56 78 90 for 1234567890 Hz)

See also:
from_bcd

Definition at line 178 of file misc.c.

{
      int i;
      freq_t f = 0;

      for (i=0; i < bcd_len/2; i++) {
            f *= 10;
            f += bcd_data[i]>>4;
            f *= 10;
            f += bcd_data[i] & 0x0f;
      }
      if (bcd_len&1) {
            f *= 10;
            f += bcd_data[bcd_len/2]>>4;
      }

      return f;
}


Generated by  Doxygen 1.6.0   Back to index