Changeset 2980 for trunk/reader-common.c
- Timestamp:
- 09/03/10 19:33:50 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-common.c
r2939 r2980 537 537 if (rc) 538 538 { 539 client[cs_idx].last=time((time_t)0);540 if (reader->b_nano[ep->emm[0]] & 0x02) //should this nano be saved?541 {542 char token[256];543 FILE *fp;544 545 time_t rawtime;546 time (&rawtime);547 struct tm *timeinfo;548 timeinfo = localtime (&rawtime); /* to access LOCAL date/time info */549 char buf[80];550 strftime (buf, 80, "%Y%m%d_%H_%M_%S", timeinfo);551 552 sprintf (token, "%swrite_%s_%s.%s", cs_confdir, (ep->emm[0] == 0x82) ? "UNIQ" : "SHARED", buf, "txt");553 if (!(fp = fopen (token, "w")))554 {555 cs_log ("ERROR: Cannot open EMM.txt file '%s' (errno=%d)\n", token, errno);556 }557 else558 {559 cs_log ("Succesfully written text EMM to %s.", token);560 int emm_length = ((ep->emm[1] & 0x0f) << 8) | ep->emm[2];561 fprintf (fp, "%s", cs_hexdump (0, ep->emm, emm_length + 3));562 fclose (fp);563 }564 565 //sprintf (token, "%s%s.%s", cs_confdir, buf,"emm");566 sprintf (token, "%swrite_%s_%s.%s", cs_confdir, (ep->emm[0] == 0x82) ? "UNIQ" : "SHARED", buf, "emm");567 if (!(fp = fopen (token, "wb")))568 {569 cs_log ("ERROR: Cannot open EMM.emm file '%s' (errno=%d)\n", token, errno);570 }571 else572 {573 if (fwrite(ep, sizeof (*ep), 1, fp) == 1)574 {575 cs_log ("Succesfully written binary EMM to %s.", token);576 }577 else578 {579 cs_log ("ERROR: Cannot write binary EMM to %s (errno=%d)\n", token, errno);580 }581 fclose (fp);582 }583 }584 585 539 if (reader->b_nano[ep->emm[0]] & 0x01) //should this nano be blcoked? 586 540 return 3;
Note:
See TracChangeset
for help on using the changeset viewer.