88 fnNetSimError(
"Unknown modulation %s for P2P protocol. Assigning QPSK\n", val);
138 xmlNetSimNode = var[2];
139 if (!strcmp(tag,
"PROTOCOL_PROPERTY"))
174 fnNetSimError(
"%d layer is not implemented for P2P protocol\n", nLayerType);
204 if (
DEVICE(i + 1) == NULL)
continue;
205 for (
int j = 0; j <
DEVICE(i + 1)->nNumOfInterface; j++)
226 return GetStringP2P_Subevent(nSubEvent);
286 Txinfo->
d0 = txphy->
d0;
291 if (dFrequency1 > dFrequency2)
293 if ((dFrequency1 - dFrequency2) >= bandwidth)
300 if ((dFrequency2 - dFrequency1) >= bandwidth)
334 for (ti = 0; ti <
DEVICE(t + 1)->nNumOfInterface; ti++)
342 for (ri = 0; ri <
DEVICE(r + 1)->nNumOfInterface; ri++)
367 subevent = P2P_LINK_UP;
369 subevent = P2P_LINK_DOWN;
371 memset(&pevent, 0,
sizeof pevent);
404 memset(&pevent, 0,
sizeof pevent);
408 for (i = 0; i <
DEVICE(d + 1)->nNumOfInterface; i++)
enum enum_802_22_Modulation MODULATION_TECHNIQUE
#define _declspec(dllexport)
This function is used to trigger the update.
#define fnNetSimError(x,...)
static int fn_NetSim_P2P_CalulateReceivedPower()
int fn_NetSim_P2P_LinkStateChanged(NETSIM_ID linkId, LINK_STATE newState)
static bool check_interference(NETSIM_ID t, NETSIM_ID ti, NETSIM_ID r, NETSIM_ID ri)
int fn_NetSim_P2P_Finish()
int fn_NetSim_P2P_FreePacket(NetSim_PACKET *pstruPacket)
int fn_NetSim_P2P_Init(struct stru_NetSim_Network *NETWORK_Formal, NetSim_EVENTDETAILS *pstruEventDetails_Formal, char *pszAppPath_Formal, char *pszWritePath_Formal, int nVersion_Type, void **fnPointer)
char * fn_NetSim_P2P_Trace(int nSubEvent)
static void configure_wireless_P2P(NETSIM_ID d, NETSIM_ID in, void *xmlNetSimNode)
int fn_NetSim_P2P_CopyPacket(NetSim_PACKET *pstruDestPacket, NetSim_PACKET *pstruSrcPacket)
static void add_event_link_up()
int fn_NetSim_P2P_Configure(void **var)
char * fn_NetSim_P2P_ConfigPacketTrace(const void *xmlNetSimNode)
static void p2p_gettxinfo(NETSIM_ID nTxId, NETSIM_ID nTxInterface, NETSIM_ID nRxId, NETSIM_ID nRxInterface, PTX_INFO Txinfo)
int fn_NetSim_P2P_Metrics(PMETRICSWRITER metricsWriter)
static bool CheckFrequencyInterfrence(double dFrequency1, double dFrequency2, double bandwidth)
PHY_MODULATION getModulationFromString(char *val)
int fn_NetSim_P2P_WritePacketTrace(NetSim_PACKET *pstruPacket, char **ppszTrace)
static int p2p_CalculateReceivedPower(NETSIM_ID tx, NETSIM_ID txi, NETSIM_ID rx, NETSIM_ID rxi)
struct stru_p2p_node_mac * ptrP2P_NODE_MAC
#define P2P_TX_POWER_DEFAULT
#define isP2PWireless(d, i)
#define P2P_BANDWIDTH_DEFAULT
#define P2P_DATA_RATE_DEFAULT
PROPAGATION_HANDLE propagationHandle
struct stru_P2P_NODE_PHY * ptrP2P_NODE_PHY
#define P2P_RECEIVER_SENSITIVITY_DBM_DEFAULT
#define P2P_MAC(devid, ifid)
#define P2P_PHY(devid, ifid)
#define isP2PConfigured(d, i)
#define P2P_CENTRAL_FREQUENCY_DEFAULT
#define get_tx_info(h, t, ti, r, ri)
PROPAGATION_HANDLE propagation_init(MAC_LAYER_PROTOCOL protocol, __CALLBACK__ check_protocol_configure check, __CALLBACK__ fnGetTxInfo fnpGetTxInfo, __CALLBACK__ fnCheckInterface checkInterference)
#define propagation_calculate_received_power(h, t, ti, r, ri, time)
NetSim_EVENTDETAILS * pstruEventDetails_Formal
NetSim_EVENTDETAILS char * pszAppPath_Formal
NetSim_EVENTDETAILS char char int nVersion_Type
NetSim_EVENTDETAILS char char * pszWritePath_Formal
NetSim_EVENTDETAILS char char int void ** fnPointer
void notify_interface_down(NETSIM_ID d, NETSIM_ID in)
PNETSIM_MACADDRESS STR_TO_MAC(char *mac)
double fn_NetSim_Config_read_Frequency(void *xmlNetSimNode, const char *name, double defaultval, const char *returnUnit)
#define DEVICE_PHYVAR(DeviceId, InterfaceId)
#define DEVICE_MACLAYER(DeviceId, InterfaceId)
char * fn_NetSim_xmlConfig_GetVal(void *xmlNetSimNode, const char *szName, int flag)
#define getXmlVar(var, name, xmlNode, flag, type, protocol)
#define DEVICE_TYPE(DeviceId)
double fn_NetSim_Config_read_txPower(void *xmlNetSimNode, const char *name, double defaultTxPower, const char *returnUnit)
#define DEVICE_MACPROTOCOL(DeviceId, InterfaceId)
#define DEVICE_DISTANCE(d1, d2)
int fn_NetSim_Link_RegisterLinkFailureCallback(NETSIM_ID linkId, int(*fnLinkCallBack)(NETSIM_ID, LINK_STATE))
EXPORTED struct stru_NetSim_Network * NETWORK
double fn_NetSim_Config_read_dataRate(void *xmlNetSimNode, const char *name, double defaultDataRate, const char *returnUnit)
void notify_interface_up(NETSIM_ID d, NETSIM_ID in)
#define DEVICE_MACVAR(DeviceId, InterfaceId)
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
#define DEVICE_INTERFACE(DeviceId, InterfaceId)
#define DEVICE_PHYLAYER(DeviceId, InterfaceId)
enum enum_Modulation PHY_MODULATION
enum enum_LayerType LAYER_TYPE
#define fnpAddEvent(pstruEvent)
netsimDEVICE_TYPE nDeviceType
NETSIM_ID nSecondInterfaceId
NETSIM_ID nFirstInterfaceId
NETSIM_ID nSecondDeviceId
union stru_NetSim_Links::uni_NetSim_Link_DeviceList puniDevList
struct stru_NetSim_Links ** ppstruNetSimLinks
PHY_MODULATION modulation
double dReceiverSensitivity
double dCenteralFrequency
struct stru_NetSim_Links::uni_NetSim_Link_DeviceList::stru_NetSim_P2P pstruP2P