363 Commits

Author SHA1 Message Date
fanoush
c73ab40ca6 cleanup - move nfc_raw_data_start 2023-08-29 19:02:35 +02:00
fanoush
365748f825 fix non nfc build 2023-08-29 00:24:50 +02:00
fanoush
f4398ce28c remove duplicated code from NRF.nfcXXXX methods
- move common code from jswrap_nfc_raw into  nfc_raw_data_start and reuse it in all NRF.nfc methods
- also avoid creating one extra flat string copy of the payload
2023-08-29 00:13:21 +02:00
fanoush
126714286c allow NDEF records with length over 254 bytes
- use 3 byte length in NDEF TLV block when over 254 bytes
- store 16bit url payload length
-add maximum lenght checking (type 2 tag data is up to 992 bytes)
2023-08-25 22:34:41 +02:00
Simon Sievert
0e3d5d2b33
ble: allow disabling pairing with NRF.setSecurity 2023-08-16 09:47:44 +02:00
Gordon Williams
2c7d11f575 nRF5x: Add NRF.on("passkey", ...) to allow passkey pairing with NRF.setSecurity({mitm:1, display:1}); 2023-08-15 15:35:18 +01:00
Gordon Williams
ee9117923d
Update jswrap_bluetooth.c
Add useful example code
2023-08-15 14:51:44 +01:00
Simon Sievert
f2446ac6f8
ble: add method to resolve random addresses
This adds a method NRF.resolveAddress(), that allows resolving a "random private resolvable address" of a bonded peer to that peer's actual address.
2023-08-14 19:53:03 +02:00
Gordon Williams
e08448dbb3 nRF5x: Ensure we don't start advertising immediately after softdevice restart if NRF.sleep() was used 2023-08-10 13:16:05 +01:00
Gordon Williams
845b2d02d4 nRF52: Add NRF.on('error') event to provide an easy way to check for Softdevice errors 2023-07-14 16:30:17 +01:00
Gordon Williams
acef6f7133 tweak to fix ERROR_BUSY 2023-07-14 16:28:29 +01:00
Gordon Williams
d69b5223a9 We now get local time info, and have promises: NRF.ctsGetTime().then(print) 2023-07-14 16:28:18 +01:00
Gordon Williams
6ab9723e80 Remove line added for debug that doesn't work, add docs, fix patch 2023-07-14 16:27:40 +01:00
Gordon Williams
802a3001f3 nRF52: Added CTS (Current Time Service) support to ANCS/AMS code 2023-07-14 16:27:28 +01:00
Gordon Williams
7dfc519e42 Allow builds for SDK 15.3.0 (from SDK 15.0.0)
# Conflicts:
#	targets/nrf5x/main.c
2023-07-05 13:47:44 +01:00
Gordon Williams
4637bb5959 Added NRF.eraseBonds() to allow peer manager info to be removed (other than by holding all buttons down) 2023-07-05 13:44:12 +01:00
Gordon Williams
80eb114f4a
Merge branch 'master' into f-SD6.1-advertising 2023-05-10 15:14:43 +01:00
fanoush
00396b5060 jsble_advertising_update_scanresponse stub for ESP32 2023-05-10 16:02:21 +02:00
fanoush
a6c41185c1 for SD>5 use static buffers for advertising and scan response data
S140 6.1.x and up no longer makes its own copy of advertising data, provided buffers need to be valid all the time, also any change needs new set of buffers (otherwise it fails with NRF_ERROR_INVALID_STATE)
2023-05-10 14:35:45 +02:00
Rob Pilling
efed55401d typescript: sendHIDReport, number[] and optional callback 2023-05-08 12:59:55 +01:00
Gordon Williams
7651847c3b Attempting to improve BLE advertising situation on ESP32. Fixed issue with BLE advertising data for name being 2 too long 2023-05-03 20:17:25 +01:00
Gordon Williams
0129aca033 Removing a bunch of ESP32 BLE warning messages 2023-05-03 14:14:40 +01:00
Gordon Williams
9b30f17227 Added jsvObjectGetChildIfExists to avoid the jsvObjectGetChild(... ,0) case - saves ~300b of flash space 2023-04-25 10:59:34 +01:00
Gordon Williams
fd0963dcbc nRF52: Add NRF.on('bond'/'advertising') events to keep track of BLE status more easily 2023-03-22 14:36:24 +00:00
Gordon Williams
9841d5401d disable whenConnected for MICROBIT1 (too little free memory) 2023-03-13 11:39:25 +00:00
Gordon Williams
a37c24f682 nRF52: Add NRF.setAdvertising({},{whenConnected:true}) to allow advertisements to be sent while a connection is active
+            nRF52: Fix NRF.getSecurityStatus's 'advertising' field (only appeared when connected previously)
2023-03-13 11:30:38 +00:00
Rob Pilling
21df2a0bf3 Update NRFSecurityStatus type
This updates the `NRFSecurityStatus` type from a prior commit
(#2337), always exposing `advertising` and clarifying other properties
depending on `connected`'s value.
2023-03-06 12:11:05 +00:00
Gordon Williams
e0cffe2ae3 Docs for #2337 2023-03-06 10:03:07 +00:00
Rob Pilling
250fb353a3 Add typing for getSecurityStatus() 2023-03-03 08:07:31 +00:00
Rob Pilling
953f33d683 Update docs with [optional] (for typescript) 2023-02-08 22:48:30 +00:00
Gordon Williams
fdee733788 Add ESPR_NO_PROMISES to allow promises to be left out of builds (specifically micro:bit 1). Adjust ifdefs so if no central mode, we're not including functionality we don't want 2022-10-28 13:55:22 +01:00
Gordon Williams
950cf2ef91 More ESP32 bluetooth fixes - can now find services/characteristics and read/write. No Notify yet 2022-10-18 16:36:52 +01:00
Gordon Williams
b01ed3dafa docs (fix #2251) 2022-07-28 09:23:17 +01:00
Gordon Williams
0d323d82fe
Merge pull request #2254 from qucchia/typescript
Typescript
2022-07-28 08:37:50 +01:00
qucchia
b4cf252826 TypeScript: Some Bluetooth and Wifi functions 2022-07-27 20:14:18 +02:00
qucchia
0ff89a939a More typos 2022-07-27 16:23:58 +02:00
qucchia
c5bb94bf7a Limit documentation comments to 80 characters (#2244) 2022-07-27 15:32:19 +02:00
qucchia
6b45a91fd1 Declare some custom TypeScript types 2022-07-23 20:16:15 +02:00
Gordon Williams
c122be92b3 better docs 2022-07-22 08:21:16 +01:00
Gordon Williams
bece571f8e Bangle.js 2: Fix NRF.setAdvertising({},{scannable:false})
Bangle.js 2: Initial long range functionality (via `phy:"coded"` in `NRF.setAdvertising/setScan/requestDevice/findDevices`)
2022-07-20 17:13:18 +01:00
Gordon Williams
c79fa0093f nRF5x: Add 'onWriteDesc' in NRF.setServices - allowing you to know when something subscribed for notifications 2022-07-05 09:27:49 +01:00
Gordon Williams
5c08b7c334 Initial support for multiple connections on nRF52 2022-06-15 16:54:08 +01:00
Gordon Williams
b7ebc81b4a nRF5x: Fix memory leak (of address) when using NRF.setScan/requestDevice/findDevice 2022-05-26 11:08:24 +01:00
Gordon Williams
295d5964ef nRF5x: Allow NRF.setAdvertising to set advertised service UUIDs (vs service data) easily with NRF.setAdvertising({'180D':undefined}) 2022-04-05 10:43:47 +01:00
Gordon Williams
e0dc690293 nRF5x: Fix merging of packers for NRF.findDevice - previously name fields in subsequent packets may have been left as 'undefined'
nRF5x: NRF.findDevice now aggregates multiple packets even if only one packet matches the filter (fix #2178)
2022-04-05 10:05:21 +01:00
Gordon Williams
aaa91394df Bangle.js2: Ensure NRF.setTxPower works for all connections and advertising 2022-03-08 10:29:50 +00:00
Gordon Williams
264fbac6de Fix build regression (fix #2148) 2022-02-14 11:52:07 +00:00
Gordon Williams
592626dc36 NRF.setScanResponse now works on SDK15 2022-02-09 16:30:39 +00:00
Gordon Williams
7c2bb3265c NRF.setAdvertising converts arrays of arrays to arrays of ArrayBuffers. Also don't update advertising when connected. 2022-02-03 10:46:12 +00:00
Gordon Williams
db5cca9675 NRF.getSecurityStatus now returns 'connected_addr' for the address of the currently-connected device 2022-02-03 08:12:35 +00:00