1 #ifndef OSCAM_EMM_CACHE_H_
2 #define OSCAM_EMM_CACHE_H_
4 void emm_save_cache(void);
5 void load_emmstat_from_file(void);
6 void save_emmstat_to_file(void);
7 void emm_load_cache(void);
9 // all these functions below use emms md5 hash as indexkey
10 struct s_emmcache
*find_emm_cache(uint8_t *emmd5
); // find a certain emm, e.g. to resend it to reader, returns null if nothing found
11 int32_t emm_edit_cache(uint8_t *emmd5
, EMM_PACKET
*ep
, bool add
); // add = false: delete a certain emm from cache add = true: update lastseen or add emm to cache
12 struct s_emmstat
*get_emm_stat(struct s_reader
*rdr
, uint8_t *emmd5
, uint8_t emmtype
); // find a certain emmstat
13 int32_t remove_emm_stat(struct s_reader
*rdr
, uint8_t *emmd5
); // remove a certain emmstat
14 int32_t clean_stale_emm_cache_and_stat(uint8_t *emmd5
, int64_t gone
); // remove stale global emmcache + emmstat where emm lastseen is older than gone ms
17 static inline void load_emmstat_from_file(void) { }
18 static inline void save_emmstat_to_file(void) { }
19 static inline void emm_load_cache(void) { }
20 static inline void emm_save_cache(void) { }