mirror of
https://github.com/espruino/Espruino.git
synced 2025-12-08 19:06:15 +00:00
Don't build NFC functions into devices that can't do it, and also improve docs on them
This commit is contained in:
parent
e57b51dfb6
commit
f47da1cd39
@ -366,7 +366,7 @@ Called with discovered characteristics when discovery is finished
|
||||
"type" : "event",
|
||||
"class" : "NRF",
|
||||
"name" : "NFCon",
|
||||
"ifdef" : "NRF52"
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)"
|
||||
}
|
||||
Called when an NFC field is detected
|
||||
*/
|
||||
@ -374,7 +374,7 @@ Called when an NFC field is detected
|
||||
"type" : "event",
|
||||
"class" : "NRF",
|
||||
"name" : "NFCoff",
|
||||
"ifdef" : "NRF52"
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)"
|
||||
}
|
||||
Called when an NFC field is no longer detected
|
||||
*/
|
||||
@ -385,7 +385,7 @@ Called when an NFC field is no longer detected
|
||||
"params" : [
|
||||
["arr","JsVar","An ArrayBuffer containign the received data"]
|
||||
],
|
||||
"ifdef" : "NRF52"
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)"
|
||||
}
|
||||
When NFC is started with `NRF.nfcStart`, this is fired
|
||||
when NFC data is received. It doesn't get called if
|
||||
@ -2010,7 +2010,7 @@ void jswrap_ble_setLowPowerConnection(bool lowPower) {
|
||||
"type" : "staticmethod",
|
||||
"class" : "NRF",
|
||||
"name" : "nfcURL",
|
||||
"ifdef" : "NRF52",
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)",
|
||||
"generate" : "jswrap_nfc_URL",
|
||||
"params" : [
|
||||
["url","JsVar","The URL string to expose on NFC, or `undefined` to disable NFC"]
|
||||
@ -2088,7 +2088,7 @@ void jswrap_nfc_URL(JsVar *url) {
|
||||
"type" : "staticmethod",
|
||||
"class" : "NRF",
|
||||
"name" : "nfcPair",
|
||||
"ifdef" : "NRF52",
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)",
|
||||
"generate" : "jswrap_nfc_pair",
|
||||
"params" : [
|
||||
["key","JsVar","16 byte out of band key"]
|
||||
@ -2149,7 +2149,7 @@ void jswrap_nfc_pair(JsVar *key) {
|
||||
"type" : "staticmethod",
|
||||
"class" : "NRF",
|
||||
"name" : "nfcAndroidApp",
|
||||
"ifdef" : "NRF52",
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)",
|
||||
"generate" : "jswrap_nfc_androidApp",
|
||||
"params" : [
|
||||
["app","JsVar","The unique identifier of the given Android App"]
|
||||
@ -2208,7 +2208,7 @@ void jswrap_nfc_androidApp(JsVar *appName) {
|
||||
"type" : "staticmethod",
|
||||
"class" : "NRF",
|
||||
"name" : "nfcRaw",
|
||||
"ifdef" : "NRF52",
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)",
|
||||
"generate" : "jswrap_nfc_raw",
|
||||
"params" : [
|
||||
["payload","JsVar","The NFC NDEF message to deliver to the reader"]
|
||||
@ -2270,7 +2270,7 @@ void jswrap_nfc_raw(JsVar *payload) {
|
||||
"type" : "staticmethod",
|
||||
"class" : "NRF",
|
||||
"name" : "nfcStart",
|
||||
"ifdef" : "NRF52",
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)",
|
||||
"generate" : "jswrap_nfc_start",
|
||||
"params" : [
|
||||
["payload","JsVar","Optional 7 byte UID"]
|
||||
@ -2339,7 +2339,7 @@ JsVar *jswrap_nfc_start(JsVar *payload) {
|
||||
"type" : "staticmethod",
|
||||
"class" : "NRF",
|
||||
"name" : "nfcStop",
|
||||
"ifdef" : "NRF52",
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)",
|
||||
"generate" : "jswrap_nfc_stop",
|
||||
"params" : [ ]
|
||||
}
|
||||
@ -2363,7 +2363,7 @@ void jswrap_nfc_stop() {
|
||||
"type" : "staticmethod",
|
||||
"class" : "NRF",
|
||||
"name" : "nfcSend",
|
||||
"ifdef" : "NRF52",
|
||||
"#if" : "defined(NRF52) && defined(USE_NFC)",
|
||||
"generate" : "jswrap_nfc_send",
|
||||
"params" : [
|
||||
["payload","JsVar","Optional tx data"]
|
||||
|
||||
@ -421,6 +421,8 @@ def get_ifdef_description(d):
|
||||
if d=="USE_FLASHFS": return "devices with filesystem in Flash support enabled (ESP32 only)"
|
||||
if d=="USE_TERMINAL": return "devices with VT100 terminal emulation enabled (Pixl.js only)"
|
||||
if d=="USE_TELNET": return "devices with Telnet enabled (Linux, ESP8266 and ESP32)"
|
||||
if d=="USE_WIZNET": return "builds with support for WIZnet Ethernet modules built in"
|
||||
if d=="USE_NFC": return "NFC (Puck.js, Pixl.js, MDBT42Q)"
|
||||
print("WARNING: Unknown ifdef '"+d+"' in common.get_ifdef_description")
|
||||
return d
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user