FireBirdLib - Topfield TMS PVR TAP Programming Library
FlashSatTablesDecode.c
Go to the documentation of this file.
1#include <string.h>
2#include "FBLib_flash.h"
3
4static bool FlashSatTablesDecode_ST_TMSS(TYPE_SatInfo_TMSS *Data, tFlashSatTable *SatTable)
5{
7
8 if(!Data || !SatTable)
9 {
10 TRACEEXIT();
11 return FALSE;
12 }
13
14 memcpy(SatTable, Data, sizeof(tFlashSatTable));
15
16 TRACEEXIT();
17 return TRUE;
18}
19
20static bool FlashSatTablesDecode_ST_TMST(TYPE_SatInfo_TMST *Data, tFlashSatTable *SatTable)
21{
22 TRACEENTER();
23
24 if(!Data || !SatTable)
25 {
26 TRACEEXIT();
27 return FALSE;
28 }
29
30 memset(SatTable, 0, sizeof(tFlashSatTable));
31 SatTable->NrOfTransponders = Data->NrOfTransponders;
32 strncpy(SatTable->SatName, Data->SatName, MAX_SatName - 1);
33
34 TRACEEXIT();
35 return TRUE;
36}
37
38static bool FlashSatTablesDecode_ST_TMSC(TYPE_SatInfo_TMSC *Data, tFlashSatTable *SatTable)
39{
40 TRACEENTER();
41
42 if(!Data || !SatTable)
43 {
44 TRACEEXIT();
45 return FALSE;
46 }
47
48 memset(SatTable, 0, sizeof(tFlashSatTable));
49 SatTable->NrOfTransponders = Data->NrOfTransponders;
50 strncpy(SatTable->SatName, "Cable", MAX_SatName - 1);
51
52 TRACEEXIT();
53 return TRUE;
54}
55
56bool FlashSatTablesDecode(void *Data, tFlashSatTable *SatTable)
57{
58 bool ret;
59
60 TRACEENTER();
61
62 if(!Data || !SatTable)
63 {
64 TRACEEXIT();
65 return FALSE;
66 }
67
68 ret = FALSE;
69 switch(GetSystemType())
70 {
71 //Unknown and old 5k/6k systems are not supported
72 case ST_UNKNOWN:
73 case ST_S:
74 case ST_ST:
75 case ST_T:
76 case ST_C:
77 case ST_CT:
78 case ST_T5700:
79 case ST_T5800:
80 case ST_TF7k7HDPVR: break;
81
82 case ST_TMSS: ret = FlashSatTablesDecode_ST_TMSS(Data, SatTable); break;
83 case ST_TMST: ret = FlashSatTablesDecode_ST_TMST(Data, SatTable); break;
84 case ST_TMSC: ret = FlashSatTablesDecode_ST_TMSC(Data, SatTable); break;
85
86 case ST_NRTYPES: break;
87 }
88
89 TRACEEXIT();
90 return ret;
91}
92
93bool FlashSatTablesGetInfo(int SatNum, tFlashSatTable *SatTable)
94{
95 TRACEENTER();
96
97 bool ret;
98
99 //SatNum out of range
100 if((SatNum < 0) || (SatNum >= FlashSatTablesGetTotal()))
101 {
102 TRACEEXIT();
103 return FALSE;
104 }
105
106 //SatTable is NULL
107 if(!SatTable)
108 {
109 TRACEEXIT();
110 return FALSE;
111 }
112
113 ret = FALSE;
114 switch(GetSystemType())
115 {
116 //Unknown and old 5k/6k systems are not supported
117 case ST_UNKNOWN:
118 case ST_S:
119 case ST_ST:
120 case ST_T:
121 case ST_C:
122 case ST_CT:
123 case ST_T5700:
124 case ST_T5800:
125 case ST_TF7k7HDPVR: break;
126
127 case ST_TMSS:
128 {
130
132 if(p)
133 {
134 p = p + SatNum;
135 ret = FlashSatTablesDecode(p, SatTable);
136 }
137 break;
138 }
139
140 case ST_TMST:
141 {
143
145 if(p) ret = FlashSatTablesDecode(p, SatTable);
146 break;
147 }
148
149 case ST_TMSC:
150 {
152
154 if(p) ret = FlashSatTablesDecode(p, SatTable);
155 break;
156 }
157
158 case ST_NRTYPES: break;
159 }
160
161 TRACEEXIT();
162 return ret;
163}
dword FIS_vFlashBlockSatInfo(void)
bool FlashSatTablesDecode(void *Data, tFlashSatTable *SatTable)
bool FlashSatTablesGetInfo(int SatNum, tFlashSatTable *SatTable)
int FlashSatTablesGetTotal(void)
SYSTEM_TYPE GetSystemType(void)
Definition: GetSystemType.c:3
#define TRACEEXIT()
Definition: libFireBird.h:1244
#define TRACEENTER()
Definition: libFireBird.h:1243
@ ST_CT
Definition: libFireBird.h:77
@ ST_T
Definition: libFireBird.h:69
@ ST_TMSC
Definition: libFireBird.h:74
@ ST_UNKNOWN
Definition: libFireBird.h:67
@ ST_T5700
Definition: libFireBird.h:71
@ ST_TMST
Definition: libFireBird.h:73
@ ST_T5800
Definition: libFireBird.h:75
@ ST_TMSS
Definition: libFireBird.h:72
@ ST_ST
Definition: libFireBird.h:76
@ ST_NRTYPES
Definition: libFireBird.h:79
@ ST_TF7k7HDPVR
Definition: libFireBird.h:78
@ ST_S
Definition: libFireBird.h:68
@ ST_C
Definition: libFireBird.h:70
char SatName[MAX_SatName]
Definition: FBLib_flash.h:56
char SatName[MAX_SatName]
Definition: libFireBird.h:1589