FireBirdLib - Topfield TMS PVR TAP Programming Library
FlashServiceSetInfo.c
Go to the documentation of this file.
1#include <string.h>
2#include "FBLib_flash.h"
3
4bool FlashServiceSetInfo(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 //Service is NULL
25 if(!Service)
26 {
27 TRACEEXIT();
28 return FALSE;
29 }
30
31 ret = FALSE;
32 switch(GetSystemType())
33 {
34 //Unknown and old 5k/6k systems are not supported
35 case ST_UNKNOWN:
36 case ST_S:
37 case ST_ST:
38 case ST_T:
39 case ST_C:
40 case ST_CT:
41 case ST_T5700:
42 case ST_T5800:
43 case ST_TF7k7HDPVR: break;
44
45 case ST_TMSS:
46 {
48
49 if(SvcType == SVC_TYPE_Tv)
51 else
53 if(p) ret = FlashServiceEncode(p, Service);
54 break;
55 }
56
57 case ST_TMST:
58 {
60
61 if(SvcType == SVC_TYPE_Tv)
63 else
65 if(p) ret = FlashServiceEncode(p, Service);
66 break;
67 }
68
69 case ST_TMSC:
70 {
72
73 if(SvcType == SVC_TYPE_Tv)
75 else
77 if(p) ret = FlashServiceEncode(p, Service);
78 break;
79 }
80
81 case ST_NRTYPES: break;
82 }
83
84 TRACEEXIT();
85 return ret;
86}
#define TYPE_Service_TMST
Definition: FBLib_flash.h:42
bool FlashServiceEncode(void *Data, tFlashService *Service)
#define TYPE_Service_TMSC
Definition: FBLib_flash.h:43
dword FIS_vFlashBlockRadioServices(void)
dword FIS_vFlashBlockTVServices(void)
int FlashServiceGetTotal(int SvcType)
bool FlashServiceSetInfo(int SvcType, int SvcNum, tFlashService *Service)
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