I could successfully make the branch at commit 5105417
and send the example blink LED application to a Xenon, however, the make failed when I tried to send the example app in the NFC Wiring API Test
. The cpp file generated from the Workbench:
#include "application.h"
#line 1 "/Users/aaronroller/dev/projects/particle/nfc-test/src/nfc-demo.ino"
void nfc_event_handler(nfc_event_type_t type, nfc_event_t *event, void* ctx);
void setup();
void loop();
#line 1 "/Users/aaronroller/dev/projects/particle/nfc-test/src/nfc-demo.ino"
void nfc_event_handler(nfc_event_type_t type, nfc_event_t *event, void* ctx) {
switch (type) {
case NFC_EVENT_FIELD_ON: digitalWrite(D7, 1); break;
case NFC_EVENT_FIELD_OFF: digitalWrite(D7, 0); break;
case NFC_EVENT_READ: digitalWrite(D7, 0); break;
default: break;
}
}
void setup() {
pinMode(D7, OUTPUT);
digitalWrite(D7, 0);
System.on(button_click, [](system_event_t ev, int clicks)->void {
NFC.getNdefMessage()[0] = std::make_shared<TextRecord>("Update record - 1!", "en");
NFC.getNdefMessage()[1] = std::make_shared<TextRecord>("Update record - 2!", "en");
NFC.getNdefMessage()[2] = std::make_shared<TextRecord>("Update record - 3!", "en");
NFC.getNdefMessage().addTextRecord("New record!", "en");
NFC.stop();
NFC.start(nfc_event_handler);
});
NFC.getNdefMessage().addTextRecord("Hello Particle!", "en");
NFC.getNdefMessage().addUriRecord("particle.io", UriRecord::NFC_URI_HTTPS_WWW);
NFC.getNdefMessage().addLauchAppRecord("no.nordicsemi.android.nrftoolbox");
NFC.start(nfc_event_handler);
}
void loop() {
}
make clean all PLATFORM=xenon APPDIR=../../nfc-test/src/ -s program-dfu
...
Downloading to address = 0x00030000, size = 616144
Download [=========================] 100% 616144 bytes
Download done.
File downloaded successfully
Creating module_user_memory.ld ...
../../../build/target/wiring/platform-14-m//libwiring.a(spark_wiring_nfc.o): In function `particle::NfcTagType2::stop()':
/device-os/wiring/src/spark_wiring_nfc.cpp:206: undefined reference to `hal_nfc_type2_stop_emulation()'
../../../build/target/wiring/platform-14-m//libwiring.a(spark_wiring_nfc.o): In function `particle::NfcTagType2::start(void (*)(nfc_event_type_t, nfc_event_t*, void*))':
/device-os/wiring/src/spark_wiring_nfc.cpp:188: undefined reference to `hal_nfc_type2_init()'
/device-os/wiring/src/spark_wiring_nfc.cpp:197: undefined reference to `hal_nfc_type2_set_payload(void const*, unsigned int)'
/device-os/wiring/src/spark_wiring_nfc.cpp:198: undefined reference to `hal_nfc_type2_set_callback(void (*)(nfc_event_type_t, nfc_event_t*, void*))'
/device-os/wiring/src/spark_wiring_nfc.cpp:199: undefined reference to `hal_nfc_type2_start_emulation()'
collect2: error: ld returned 1 exit status
make[1]: *** [/nfc-test/src//target/.elf] Error 1
make: *** [/device-os/modules/xenon/user-part/makefile] Error 2
I’m on a Macbook 10.13.3 if that matters.
The Xenon I flashed.
My story is to have the Xenon scan a Passive tag that has a URI with the UID as a parameter already encoded. I plan to read the URI that has the UID as a parameter which is handy because per the README the UID won’t be available from the NFC API.
If I can get basic NFC capabilities working, I will be an enthusiastic real world tester with 30 Argons and Xenons ready to go. I can deploy the branch code since my app is also Beta.
Thanks! Aaron