@@ -158,7 +158,18 @@ static esp_err_t _spp_queue_packet(uint8_t *data, size_t len){
158158 return ESP_OK;
159159}
160160
161- const uint16_t SPP_TX_MAX = 330 ;
161+ // SPP_TX_MAX seems to default to a lower amount (330) until there is congestion it then
162+ // tries to catch up but at 330, it cannot and the heap begins to take the hit.
163+ // Increasing the max to 2048 we see normal verbose xfers of 512 until congestion
164+ // when it increases briefly to 2048 then returns to 512 with no heap hit.
165+ // The rate at which we congest is dependant on how much we are attempting to TX and
166+ // how much is coming in RX from the phone.
167+ // At ~25kBps heap lowest point is 100k and stable
168+ // At ~50kBps heap lowest point is ~78k and stable
169+ // Above 50kbps it becomes unstable
170+
171+ // const uint16_t SPP_TX_MAX = 330; //Original
172+ const uint16_t SPP_TX_MAX = 512 *4 ;
162173static uint8_t _spp_tx_buffer[SPP_TX_MAX];
163174static uint16_t _spp_tx_buffer_len = 0 ;
164175
@@ -288,10 +299,13 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
288299 case ESP_SPP_CONG_EVT:// connection congestion status changed
289300 if (param->cong .cong ){
290301 xEventGroupClearBits (_spp_event_group, SPP_CONGESTED);
291- } else {
302+ log_d (" ESP_SPP_CONG_EVT: CONGESTED" );
303+ }
304+ else
305+ {
292306 xEventGroupSetBits (_spp_event_group, SPP_CONGESTED);
293307 }
294- log_v (" ESP_SPP_CONG_EVT: %s" , param->cong .cong ? " CONGESTED" : " FREE" );
308+ // log_v("ESP_SPP_CONG_EVT: %s", param->cong.cong ? "CONGESTED" : "FREE");
295309 break ;
296310
297311 case ESP_SPP_WRITE_EVT:// write operation completed
0 commit comments