comparison src/recpt1.c @ 156:159a729b90eb

Specify the BS channels by transponder and slot.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Mon, 10 Sep 2012 14:16:44 +0900
parents 5d010d0ff6a1
children 38f79bcba50d
comparison
equal deleted inserted replaced
155:5d010d0ff6a1 156:159a729b90eb
41 #define SIZE_CHANK 1316 41 #define SIZE_CHANK 1316
42 42
43 /* ipc message size */ 43 /* ipc message size */
44 #define MSGSZ 255 44 #define MSGSZ 255
45 45
46 #define ISDB_T_NODE_LIMIT 24 // 32:ARIB limit 24:program maximum
47 #define ISDB_T_SLOT_LIMIT 8
48
46 typedef struct pt1_msgbuf { 49 typedef struct pt1_msgbuf {
47 long mtype; 50 long mtype;
48 char mtext[MSGSZ]; 51 char mtext[MSGSZ];
49 } pt1_message_buf; 52 } pt1_message_buf;
50 53
51 /* globals */ 54 /* globals */
52 boolean f_exit = FALSE; 55 boolean f_exit = FALSE;
53 struct channel_info_list *channel_list = NULL; 56 struct channel_info_list *channel_list = NULL;
54 extern struct ushare_t *ut; 57 extern struct ushare_t *ut;
58 char bs_channel_buf[8];
59 ISDB_T_FREQ_CONV_TABLE isdb_t_conv_set = { 0, CHTYPE_SATELLITE, 0, bs_channel_buf };
55 60
56 /* prototypes */ 61 /* prototypes */
57 int tune(char *channel, thread_data *tdata, char *device); 62 int tune(char *channel, thread_data *tdata, char *device);
58 int close_tuner(thread_data *tdata); 63 int close_tuner(thread_data *tdata);
59 static int get_device_id_by_name ( const char *name ); 64 static int get_device_id_by_name ( const char *name );
231 /* lookup frequency conversion table*/ 236 /* lookup frequency conversion table*/
232 ISDB_T_FREQ_CONV_TABLE * 237 ISDB_T_FREQ_CONV_TABLE *
233 searchrecoff(char *channel) 238 searchrecoff(char *channel)
234 { 239 {
235 int lp; 240 int lp;
241
242 if(channel[0] == 'B' && channel[1] == 'S') {
243 int node = 0;
244 int slot = 0;
245 char *bs_ch;
246
247 bs_ch = channel + 2;
248 while(isdigit(*bs_ch)) {
249 node *= 10;
250 node += *bs_ch++ - '0';
251 }
252 if(*bs_ch == '_' && (node&0x01) && node < ISDB_T_NODE_LIMIT) {
253 if(isdigit(*++bs_ch)) {
254 slot = *bs_ch - '0';
255 if(*++bs_ch == '\0' && slot < ISDB_T_SLOT_LIMIT) {
256 isdb_t_conv_set.set_freq = node / 2;
257 isdb_t_conv_set.add_freq = slot;
258 sprintf(bs_channel_buf, "BS%d_%d", node, slot);
259 return &isdb_t_conv_set;
260 }
261 }
262 }
263 return NULL;
264 }
236 265
237 for(lp = 0; isdb_t_conv_table[lp].parm_freq != NULL; lp++) { 266 for(lp = 0; isdb_t_conv_table[lp].parm_freq != NULL; lp++) {
238 /* return entry number in the table when strings match and 267 /* return entry number in the table when strings match and
239 * lengths are same. */ 268 * lengths are same. */
240 if((memcmp(isdb_t_conv_table[lp].parm_freq, channel, 269 if((memcmp(isdb_t_conv_table[lp].parm_freq, channel,