Skip to content

Commit 425c1c1

Browse files
committed
NFC Spec: Fix ref/pointer qualifier alignement.
1 parent 1074afb commit 425c1c1

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

docs/design-documents/nfc/nfc_design.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ The user instantiates the `NFCController` class using a driver, an event queue u
169169
It offers the following methods:
170170
171171
```cpp
172-
void set_delegate(Delegate* delegate);
172+
void set_delegate(Delegate *delegate);
173173
```
174174

175175
Set the instance's delegate.
@@ -245,9 +245,9 @@ void on_discovery_terminated(nfc_discovery_terminated_reason_t reason);
245245
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).
246246
247247
```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);
249249
250-
void on_nfc_target_discovered(const mbed::SharedPtr<NFCRemoteTarget>& nfc_target);
250+
void on_nfc_target_discovered(const mbed::SharedPtr<NFCRemoteTarget> &nfc_target);
251251
```
252252

253253
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;
325325
API used by descendant classes:
326326

327327
```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();
331331
```
332332
333333
API implemented by descendant classes:
334334
```cpp
335-
virtual NFCNDEFCapable::Delegate* ndef_capable_delegate();
335+
virtual NFCNDEFCapable::Delegate *ndef_capable_delegate();
336336
```
337337

338338
**Delegate**
@@ -446,13 +446,13 @@ For instance, the `URI`'s class API is:
446446
uri_prefix_t uri_prefix() const
447447
void set_uri_prefix(uri_prefix_t prefix)
448448
449-
bool get_uri(char* uri, size_t max_sz) const
449+
bool get_uri(char *uri, size_t max_sz) const
450450
size_t uri_size() const
451451
void set_uri(const char* uri)
452452
453-
bool get_full_uri(char* uri, size_t max_sz) const
453+
bool get_full_uri(char *uri, size_t max_sz) const
454454
size_t full_uri_size() const
455-
void set_full_uri(const char* uri)
455+
void set_full_uri(const char *uri)
456456
```
457457

458458
**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)
466466
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.
467467

468468
```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);
471471
```
472472
473473
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
476476
477477
```cpp
478478
virtual void on_parsing_started() { }
479-
virtual void on_record_parsed(const Record& record) { }
479+
virtual void on_record_parsed(const Record &record) { }
480480
virtual void on_parsing_terminated() { }
481481
virtual void on_parsing_error(error_t error) { }
482482
```
@@ -504,8 +504,8 @@ virtual bool parse(const Record&);
504504
It aggregates `RecordParser` instances and defers parsing to the instances it contains.
505505
506506
```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);
509509
```
510510

511511
##### ndef::GenericRecordParser<ParserImplementation, ParsingResult>
@@ -514,13 +514,13 @@ This is a partial implementation of the `RecordParser` interface. It exposes a d
514514

515515
```cpp
516516
bool parse(const Record&)
517-
void set_delegate(Delegate* delegate)
517+
void set_delegate(Delegate *delegate)
518518
```
519519
520520
Implementation of this class must expose the following nonvirtual function:
521521
522522
```c++
523-
bool do_parse(const Record& record, ParsingResult& parsing_result);
523+
bool do_parse(const Record &record, ParsingResult &parsing_result);
524524
```
525525

526526
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
532532
Clients of this class must implement this delegate. It receives the objects parsed.
533533

534534
```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);
536536
```
537537
538538
**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);
544544
Parsers for each common record type exist. They inherit from the `GenericRecordParser` to exposes a common delegate interface:
545545
546546
```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)
548548
```
549549

550550
#### Simple parser
@@ -556,9 +556,9 @@ The APIs provide a class named `SimpleMessageParser` that glues together a `Mess
556556
Clients of the class can register a delegate, parse a message or add a new `RecordParser` in the parsing chain.
557557

558558
```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);
562562
```
563563
564564
##### Delegate
@@ -568,10 +568,10 @@ Clients of this class must implement this delegate. It receives events from the
568568
```cpp
569569
virtual void on_parsing_error(ndef::MessageParser::error_t error);
570570
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);
575575
virtual void on_parsing_terminated();
576576
```
577577

@@ -605,7 +605,7 @@ size_t get_max_size();
605605
void start_session(bool force = true);
606606
void end_session();
607607
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);
609609
void read_size(size_t count);
610610
void write_size();
611611
void erase_bytes(uint32_t address, size_t size)

0 commit comments

Comments
 (0)