FireBirdLib - Topfield TMS PVR TAP Programming Library
FlashServiceGetInfo.c
Go to the documentation of this file.
1#include <string.h>
2#include "FBLib_flash.h"
3
4bool FlashServiceGetInfo(int SvcType, int SvcNum, tFlashService *Service)
5{
7
8 bool ret;
9
10 //SvcType out of range
11 if((SvcType < 0) || (SvcType > SVC_TYPE_Radio))
12 {
13 TRACEEXIT();
14 return FALSE;
15 }
16
17 //SvcNum out of range
18 if((SvcNum < 0) || (SvcNum >= FlashServiceGetTotal(SvcType)))
19 {
20 TRACEEXIT();
21 return FALSE;
22 }
23
24
25 //Service is NULL
26 if(!Service)
27 {
28 TRACEEXIT();
29 return FALSE;
30 }
31
32 ret = FALSE;
33 switch(GetSystemType())
34 {
35 //Unknown and old 5k/6k systems are not supported
36 case ST_UNKNOWN:
37 case ST_S:
38 case ST_ST:
39 case ST_T:
40 case ST_C:
41 case ST_CT:
42 case ST_T5700:
43 case ST_T5800:
44 case ST_TF7k7HDPVR: break;
45
46 case ST_TMSS:
47 {
49
50 if(SvcType == SVC_TYPE_Tv)
52 else
54 if(p) ret = FlashServiceDecode(p, Service);
55 break;
56 }
57
58 case ST_TMST:
59 {
61
62 if(SvcType == SVC_TYPE_Tv)
64 else
66 if(p) ret = FlashServiceDecode(p, Service);
67 break;
68 }
69
70 case ST_TMSC:
71 {
73
74 if(SvcType == SVC_TYPE_Tv)
76 else
78 if(p) ret = FlashServiceDecode(p, Service);
79 break;
80 }
81
82 case ST_NRTYPES: break;
83 }
84
85 TRACEEXIT();
86 return ret;
87}
#define TYPE_Service_TMST
Definition: FBLib_flash.h:42
bool FlashServiceDecode(void *Data, tFlashService *Service)
#define TYPE_Service_TMSC
Definition: FBLib_flash.h:43
dword FIS_vFlashBlockRadioServices(void)
dword FIS_vFlashBlockTVServices(void)
bool FlashServiceGetInfo(int SvcType, int SvcNum, tFlashService *Service)
int FlashServiceGetTotal(int SvcType)
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