Psyllid  v1.12.4
Project 8 Data Acquisisition Software
roach_packet.cc
Go to the documentation of this file.
1 /*
2  * roach_packet.cc
3  *
4  * Created on: Jan 27, 2016
5  * Author: nsoblath
6  */
7 
8 #include "roach_packet.hh"
9 
10 #include "byte_swap.hh"
11 
12 namespace psyllid
13 {
14 
16  f_packet()
17  {}
18 
20  {}
21 
23  {
24  a_pkt->f_word_0 = be64toh( a_pkt->f_word_0 );
25  a_pkt->f_word_1 = be64toh( a_pkt->f_word_1 );
26  a_pkt->f_word_2 = be64toh( a_pkt->f_word_2 );
27  a_pkt->f_word_3 = be64toh( a_pkt->f_word_3 );
28  static const unsigned n_words = PAYLOAD_SIZE / 8;
29  uint64_t* t_data_64bit = reinterpret_cast< uint64_t* >( a_pkt->f_data );
30  for( unsigned i_word = 0; i_word < n_words; ++i_word )
31  {
32  t_data_64bit[ i_word ] = payload_swap( t_data_64bit[ i_word ] );
33  }
34  return;
35  }
36 
37 }
38 
39 
#define PAYLOAD_SIZE
Definition: roach_packet.hh:15
void byteswap_inplace(raw_roach_packet *a_pkt)
Definition: roach_packet.cc:22
#define payload_swap(x)
Definition: roach_packet.hh:24