diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 3b254d8..ec083a5 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -415,6 +415,9 @@ int read_loop(int sockfd) // Endianess conversions: request.request_time = owl_ntoh_timestamp(request.request_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")) { diff --git a/owlps-client/owlps-client.c b/owlps-client/owlps-client.c index 1446388..3b6c224 100644 --- a/owlps-client/owlps-client.c +++ b/owlps-client/owlps-client.c @@ -348,6 +348,9 @@ void make_packet() printf("Direction = %d, X = %f, Y = %f, Z = %f\n", packet[offset - 1], options.x, options.y, options.z) ; #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)) ; offset += sizeof(float) ; memcpy(&packet[offset], &options.y, sizeof(float)) ; diff --git a/owlps-listener/owlps-listenerd.c b/owlps-listener/owlps-listenerd.c index 81e999a..186de37 100644 --- a/owlps-listener/owlps-listenerd.c +++ b/owlps-listener/owlps-listenerd.c @@ -1065,9 +1065,9 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header, request_time_str, start_time_str, request.antenna_signal_dbm - 0x100, - request.x_position, - request.y_position, - request.z_position, + owl_ntohf(request.x_position), + owl_ntohf(request.y_position), + owl_ntohf(request.z_position), request.direction ) ; } @@ -1267,9 +1267,9 @@ uint_fast16_t make_packet(uint8_t **packet) uint_fast16_t offset ; // Index used to create the packet owl_timestamp request_time ; float - my_position_x = GET_MY_POSITION_X(), - my_position_y = GET_MY_POSITION_Y(), - my_position_z = GET_MY_POSITION_Z() ; + my_position_x = owl_htonf(GET_MY_POSITION_X()), + my_position_y = owl_htonf(GET_MY_POSITION_Y()), + my_position_z = owl_htonf(GET_MY_POSITION_Z()) ; owl_timestamp_now(&request_time) ; diff --git a/owlps-positioning/src/inputudpsocket.cc b/owlps-positioning/src/inputudpsocket.cc index e9b0be9..d2028bf 100644 --- a/owlps-positioning/src/inputudpsocket.cc +++ b/owlps-positioning/src/inputudpsocket.cc @@ -150,9 +150,9 @@ const Request& InputUDPSocket::get_next_request() calib_request->set_direction(Direction(request.direction)) ; - ReferencePoint position(request.x_position, - request.y_position, - request.z_position) ; + ReferencePoint position(owl_ntohf(request.x_position), + owl_ntohf(request.y_position), + owl_ntohf(request.z_position)) ; const ReferencePoint &reference_point = Stock::find_create_reference_point(position) ; calib_request->set_reference_point(&reference_point) ;