- Timestamp:
- 01/20/12 22:30:58 (12 years ago)
- Location:
- branches/sc8in1
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sc8in1/csctapi/ifd_sc8in1.c
r6265 r6266 73 73 74 74 75 if (Sc8in1_NeedBaudrateChange(reader, 9600, &termiobackup, &termio, 1)) {75 if (Sc8in1_NeedBaudrateChange(reader, 9600, &termiobackup, &termio, 0)) { 76 76 cs_debug_mask(D_TRACE, "Sc8in1_NeedBaudrateChange for SC8in1 command"); 77 77 // save current baudrate for later restore … … 116 116 117 117 // restore baudrate only if changed 118 if (currentBaudrate && Sc8in1_SetBaudrate(reader, currentBaudrate, &termiobackup, 1)) { 119 cs_log("ERROR: SC8in1 selectslot restore Bitrate attributes\n"); 120 return ERROR; 118 if (currentBaudrate) { 119 if (Sc8in1_SetBaudrate(reader, currentBaudrate, &termiobackup, 1)) { 120 cs_log("ERROR: SC8in1 selectslot restore Bitrate attributes\n"); 121 return ERROR; 122 } 121 123 } 122 124 else { … … 289 291 // Display "OSCam" on MCR display 290 292 unsigned char helloOscam[5] = {'O', 'S', 'C', 'a', 'm'}; 291 return MCR_DisplayText(reader, &helloOscam[0], 5, 100 );293 return MCR_DisplayText(reader, &helloOscam[0], 5, 100, 1); 292 294 } 293 295 … … 312 314 // display the next character 313 315 cs_writelock(&reader->sc8in1_config->sc8in1_lock); 314 if (mcrWriteDisplayAscii(reader, 315 reader->sc8in1_config->display->text[++reader->sc8in1_config->display->last_char - 1], 0xFF)) { 316 cs_log("SC8in1: Error in mcr_update_display_thread write"); 316 if (reader->sc8in1_config->display->blocking) { 317 int i = 0; 318 for (i = 0; i < reader->sc8in1_config->display->text_length; i++) { 319 if (mcrWriteDisplayAscii(reader, 320 reader->sc8in1_config->display->text[++reader->sc8in1_config->display->last_char - 1], 0xFF)) { 321 cs_log("SC8in1: Error in mcr_update_display_thread write"); 322 } 323 cs_sleepms(display_sleep); 324 } 325 } 326 else { 327 if (mcrWriteDisplayAscii(reader, 328 reader->sc8in1_config->display->text[++reader->sc8in1_config->display->last_char - 1], 0xFF)) { 329 cs_log("SC8in1: Error in mcr_update_display_thread write"); 330 } 317 331 } 318 332 cs_writeunlock(&reader->sc8in1_config->sc8in1_lock); … … 321 335 if (reader->sc8in1_config->display->last_char == reader->sc8in1_config->display->text_length) { 322 336 cs_writelock(&reader->sc8in1_config->sc8in1_display_lock); 323 reader->sc8in1_config->display = reader->sc8in1_config->display->next; 337 struct s_sc8in1_display *next = reader->sc8in1_config->display->next; 338 free(reader->sc8in1_config->display->text); 339 free(reader->sc8in1_config->display); 340 reader->sc8in1_config->display = next; 324 341 cs_writeunlock(&reader->sc8in1_config->sc8in1_display_lock); 325 free(&reader->sc8in1_config->display->text);326 free(reader->sc8in1_config->display);327 342 } 328 343 } … … 336 351 } 337 352 338 int32_t MCR_DisplayText(struct s_reader *reader, char* text, uint16_t text_len, uint16_t time ) {353 int32_t MCR_DisplayText(struct s_reader *reader, char* text, uint16_t text_len, uint16_t time, uint8_t blocking) { 339 354 struct s_sc8in1_display *display; 340 355 if (cs_malloc(&display, sizeof(struct s_sc8in1_display), -1)) { … … 348 363 display->char_change_time = time; 349 364 display->last_char = 0; 365 display->blocking = blocking; 350 366 display->next = NULL; 351 367 cs_writelock(&reader->sc8in1_config->sc8in1_display_lock); … … 437 453 int32_t SC8in1_Reset (struct s_reader * reader, ATR * atr) 438 454 { 455 LOCK_SC8IN1 439 456 cs_debug_mask (D_IFD, "IFD: Resetting card:\n"); 440 457 int32_t ret; … … 444 461 445 462 if ( ! reader->ins7e11_fast_reset ) { 446 LOCK_SC8IN1447 463 if (Sc8in1_SetBaudrate(reader, DEFAULT_BAUDRATE, NULL, 0)) { 448 464 UNLOCK_SC8IN1 … … 452 468 return ERROR; 453 469 } 454 UNLOCK_SC8IN1455 470 } 456 471 else { … … 459 474 460 475 for(i=0; i<3; i++) { 461 LOCK_SC8IN1462 476 IO_Serial_Flush(reader); 463 477 if (IO_Serial_SetParity (reader, parity[i])) { … … 477 491 #endif 478 492 IO_Serial_RTS_Set(reader); 479 UNLOCK_SC8IN1480 481 493 cs_sleepms(200); 482 483 LOCK_SC8IN1484 494 #ifdef USE_GPIO //felix: set card reset hi (inactive) 485 495 if (reader->detect>4) { … … 496 506 while(n<ATR_MAX_SIZE && !IO_Serial_Read(reader, ATR_TIMEOUT, 1, buf+n)) 497 507 n++; 498 499 UNLOCK_SC8IN1500 501 508 if(n==0) 502 509 continue; … … 507 514 break; 508 515 } 509 LOCK_SC8IN1510 516 IO_Serial_Flush(reader); 511 517 UNLOCK_SC8IN1 -
branches/sc8in1/csctapi/ifd_sc8in1.h
r6265 r6266 28 28 int32_t Sc8in1_SetSlotForReader(struct s_reader *reader); 29 29 int32_t SC8in1_Reset (struct s_reader * reader, ATR * atr); 30 int32_t MCR_DisplayText(struct s_reader *reader, char* text, uint16_t text_len, uint16_t time );30 int32_t MCR_DisplayText(struct s_reader *reader, char* text, uint16_t text_len, uint16_t time, uint8_t blocking); -
branches/sc8in1/globals.h
r6265 r6266 1020 1020 uint16_t char_change_time; 1021 1021 uint16_t last_char; 1022 uint8_t blocking; 1022 1023 struct s_sc8in1_display *next; 1023 1024 }; -
branches/sc8in1/oscam-reader.c
r6251 r6266 1 1 #include "globals.h" 2 2 #include "reader-common.h" 3 #include "csctapi/ifd_sc8in1.h" 3 4 4 5 int32_t logfd = 0; … … 556 557 cs_log("Error processing ecm for caid %04X, srvid %04X (servicename: %s) on reader %s.", er->caid, er->srvid, get_servicename(cl, er->srvid, er->caid, buf), reader->label); 557 558 ea.rc = E_NOTFOUND; 559 if (reader->typ == R_SC8in1 && reader->sc8in1_config->mcr_type) { 560 char text[] = {'S', (char)reader->slot+0x30, 'E', 'e', 'r'}; 561 MCR_DisplayText(reader, text, 5, 400, 0); 562 } 558 563 } else 559 564 ea.rc = E_FOUND; -
branches/sc8in1/reader-common.c
r6261 r6266 10 10 #include "csctapi/ifd_cool.h" 11 11 #endif 12 13 #include "csctapi/ifd_sc8in1.h" 12 14 13 15 #if defined(TUXBOX) && defined(PPC) //dbox2 only … … 277 279 uint16_t deprecated; 278 280 for (deprecated = reader->deprecated; deprecated < 2; deprecated++) { 279 if (!reader_activate_card(reader, &atr, deprecated)) return(0);281 if (!reader_activate_card(reader, &atr, deprecated)) break; 280 282 ret = reader_get_cardsystem(reader, atr); 281 283 if (ret) … … 292 294 reader->card_status = CARD_FAILURE; 293 295 cs_log("card initializing error"); 296 if (reader->typ == R_SC8in1 && reader->sc8in1_config->mcr_type) { 297 char text[] = {'S', (char)reader->slot+0x30, 'A', 'E', 'R'}; 298 MCR_DisplayText(reader, text, 5, 400, 0); 299 } 294 300 #ifdef QBOXHD_LED 295 301 qboxhd_led_blink(QBOXHD_LED_COLOR_MAGENTA,QBOXHD_LED_BLINK_MEDIUM); … … 301 307 reader->card_status = CARD_INSERTED; 302 308 do_emm_from_file(reader); 309 if (reader->typ == R_SC8in1 && reader->sc8in1_config->mcr_type) { 310 char text[] = {'S', (char)reader->slot+0x30, 'A', 'O', 'K'}; 311 MCR_DisplayText(reader, text, 5, 400, 0); 312 } 313 303 314 #ifdef COOL 304 315 if (reader->typ == R_INTERNAL) {
Note:
See TracChangeset
for help on using the changeset viewer.