Changeset 11362
- Timestamp:
- 02/27/17 11:02:36 (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/module-gbox.c
r11361 r11362 28 28 #define STATS_WRITE_TIME 300 //write stats file every 5 min 29 29 #define MAX_GBOX_CARDS 1024 //send max. 1024 to peer 30 #define LOCALS_CHECK_TIME 30 //check local cards every 30 sec31 30 32 31 #define LOCAL_GBOX_MAJOR_VERSION 0x02 … … 35 34 static int8_t local_gbox_initialized = 0; 36 35 static uint8_t local_cards_initialized = 0; 36 static uint8_t local_card_change_detected = 0; 37 37 static time_t last_stats_written; 38 static time_t last_locals_checked;39 38 40 39 static int32_t gbox_send_ecm(struct s_client *cli, ECM_REQUEST *er); 40 41 void gbx_local_card_changed(void) 42 { 43 cs_log_dbg(D_READER, "Local card change detected"); 44 local_card_change_detected = 1; 45 return; 46 } 41 47 42 48 char *get_gbox_tmp_fname(char *fext) … … 1263 1269 if(!peer) { return -1; } 1264 1270 1265 if ( (time(NULL) - last_locals_checked) > LOCALS_CHECK_TIME)1271 if (local_card_change_detected) 1266 1272 { 1273 local_card_change_detected = 0; 1267 1274 gbox_local_cards(proxy->reader, &cli->ttab); 1268 last_locals_checked = time(NULL);1275 cs_log("Local Cards updated"); 1269 1276 } 1270 1277 … … 1655 1662 1656 1663 last_stats_written = time(NULL); 1657 last_locals_checked = time(NULL);1658 1664 gbox_write_version(); 1659 1665 start_sms_sender(); -
trunk/module-gbox.h
r11361 r11362 170 170 void gbox_send_good_night(void); 171 171 void gbox_send_goodbye(struct s_client *cli); 172 extern void gbx_local_card_changed(void); 172 173 #else 173 174 static inline void gbox_free_cards_pending(ECM_REQUEST *UNUSED(er)) { } 174 175 static inline void gbox_send_good_night(void) { } 176 static inline void gbx_local_card_changed(void) { } 175 177 #endif 176 178 -
trunk/reader-common.c
r11072 r11362 3 3 #ifdef WITH_CARDREADER 4 4 5 #include "module-gbox.h" 5 6 #include "module-led.h" 6 7 #include "oscam-chk.h" … … 206 207 if (ret){ 207 208 rdr_log(reader,"THIS WAS A SUCCESSFUL START ATTEMPT No %u out of max alloted of %u", (i+1), j); 209 gbx_local_card_changed(); 208 210 break; 209 211 } … … 269 271 } 270 272 led_status_card_ejected(); 273 gbx_local_card_changed(); 271 274 } 272 275 reader->card_status = NO_CARD;
Note:
See TracChangeset
for help on using the changeset viewer.