Agree with phatpaul.
I tend to keep the variables just in the section which use it. Not only related to stack use, but also make code looks more logical.
But there's another discussion about `{}` and `do {} while {0}`, which is better?
Search found 28 matches
- Tue Mar 05, 2019 4:16 am
- Forum: ESP-IDF
- Topic: BLE gatt_client ( do while(0) )
- Replies: 6
- Views: 8352
- Tue Dec 11, 2018 3:03 am
- Forum: ESP-IDF 中文讨论版
- Topic: 蓝牙和lwip无法共存
- Replies: 3
- Views: 9022
Re: 蓝牙和lwip无法共存
@xuanzihao, 是否可以提供一个测试代码?
另外,如果你不使用select函数,直接做一个简单的socket recv,是否有问题?
另外,如果你不使用select函数,直接做一个简单的socket recv,是否有问题?
- Tue Dec 11, 2018 2:58 am
- Forum: ESP-IDF
- Topic: ESP32 Wi-Fi in AP mode and BLE scanning
- Replies: 2
- Views: 6976
Re: ESP32 Wi-Fi in AP mode and BLE scanning
Hello. I am developing an application in which BLE and Wi-Fi should be used at the same time. When the device starts, if it does not detect access points for connection, it enters the configuration mode. In this mode, ESP32 creates a Wi-Fi access point and starts a BLE scan to search for nearby dev...
- Thu Dec 06, 2018 6:21 am
- Forum: ESP-IDF 中文讨论版
- Topic: 蓝牙和lwip无法共存
- Replies: 3
- Views: 9022
Re: 蓝牙和lwip无法共存
hello~请问一下如何将蓝牙和lwip进行共存。 发现blue init后,在接收蓝牙广播过程中,使用lwip 做一个tcp client. 会出现select 错误 [0;32mI (9015) HXJ_TCPCLIENT: TCP client A select timeout occurred[0m 而单独使用tcp,不打开蓝牙,则不会出现此问题~ 蓝牙 WIFI都运行在CPU0 //蓝牙初始化如下 void blue_init() { esp_err_t ret; // Initialize NVS. /* esp_err_t ret = nvs_flash_init(); if ...
- Mon Dec 03, 2018 3:51 am
- Forum: ESP-IDF
- Topic: WIFI/BLE Simultaneously
- Replies: 67
- Views: 184578
Re: WIFI/BLE Simultaneously
Dear Mr Tian Hao, I think I solved at 50% my problem. In my Arduino IDE I previously setup the "Core Debug Level: Debug" and then I realized that this setup slow down the performance. If "Core Debug Level:" is set to "None" the performance are really improved. For example without WiFi int sketch i ...
- Thu Nov 01, 2018 3:40 am
- Forum: ESP32 Arduino
- Topic: Bluetooth Communication with GPS Tracker GPSlim236
- Replies: 4
- Views: 9750
Re: Bluetooth Communication with GPS Tracker GPSlim236
Hi, E1nste1n, From your description, you should use "bt_spp_initiator" demo. Since your android phone and terminal application can work with GPSlim236, it seems GPSlim235 start a SPP service, you should use "bt_spp_initator" to discover and connect to it. Could you try it? Welcome to discuss any pro...
- Mon Oct 22, 2018 9:53 am
- Forum: ESP-ADF
- Topic: Bluetooth wifi coexistence problem
- Replies: 6
- Views: 12109
Re: Bluetooth wifi coexistence problem
I added the wifi startup code to the play_bt_music_example in the original adf, but I didn't operate the wifi. When I connected the Bluetooth to start playing, after waiting for 5 seconds, the cpu was reset by wdt, when I removed the wifi-related function. Everything is normal, here is the error me...
- Wed Oct 10, 2018 12:08 pm
- Forum: ESP-IDF
- Topic: WIFI/BLE Simultaneously
- Replies: 67
- Views: 184578
Re: WIFI/BLE Simultaneously
Dear Mr Tian Hao, above all thanks for quick reply, I try to explain what I mean for "poor performance", I have sketch (Arduino 1.8.6) with a BLE Server, and I have an Android app to connect to the server and send some commands. This works well and fast. Now I added WiFi connection in the sketch, a...
- Wed Oct 10, 2018 3:10 am
- Forum: ESP-IDF
- Topic: WIFI/BLE Simultaneously
- Replies: 67
- Views: 184578
Re: WIFI/BLE Simultaneously
Hi Loboris or Kolban or Espressif Developer, Could you guys please provide some more useful and fruitful informations regarding how WiFi and BLE are working together from Architecture Point of View? So that ESP32 Users might have better idea and will have clear understanding regarding that. I can d...
- Wed Oct 10, 2018 3:04 am
- Forum: ESP-IDF
- Topic: WIFI/BLE Simultaneously
- Replies: 67
- Views: 184578
Re: WIFI/BLE Simultaneously
Dear Mr. Tian Hao, your post it is very interesting, and it is nice to read:-" For example, in balance preference, Bluetooth A2DP can play music fluently while WiFi is running throughput test (In sheildbox, the TCP RX can reach 8Mbps). " But as Mr. Ritesh Prajapati said We need samples and document...