NetSim Source Code Help v14.4
All 13 Components
 
Loading...
Searching...
No Matches
Component 11/Satellite/Satellite_Frame.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* This source code is licensed per the NetSim license agreement. *
13* *
14* No portion of this source code may be used as the basis for a derivative work, *
15* or used, for any purpose other than its intended use per the NetSim license *
16* agreement. *
17* *
18* This source code and the algorithms contained within it are confidential trade *
19* secrets of TETCOS and may not be used as the basis for any other software, *
20* hardware, product or service. *
21* *
22* Author: Shashi Kant Suman *
23* *
24* ----------------------------------------------------------------------------------*/
25#ifndef _NETSIM_SATELLITE_FRAME_H_
26#define _NETSIM_SATELLITE_FRAME_H_
27
28#include "Satellite.h"
29#include "Satellite_Buffer.h"
30#include "ErrorModel.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36 typedef struct stru_tdma_slot_conf
37 {
38 UINT symbolPerSlot;
39 UINT modulationBits;
40 UINT symbolRate;
41
42 double slotLength_us;
43 UINT bitsPerSlot;
44 }SLOTCONF,*ptrSLOTCONF;
45
46 typedef enum enum_frame_usage_mode
47 {
48 FRUSAGE_NORMAL,
49 FRUSAGE_SHORT,
50 }FRAMEUSAGEMODE;
51
52 typedef struct stru_tdma_frame_conf
53 {
54 UINT slotCountInFrame;
55 double frameBandwidth_Hz;
56
57 UINT pilotBlockSize_inSymbols;
58 UINT pilotBlockInterval_inSlots;
59 UINT plHdrSize_inSlots;
60 UINT frameHdrLength_inBytes;
61 FRAMEUSAGEMODE usageMode;
62
63 double frameLength_us;
64 double pilotBlockLength_us;
65 UINT bitsPerFrame;
66 UINT framesPerSuperframe;
67 }FRAMECONF, * ptrFRAMECONF;
68
69 typedef struct stru_tdma_frame
70 {
71 UINT frameId;
72 double bandwidth_Hz;
73 bool isRandomAccess;
74
75 UINT carrierId;
76
77 double relativeFrameStartTime;
78 double relativeFrameEndTime;
79
80 double frameStartTime;
81 double frameEndTime;
82
83 NetSim_PACKET* head;
84 NetSim_PACKET* tail;
85 }FRAME, * ptrFRAME;
86
87 typedef enum enum_ber_model
88 {
89 BERMODEL_Fixed,
90 BERMODEL_File,
91 BERMODEL_Model,
92 }BERMODEL;
93
95 {
96 double allocatedBandwidth_Hz;
97 double occupiedBandwidth_Hz;
98 double effectiveBandwidth_Hz;
99 double rollOffFactor;
100 double spacingFactor;
101
102 BERMODEL berModel;
103 double berValue;
104 size_t berTableLen;
105 ptrBER berTable;
106 char* berFile;
107
108 PHY_MODULATION modulation;
109 double codingRate;
110 }CARRIERCONF, * ptrCARRIERCONF;
111
112 typedef struct stru_tdma_carrier
113 {
114 UINT carrierId;
115 double centerFrequency_Hz;
116 double bandwidth_Hz;
117
118 UINT frameCount;
119 ptrFRAME* frames;
120 }CARRIER, * ptrCARRIER;
121
122 typedef enum
123 {
124 SUPER_FRAME_CONFIG_0, //!< SUPER_FRAME_CONFIG_0
125 SUPER_FRAME_CONFIG_1, //!< SUPER_FRAME_CONFIG_1
126 SUPER_FRAME_CONFIG_2, //!< SUPER_FRAME_CONFIG_2
127 SUPER_FRAME_CONFIG_3, //!< SUPER_FRAME_CONFIG_3
128 } SuperFrameConfiguration_t;
129
130 typedef struct stru_tdma_superframe
131 {
132 SuperFrameConfiguration_t superFrameConfigType; //???
133 UINT superFrameId;
134 LINKTYPE linkType;
135
136 double bandwidth_Hz;
137 double baseFreqnecy_Hz;
138 double centralFrequency_Hz;
139 char* band;
140 char* accessProtocol;
141 double superFrameDuration_us;
142
143 ptrSLOTCONF slotConfig;
144 ptrCARRIERCONF carrierConfig;
145 ptrFRAMECONF frameConfig;
146
147 UINT carrierCount;
148 ptrCARRIER* carriers;
149
150 double startTime_us;
151 double endTime_us;
152
153 UINT bufferCount;
154 ptrSATELLITE_BUFFER* buffers;
155
156 }SUPERFRAME, * ptrSUPERFRAME;
157 ptrSUPERFRAME superframe_alloc(LINKTYPE linkType,
158 NETSIM_ID d, NETSIM_ID in);
159 void superframe_init(NETSIM_ID d, NETSIM_ID in);
160 void satellite_superframe_start();
161 void satellite_frame_start();
162 void satellite_allocate_slot(NETSIM_ID d, NETSIM_ID in,
163 ptrSUPERFRAME sf, ptrFRAME fr);
164 ptrSUPERFRAME satellite_get_return_superframe(NETSIM_ID d, NETSIM_ID in);
165 ptrSUPERFRAME satellite_get_forward_superframe(NETSIM_ID d, NETSIM_ID in);
166
167#ifdef __cplusplus
168}
169#endif
170#endif /* _NETSIM_SATELLITE_FRAME_H_ */