cancel
Showing results for 
Search instead for 
Did you mean: 

How to use UpdateCharData[] and Custom_App_Context_t

JT.2
Associate

I am new to microcontroller development and trying to implement my first custom ble service.

I looked at a few other examples that often use the _App_Context_t struct to store data before passing it to the character update method.

Example:

Custom_STM_App_Update_Char(CUSTOM_STM_LED_VALUE, (uint8_t *) &Custom_App_Context.LEDMeasurement.LED1_Value);

However, after enabling notifications for some characteristics, cubemx also generates methods like

Custom_Led_value_Update_Char() and Custom_Led_value_Send_Notification() that send data via the UpdateCharData[247]; and NotifyCharData[247]; arrays defined at the top of the file.

Could someone explain the difference between those arrays and using a App_Context, the reason for their 247 byte length etc.?

void Custom_Led_value_Update_Char(void) /* Property Read */
{
  Custom_STM_App_Update_Char(CUSTOM_STM_LED_VALUE, (uint8_t *)UpdateCharData);
  /* USER CODE BEGIN Led_value_UC*/
 
  /* USER CODE END Led_value_UC*/
  return;
}

0 REPLIES 0