Loading...
Searching...
No Matches
lfrfid_worker.h File Reference

LFRFID worker. More...

#include <toolbox/protocols/protocol_dict.h>
#include "protocols/lfrfid_protocols.h"

Go to the source code of this file.

Typedefs

typedef void(* LFRFIDWorkerReadCallback) (LFRFIDWorkerReadResult result, ProtocolId protocol, void *context)
 
typedef void(* LFRFIDWorkerWriteCallback) (LFRFIDWorkerWriteResult result, void *context)
 
typedef void(* LFRFIDWorkerReadRawCallback) (LFRFIDWorkerReadRawResult result, void *context)
 
typedef void(* LFRFIDWorkerEmulateRawCallback) (LFRFIDWorkerEmulateRawResult result, void *context)
 
typedef struct LFRFIDWorker LFRFIDWorker
 

Enumerations

enum  LFRFIDWorkerWriteResult { LFRFIDWorkerWriteOK , LFRFIDWorkerWriteProtocolCannotBeWritten , LFRFIDWorkerWriteFobCannotBeWritten , LFRFIDWorkerWriteTooLongToWrite }
 
enum  LFRFIDWorkerReadType { LFRFIDWorkerReadTypeAuto , LFRFIDWorkerReadTypeASKOnly , LFRFIDWorkerReadTypePSKOnly }
 
enum  LFRFIDWorkerReadResult {
  LFRFIDWorkerReadSenseStart , LFRFIDWorkerReadSenseEnd , LFRFIDWorkerReadSenseCardStart , LFRFIDWorkerReadSenseCardEnd ,
  LFRFIDWorkerReadStartASK , LFRFIDWorkerReadStartPSK , LFRFIDWorkerReadDone
}
 
enum  LFRFIDWorkerReadRawResult { LFRFIDWorkerReadRawFileError , LFRFIDWorkerReadRawOverrun }
 
enum  LFRFIDWorkerEmulateRawResult { LFRFIDWorkerEmulateRawFileError , LFRFIDWorkerEmulateRawOverrun }
 

Functions

LFRFIDWorkerlfrfid_worker_alloc (ProtocolDict *dict)
 Allocate LF-RFID worker.
 
void lfrfid_worker_free (LFRFIDWorker *worker)
 Free LF-RFID worker.
 
void lfrfid_worker_start_thread (LFRFIDWorker *worker)
 Start LF-RFID worker thread.
 
void lfrfid_worker_stop_thread (LFRFIDWorker *worker)
 Stop LF-RFID worker thread.
 
void lfrfid_worker_read_start (LFRFIDWorker *worker, LFRFIDWorkerReadType type, LFRFIDWorkerReadCallback callback, void *context)
 Start read mode.
 
void lfrfid_worker_write_start (LFRFIDWorker *worker, LFRFIDProtocol protocol, LFRFIDWorkerWriteCallback callback, void *context)
 Start write mode.
 
void lfrfid_worker_emulate_start (LFRFIDWorker *worker, LFRFIDProtocol protocol)
 Start emulate mode.
 
void lfrfid_worker_read_raw_start (LFRFIDWorker *worker, const char *filename, LFRFIDWorkerReadType type, LFRFIDWorkerReadRawCallback callback, void *context)
 Start raw read mode.
 
void lfrfid_worker_emulate_raw_start (LFRFIDWorker *worker, const char *filename, LFRFIDWorkerEmulateRawCallback callback, void *context)
 Emulate raw read mode.
 
void lfrfid_worker_stop (LFRFIDWorker *worker)
 Stop all modes.
 

Detailed Description

LFRFID worker.

Function Documentation

◆ lfrfid_worker_alloc()

LFRFIDWorker * lfrfid_worker_alloc ( ProtocolDict * dict)

Allocate LF-RFID worker.

Returns
LFRFIDWorker*

◆ lfrfid_worker_emulate_raw_start()

void lfrfid_worker_emulate_raw_start ( LFRFIDWorker * worker,
const char * filename,
LFRFIDWorkerEmulateRawCallback callback,
void * context )

Emulate raw read mode.

Parameters
workerThe worker
filenameThe filename
callbackThe callback
contextThe context

◆ lfrfid_worker_emulate_start()

void lfrfid_worker_emulate_start ( LFRFIDWorker * worker,
LFRFIDProtocol protocol )

Start emulate mode.

Parameters
workerThe worker
[in]protocolThe protocol

◆ lfrfid_worker_free()

void lfrfid_worker_free ( LFRFIDWorker * worker)

Free LF-RFID worker.

Parameters
workerThe worker

◆ lfrfid_worker_read_raw_start()

void lfrfid_worker_read_raw_start ( LFRFIDWorker * worker,
const char * filename,
LFRFIDWorkerReadType type,
LFRFIDWorkerReadRawCallback callback,
void * context )

Start raw read mode.

Parameters
workerThe worker
filenameThe filename
typeThe type
callbackThe callback
contextThe context

◆ lfrfid_worker_read_start()

void lfrfid_worker_read_start ( LFRFIDWorker * worker,
LFRFIDWorkerReadType type,
LFRFIDWorkerReadCallback callback,
void * context )

Start read mode.

Parameters
workerThe worker
typeThe type
callbackThe callback
contextThe context

◆ lfrfid_worker_start_thread()

void lfrfid_worker_start_thread ( LFRFIDWorker * worker)

Start LF-RFID worker thread.

Parameters
workerThe worker

◆ lfrfid_worker_stop()

void lfrfid_worker_stop ( LFRFIDWorker * worker)

Stop all modes.

Parameters
workerThe worker

◆ lfrfid_worker_stop_thread()

void lfrfid_worker_stop_thread ( LFRFIDWorker * worker)

Stop LF-RFID worker thread.

Parameters
workerThe worker

◆ lfrfid_worker_write_start()

void lfrfid_worker_write_start ( LFRFIDWorker * worker,
LFRFIDProtocol protocol,
LFRFIDWorkerWriteCallback callback,
void * context )

Start write mode.

Parameters
workerThe worker
protocolThe protocol
callbackThe callback
contextThe context