[Aggregator] Send the capture time to Positioner
The Aggregator now transmits the capture timestamp of each packet to the positioning server. For now this timestamp is not stored, only displayed (in verbose mode) when a request is received.
This commit is contained in:
parent
b60d0d380f
commit
e98474e678
|
@ -108,6 +108,7 @@ typedef struct _owl_request_info
|
|||
{
|
||||
uint16_t packet_id ; // Number of the current packet
|
||||
uint8_t ap_mac_addr_bytes[ETHER_ADDR_LEN] ; // MAC of the listener
|
||||
owl_timestamp capture_time ; // Timestamp of arrival on the listener
|
||||
uint8_t ss_dbm ; // Signal strength measured by the listener (dBm)
|
||||
} owl_request_info ;
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ typedef struct _request_info_list
|
|||
uint16_t packet_id ;
|
||||
// MAC address of the transmitter AP (in bytes):
|
||||
uint8_t ap_mac_addr_bytes[ETHER_ADDR_LEN] ;
|
||||
// Timestamp of arrival on the listener:
|
||||
owl_timestamp capture_time ;
|
||||
// Signal strength received by the AP from the mobile:
|
||||
uint8_t ss_dbm ;
|
||||
struct _request_info_list *next ;
|
||||
|
|
|
@ -705,6 +705,8 @@ void* monitor_requests(void *NULL_value)
|
|||
memcpy(info.ap_mac_addr_bytes,
|
||||
request_info_ptr->ap_mac_addr_bytes,
|
||||
ETHER_ADDR_LEN) ;
|
||||
info.capture_time = request_info_ptr->capture_time ;
|
||||
owl_hton_timestamp(&info.capture_time) ;
|
||||
info.ss_dbm = request_info_ptr->ss_dbm ;
|
||||
sendto(sockfd, &info, sizeof(info),
|
||||
0, (struct sockaddr *)&serv, serv_len) ;
|
||||
|
@ -788,6 +790,7 @@ void got_request(owl_captured_request request)
|
|||
tmp_info->packet_id = request.packet_id ;
|
||||
memcpy(tmp_info->ap_mac_addr_bytes, request.ap_mac_addr_bytes,
|
||||
ETHER_ADDR_LEN) ;
|
||||
tmp_info->capture_time = request.capture_time ;
|
||||
tmp_info->ss_dbm = request.ss_dbm ;
|
||||
tmp_info->next = NULL ;
|
||||
|
||||
|
|
|
@ -190,6 +190,9 @@ bool InputUDPSocket::fill_current_request()
|
|||
owl_mac_bytes_to_string(request_info.ap_mac_addr_bytes)) ;
|
||||
PosUtil::to_upper(mac_ap) ;
|
||||
|
||||
owl_ntoh_timestamp(&request_info.capture_time) ;
|
||||
Timestamp capture_time(request_info.capture_time) ;
|
||||
|
||||
// Substracting 256 is not mandatory here since it is done
|
||||
// automatically when casting from unsigned to signed, but
|
||||
// I write it anyway for the sake of clarity.
|
||||
|
@ -200,6 +203,7 @@ bool InputUDPSocket::fill_current_request()
|
|||
<< "\t* Packet received from the aggregator:"
|
||||
<< "\n\t\tPacket number: " << packet_id
|
||||
<< "\n\t\tAP MAC: " << mac_ap
|
||||
<< "\n\t\tCapture timestamp: " << capture_time
|
||||
<< "\n\t\tSignal: "
|
||||
<< ss << " dBm"
|
||||
<< '\n' ;
|
||||
|
|
Loading…
Reference in New Issue