From aa8d11e12b97935b1b02bfa4bd32254110ca197e Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Fri, 30 Dec 2011 17:02:53 +0100 Subject: [PATCH] [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. --- libowlps/owlps.h | 4 ++-- owlps-aggregator/owlps-aggregator.h | 4 ++-- owlps-aggregator/owlps-aggregatord.c | 16 ++++++++-------- owlps-listener/owlps-listenerd.c | 6 +++--- owlps-positioning/src/inputudpsocket.cc | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libowlps/owlps.h b/libowlps/owlps.h index fe918b4..410adfa 100644 --- a/libowlps/owlps.h +++ b/libowlps/owlps.h @@ -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 ; diff --git a/owlps-aggregator/owlps-aggregator.h b/owlps-aggregator/owlps-aggregator.h index 4abd099..b1c4c92 100644 --- a/owlps-aggregator/owlps-aggregator.h +++ b/owlps-aggregator/owlps-aggregator.h @@ -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 ; diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 979f683..0a203c0 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -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 diff --git a/owlps-listener/owlps-listenerd.c b/owlps-listener/owlps-listenerd.c index 5e9e271..4115ccc 100644 --- a/owlps-listener/owlps-listenerd.c +++ b/owlps-listener/owlps-listenerd.c @@ -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: diff --git a/owlps-positioning/src/inputudpsocket.cc b/owlps-positioning/src/inputudpsocket.cc index 5a0aaa1..0406820 100644 --- a/owlps-positioning/src/inputudpsocket.cc +++ b/owlps-positioning/src/inputudpsocket.cc @@ -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