16#ifndef _NETSIM_MEDIUM_H_
17#define _NETSIM_MEDIUM_H_
22#ifndef _NETSIM_MDEIUM_CODE_
23#pragma comment(lib,"Medium.lib")
26 _declspec(dllexport)
void medium_add_device(NETSIM_ID d,
28 double dFrequency_MHz,
29 double dBandwidth_MHz,
30 double dRxSensitivity_dBm,
31 double dEdThreshold_dBm,
32 void(*medium_change_callback)(NETSIM_ID, NETSIM_ID,
bool, NetSim_PACKET*),
33 bool(*isRadioIdle)(NETSIM_ID, NETSIM_ID),
34 bool(*isTransmitterBusy)(NETSIM_ID, NETSIM_ID),
35 void* (*propagationinfo_find)(NETSIM_ID, NETSIM_ID, NETSIM_ID, NETSIM_ID),
36 void(*packetsentnotify)(NETSIM_ID, NETSIM_ID, NetSim_PACKET*));
38 _declspec(dllexport)
void medium_update_frequency(NETSIM_ID d, NETSIM_ID in,
double f_MHz);
39 _declspec(dllexport)
void medium_update_bandwidth(NETSIM_ID d, NETSIM_ID in,
double bw_MHz);
40 _declspec(dllexport)
void medium_update_rxsensitivity(NETSIM_ID d, NETSIM_ID in,
double p_dbm);
41 _declspec(dllexport)
void medium_update_edthershold(NETSIM_ID d, NETSIM_ID in,
double p_dbm);
42 _declspec(dllexport)
void medium_update_modulation(NETSIM_ID d, NETSIM_ID in, PHY_MODULATION m,
double coderate);
43 _declspec(dllexport)
void medium_update_datarate(NETSIM_ID d, NETSIM_ID in,
double r_mbps);
44 _declspec(dllexport)
void medium_update_MCS(NETSIM_ID d, NETSIM_ID in,
int MCS,
string Standard,
string BER_Model);
46 _declspec(dllexport)
void medium_notify_packet_send(NetSim_PACKET* packet,
52 _declspec(dllexport)
void medium_notify_packet_received(NetSim_PACKET* packet);
54 _declspec(dllexport)
bool medium_isIdle(NETSIM_ID d,
56 _declspec(dllexport)
double medium_get_interference(NetSim_PACKET* packet,
62 _declspec(dllexport)
double calculate_BER_Using_Table(PHY_MODULATION modulation,
63 double dReceivedPower_dBm,
64 double dInterferencePower_dBm,
65 double dBandwidth_MHz,
69 double GET_BER(
double sinr,
int MCS,
double dBandwidth_MHz,
string protocol);