#define _CRT_SECURE_NO_WARNINGS
/* -------------------------------------------------------------------------- /
/ — DEPENDANCIES --------------------------------------------------------- */
#include
#include <winsock2.h>
#include <ws2tcpip.h>
#include<stdio.h>
using namespace std;
#pragma comment(lib,“Ws2_32.lib”)
/* -------------------------------------------------------------------------- /
/ — PRIVATE MACROS ------------------------------------------------------- */
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
/* -------------------------------------------------------------------------- /
/ — PRIVATE CONSTANTS ---------------------------------------------------- */
#define PROTOCOL_VERSION 1
#define PKT_PUSH_DATA 0
#define PKT_PUSH_ACK 1
#define PKT_PULL_DATA 2
#define PKT_PULL_RESP 3
#define PKT_PULL_ACK 4
/-----------------------------------STRUCT-----------------------------------/
/----------------------------------------------------------------------------/
/*
@struct lgw_pkt_rx_s
@brief Structure containing the metadata of a packet that was received and a pointer to the payload
/
struct lgw_pkt_rx_s {
uint32_t freq_hz; /!> central frequency of the IF chain /
uint8_t if_chain; /!> by which IF chain was packet received /
uint8_t status; /!> status of the received packet /
uint32_t count_us; /!> internal concentrator counter for timestamping, 1 microsecond resolution /
uint8_t rf_chain; /!> through which RF chain the packet was received /
uint8_t