Fraxinus  16.5.0-fx-rc8
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
igtl_us_status.c
Go to the documentation of this file.
1 // This file is part of CustusX, an Image Guided Therapy Application.
2 //
3 // Copyright (C) 2008- SINTEF Technology & Society, Medical Technology
4 //
5 // CustusX is fully owned by SINTEF Medical Technology (SMT). CustusX source
6 // code and binaries can only be used by SMT and those with explicit permission
7 // from SMT. CustusX shall not be distributed to anyone else.
8 //
9 // CustusX is a research tool. It is NOT intended for use or certified for use
10 // in a normal clinical setting. SMT does not take responsibility for its use
11 // in any way.
12 //
13 // See CustusX_License.txt for more information.
14 
15 /*
16  * igtl_us_status.cpp
17  *
18  * Created on: Apr 23, 2012
19  * Author: olevs
20  */
21 
22 #include "igtl_us_status.h"
23 #include "igtl_util.h"
24 
26 {
27  igtl_int64* tmp64 = (igtl_int64*)message;
28  igtl_int32* tmp32 = (igtl_int32*)message;
29 // igtl_uint16* tmp16 = (igtl_uint16*)message;
30 
31  if (igtl_is_little_endian())
32  {
33  int i;
34  for (i = 0; i < 6; i++)//Update number when adding more variables to message
35  tmp64[i] = BYTE_SWAP_INT64(tmp64[i]);
36 
37  for (i = 0; i < 1; i ++)
38  tmp32[12 + i] = BYTE_SWAP_INT32(tmp32[12 + i]);//6*64 bit adressed as 32 bit = 12
39 
40 // tmp16[34] = BYTE_SWAP_INT16(tmp16[34]);//3*64 bit + 8*32 bit (adressed as 16 bit = 28)
41  }
42 
43 }
44 
45 igtl_uint64 igtl_export igtl_us_status_get_crc(igtl_us_status_message * message)
46 {
47  igtl_uint64 crc = crc64(0, 0, 0);
48 
49  crc = crc64((unsigned char*)message, IGTL_US_STATUS_HEADER_SIZE, crc);
50  return crc;
51 }
#define IGTL_US_STATUS_HEADER_SIZE
void igtl_export igtl_us_status_convert_byte_order(igtl_us_status_message *message)
igtl_uint64 igtl_export igtl_us_status_get_crc(igtl_us_status_message *message)