NetSim Source Code Help
Loading...
Searching...
No Matches
Medium.h
Go to the documentation of this file.
1#pragma once
2/************************************************************************************
3* Copyright (C) 2020 *
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
46 NETSIM_ID txId,
47 NETSIM_ID txIf,
48 NETSIM_ID rxId,
49 NETSIM_ID rxIf);
50
52
53 _declspec(dllexport) bool medium_isIdle(NETSIM_ID d,
54 NETSIM_ID in);
55
56#ifdef __cplusplus
57}
58#endif
59#endif //_NETSIM_MEDIUM_H_
unsigned int NETSIM_ID
Definition: Animation.h:45
#define _declspec(dllexport)
This function is used to trigger the update.
Definition: Linux.h:41
void medium_update_edthershold(NETSIM_ID d, NETSIM_ID in, double p_dbm)
Definition: Medium.c:204
void medium_update_rxsensitivity(NETSIM_ID d, NETSIM_ID in, double p_dbm)
Definition: Medium.c:192
bool medium_isIdle(NETSIM_ID d, NETSIM_ID in)
Definition: Medium.c:560
void medium_notify_packet_received(NetSim_PACKET *packet)
Definition: Medium.c:551
void medium_update_bandwidth(NETSIM_ID d, NETSIM_ID in, double bw_MHz)
Definition: Medium.c:180
void medium_update_datarate(NETSIM_ID d, NETSIM_ID in, double r_mbps)
Definition: Medium.c:229
void medium_update_frequency(NETSIM_ID d, NETSIM_ID in, double f_MHz)
Definition: Medium.c:168
void medium_update_modulation(NETSIM_ID d, NETSIM_ID in, PHY_MODULATION m, double coderate)
Definition: Medium.c:216
void medium_add_device(NETSIM_ID d, NETSIM_ID ifid, double dFrequency_MHz, double dBandwidth_MHz, double dRxSensitivity_dBm, double dEdThreshold_dBm, void(*medium_change_callback)(NETSIM_ID, NETSIM_ID, bool, NetSim_PACKET *), bool(*isRadioIdle)(NETSIM_ID, NETSIM_ID), bool(*isTransmitterBusy)(NETSIM_ID, NETSIM_ID), void *(*propagationinfo_find)(NETSIM_ID, NETSIM_ID, NETSIM_ID, NETSIM_ID), void(*packetsentnotify)(NETSIM_ID, NETSIM_ID, NetSim_PACKET *))
Definition: Medium.c:135
void medium_notify_packet_send(NetSim_PACKET *packet, NETSIM_ID txId, NETSIM_ID txIf, NETSIM_ID rxId, NETSIM_ID rxIf)
Definition: Medium.c:538
enum enum_Modulation PHY_MODULATION