[lib] Rename antenna_signal_dbm -> ss_dbm
Use "ss" instead of "antenna_signal" in the data types declared in owlps.h. Shorter, and as meaningful.
This commit is contained in:
parent
376aa106dc
commit
aa8d11e12b
|
@ -65,7 +65,7 @@ typedef struct _owl_captured_request
|
||||||
uint8_t mobile_ip_addr_bytes[4] ; // IP of the mobile
|
uint8_t mobile_ip_addr_bytes[4] ; // IP of the mobile
|
||||||
owl_timestamp request_time ; // Request ID (timestamp on the mobile)
|
owl_timestamp request_time ; // Request ID (timestamp on the mobile)
|
||||||
owl_timestamp start_time ; // Timestamp of arrival on the listener
|
owl_timestamp start_time ; // Timestamp of arrival on the listener
|
||||||
uint8_t antenna_signal_dbm ; // Signal strength measured by the listener
|
uint8_t ss_dbm ; // Signal strength measured by the listener (dBm)
|
||||||
/* Calibration data */
|
/* Calibration data */
|
||||||
float x_position ;
|
float x_position ;
|
||||||
float y_position ;
|
float y_position ;
|
||||||
|
@ -96,7 +96,7 @@ typedef struct _owl_request
|
||||||
typedef struct _owl_request_info
|
typedef struct _owl_request_info
|
||||||
{
|
{
|
||||||
uint8_t ap_mac_addr_bytes[ETHER_ADDR_LEN] ; // MAC of the listener
|
uint8_t ap_mac_addr_bytes[ETHER_ADDR_LEN] ; // MAC of the listener
|
||||||
uint8_t antenna_signal_dbm ; // Signal strength measured by the listener
|
uint8_t ss_dbm ; // Signal strength measured by the listener (dBm)
|
||||||
} owl_request_info ;
|
} owl_request_info ;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@
|
||||||
/* Linked list storing data of each request */
|
/* Linked list storing data of each request */
|
||||||
typedef struct _request_info_list
|
typedef struct _request_info_list
|
||||||
{
|
{
|
||||||
// MAC address of the data sender (in bytes):
|
// MAC address of the transmitter AP (in bytes):
|
||||||
uint8_t ap_mac_addr_bytes[ETHER_ADDR_LEN] ;
|
uint8_t ap_mac_addr_bytes[ETHER_ADDR_LEN] ;
|
||||||
// Signal strength received by the AP from the mobile:
|
// Signal strength received by the AP from the mobile:
|
||||||
uint8_t antenna_signal_dbm ;
|
uint8_t ss_dbm ;
|
||||||
struct _request_info_list *next ;
|
struct _request_info_list *next ;
|
||||||
} request_info_list ;
|
} request_info_list ;
|
||||||
|
|
||||||
|
|
|
@ -514,7 +514,7 @@ int read_loop(int sockfd)
|
||||||
mobile_ip_str,
|
mobile_ip_str,
|
||||||
request_time_str,
|
request_time_str,
|
||||||
start_time_str,
|
start_time_str,
|
||||||
request.antenna_signal_dbm - 0x100,
|
request.ss_dbm - 0x100,
|
||||||
request.x_position,
|
request.x_position,
|
||||||
request.y_position,
|
request.y_position,
|
||||||
request.z_position,
|
request.z_position,
|
||||||
|
@ -664,8 +664,8 @@ void* monitor_requests(void *NULL_value)
|
||||||
memcpy(info.ap_mac_addr_bytes,
|
memcpy(info.ap_mac_addr_bytes,
|
||||||
request_info_ptr->ap_mac_addr_bytes,
|
request_info_ptr->ap_mac_addr_bytes,
|
||||||
ETHER_ADDR_LEN) ;
|
ETHER_ADDR_LEN) ;
|
||||||
info.antenna_signal_dbm =
|
info.ss_dbm =
|
||||||
request_info_ptr->antenna_signal_dbm - 0x100 ;
|
request_info_ptr->ss_dbm - 0x100 ;
|
||||||
sendto(sockfd, &info, sizeof(info),
|
sendto(sockfd, &info, sizeof(info),
|
||||||
0, (struct sockaddr *)&serv, serv_len) ;
|
0, (struct sockaddr *)&serv, serv_len) ;
|
||||||
|
|
||||||
|
@ -673,9 +673,9 @@ void* monitor_requests(void *NULL_value)
|
||||||
owl_mac_bytes_to_string_r(request_info_ptr->
|
owl_mac_bytes_to_string_r(request_info_ptr->
|
||||||
ap_mac_addr_bytes,
|
ap_mac_addr_bytes,
|
||||||
mac_str) ;
|
mac_str) ;
|
||||||
fprintf(fd, ";%s;%d", mac_str,
|
fprintf(fd, ";%s;%d",
|
||||||
request_info_ptr->antenna_signal_dbm
|
mac_str,
|
||||||
- 0x100) ;
|
request_info_ptr->ss_dbm - 0x100) ;
|
||||||
|
|
||||||
// Delete request
|
// Delete request
|
||||||
request_info_ptr = request_info_ptr->next ;
|
request_info_ptr = request_info_ptr->next ;
|
||||||
|
@ -746,7 +746,7 @@ void got_request(owl_captured_request request)
|
||||||
tmp_info = malloc(sizeof(request_info_list)) ;
|
tmp_info = malloc(sizeof(request_info_list)) ;
|
||||||
memcpy(tmp_info->ap_mac_addr_bytes, request.ap_mac_addr_bytes,
|
memcpy(tmp_info->ap_mac_addr_bytes, request.ap_mac_addr_bytes,
|
||||||
ETHER_ADDR_LEN) ;
|
ETHER_ADDR_LEN) ;
|
||||||
tmp_info->antenna_signal_dbm = request.antenna_signal_dbm ;
|
tmp_info->ss_dbm = request.ss_dbm ;
|
||||||
tmp_info->next = NULL ;
|
tmp_info->next = NULL ;
|
||||||
|
|
||||||
/* Add it in the list */
|
/* Add it in the list */
|
||||||
|
@ -1297,7 +1297,7 @@ void print_request_info(request_info_list *info)
|
||||||
"\tAP MAC: %s\n"
|
"\tAP MAC: %s\n"
|
||||||
"\tSignal strength: %d dBm\n",
|
"\tSignal strength: %d dBm\n",
|
||||||
ap_mac_str,
|
ap_mac_str,
|
||||||
info->antenna_signal_dbm - 0x100
|
info->ss_dbm - 0x100
|
||||||
) ;
|
) ;
|
||||||
}
|
}
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
|
@ -1056,7 +1056,7 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
||||||
request_time_str,
|
request_time_str,
|
||||||
start_time_str,
|
start_time_str,
|
||||||
rtap_fields[RTAP_ANTENNASIGNALDBM] ?
|
rtap_fields[RTAP_ANTENNASIGNALDBM] ?
|
||||||
request.antenna_signal_dbm - 0x100 : 0,
|
request.ss_dbm - 0x100 : 0,
|
||||||
owl_ntohf(request.x_position),
|
owl_ntohf(request.x_position),
|
||||||
owl_ntohf(request.y_position),
|
owl_ntohf(request.y_position),
|
||||||
owl_ntohf(request.z_position),
|
owl_ntohf(request.z_position),
|
||||||
|
@ -1147,12 +1147,12 @@ void extract_radiotap_data(const u_char *packet,
|
||||||
rtap_position += RTAP_L_FHSS ;
|
rtap_position += RTAP_L_FHSS ;
|
||||||
break ;
|
break ;
|
||||||
case RTAP_ANTENNASIGNALDBM:
|
case RTAP_ANTENNASIGNALDBM:
|
||||||
memcpy(&request->antenna_signal_dbm,
|
memcpy(&request->ss_dbm,
|
||||||
&packet[rtap_position], RTAP_L_ANTENNASIGNALDBM) ;
|
&packet[rtap_position], RTAP_L_ANTENNASIGNALDBM) ;
|
||||||
rtap_fields[RTAP_ANTENNASIGNALDBM] = owl_true;
|
rtap_fields[RTAP_ANTENNASIGNALDBM] = owl_true;
|
||||||
if (VERBOSE_INFO)
|
if (VERBOSE_INFO)
|
||||||
printf("Antenna signal: %d dBm\n",
|
printf("Antenna signal: %d dBm\n",
|
||||||
request->antenna_signal_dbm - 0x100);
|
request->ss_dbm - 0x100);
|
||||||
rtap_position += RTAP_L_ANTENNASIGNALDBM ;
|
rtap_position += RTAP_L_ANTENNASIGNALDBM ;
|
||||||
break ;
|
break ;
|
||||||
case RTAP_ANTENNANOISEDBM:
|
case RTAP_ANTENNANOISEDBM:
|
||||||
|
|
|
@ -167,7 +167,7 @@ bool InputUDPSocket::fill_current_request()
|
||||||
// Substracting 256 is not mandatory here since it is done
|
// Substracting 256 is not mandatory here since it is done
|
||||||
// automatically when casting from unsigned to signed, but
|
// automatically when casting from unsigned to signed, but
|
||||||
// I write it anyway for the sake of clarity.
|
// I write it anyway for the sake of clarity.
|
||||||
int_fast8_t ss = request_info.antenna_signal_dbm - 0x100 ;
|
int_fast8_t ss = request_info.ss_dbm - 0x100 ;
|
||||||
|
|
||||||
if (Configuration::is_configured("verbose"))
|
if (Configuration::is_configured("verbose"))
|
||||||
cout
|
cout
|
||||||
|
|
Loading…
Reference in New Issue