cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX no longer generates BLE Notification functions

LucaP
Associate II

Hello Community,

I have been working on a BLE project with one service and three characteristics, two of which have server notification properties, and I have noticed the following issue in CubeMX 6.15 (server side, custom template).

The function Custom_<CHAR_NAME>_Send_Notification() is no longer auto-generated in custom_app.c if the length is greater that the limit supported by aci_gatt_update_char_value(), which is (BLE_CMD_MAX_PARAM_LEN - 6).

In past CubeMX versions, any char with length greater that such limit genered of a function that internally called aci_gatt_update_char_value_ext(), which indeed supports chars up to 512:

void Custom_CHAR_Send_Notification(void) /* Property Notification */
{
  uint8_t updateflag = 0;

  /* USER CODE BEGIN Data_NS_1*/
  updateflag = Custom_App_Context.Data_Notification_Status;
  /* USER CODE END Data_NS_1*/

  if (updateflag != 0)
  {
Custom_STM_App_Update_Char_Ext(Connection_Handle, CUSTOM_STM_CHAR, (uint8_t *)NotifyCharData);
  }

  /* USER CODE BEGIN Data_NS_Last*/

  /* USER CODE END Data_NS_Last*/

  return;
}

The latest CubeMX still generates the Send_Notification() function for shorter lengths, but as I soon and I change the length to 512 and re-generate code, the function disappears from custom_app.c. Without that, there is no way to send a notification to the client, unless I implement the function manually. 

Am I missing something? Thanks!

0 REPLIES 0