Mistake on this page?
Report an issue in GitHub or email us
1 /*
2  * Copyright (c) 2018 ARM Limited. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  * Licensed under the Apache License, Version 2.0 (the License); you may
5  * not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
20 #include <string>
21 #include <vector>
22 #include <stdio.h>
23 #include <stdarg.h>
25 #include "nfc/ndef/MessageBuilder.h"
26 #include "nfc/ndef/common/URI.h"
27 #include "nfc/ndef/common/util.h"
28 #include "NFCTestShim.h"
31 #include "NFCEEPROM.h"
32 #include "EEPROMDriver.h"
35 /**
36  * Wrapper class handles events specific to the EEPROM driver.
37  */
38 class NFCProcessEEPROM : NFCTestShim, mbed::nfc::NFCEEPROM::Delegate {
39 public:
40  NFCProcessEEPROM(events::EventQueue &queue, mbed::nfc::NFCEEPROMDriver &eeprom_driver);
41  virtual nfc_err_t init();
42  void queue_write_call();
43  void queue_write_long_call();
44  void queue_read_call();
45  void queue_erase_call();
46  virtual void cmd_get_max_ndef();
49 private:
50  virtual void on_ndef_message_written(nfc_err_t result);
51  virtual void on_ndef_message_read(nfc_err_t result);
52  virtual void parse_ndef_message(const mbed::Span<const uint8_t> &buffer);
53  virtual size_t build_ndef_message(const mbed::Span<uint8_t> &buffer);
54  virtual void on_ndef_message_erased(nfc_err_t result);
55 private:
56  mbed::nfc::NFCEEPROM _eeprom;
57  mbed::nfc::NFCEEPROMDriver *_ptr_eeprom_driver;
58 };
60 #endif // eeprom
virtual size_t build_ndef_message(const Span< uint8_t > &buffer)
Build a NDEF message.
virtual void on_ndef_message_read(nfc_err_t result)
The NDEF message reading request completed.
Definition: NFCEEPROM.h:80
Definition: EventQueue.h:62
The abstraction for a NFC EEPROM driver.
The NFCEEPROM delegate.
Definition: NFCEEPROM.h:60
virtual void on_ndef_message_erased(nfc_err_t result)
The NDEF message erasing request completed.
Definition: NFCEEPROM.h:66
virtual void cmd_get_max_ndef()=0
For an EEPROM, this queries and responds with the flash size, For a Controller, responds with the con...
int nfc_err_t
Type for NFC errors.
Definition: nfc_errors.h:59
Test app driver wrapper.
Definition: NFCTestShim.h:35
The NFC EEPROM class represents a NFC target device connected using a wired link (I2C, SPI, etc).
Definition: NFCEEPROM.h:46
virtual void on_ndef_message_written(nfc_err_t result)
The NDEF message writing request completed.
Definition: NFCEEPROM.h:73
virtual void parse_ndef_message(const Span< const uint8_t > &buffer)
Parse a NDEF message.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.