Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BLE GAP/GATT support to the dev-esp32 branch #3473

Open
wants to merge 32 commits into
base: dev-esp32
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2cf72b4
It compiles!!
pjsg Oct 16, 2021
4a55397
Seems to sort of work.
pjsg Oct 16, 2021
f8709b9
Fixed the docs and add support for advertising data
pjsg Oct 17, 2021
0a4253a
Ensure that BT and STRUCT are enabled. Can't figure out how to enforc…
pjsg Oct 17, 2021
06becd1
Try and get shutdown to work
pjsg Oct 18, 2021
69405ce
Paritally working
pjsg Oct 18, 2021
e803610
Now actually gets started
pjsg Oct 19, 2021
28cb898
Making progress on ble
pjsg Oct 19, 2021
96993ef
FIx the advertising start
pjsg Oct 21, 2021
d204d33
Use the hardware random number generator
pjsg Oct 21, 2021
6b55c39
Merge remote-tracking branch 'origin/dev-esp32-idf4' into ble
pjsg Oct 21, 2021
52562a6
Got rid of the random printfs
pjsg Oct 24, 2021
7b6a85b
Remove trailing spaces
pjsg Oct 24, 2021
3f33027
See if this fixes the cross compiles
pjsg Oct 24, 2021
b5c4082
Allow dynamic update of advertisements
pjsg Oct 26, 2021
4109e30
Prevent ble.shutdown() as it corrupts something...
pjsg Nov 5, 2021
7e123b2
Apply suggestions from code review
pjsg Nov 9, 2021
7aa2233
Add support for notify (untested)
pjsg Jan 6, 2022
13e1dad
Update the docs to match the code
pjsg Jan 6, 2022
adc188b
Merge remote-tracking branch 'origin/dev-esp32-idf4' into ble
pjsg Jan 7, 2022
4d24232
Notify seems to work now.
pjsg Jan 8, 2022
225217c
Updated the Kconfig to note that you have to enable the Nimble module…
pjsg Feb 20, 2022
f18e9d5
Merge remote-tracking branch 'origin/dev-esp32-idf4' into ble
pjsg Mar 5, 2022
891cf01
Review comments
pjsg Mar 5, 2022
3e5ba28
Moved the flash init logic
pjsg Mar 6, 2022
1c26ba3
FIx missing } in an example
pjsg Mar 6, 2022
9483312
Merge remote-tracking branch 'origin/dev-esp32' into ble
pjsg Jan 14, 2024
aaaa440
First attempt to add name support to characteristics
pjsg Jan 15, 2024
55ab2fa
Now correctly supports adding User Description desriptors
pjsg Jan 15, 2024
8cafd55
Merge remote-tracking branch 'origin/dev-esp32' into ble
pjsg Jan 31, 2024
3e4dd23
Now runs on idf5 and you can start and stop the stack!
pjsg Jan 31, 2024
0b6205b
Fix memory leak now that we can shutdown the stack
pjsg Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion components/base_nodemcu/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ void __attribute__((noreturn)) app_main(void)

nodemcu_init ();

nvs_flash_init ();
// This is the standard flash init sequence
int rc = nvs_flash_init();
if (rc == ESP_ERR_NVS_NO_FREE_PAGES || rc == ESP_ERR_NVS_NEW_VERSION_FOUND) {
nvs_flash_erase();
nvs_flash_init();
}

esp_netif_init ();

start_lua ();
Expand Down
7 changes: 7 additions & 0 deletions components/lua/lua-5.3/luaconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@
# define LUA_FLOAT_TYPE LUA_FLOAT_FLOAT
#endif

#ifdef LUA_USE_ESP
#define L_RANDMAX 2147483647
extern uint32_t esp_random(void);
#define l_rand() (esp_random() & L_RANDMAX)
#define l_srand(x)
#endif

/*
** Configuration for Paths.
**
Expand Down
1 change: 1 addition & 0 deletions components/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set(module_srcs
"adc.c"
"bit.c"
"ble.c"
"bthci.c"
"common.c"
"crypto.c"
Expand Down
10 changes: 9 additions & 1 deletion components/modules/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ menu "NodeMCU modules"
Includes the bit module. This module provide bit manipulation
functions on Lua numbers.

config NODEMCU_CMODULE_BLE
bool "Bluetooth GAP/GATT interface module"
default "n"
select NODEMCU_CMODULE_STRUCT
select BT_ENABLED
help
Includes the simple Bluetooth GAP/GATT module. You must enable the Nimble BLE module as well.
pjsg marked this conversation as resolved.
Show resolved Hide resolved

config NODEMCU_CMODULE_BTHCI
bool "BlueTooth HCI interface module"
bool "Bluetooth HCI interface module"
default "n"
select BT_ENABLED
help
Expand Down
Loading
Loading