[lib] Rename PACKET_TYPE_* -> OWL_REQUEST_*
This commit is contained in:
parent
1e1023e6b5
commit
204750b8c5
|
@ -130,9 +130,9 @@ typedef struct _owl_autocalibration_order
|
|||
|
||||
|
||||
/* Positioning request types */
|
||||
#define PACKET_TYPE_NORMAL 0
|
||||
#define PACKET_TYPE_CALIBRATION 1
|
||||
#define PACKET_TYPE_AUTOCALIBRATION 2
|
||||
#define OWL_REQUEST_NORMAL 0
|
||||
#define OWL_REQUEST_CALIBRATION 1
|
||||
#define OWL_REQUEST_AUTOCALIBRATION 2
|
||||
|
||||
|
||||
/* Wi-Fi channel frequencies in Hz */
|
||||
|
|
|
@ -331,7 +331,7 @@ void make_packet()
|
|||
sizeof(uint8_t) * 2 + sizeof(owl_timestamp) + sizeof(float) * 3 ;
|
||||
packet = malloc(packet_size) ;
|
||||
|
||||
memset(&packet[offset], PACKET_TYPE_CALIBRATION, 1) ; // Packet type
|
||||
memset(&packet[offset], OWL_REQUEST_CALIBRATION, 1) ; // Packet type
|
||||
++offset ;
|
||||
memcpy(&packet[offset], &request_time, sizeof(request_time)) ;
|
||||
offset += sizeof(request_time) ;
|
||||
|
@ -352,7 +352,7 @@ void make_packet()
|
|||
printf("Preparing request packet…\n") ;
|
||||
packet_size = sizeof(uint8_t) + sizeof(owl_timestamp) ;
|
||||
packet = malloc(packet_size) ;
|
||||
memset(&packet[0], PACKET_TYPE_NORMAL, 1) ; // Packet type
|
||||
memset(&packet[0], OWL_REQUEST_NORMAL, 1) ; // Packet type
|
||||
memcpy(&packet[1], &request_time, sizeof(request_time)) ;
|
||||
}
|
||||
|
||||
|
|
|
@ -758,12 +758,12 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
|||
+ sizeof(struct iphdr) + sizeof(struct udphdr)] ;
|
||||
switch(packet_type)
|
||||
{
|
||||
case PACKET_TYPE_NORMAL :
|
||||
case OWL_REQUEST_NORMAL :
|
||||
if (GET_VERBOSE())
|
||||
printf("\nExplicit packet received.\n") ;
|
||||
break ;
|
||||
|
||||
case PACKET_TYPE_CALIBRATION :
|
||||
case OWL_REQUEST_CALIBRATION :
|
||||
if (GET_VERBOSE())
|
||||
printf("\nExplicit calibration packet received.\n") ;
|
||||
request.direction =
|
||||
|
@ -783,7 +783,7 @@ void read_packet(u_char *args, const struct pcap_pkthdr *header,
|
|||
+ sizeof(struct udphdr) + 18], sizeof(float)) ;
|
||||
break ;
|
||||
|
||||
case PACKET_TYPE_AUTOCALIBRATION :
|
||||
case OWL_REQUEST_AUTOCALIBRATION :
|
||||
if (GET_VERBOSE())
|
||||
{
|
||||
printf("\nAutocalibration packet received.") ;
|
||||
|
@ -1160,7 +1160,7 @@ uint_fast16_t make_packet(uint8_t **packet)
|
|||
size = sizeof(char) + sizeof(owl_timestamp) ;
|
||||
pkt = malloc(size) ;
|
||||
|
||||
memset(&pkt[0], PACKET_TYPE_AUTOCALIBRATION, 1) ; // Packet type
|
||||
memset(&pkt[0], OWL_REQUEST_AUTOCALIBRATION, 1) ; // Packet type
|
||||
memcpy(&pkt[1], &request_time, sizeof(request_time)) ;
|
||||
|
||||
*packet = pkt ;
|
||||
|
|
Loading…
Reference in New Issue