bt: PORT_WriteDataCO: fixed a bug, reduced heap memory allocation
authorMarkus Becker <markus.becker@seibtundstraub.de>
Mon, 7 May 2018 19:35:13 +0000 (21:35 +0200)
committerAngus Gratton <gus@projectgus.com>
Tue, 12 Jun 2018 23:52:02 +0000 (09:52 +1000)
commit3a71ae85951885f560cc2e3659c5fac3ae609bcf
treeb622a6f42682c5e335e89dc715bd684ef01242b3
parentb2ff235bd003bf3dcb114ff7efe3e0c605c4dd9f
bt: PORT_WriteDataCO: fixed a bug, reduced heap memory allocation

* a missing pointer increment caused error, if available was > 0 after the first iteration of while(available) loop.
* changed memory allocation strategy from large fixed size (RFCOMM_DATA_BUF_SIZE) to just the needed
  size, which will be below MTU

Cherry-picked from https://github.com/espressif/esp-idf/pull/1923/
components/bt/bluedroid/stack/rfcomm/port_api.c