~ubuntu-branches/ubuntu/lucid/mythtv/lucid

« back to all changes in this revision

Viewing changes to contrib/channel_changers/6200ch/6200ch.c

  • Committer: Bazaar Package Importer
  • Author(s): Dave Walker (Daviey), Jamie Bennett, Mario Limonciello, Dave Walker (Daviey)
  • Date: 2010-03-23 19:32:33 UTC
  • mfrom: (1.1.49 upstream)
  • Revision ID: james.westby@ubuntu.com-20100323193233-5sv9djoxtlmwt3ca
Tags: 0.23.0+fixes23789-0ubuntu1
[ Jamie Bennett ]
* Fix FTBFS on armel (LP: #537714)

[ Mario Limonciello ]
* mythtv-{common,backend}.{config,templates,postinst}: (LP: #483748)
  - Simplify debconf questions by avoiding showing the generated pw
  - Don't warn about mythtv group.
  - Don't notify about running mythtv-setup.  This is optional (but
    of course encouraged!)
* Set version to include a "+" delimitter.
* Restore libfaad-dev dependency. (LP: #546552)

[ Dave Walker (Daviey) ]
* New snapshot (r23789), based from 0.23-fixes.
* debian/control:
  - mythtv-frontend set to Conflict with mythflix, as it's dropped
    upstream. (LP: #544521)
  - Remove unnecessary and potentially problematic use of Pre-Depends.
  - Set the debug package to Priority extra.
  - Change *-perl Section's from libs to perl
  - add ${shlibs:Depends} for mythtv-common Depends field
  - Minor spelling fix.
  - Fixes the long description for one of the packages, ensuring the
    description doesn't exceed 80 characters.
  - Vcs-* set to -fixes, rather than -trunk.
* debian/rules:
  - Use debconf-updatepo to update translations when required
  - Ensure license files are not included in the binary packages, except 
    for debian/copyright.
  - Fixes the permissions of certain files in the packaging.
* debian/copyright:
  - updated to reflect that mythtv is GPL-2 only.
  - inserted better licence statement and Copyright reference.
* debian/mythtv-*.templates
  - Simplified strings; removed verbosity and improved readability.
* Prevent the maintainer scripts from failing in case any questions 
  can't be displayed.
* Added holding debian/mythtv-frontend.config, mainly to appease lintian.
* debian/mythtv-frontend.menu: Changed section to Applications/Graphics.
* debian/mythtv-backend.postinst: Load debconf libraries.
* debian/source.lintian-overrides: Removes the unecessary override of the 
  binNMU warnings.
* Fix perl binding installation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#define DCX3200_MODEL_ID1  0x0000f740
42
42
#define DCX3200_MODEL_ID2  0x0000fa07
43
43
 
 
44
#define DCX3432_VENDOR_ID1 0x000024a0
 
45
#define DCX3432_MODEL_ID1  0x0000ea05
 
46
 
44
47
#define DCH3416_VENDOR_ID1 0x00001e46
45
48
#define DCH3416_MODEL_ID1  0x0000b630
46
49
 
89
92
#define QIP7100_MODEL_ID1  0x00008100
90
93
#define QIP7100_MODEL_ID2  0x00000001
91
94
 
 
95
#define QIP6200_VENDOR_ID1 0x0000211e
 
96
#define QIP6200_MODEL_ID1  0x00007100
 
97
 
92
98
#define MOT_UNKNOWN_VENDOR_ID1 0x04db
93
99
#define MOT_UNKNOWN_VENDOR_ID2 0x0406
94
100
#define MOT_UNKNOWN_VENDOR_ID3 0x0ce5
100
106
#define MOT_UNKNOWN_VENDOR_ID9 0x1ade
101
107
#define MOT_UNKNOWN_VENDOR_ID10 0x1cfb
102
108
#define MOT_UNKNOWN_VENDOR_ID11 0x2040
103
 
#define MOT_UNKNOWN_VENDOR_ID12 0x211e
104
 
#define MOT_UNKNOWN_VENDOR_ID13 0x2180
105
 
#define MOT_UNKNOWN_VENDOR_ID14 0x2210
106
 
#define MOT_UNKNOWN_VENDOR_ID15 0x230b
107
 
#define MOT_UNKNOWN_VENDOR_ID16 0x2375
108
 
#define MOT_UNKNOWN_VENDOR_ID17 0x2395
109
 
#define MOT_UNKNOWN_VENDOR_ID18 0x23a2
110
 
#define MOT_UNKNOWN_VENDOR_ID19 0x23ed
111
 
#define MOT_UNKNOWN_VENDOR_ID20 0x23ee
112
 
#define MOT_UNKNOWN_VENDOR_ID21 0x23a0
113
 
#define MOT_UNKNOWN_VENDOR_ID22 0x23a1
 
109
#define MOT_UNKNOWN_VENDOR_ID12 0x2180
 
110
#define MOT_UNKNOWN_VENDOR_ID13 0x2210
 
111
#define MOT_UNKNOWN_VENDOR_ID14 0x230b
 
112
#define MOT_UNKNOWN_VENDOR_ID15 0x2375
 
113
#define MOT_UNKNOWN_VENDOR_ID16 0x2395
 
114
#define MOT_UNKNOWN_VENDOR_ID17 0x23a2
 
115
#define MOT_UNKNOWN_VENDOR_ID18 0x23ed
 
116
#define MOT_UNKNOWN_VENDOR_ID19 0x23ee
 
117
#define MOT_UNKNOWN_VENDOR_ID20 0x23a0
 
118
#define MOT_UNKNOWN_VENDOR_ID21 0x23a1
114
119
 
115
120
#define PACE_VENDOR_ID1    0x00005094 /* 550 & 779 */
116
121
#define PACE_VENDOR_ID2    0x00005094 /* unknown */
129
134
#define RETRY_COUNT_FAST 0
130
135
 
131
136
void set_chan_slow(raw1394handle_t handle, int device, int verbose, int chn);
 
137
void set_chan_slow_four_digit(raw1394handle_t handle, int device, int verbose, int chn);
132
138
void set_chan_fast(raw1394handle_t handle, int device, int verbose, int chn);
133
139
void set_power_fast(raw1394handle_t handle, int device, int verbose);
134
140
 
135
141
void usage()
136
142
{
137
143
   fprintf(stderr, "Usage: 6200ch [-v] [-s] [-n NODE] [-g GUID] [-p PORT] "
138
 
           "<channel_num>\n");
 
144
           "[-4] <channel_num>\n");
139
145
   fprintf(stderr, "-v        print additional verbose output\n");
140
 
   fprintf(stderr, "-s        use single packet method\n");
 
146
   fprintf(stderr, "-s        use single packet method. Cannot be used with -4.\n");
141
147
   fprintf(stderr, "-w        toggle power state\n");
142
148
   fprintf(stderr, "-n NODE   node to start device scanning on (default:%i)\n",
143
149
           STARTING_NODE);
144
150
   fprintf(stderr, "-p PORT   port/adapter to use              (default:%i)\n",
145
151
           STARTING_PORT);
146
152
   fprintf(stderr, "-g GUID   GUID to use, -n switch, if present, will be ignored.\n");
 
153
   fprintf(stderr, "-4        Enable 4 digit channel number support. Cannot be used with -s.\n");
147
154
   exit(1);
148
155
}
149
156
 
159
166
   octlet_t cli_GUID=0LL;
160
167
   octlet_t node_GUID=0LL;
161
168
   int chn = 0;
 
169
   int use_four_digit = 0;
162
170
 
163
171
   /* some people experience crashes when starting on node 1 */
164
172
   int starting_node = STARTING_NODE;
169
177
      usage();
170
178
 
171
179
   opterr = 0;
172
 
   while ((c = getopt(argc, argv, "vswg:n:p:")) != -1)
 
180
   while ((c = getopt(argc, argv, "vswg:n:p:4")) != -1)
173
181
   {
174
182
       switch (c) {
175
183
       case 'v':
192
200
       case 'p':
193
201
           starting_port = atoi(optarg);
194
202
           break;
 
203
       case '4':
 
204
           use_four_digit = 1;
 
205
           break;
195
206
       default:
196
207
           fprintf(stderr, "incorrect command line arguments\n");
197
208
           usage();
198
209
       }
199
210
   }
200
211
 
 
212
   {
 
213
   /* We cannot use single packet with 4 digits */
 
214
       if (single_packet && use_four_digit)
 
215
           usage();
 
216
   }
201
217
   /* print out usage message if not enough arguments */
202
218
   if (optind == argc-1)
203
219
   {
204
 
       /* the last argument is the channel number */
 
220
   /* the last argument is the channel number */
205
221
       chn = atoi(argv[optind]);
206
222
   }
207
223
   else if (!toggle_power)
292
308
            (dir.vendor_id == DCT6412_VENDOR_ID2) ||
293
309
            (dir.vendor_id == DCT6416_VENDOR_ID1) ||
294
310
            (dir.vendor_id == DCT6416_VENDOR_ID2) ||
 
311
            (dir.vendor_id == DCX3432_VENDOR_ID1) ||
295
312
            (dir.vendor_id == QIP7100_VENDOR_ID1) ||
 
313
            (dir.vendor_id == QIP6200_VENDOR_ID1) ||
296
314
            (dir.vendor_id == MOT_UNKNOWN_VENDOR_ID1) ||
297
315
            (dir.vendor_id == MOT_UNKNOWN_VENDOR_ID2) ||
298
316
            (dir.vendor_id == MOT_UNKNOWN_VENDOR_ID3) ||
314
332
            (dir.vendor_id == MOT_UNKNOWN_VENDOR_ID19) ||
315
333
            (dir.vendor_id == MOT_UNKNOWN_VENDOR_ID20) ||
316
334
            (dir.vendor_id == MOT_UNKNOWN_VENDOR_ID21) ||
317
 
            (dir.vendor_id == MOT_UNKNOWN_VENDOR_ID22) ||
318
335
            (dir.vendor_id == PACE_VENDOR_ID1) ||
319
336
            (dir.vendor_id == PACE_VENDOR_ID2)) &&
320
337
           ((dir.model_id == DCH3200_MODEL_ID1) ||
321
338
            (dir.model_id == DCX3200_MODEL_ID1) ||
322
339
            (dir.model_id == DCX3200_MODEL_ID2) ||
 
340
            (dir.model_id == DCX3432_MODEL_ID1) ||
323
341
            (dir.model_id == DCH3416_MODEL_ID1) ||
324
342
            (dir.model_id == DCT3412_MODEL_ID1) ||
325
343
            (dir.model_id == DCT3416_MODEL_ID1) ||
332
350
            (dir.model_id == DCT6416_MODEL_ID1) ||
333
351
            (dir.model_id == QIP7100_MODEL_ID1) ||
334
352
            (dir.model_id == QIP7100_MODEL_ID2) ||
 
353
            (dir.model_id == QIP6200_MODEL_ID1) ||
335
354
            (dir.model_id == PACE550_MODEL_ID1) ||
336
355
            (dir.model_id == PACE779_MODEL_ID1)) )
337
356
      {
358
377
       if (single_packet)
359
378
           set_chan_fast(handle, device, verbose, chn);
360
379
       else
 
380
       if (use_four_digit)
 
381
           set_chan_slow_four_digit(handle, device, verbose, chn); 
 
382
       else
361
383
           set_chan_slow(handle, device, verbose, chn);
362
384
   }
363
385
 
389
411
   }
390
412
}
391
413
 
 
414
// Same as set_chan_slow(), but sends 4 digits instead of 3 (for quicker channel changes on QIP6200-2 / QIP7100-1)
 
415
void set_chan_slow_four_digit(raw1394handle_t handle, int device, int verbose, int chn)
 
416
{
 
417
   int i;
 
418
   int dig[4];
 
419
   quadlet_t cmd[2];
 
420
 
 
421
   if (verbose)
 
422
       printf("chn: %d\n", chn);
 
423
 
 
424
   dig[3] = (chn % 10);
 
425
   dig[2] = (chn % 100) / 10;
 
426
   dig[1] = (chn % 1000) / 100;
 
427
   dig[0] = (chn % 10000) / 1000;
 
428
 
 
429
   if (verbose)
 
430
      printf("AV/C Command: %d%d%d%d = Op1=0x%08X Op2=0x%08X Op3=0x%08X Op4=0x%08X\n",
 
431
            dig[0], dig[1], dig[2], dig[3],
 
432
            CTL_CMD0 | dig[0], CTL_CMD0 | dig[1], CTL_CMD0 | dig[2], CTL_CMD0 | dig[3]);
 
433
 
 
434
   for (i=0; i<4; i++) {
 
435
      if (verbose)
 
436
          printf("Sending digit %d\n", dig[i]);
 
437
      cmd[0] = CTL_CMD0 | dig[i];
 
438
      cmd[1] = 0x0;
 
439
    
 
440
      avc1394_transaction_block(handle, device, cmd, 2, RETRY_COUNT_SLOW);
 
441
      usleep(500000); // small delay for button to register
 
442
   }
 
443
 
444
 
392
445
void set_chan_fast(raw1394handle_t handle, int device, int verbose, int chn)
393
446
{
394
447
    quadlet_t cmd[3];