cancel
Showing results for 
Search instead for 
Did you mean: 

[BLE] CubeMX does not generate read characteristic update function in "custom_app.c"

DecaMeron
Associate

Hi,

I'm building a BLE application using custom template in STM32CubeMX. I have two services. The first one has only one characteristic with the properties "Read" and "Write without response". The second service has two characteristics, both with "Read" and "Notify" properties.

The code generated in "custom_app.c" have the function:

void Custom_<Srv2Char1>_Update_Char(void){...}
void Custom_<Srv2Char1>_Send_Notification(void){...}
void Custom_<Srv2Char2>_Update_Char(void){...}
void Custom_<Srv2Char2>_Send_Notification(void){...}

However, no function is generated for the characteristic of the first service. I expected to have a function like this:

void Custom_<Srv1Char1>_Update_Char(void){...}

 

I performed some tests:

  1. Used shorter names for the characteristics.
  2. Created two new characteristics, one in service 1 and the other in service 2, both with only the "Read" property enabled.

In both cases, no "Update_Char" function was generated.


I don’t know if this behavior is correct. If it is, how am I supposed to respond to a "Read" request?
Here’s what I’m doing:

void Custom_STM_App_Notification(Custom_STM_App_Notification_evt_t *pNotification)
{
    switch (pNotification->Custom_Evt_Opcode)
    {
        ...
        ...
        case CUSTOM_STM_<Srv1Char1>_READ_EVT:
	        ...
            Custom_STM_App_Update_Char(CUSTOM_STM_<Srv1Char1>, (uint8_t*) UpdateCharData);
	        ...         
        break;
        ...
        ...
    }
    return;
}

 

Some other info:

  • STM32CubeMX version 6.16.1
  • STM32IDE version: 2.0.0
  • The ".ioc" file is attached 

 

Thanks!

0 REPLIES 0