Loading...
Searching...
No Matches
ibutton_worker.h
Go to the documentation of this file.
1
7#pragma once
8
9#include "ibutton_key.h"
10#include "ibutton_protocols.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16typedef enum {
17 iButtonWorkerWriteOK,
18 iButtonWorkerWriteSameKey,
19 iButtonWorkerWriteNoDetect,
20 iButtonWorkerWriteCannotWrite,
21} iButtonWorkerWriteResult;
22
23typedef void (*iButtonWorkerReadCallback)(void* context);
24typedef void (*iButtonWorkerWriteCallback)(void* context, iButtonWorkerWriteResult result);
25typedef void (*iButtonWorkerEmulateCallback)(void* context, bool emulated);
26
27typedef struct iButtonWorker iButtonWorker;
28
34
40
46
52
60 iButtonWorker* worker,
61 iButtonWorkerReadCallback callback,
62 void* context);
63
70
78 iButtonWorker* worker,
79 iButtonWorkerWriteCallback callback,
80 void* context);
81
88
95
103 iButtonWorker* worker,
104 iButtonWorkerEmulateCallback callback,
105 void* context);
106
113
119
120#ifdef __cplusplus
121}
122#endif
iButton key data holder
Common interface for accessing various iButton protocols.
void ibutton_worker_free(iButtonWorker *worker)
Free ibutton worker.
Definition ibutton_worker.c:119
void ibutton_worker_read_start(iButtonWorker *worker, iButtonKey *key)
Start read mode.
Definition ibutton_worker.c:72
void ibutton_worker_read_set_callback(iButtonWorker *worker, iButtonWorkerReadCallback callback, void *context)
Set "read success" callback.
Definition ibutton_worker.c:39
void ibutton_worker_stop(iButtonWorker *worker)
Stop all modes.
Definition ibutton_worker.c:110
void ibutton_worker_write_id_start(iButtonWorker *worker, iButtonKey *key)
Start write blank mode.
Definition ibutton_worker.c:81
void ibutton_worker_write_copy_start(iButtonWorker *worker, iButtonKey *key)
Start write copy mode.
Definition ibutton_worker.c:91
void ibutton_worker_stop_thread(iButtonWorker *worker)
Stop ibutton worker thread.
Definition ibutton_worker.c:134
void ibutton_worker_write_set_callback(iButtonWorker *worker, iButtonWorkerWriteCallback callback, void *context)
Set "write event" callback.
Definition ibutton_worker.c:50
void ibutton_worker_emulate_start(iButtonWorker *worker, iButtonKey *key)
Start emulate mode.
Definition ibutton_worker.c:101
void ibutton_worker_emulate_set_callback(iButtonWorker *worker, iButtonWorkerEmulateCallback callback, void *context)
Set "emulate success" callback.
Definition ibutton_worker.c:61
iButtonWorker * ibutton_worker_alloc(iButtonProtocols *protocols)
Allocate ibutton worker.
Definition ibutton_worker.c:25
void ibutton_worker_start_thread(iButtonWorker *worker)
Start ibutton worker thread.
Definition ibutton_worker.c:128
Definition ibutton_key.c:4
Definition ibutton_protocols.c:24
Definition ibutton_worker_i.h:33