Skip to content

Commit a989c15

Browse files
author
Donatien Garnier
committed
Updtate event handling model in NFCEEPROM
1 parent 588c26c commit a989c15

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

docs/design-documents/nfc/nfc_design.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,6 @@ The `set_size()` command is called to change the size of the buffer (within the
537537

538538
```cpp
539539
void reset();
540-
void process_events();
541540
size_t get_max_size();
542541
void start_session();
543542
void end_session();
@@ -557,7 +556,12 @@ void on_bytes_written(size_t count);
557556
void on_size_read(bool success, size_t size);
558557
void on_size_written(bool success);
559558
void on_bytes_erased(size_t count);
560-
void on_event();
559+
```
560+
561+
The implementation also has access to an event queue in case asynchronous operations need to be run:
562+
```cpp
563+
Delegate *delegate();
564+
events::EventQueue *event_queue();
561565
```
562566

563567
### NCI Driver APIs
Loading

docs/design-documents/nfc/uml_diagram_endpoints.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ abstract class NFCTarget::Delegate {
4040
}
4141

4242
class NFCEEPROM {
43+
+nfc_err_t initialize()
4344
+void set_delegate(NFCEEPROM::Delegate* delegate)
4445
}
4546

@@ -49,9 +50,9 @@ abstract class NFCEEPROM::Delegate {
4950

5051
abstract class NFCEEPROMDriver {
5152
+void set_delegate(Delegate* delegate)
53+
+void set_event_queue(events::EventQueue* queue)
5254

5355
+{abstract} void reset()
54-
+{abstract} void process_events()
5556
+{abstract} size_t get_max_size()
5657
+{abstract} void start_session()
5758
+{abstract} void end_session()
@@ -60,6 +61,8 @@ abstract class NFCEEPROMDriver {
6061
+{abstract} void write_size(size_t count)
6162
+{abstract} void read_size()
6263
+{abstract} void erase_bytes(uint32_t address, size_t size)
64+
#Delegate *delegate()
65+
#events::EventQueue *event_queue()
6366
}
6467

6568
abstract class NFCEEPROMDriver::Delegate {
@@ -70,7 +73,6 @@ abstract class NFCEEPROMDriver::Delegate {
7073
+{abstract} void on_size_read(bool success, size_t size)
7174
+{abstract} void on_size_written(bool success)
7275
+{abstract} void on_bytes_erased(size_t count)
73-
+{abstract} void on_event()
7476
}
7577

7678
NFCNDEFCapable <-- NFCTarget

0 commit comments

Comments
 (0)