Functions
dascubed/CubeBuffer.cpp File Reference
#include <sys/time.h>
#include <math.h>
#include <plugin.h>
#include "CubeBuffer.h"
#include "CubeTcpServer.h"
#include "CubeDevice.h"
#include "CubeMessages.h"

Functions

int int24to32 (const char *ptr)

Function Documentation

int int24to32 ( const char *  ptr) [inline]

Converts big endian coded over 3 bytes to native integers over 4 bytes

References TRACE.

{
  TRACE;
  union {
    unsigned char bytes[4];
    int value;
  } val;
#if BYTE_ORDER==LITTLE_ENDIAN
  val.bytes[3]=0;
  val.bytes[2]=ptr[0];
  val.bytes[1]=ptr[1];
  val.bytes[0]=ptr[2];
#else
  val.bytes[0]=0;
  val.bytes[1]=ptr[0];
  val.bytes[2]=ptr[1];
  val.bytes[3]=ptr[2];
#endif
  return val.value-0x00800000;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines