34 Commits

Author SHA1 Message Date
Gordon Williams
480033719f fix ESP32 build 2025-05-13 10:56:28 +01:00
Gordon Williams
b84efeca3e Change ioBuffer FIFO from 4 byte blocks to variable length blocks. Far more efficient for USB/BLE/other block data 2025-02-26 16:22:58 +00:00
Gordon Williams
9090fcf83e ESP32C3: don't kick connected BLE devices off if reset() is called
ESP32C3: disable warnings about "BT_BTM: BTM_GetSecurityFlags false"
2024-11-04 11:36:28 +00:00
Gordon Williams
621dbc8b76 ESP32: Fix setServices with 128bit UUIDs, fix NRF.setServices' onWrite and notify/indicate 2024-04-23 16:17:43 +01:00
Gordon Williams
812adddcc6 Add jsvGet...Child functions to replace common call patterns - saves 280 bytes on Pico 2024-01-29 20:55:05 +00:00
Gordon Williams
4327ebd34e Tidying up error messages (no trailing '.' or '\n'), making almost-similar error messages the same
Used the following to try and find issues:

find . -name "*.c" | xargs -I{} grep -h jsExceptionHere {} | sed -e "s/^[^\"]*\"/\"/" | sort | uniq -c
2023-10-06 10:47:58 +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
82d0077263 removing tabs in ESP32 code 2023-05-03 14:16:57 +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
18472be484 ESP32: Fix build with asserts enabled
ESP32: Add BTN1 (D0/BOOT) and LED1 (D2) as these appear to be reasonably common in boards
2023-01-24 15:22:41 +00:00
Gordon Williams
51b22bb3a0 ESP32: Allow up to 16k vars (if enough memory), allow non-active scan, and remove 30s BLE scan limit 2022-12-09 17:08:29 +00:00
Gordon Williams
891029bfde ESP32: Bluetooth LE tweaks - central mode connects, scans, reads, writes and notifies
Bluetooth: fix for incorrect Bluetooth task strings shown in some errors
Tried to move common code in jsble_exec_pending into jsble_exec_pending_common
2022-10-27 15:28:28 +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
d07dc0c0b9 ESP32 BLE improvements - less warnings, connect works, getPrimaryService works with >16 bit UUIDs 2022-10-18 14:20:25 +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
5c08b7c334 Initial support for multiple connections on nRF52 2022-06-15 16:54:08 +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
147be42006 nRF52: 'BLE task in progress' messages now give a readable name, not a task numbe nRF52: BLE stack errors now reports a line number
nRF52: 'BLE task in progress' messages now give a readable name, not task numberr
2021-08-13 10:16:09 +01:00
Gordon Williams
5ee483ada5 Fix ESP32 bluetooth compile 2021-05-28 13:34:08 +01:00
Gordon Williams
3c5b78ea75 fix ESP32 build regression 2020-10-29 08:11:07 +00:00
Gordon Williams
542265bdb9 nRF5x: Add callback param to 'NRF.restart', allowing code to be called with softdevice disabled 2020-10-26 13:58:55 +00:00
MaBecker
a38b8054bf esp32_improvement
* keep jsWarn() for not implemented functions
* add Exceptions for issues
2020-07-14 08:57:43 +02:00
MaBecker
bbc372620c esp32_improvements
- add FLASH_BAUD
- fix erase_flash
- switch jsWarn()  to jsDevInfo()
- keep jsWarn()/ jsError() for not implemented functions
- switch jsError() to jsExceptionHere() if helpfull
2020-07-13 17:52:38 +02:00
Gordon Williams
8274d48c33 nRF52: Add NRF.getSecurityStatus to allow devices to detect the current state of the connection 2019-04-23 12:24:40 +01:00
Gordon Williams
b6a256fe77 nRF52: Now create exception if advertising calls fail (but ignore when in IRQ)
nRF52: Add setAdvertising({},{scannable:false}) for disabling scan response
            nRF52: Add note about connectable:false requiring >=100ms intervals
2019-04-04 19:24:37 +01:00
Gordon Williams
e56d91b044 Added active option to NRF.setScan/findDevices/requestDevices to allow scan response packets to be requested 2019-02-11 09:35:54 +00:00
Gordon Williams
eeb9ec8dd5 nRF52: Add docs for properties that weren't documented before
nRF52: Add ability to connect to device with passkey authentication
2019-01-31 14:23:26 +00:00
Gordon Williams
5d76771c11 Massive bluetooth name refactoring, potentially to help with #1445 2018-09-03 17:07:23 +01:00
Gordon Williams
66d3905968 minor refactor to make connection types more obvious 2018-07-12 17:34:21 +01:00
Gordon Williams
3583ef52cd Add options argument to NRF.connect and BluetoothDevice.gatt.connect, allowing a connection interval to be specified 2018-07-12 10:51:29 +01:00
jumjum123
9d6b6ea7b6 Added init security and implementation for jsble_xxxxx_connection
esp32_gap_func.c
- support event ESP_GAP_BLE_SEC_REQ_EVT
- restructured addAdvertisingDeviceName restructured
- added function addAdvertisingUart
- added handling of UART in bluetooth_gap_getAdvertisingData
- added function gap_init_security
esp32_gap_func.h
- added definition for gap_init_security();
bluetooth.c
- added call of gap_initSecurity in jsble_init
- added implementation for jsble_has_connection()
- added implementation for jsble_has_central_connection()
- added implementation jsble_has_simple_connection()
2018-06-08 12:40:51 +02:00
jumjum123
0054b39c00 ESP32.py
- added variables_mode in config.
build_platform_config.py
- added define for variables_mode
jsvar.h
- added jsVarsSize;  //size of jsVars for option malloc
- added support of malloc jsVars in jsvInit
jsvar.c
- added definition jsVars for variables_mode_malloc
jshardwareESP32.h
- new file with functions to set/get enable status of BLE and Wifi
jshardwareESP32.c
- new file with functions to set/get enable status of BLE and Wifi
ESP32.make
- added jshardware.c to SOURCES
main.c
- added handling for Wifi enabled
- added calculation for jsVars
- initialise jsVars based on calculation
jshardware.c
- used new API call to get Serial Number, even if Wifi is not enabled
- initialises BLE, if BLE is enabled (in NVS storage)
bluetooth.c
- check if BLE is enabled before initialising
jswrap_esp32.h
- defines functions to enable BLE and/or Wifi
jswrap_esp32.c
- wrapper for functions to enable BLE/Wifi, remove code from Flash, to avoid overflow in jsVars
- added status for BLE/Wifi to ESP32.getStatus
esp32_gap_func.c
- get mac adress even if Wifi is not enabled

 Changes to be committed:
	modified:   boards/ESP32.py
	modified:   make/family/ESP32.make
	modified:   scripts/build_platform_config.py
	modified:   src/jsvar.c
	modified:   src/jsvar.h
	modified:   targets/esp32/BLE/esp32_gap_func.c
	modified:   targets/esp32/bluetooth.c
	modified:   targets/esp32/jshardware.c
	new file:   targets/esp32/jshardwareESP32.c
	new file:   targets/esp32/jshardwareESP32.h
	modified:   targets/esp32/jswrap_esp32.c
	modified:   targets/esp32/jswrap_esp32.h
	modified:   targets/esp32/main.c
2018-06-01 12:23:00 +02:00
wilberforce
883000cf81 update esp-idf to v3.0. BLE support - thanks to @jumjum. 2500 vars. Erase flash before flashing 2018-05-13 13:54:02 +12:00