Position endianess conversion in all modules
This commit is contained in:
parent
2ce238984c
commit
d31ac3864e
|
@ -415,6 +415,9 @@ int read_loop(int sockfd)
|
||||||
// Endianess conversions:
|
// Endianess conversions:
|
||||||
request.request_time = owl_ntoh_timestamp(request.request_time) ;
|
request.request_time = owl_ntoh_timestamp(request.request_time) ;
|
||||||
request.start_time = owl_ntoh_timestamp(request.start_time) ;
|
request.start_time = owl_ntoh_timestamp(request.start_time) ;
|
||||||
|
request.x_position = owl_ntohf(request.x_position) ;
|
||||||
|
request.y_position = owl_ntohf(request.y_position) ;
|
||||||
|
request.z_position = owl_ntohf(request.z_position) ;
|
||||||
|
|
||||||
if (cfg_getbool(cfg, "verbose"))
|
if (cfg_getbool(cfg, "verbose"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -348,6 +348,9 @@ void make_packet()
|
||||||
printf("Direction = %d, X = %f, Y = %f, Z = %f\n",
|
printf("Direction = %d, X = %f, Y = %f, Z = %f\n",
|
||||||
packet[offset - 1], options.x, options.y, options.z) ;
|
packet[offset - 1], options.x, options.y, options.z) ;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
options.x = owl_htonf(options.x) ;
|
||||||
|
options.y = owl_htonf(options.y) ;
|
||||||
|
options.z = owl_htonf(options.z) ;
|
||||||
memcpy(&packet[offset], &options.x, sizeof(float)) ;
|
memcpy(&packet[offset], &options.x, sizeof(float)) ;
|
||||||
offset += sizeof(float) ;
|
offset += sizeof(float) ;
|
||||||
memcpy(&packet[offset], &options.y, sizeof(float)) ;
|
memcpy(&packet[offset], &options.y, sizeof(float)) ;
|
||||||
|
|
|
@ -1065,9 +1065,9 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
||||||
request_time_str,
|
request_time_str,
|
||||||
start_time_str,
|
start_time_str,
|
||||||
request.antenna_signal_dbm - 0x100,
|
request.antenna_signal_dbm - 0x100,
|
||||||
request.x_position,
|
owl_ntohf(request.x_position),
|
||||||
request.y_position,
|
owl_ntohf(request.y_position),
|
||||||
request.z_position,
|
owl_ntohf(request.z_position),
|
||||||
request.direction
|
request.direction
|
||||||
) ;
|
) ;
|
||||||
}
|
}
|
||||||
|
@ -1267,9 +1267,9 @@ uint_fast16_t make_packet(uint8_t **packet)
|
||||||
uint_fast16_t offset ; // Index used to create the packet
|
uint_fast16_t offset ; // Index used to create the packet
|
||||||
owl_timestamp request_time ;
|
owl_timestamp request_time ;
|
||||||
float
|
float
|
||||||
my_position_x = GET_MY_POSITION_X(),
|
my_position_x = owl_htonf(GET_MY_POSITION_X()),
|
||||||
my_position_y = GET_MY_POSITION_Y(),
|
my_position_y = owl_htonf(GET_MY_POSITION_Y()),
|
||||||
my_position_z = GET_MY_POSITION_Z() ;
|
my_position_z = owl_htonf(GET_MY_POSITION_Z()) ;
|
||||||
|
|
||||||
owl_timestamp_now(&request_time) ;
|
owl_timestamp_now(&request_time) ;
|
||||||
|
|
||||||
|
|
|
@ -150,9 +150,9 @@ const Request& InputUDPSocket::get_next_request()
|
||||||
|
|
||||||
calib_request->set_direction(Direction(request.direction)) ;
|
calib_request->set_direction(Direction(request.direction)) ;
|
||||||
|
|
||||||
ReferencePoint position(request.x_position,
|
ReferencePoint position(owl_ntohf(request.x_position),
|
||||||
request.y_position,
|
owl_ntohf(request.y_position),
|
||||||
request.z_position) ;
|
owl_ntohf(request.z_position)) ;
|
||||||
const ReferencePoint &reference_point =
|
const ReferencePoint &reference_point =
|
||||||
Stock::find_create_reference_point(position) ;
|
Stock::find_create_reference_point(position) ;
|
||||||
calib_request->set_reference_point(&reference_point) ;
|
calib_request->set_reference_point(&reference_point) ;
|
||||||
|
|
Loading…
Reference in New Issue