NetSim Source Code Help v14.4
All 13 Components
 
Loading...
Searching...
No Matches
CDMA.c
1/************************************************************************************
2 * Copyright (C) 2023 *
3 * TETCOS, Bangalore. India *
4 * *
5 * Tetcos owns the intellectual property rights in the Product and its content. *
6 * The copying, redistribution, reselling or publication of any or all of the *
7 * Product or its content without express prior written consent of Tetcos is *
8 * prohibited. Ownership and / or any other right relating to the software and all *
9 * intellectual property rights therein shall remain at all times with Tetcos. *
10 * *
11 * Author: Shashi Kant Suman *
12 * *
13 * ---------------------------------------------------------------------------------*/
14#include "main.h"
15#include "Cellular.h"
16#include "CDMA.h"
17#include "AdvancedPlots.h"
18#pragma comment(lib,"AdvancedPlots.lib")
19/** This function is used to initialize the CDMA parameters in a network */
20_declspec(dllexport) int fn_NetSim_CDMA_Init(struct stru_NetSim_Network *NETWORK_Formal,
21 NetSim_EVENTDETAILS *pstruEventDetails_Formal,
22 char *pszAppPath_Formal,
23 char *pszWritePath_Formal,
24 int nVersion_Type,
25 void **fnPointer)
26{
27 init_linkpacketlog();
28 return fn_NetSim_CDMA_Init_F(NETWORK_Formal,
29 pstruEventDetails_Formal,
30 pszAppPath_Formal,
31 pszWritePath_Formal,
32 nVersion_Type,
33 fnPointer);
34}
35/** This function is called by the NetworkStack.dll, while configuring the Network for CDMA protocol */
36_declspec(dllexport) int fn_NetSim_CDMA_Configure(void** var)
37{
38 return fn_NetSim_CDMA_Configure_F(var);
39}
40/**
41This function is called by NetworkStack.dll, which inturn calls the Cellular run function
42which is present in Cellular.c
43 */
44_declspec (dllexport) int fn_NetSim_CDMA_Run()
45{
46 return fn_NetSim_Cellular_Run();
47}
48/**
49This function is called by NetworkStack.dll, while writing the event trace
50to get the sub event as a string.
51*/
52_declspec (dllexport) char *fn_NetSim_CDMA_Trace(int nSubEvent)
53{
54 switch(nSubEvent%100)
55 {
56 case Subevent_DropCall:
57 return "DropCall";
58 case Subevent_TxNextBurst:
59 return "TxNextBurst";
60 default:
61 return "CDMA_UnknownEvent";
62 }
63}
64/**
65 This function is called by NetworkStack.dll, to free the CDMA protocol control packets.
66*/
67_declspec(dllexport) int fn_NetSim_CDMA_FreePacket(NetSim_PACKET* pstruPacket)
68{
69 return fn_NetSim_Cellular_FreePacket(pstruPacket);
70}
71/**
72 This function is called by NetworkStack.dll, to copy the CDMA protocol
73 related information to a new packet
74*/
75_declspec(dllexport) int fn_NetSim_CDMA_CopyPacket(NetSim_PACKET* pstruDestPacket,NetSim_PACKET* pstruSrcPacket)
76{
77 return fn_NetSim_Cellular_CopyPacket(pstruDestPacket,pstruSrcPacket);
78}
79/**
80 This function writes the CDMA metrics in Metrics.txt
81*/
82_declspec(dllexport) int fn_NetSim_CDMA_Metrics(char* szMetrics)
83{
84 return fn_NetSim_CDMA_Metrics_F(szMetrics);
85}
86/**
87 This function is used to configure the packet trace
88*/
89_declspec(dllexport) char* fn_NetSim_CDMA_ConfigPacketTrace()
90{
91 return "";
92}
93/**
94 This function is used to write the packet trace
95*/
96_declspec(dllexport) int fn_NetSim_CDMA_WritePacketTrace(NetSim_PACKET* pstruPacket, char** ppszTrace)
97{
98 return 1;
99}
100/**
101This function is called by NetworkStack.dll, once simulation ends, to free the
102allocated memory for the network.
103*/
104_declspec(dllexport) int fn_NetSim_CDMA_Finish()
105{
106 LinkPacketLog_close();
107 return 1;
108}