Nicolino Piergiovanni

BlueNRG-1: more than 20 bytes transmission

Discussion created by Nicolino Piergiovanni on Jul 25, 2017
Latest reply on Oct 3, 2017 by Julien Tiron

Hi, all.

I started from chat examples in ...\EVAL_IDB007\BlueNRG-1 DK 2.4.0\Project\BLE_Examples\BLE_Chat.

I have added a  new service to send a message length more than 20 bytes (typically 23 bytes):

 

....

ret = aci_gatt_add_char(chatServHandle, UUID_TYPE_128, &char_uuid, 32, CHAR_PROP_NOTIFY | CHAR_PROP_READ, ATTR_PERMISSION_NONE, GATT_DONT_NOTIFY_EVENTS, 16, 1, &TXCharHandle);

....

If I send a message less or equal 20 bytes, no problem: all bytes are received by the host. If I send a message 20+x bytes long, only the last x bytes are received by the host.

I have used the ST control routine:

        while(j < end)         {          uint32_t len = MIN(20, end - j);          struct timer t;          Timer_Set(&t, CLOCK_SECOND*10);          while(aci_gatt_update_char_value(chatServHandle,TXCharHandle,0,len,(uint8_t *)cmd+j)==BLE_STATUS_INSUFFICIENT_RESOURCES)           {             APP_FLAG_SET(TX_BUFFER_FULL);            while(APP_FLAG(TX_BUFFER_FULL))             {              BTLE_StackTick();              // Radio is busy (buffer full).              if(Timer_Expired(&t))                break;            }            }               j += len;                    }/* while(j < end)*/      }

 

Anyone have used the ST BLE stack V1.x for sending messages more than 20 bytes?

Is that possible? How?

Thank in advance.

 

 

 

 



Outcomes