diff --git a/libs/bluetooth/jswrap_bluetooth.c b/libs/bluetooth/jswrap_bluetooth.c index a9c1768e6..50013f999 100644 --- a/libs/bluetooth/jswrap_bluetooth.c +++ b/libs/bluetooth/jswrap_bluetooth.c @@ -2372,7 +2372,7 @@ void jswrap_ble_setTxPower(JsVarInt pwr) { } **THIS IS DEPRECATED** - please use `NRF.setConnectionInterval` for peripheral -and `NRF.connect(addr, options)`/`BluetoothRemoteGATTServer.connect(options)` +and `NRF.connect(address, options)`/`BluetoothRemoteGATTServer.connect(options)` for central connections. This sets the connection parameters - these affect the transfer speed and power @@ -3831,7 +3831,7 @@ JsVar *jswrap_ble_startBonding(bool forceRePair) { "ifdef" : "NRF52_SERIES" } A Web Bluetooth-style device - you can request one using -`NRF.requestDevice(address)` +`NRF.requestDevice(options)` For example: diff --git a/scripts/build_docs.py b/scripts/build_docs.py index 8ff2368bd..cfeca6200 100755 --- a/scripts/build_docs.py +++ b/scripts/build_docs.py @@ -84,9 +84,12 @@ def htmlify(d,current): end = d.find("", idx) while idx>=0 and end>idx: codeBlock = d[idx+6:end] - # search for known links in code - if codeBlock[-2:]=="()" and codeBlock[:-2] in links: - codeBlock = ""+codeBlock+""; + # search for known links in code (any function call regardless of param names) + m = re.match(r"^([A-Za-z0-9.]+)\([A-Za-z0-9,\.]*\)$", codeBlock) + if m: + link = m.groups()[0] + if link+"()" in links: # 'and link!=current' would stop a function linking to itself + codeBlock = ""+codeBlock+""; elif codeBlock in links: codeBlock = ""+codeBlock+""; # ensure multi-line code is handled correctly @@ -281,8 +284,10 @@ def insert_mdn_link(jsondata): def add_link(jsondata): if not "no_create_links" in jsondata: link = get_prefixed_name(jsondata); - if link!="global": - links[link] = get_link(jsondata) + url = get_link(jsondata) + links[link] = url + if common.is_function(jsondata): + links[link+"()"] = url jsondatas = sorted(jsondatas, key=lambda s: common.get_name_or_space(s).lower()) html('
') diff --git a/scripts/common.py b/scripts/common.py index c2a84ef10..85998e1b7 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -421,7 +421,7 @@ def is_property(jsondata): return jsondata["type"]=="property" or jsondata["type"]=="staticproperty" or jsondata["type"]=="variable" def is_function(jsondata): - return jsondata["type"]=="function" or jsondata["type"]=="method" + return jsondata["type"]=="method" or jsondata["type"]=="staticmethod" or jsondata["type"]=="function" def get_prefix_name(jsondata): if jsondata["type"]=="event": return "event"