cancel
Showing results for 
Search instead for 
Did you mean: 

aci_gap_init always return 0x46

JSanz.1
Associate III

It seems to enroll well to APP but when I try to send a message the aci_gap_init return the status value 0x46, BLE_STATUS_NOT_ALLOWED

/* USER CODE BEGIN FD_WRAP_FUNCTIONS */

tBleStatus P2PS_STM_App_Update_Buffer(uint16_t UUID, uint8_t *pPayload, uint8_t length)

{

uint8_t role = GAP_PERIPHERAL_ROLE;

uint16_t gap_service_handle, gap_dev_name_char_handle, gap_appearance_char_handle;

tBleStatus result = BLE_STATUS_INVALID_PARAMS;

result = aci_gap_init(role, 0,

       APPBLE_GAP_DEVICE_NAME_LENGTH,

       &gap_service_handle, &gap_dev_name_char_handle, &gap_appearance_char_handle);

switch(UUID)

{

case P2P_NOTIFY_CHAR_UUID:

result = aci_gatt_update_char_value(gap_service_handle, gap_dev_name_char_handle, 0, length, pPayload);

break;

default:

break;

}

return result;

}

Thanks,

2 REPLIES 2
Remi QUINTIN
ST Employee

It looks like you are calling the aci_gap_init function at the wrong place.

It should be called once during the initialization of the device.

Have a look at static void Ble_Hci_Gap_Gatt_Init(void) function.

JSanz.1
Associate III

Thanks for your help