[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:
Matteo Cypriani 2011-12-30 17:02:53 +01:00
parent 376aa106dc
commit aa8d11e12b
5 changed files with 16 additions and 16 deletions

View File

@ -65,7 +65,7 @@ typedef struct _owl_captured_request
uint8_t mobile_ip_addr_bytes[4] ; // IP of the mobile
owl_timestamp request_time ; // Request ID (timestamp on the mobile)
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 */
float x_position ;
float y_position ;
@ -96,7 +96,7 @@ typedef struct _owl_request
typedef struct _owl_request_info
{
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 ;

View File

@ -30,10 +30,10 @@
/* Linked list storing data of each request */
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] ;
// Signal strength received by the AP from the mobile:
uint8_t antenna_signal_dbm ;
uint8_t ss_dbm ;
struct _request_info_list *next ;
} request_info_list ;

View File

@ -514,7 +514,7 @@ int read_loop(int sockfd)
mobile_ip_str,
request_time_str,
start_time_str,
request.antenna_signal_dbm - 0x100,
request.ss_dbm - 0x100,
request.x_position,
request.y_position,
request.z_position,
@ -664,8 +664,8 @@ void* monitor_requests(void *NULL_value)
memcpy(info.ap_mac_addr_bytes,
request_info_ptr->ap_mac_addr_bytes,
ETHER_ADDR_LEN) ;
info.antenna_signal_dbm =
request_info_ptr->antenna_signal_dbm - 0x100 ;
info.ss_dbm =
request_info_ptr->ss_dbm - 0x100 ;
sendto(sockfd, &info, sizeof(info),
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->
ap_mac_addr_bytes,
mac_str) ;
fprintf(fd, ";%s;%d", mac_str,
request_info_ptr->antenna_signal_dbm
- 0x100) ;
fprintf(fd, ";%s;%d",
mac_str,
request_info_ptr->ss_dbm - 0x100) ;
// Delete request
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)) ;
memcpy(tmp_info->ap_mac_addr_bytes, request.ap_mac_addr_bytes,
ETHER_ADDR_LEN) ;
tmp_info->antenna_signal_dbm = request.antenna_signal_dbm ;
tmp_info->ss_dbm = request.ss_dbm ;
tmp_info->next = NULL ;
/* Add it in the list */
@ -1297,7 +1297,7 @@ void print_request_info(request_info_list *info)
"\tAP MAC: %s\n"
"\tSignal strength: %d dBm\n",
ap_mac_str,
info->antenna_signal_dbm - 0x100
info->ss_dbm - 0x100
) ;
}
#endif // NDEBUG

View File

@ -1056,7 +1056,7 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
request_time_str,
start_time_str,
rtap_fields[RTAP_ANTENNASIGNALDBM] ?
request.antenna_signal_dbm - 0x100 : 0,
request.ss_dbm - 0x100 : 0,
owl_ntohf(request.x_position),
owl_ntohf(request.y_position),
owl_ntohf(request.z_position),
@ -1147,12 +1147,12 @@ void extract_radiotap_data(const u_char *packet,
rtap_position += RTAP_L_FHSS ;
break ;
case RTAP_ANTENNASIGNALDBM:
memcpy(&request->antenna_signal_dbm,
memcpy(&request->ss_dbm,
&packet[rtap_position], RTAP_L_ANTENNASIGNALDBM) ;
rtap_fields[RTAP_ANTENNASIGNALDBM] = owl_true;
if (VERBOSE_INFO)
printf("Antenna signal: %d dBm\n",
request->antenna_signal_dbm - 0x100);
request->ss_dbm - 0x100);
rtap_position += RTAP_L_ANTENNASIGNALDBM ;
break ;
case RTAP_ANTENNANOISEDBM:

View File

@ -167,7 +167,7 @@ bool InputUDPSocket::fill_current_request()
// 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.
int_fast8_t ss = request_info.antenna_signal_dbm - 0x100 ;
int_fast8_t ss = request_info.ss_dbm - 0x100 ;
if (Configuration::is_configured("verbose"))
cout