Fraxinus  22.04-rc5
An IGT application
igtl_us_status.c
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 /*
13  * igtl_us_status.cpp
14  *
15  * Created on: Apr 23, 2012
16  * Author: olevs
17  */
18 
19 #include "igtl_us_status.h"
20 #include "igtl_util.h"
21 
23 {
24  igtl_int64* tmp64 = (igtl_int64*)message;
25  igtl_int32* tmp32 = (igtl_int32*)message;
26 // igtl_uint16* tmp16 = (igtl_uint16*)message;
27 
28  if (igtl_is_little_endian())
29  {
30  int i;
31  for (i = 0; i < 6; i++)//Update number when adding more variables to message
32  tmp64[i] = BYTE_SWAP_INT64(tmp64[i]);
33 
34  for (i = 0; i < 1; i ++)
35  tmp32[12 + i] = BYTE_SWAP_INT32(tmp32[12 + i]);//6*64 bit adressed as 32 bit = 12
36 
37 // tmp16[34] = BYTE_SWAP_INT16(tmp16[34]);//3*64 bit + 8*32 bit (adressed as 16 bit = 28)
38  }
39 
40 }
41 
42 igtl_uint64 igtl_export igtl_us_status_get_crc(igtl_us_status_message * message)
43 {
44  igtl_uint64 crc = crc64(0, 0, 0);
45 
46  crc = crc64((unsigned char*)message, IGTL_US_STATUS_HEADER_SIZE, crc);
47  return crc;
48 }
#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)