12 Commits

Author SHA1 Message Date
Gordon Williams
1e0bf95da6 Fixed build issues for bluetooth with no centrals (microbit1) 2022-10-28 11:31:11 +01: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
5c08b7c334 Initial support for multiple connections on nRF52 2022-06-15 16:54:08 +01:00
Gordon Williams
8861b27954 Util Timer now runs independently of system time. More accurate on nRF52 (fix #2125)
Also remove (mostly) duplicated jshPinPulse
2022-03-03 16:43:00 +00:00
Gordon Williams
66d3905968 minor refactor to make connection types more obvious 2018-07-12 17:34:21 +01:00
jumjum123
c5684284ea Fixed problems around Advertising. There are still some, ....
Added patch from Rob Blanckaert
Added set Encrypton to gatts connect handler

esp32_gatts_func.h
- added a bool for connected from a client in gatts_service_inst
esp32_gatts_func.c
- added include for esp_gap_ble_api.h
- added function to check if a client is connected
- added patches from Rob Blanckaert ( https://github.com/basicer/Espruino/tree/ESP32-v3.0 ) to gatts_write_value_handler
- added esp_ble_set_encryption to gatts_connect_handler
- added handling of connected flag, see esp32_gatts_func.h
- fixed startAdvertising, started only if no client is connected
- added permissions to UART decriptor, patch from Rob Blanckaert
- set connected to false in initialisation
2018-06-15 11:22:09 +02:00
jumjum123
6b99663402 added buffer handling for Bluetooth serial print
esp32_gatts_func.c
- send notification with buffer, replaced gatts_sendNotification to copy character to buffer first
  send on buffer full or latest on 10msec later
bluetooth.h
- added definition GATT_MTU_SIZE_DEFAULT
- added definition BLE_NUS_MAX_DATA_LEN
2018-06-08 13:25:31 +02: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