@@ -169,7 +169,7 @@ The user instantiates the `NFCController` class using a driver, an event queue u
169
169
It offers the following methods:
170
170
171
171
```cpp
172
- void set_delegate(Delegate* delegate);
172
+ void set_delegate(Delegate * delegate);
173
173
```
174
174
175
175
Set the instance's delegate.
@@ -245,9 +245,9 @@ void on_discovery_terminated(nfc_discovery_terminated_reason_t reason);
245
245
Let the user know when a discovery loop has been terminated (either because endpoints have been found, the user canceled it or an error occurred).
246
246
247
247
```cpp
248
- void on_nfc_initiator_discovered(const mbed::SharedPtr<NFCRemoteInitiator>& nfc_initiator);
248
+ void on_nfc_initiator_discovered(const mbed::SharedPtr<NFCRemoteInitiator> & nfc_initiator);
249
249
250
- void on_nfc_target_discovered(const mbed::SharedPtr<NFCRemoteTarget>& nfc_target);
250
+ void on_nfc_target_discovered(const mbed::SharedPtr<NFCRemoteTarget> & nfc_target);
251
251
```
252
252
253
253
These methods called when a remote initiator (the local controller is acting as a target) or a remote target (the local controller is acting as an initiator) is detected.
@@ -325,14 +325,14 @@ bool is_ndef_supported() const;
325
325
API used by descendant classes:
326
326
327
327
``` cpp
328
- void parse_ndef_message (const ac_buffer_t& buffer);
329
- void build_ndef_message(ac_buffer_builder_t& buffer_builder);
330
- ndef_msg_t* ndef_message();
328
+ void parse_ndef_message (const ac_buffer_t & buffer);
329
+ void build_ndef_message(ac_buffer_builder_t & buffer_builder);
330
+ ndef_msg_t * ndef_message();
331
331
```
332
332
333
333
API implemented by descendant classes:
334
334
```cpp
335
- virtual NFCNDEFCapable::Delegate* ndef_capable_delegate();
335
+ virtual NFCNDEFCapable::Delegate * ndef_capable_delegate();
336
336
```
337
337
338
338
** Delegate**
@@ -446,13 +446,13 @@ For instance, the `URI`'s class API is:
446
446
uri_prefix_t uri_prefix() const
447
447
void set_uri_prefix(uri_prefix_t prefix)
448
448
449
- bool get_uri(char* uri, size_t max_sz) const
449
+ bool get_uri(char * uri, size_t max_sz) const
450
450
size_t uri_size() const
451
451
void set_uri(const char* uri)
452
452
453
- bool get_full_uri(char* uri, size_t max_sz) const
453
+ bool get_full_uri(char * uri, size_t max_sz) const
454
454
size_t full_uri_size() const
455
- void set_full_uri(const char* uri)
455
+ void set_full_uri(const char * uri)
456
456
```
457
457
458
458
** Note:** These types can be replaced by user defined ones if parsing and serialization logic is provided.
@@ -466,8 +466,8 @@ void set_full_uri(const char* uri)
466
466
A ` MessageParser ` , which produces ` Record ` instances to its client, parses messages incoming from the peer. The parsing operation is event-driven: A message parser client registers a delegate inside the message parser. This delegate is notified whenever an interesting event happens during the parsing.
467
467
468
468
``` cpp
469
- void set_delegate (Delegate* delegate);
470
- void parse(const ac_buffer_t& data_buffer);
469
+ void set_delegate (Delegate * delegate);
470
+ void parse(const ac_buffer_t & data_buffer);
471
471
```
472
472
473
473
It is important to note that the data_buffer in the entry of the parse function must contain the entire NDEF message.
@@ -476,7 +476,7 @@ It is important to note that the data_buffer in the entry of the parse function
476
476
477
477
```cpp
478
478
virtual void on_parsing_started() { }
479
- virtual void on_record_parsed(const Record& record) { }
479
+ virtual void on_record_parsed(const Record & record) { }
480
480
virtual void on_parsing_terminated() { }
481
481
virtual void on_parsing_error(error_t error) { }
482
482
```
@@ -504,8 +504,8 @@ virtual bool parse(const Record&);
504
504
It aggregates `RecordParser` instances and defers parsing to the instances it contains.
505
505
506
506
```cpp
507
- bool parse(const Record& record);
508
- void set_next_parser(RecordParser* parser);
507
+ bool parse(const Record & record);
508
+ void set_next_parser(RecordParser * parser);
509
509
```
510
510
511
511
##### ndef::GenericRecordParser<ParserImplementation, ParsingResult>
@@ -514,13 +514,13 @@ This is a partial implementation of the `RecordParser` interface. It exposes a d
514
514
515
515
``` cpp
516
516
bool parse (const Record&)
517
- void set_delegate(Delegate* delegate)
517
+ void set_delegate(Delegate * delegate)
518
518
```
519
519
520
520
Implementation of this class must expose the following nonvirtual function:
521
521
522
522
```c++
523
- bool do_parse(const Record& record, ParsingResult& parsing_result);
523
+ bool do_parse(const Record & record, ParsingResult & parsing_result);
524
524
```
525
525
526
526
If the parsing is successful, then it should return true and fill ` parsing_result ` ; otherwise, it should return false and leave ` parsing_result ` untouched.
@@ -532,7 +532,7 @@ If the parsing is successful, then it should return true and fill `parsing_resul
532
532
Clients of this class must implement this delegate. It receives the objects parsed.
533
533
534
534
``` cpp
535
- virtual void on_record_parsed (const ParsingResult& record, const RecordID* id);
535
+ virtual void on_record_parsed (const ParsingResult & record, const RecordID * id);
536
536
```
537
537
538
538
**Note:** Usually, clients are client of an implementation of an ndef::GenericRecordParser<ParserImplementation, ParsingResult> . They can refer to the delegate as `ImplementationName::Delegate`.
@@ -544,7 +544,7 @@ virtual void on_record_parsed(const ParsingResult& record, const RecordID* id);
544
544
Parsers for each common record type exist. They inherit from the `GenericRecordParser` to exposes a common delegate interface:
545
545
546
546
```cpp
547
- virtual void on_record_parsed(const <ParsedType>& result, const ndef::RecordID* id)
547
+ virtual void on_record_parsed(const <ParsedType> & result, const ndef::RecordID * id)
548
548
```
549
549
550
550
#### Simple parser
@@ -556,9 +556,9 @@ The APIs provide a class named `SimpleMessageParser` that glues together a `Mess
556
556
Clients of the class can register a delegate, parse a message or add a new ` RecordParser ` in the parsing chain.
557
557
558
558
``` cpp
559
- void set_delegate (Delegate* delegate);
560
- void parse(const ac_buffer_t& data_buffer);
561
- void add_record_parser(ndef::RecordParser* parser);
559
+ void set_delegate (Delegate * delegate);
560
+ void parse(const ac_buffer_t & data_buffer);
561
+ void add_record_parser(ndef::RecordParser * parser);
562
562
```
563
563
564
564
##### Delegate
@@ -568,10 +568,10 @@ Clients of this class must implement this delegate. It receives events from the
568
568
```cpp
569
569
virtual void on_parsing_error(ndef::MessageParser::error_t error);
570
570
virtual void on_parsing_started();
571
- virtual void on_text_parsed(const Text& text, const ndef::RecordID* id);
572
- virtual void on_mime_parsed(const Mime& text, const ndef::RecordID* id);
573
- virtual void on_uri_parsed(const URI& uri, const ndef::RecordID* id);
574
- virtual void on_unknown_record_parsed(const ndef::Record& record);
571
+ virtual void on_text_parsed(const Text& text, const ndef::RecordID * id);
572
+ virtual void on_mime_parsed(const Mime& text, const ndef::RecordID * id);
573
+ virtual void on_uri_parsed(const URI& uri, const ndef::RecordID * id);
574
+ virtual void on_unknown_record_parsed(const ndef::Record & record);
575
575
virtual void on_parsing_terminated();
576
576
```
577
577
@@ -605,7 +605,7 @@ size_t get_max_size();
605
605
void start_session (bool force = true);
606
606
void end_session();
607
607
void read_bytes(uint32_t address, size_t count);
608
- void write_bytes(uint32_t address, const uint8_t* bytes, size_t count);
608
+ void write_bytes(uint32_t address, const uint8_t * bytes, size_t count);
609
609
void read_size(size_t count);
610
610
void write_size();
611
611
void erase_bytes(uint32_t address, size_t size)
0 commit comments