Amend NFCController API

pull/7426/head
Donatien Garnier 2018-08-17 19:10:23 +01:00
parent f7ff432535
commit 978bd26fcb
3 changed files with 20 additions and 12 deletions

View File

@ -92,6 +92,11 @@ For now, the one controller we support is the PN512 which implements the `NFCCon
It offers the following methods: It offers the following methods:
```cpp
void set_delegate(Delegate* delegate);
```
Set the instance's delegate.
```cpp ```cpp
struct nfc_rf_protocols_bitmask_t struct nfc_rf_protocols_bitmask_t
{ {
@ -122,6 +127,11 @@ These are mapped against NFC Forum-defined protocols.
* NFC-DEP is based on ISO/IEC 18092 / FIXME and is the basis for NFC peer-to-peer communication. * NFC-DEP is based on ISO/IEC 18092 / FIXME and is the basis for NFC peer-to-peer communication.
* T5T is also known as ISO/IEC 15963. * T5T is also known as ISO/IEC 15963.
```cpp
nfc_err_t initialize();
```
Initialize the NFC controller.
```cpp ```cpp
nfc_err_t configure_rf_protocols(nfc_rf_protocols_bitmask_t rf_protocols); nfc_err_t configure_rf_protocols(nfc_rf_protocols_bitmask_t rf_protocols);
``` ```
@ -215,16 +225,6 @@ ndef::MessageBuilder* ndef_message_builder();
This class derives from the base `NFCEndpoint` and `NFCNDEFCapable` classes. This class derives from the base `NFCEndpoint` and `NFCNDEFCapable` classes.
```cpp
bool is_ndef_supported();
void set_ndef_message(const NDEFMessage& message);
void clear_ndef_message();
NDEFMessage get_ndef_message();
```
These methods provide access to the NDEF message that we are exposing to the remote initiator.
```cpp ```cpp
enum nfc_tag_type_t { enum nfc_tag_type_t {
nfc_tag_type_1, nfc_tag_type_1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -3,6 +3,7 @@ class NFCController {
+NFCController(NFCControllerDriver* driver, events::EventQueue* queue) +NFCController(NFCControllerDriver* driver, events::EventQueue* queue)
+void set_delegate(NFCController::Delegate* delegate) +void set_delegate(NFCController::Delegate* delegate)
+nfc_rf_protocols_bitmask_t get_supported_rf_protocols() const +nfc_rf_protocols_bitmask_t get_supported_rf_protocols() const
+nfc_err_t initialize()
+nfc_err_t configure_rf_protocols(nfc_rf_protocols_bitmask_t rf_protocols) +nfc_err_t configure_rf_protocols(nfc_rf_protocols_bitmask_t rf_protocols)
+nfc_err_t start_discovery() +nfc_err_t start_discovery()
+nfc_err_t cancel_discovery() +nfc_err_t cancel_discovery()
@ -15,11 +16,18 @@ abstract class NFCController::Delegate {
} }
abstract class NFCControllerDriver { abstract class NFCControllerDriver {
+{abstract} void initialize(scheduler_timer_t* pTimer) +void set_delegate(Delegate* delegate)
+{abstract} transceiver_t* get_transceiver() +{abstract} transceiver_t* initialize(scheduler_timer_t* pTimer)
+{abstract} void get_supported_nfc_techs(nfc_tech_t* initiator, nfc_tech_t* target) const
}
abstract class NFCControllerDriver::Delegate {
+{abstract} void on_hw_interrupt()
} }
NFCController o-- NFCController::Delegate NFCController o-- NFCController::Delegate
NFCController o-- NFCControllerDriver NFCController o-- NFCControllerDriver
NFCControllerDriver o-- NFCControllerDriver::Delegate
NFCControllerDriver::Delegate <-- NFCController
@enduml @enduml