[nfc] Move NFC code to the CHIP platform layer (#5665)
* [nfc] Move NFC code to the CHIP platform layer
When NFC support was added to nRF Connect examples, NFC PR
had not yet been merged to the CHIP spec. Now that NFC is
officially one of supported methods of sharing the
commissioning information, it makes sense to move the NFC
code to the platform layer of the CHIP library.
* Disable NFC commissioning for shell example
diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn
index d826d2c..46d1dd8 100644
--- a/src/platform/BUILD.gn
+++ b/src/platform/BUILD.gn
@@ -75,6 +75,10 @@
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_ble}" ]
}
+ if (chip_enable_nfc) {
+ defines += [ "CHIP_DEVICE_CONFIG_ENABLE_NFC=1" ]
+ }
+
if (chip_mdns != "none") {
defines += [ "CHIP_DEVICE_CONFIG_ENABLE_MDNS=1" ]
}
@@ -554,6 +558,13 @@
"nrfconnect/ThreadStackManagerImpl.h",
]
}
+
+ if (chip_enable_nfc) {
+ sources += [
+ "Zephyr/NFCManagerImpl.cpp",
+ "nrfconnect/NFCManagerImpl.h",
+ ]
+ }
} else if (chip_device_platform == "qpg6100") {
sources += [
"FreeRTOS/SystemTimeSupport.cpp",