~registry/libfprint/master

« back to all changes in this revision

Viewing changes to libfprint/drivers/upektc_img.c

  • Committer: Vasily Khoruzhick
  • Author(s): Zoltán Böszörményi
  • Date: 2023-01-17 19:50:21 UTC
  • Revision ID: git-v1:987f23698e52c12f53b55e8474e2d9f5d0d05429
upektc_img: Deduce sensor type from the information packet

Show diffs side-by-side

added added

removed removed

Lines of Context:
550
550
      FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_GET_CLASS (dev);
551
551
      uint16_t width = 0;
552
552
 
553
 
#if 0
554
 
      if (data[46] == 0x26 && data[47] == 0x00 && data[48] == 0x00 && data[49] == 0x66) /* Sensor type 66000026 = TCS1s */
555
 
        fp_dbg ("Sensor type : TCS1s");
556
 
#endif
557
 
 
 
553
      self->area_sensor = !(data[49] & 0x80);
558
554
      width = (data[51] << 8) | data[50];
559
555
 
560
556
      switch (width)
563
559
          fp_dbg ("Sensor type : TCS1x"); /* 360x256 --- 270x192 must be set*/
564
560
          img_class->img_width = 192;
565
561
          img_class->img_height = 270;
566
 
          self->area_sensor = TRUE;
567
562
          break;
568
563
 
569
564
        case 208:
570
565
          fp_dbg ("Sensor type : TCS2"); /* 288x208 --- 216x156 must be set*/
571
566
          img_class->img_width = 156;
572
567
          img_class->img_height = 216;
573
 
          self->area_sensor = TRUE;
574
568
          break;
575
569
 
576
570
        case 248:
577
571
          fp_dbg ("Sensor type : TCS3"); /* 360x248 --- 270x186 must be set*/
578
572
          img_class->img_width = 186;
579
573
          img_class->img_height = 270;
580
 
          self->area_sensor = FALSE;
581
574
          break;
582
575
 
583
576
        case 192:
584
577
          fp_dbg ("Sensor type : TCS4x"); /* 512x192 --- 384x144 must be set*/
585
578
          img_class->img_width = 144;
586
579
          img_class->img_height = 384;
587
 
          self->area_sensor = FALSE;
588
580
          break;
589
581
 
590
582
        case 144:
591
583
          fp_dbg ("Sensor type : TCS5x"); /* 512x144 --- 384x108 must be set*/
592
584
          img_class->img_width = 108;
593
585
          img_class->img_height = 384;
594
 
          self->area_sensor = FALSE;
595
586
          break;
596
587
 
597
588
        default: