NetSim Source Code Help v14.4
All 13 Components
 
Loading...
Searching...
No Matches
Medium.h
1#pragma once
2/************************************************************************************
3* Copyright (C) 2023 *
4* TETCOS, Bangalore. India *
5* *
6* Tetcos owns the intellectual property rights in the Product and its content. *
7* The copying, redistribution, reselling or publication of any or all of the *
8* Product or its content without express prior written consent of Tetcos is *
9* prohibited. Ownership and / or any other right relating to the software and all *
10* intellectual property rights therein shall remain at all times with Tetcos. *
11* *
12* Author: Shashi Kant Suman *
13* *
14* ---------------------------------------------------------------------------------*/
15
16#ifndef _NETSIM_MEDIUM_H_
17#define _NETSIM_MEDIUM_H_
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22#ifndef _NETSIM_MDEIUM_CODE_
23#pragma comment(lib,"Medium.lib")
24#endif
25
26 _declspec(dllexport) void medium_add_device(NETSIM_ID d,
27 NETSIM_ID ifid,
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*));
37
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);
45
46 _declspec(dllexport) void medium_notify_packet_send(NetSim_PACKET* packet,
47 NETSIM_ID txId,
48 NETSIM_ID txIf,
49 NETSIM_ID rxId,
50 NETSIM_ID rxIf);
51
52 _declspec(dllexport) void medium_notify_packet_received(NetSim_PACKET* packet);
53
54 _declspec(dllexport) bool medium_isIdle(NETSIM_ID d,
55 NETSIM_ID in);
56 _declspec(dllexport) double medium_get_interference(NetSim_PACKET* packet,
57 NETSIM_ID txId,
58 NETSIM_ID txIf,
59 NETSIM_ID rxId,
60 NETSIM_ID rxIf);
61
62 _declspec(dllexport) double calculate_BER_Using_Table(PHY_MODULATION modulation,
63 double dReceivedPower_dBm,
64 double dInterferencePower_dBm,
65 double dBandwidth_MHz,
66 int MCS,
67 string Protocol);
68
69 double GET_BER(double sinr, int MCS, double dBandwidth_MHz, string protocol);
70#ifdef __cplusplus
71}
72#endif
73#endif //_NETSIM_MEDIUM_H_