comparison recpt1/recpt1.c @ 135:2b057f249811

imported bs_ch patch
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 25 Apr 2013 15:02:28 +0900
parents b14397800eae
children 61ff9cabf962
comparison
equal deleted inserted replaced
134:550ee373afbc 135:2b057f249811
38 #define SIZE_CHANK 1316 38 #define SIZE_CHANK 1316
39 39
40 /* ipc message size */ 40 /* ipc message size */
41 #define MSGSZ 255 41 #define MSGSZ 255
42 42
43 #define ISDB_T_NODE_LIMIT 24 // 32:ARIB limit 24:program maximum
44 #define ISDB_T_SLOT_LIMIT 8
45
43 /* type definitions */ 46 /* type definitions */
44 typedef int boolean; 47 typedef int boolean;
45 48
46 typedef struct sock_data { 49 typedef struct sock_data {
47 int sfd; /* socket fd */ 50 int sfd; /* socket fd */
71 char mtext[MSGSZ]; 74 char mtext[MSGSZ];
72 } message_buf; 75 } message_buf;
73 76
74 /* globals */ 77 /* globals */
75 boolean f_exit = FALSE; 78 boolean f_exit = FALSE;
79 char bs_channel_buf[8];
80 ISDB_T_FREQ_CONV_TABLE isdb_t_conv_set = { 0, CHTYPE_SATELLITE, 0, bs_channel_buf };
76 81
77 /* prototypes */ 82 /* prototypes */
78 ISDB_T_FREQ_CONV_TABLE *searchrecoff(char *channel); 83 ISDB_T_FREQ_CONV_TABLE *searchrecoff(char *channel);
79 void calc_cn(int fd, int type); 84 void calc_cn(int fd, int type);
80 int tune(char *channel, thread_data *tdata, char *device); 85 int tune(char *channel, thread_data *tdata, char *device);
183 ISDB_T_FREQ_CONV_TABLE * 188 ISDB_T_FREQ_CONV_TABLE *
184 searchrecoff(char *channel) 189 searchrecoff(char *channel)
185 { 190 {
186 int lp; 191 int lp;
187 192
193 if(channel[0] == 'B' && channel[1] == 'S') {
194 int node = 0;
195 int slot = 0;
196 char *bs_ch;
197
198 bs_ch = channel + 2;
199 while(isdigit(*bs_ch)) {
200 node *= 10;
201 node += *bs_ch++ - '0';
202 }
203 if(*bs_ch == '_' && (node&0x01) && node < ISDB_T_NODE_LIMIT) {
204 if(isdigit(*++bs_ch)) {
205 slot = *bs_ch - '0';
206 if(*++bs_ch == '\0' && slot < ISDB_T_SLOT_LIMIT) {
207 isdb_t_conv_set.set_freq = node / 2;
208 isdb_t_conv_set.add_freq = slot;
209 sprintf(bs_channel_buf, "BS%d_%d", node, slot);
210 return &isdb_t_conv_set;
211 }
212 }
213 }
214 return NULL;
215 }
188 for(lp = 0; isdb_t_conv_table[lp].parm_freq != NULL; lp++) { 216 for(lp = 0; isdb_t_conv_table[lp].parm_freq != NULL; lp++) {
189 /* return entry number in the table when strings match and 217 /* return entry number in the table when strings match and
190 * lengths are same. */ 218 * lengths are same. */
191 if((memcmp(isdb_t_conv_table[lp].parm_freq, channel, 219 if((memcmp(isdb_t_conv_table[lp].parm_freq, channel,
192 strlen(channel)) == 0) && 220 strlen(channel)) == 0) &&