Skip to main content
mavv
Associate
November 18, 2019
Solved

Hello, I tried to mix BLE+mesh using IDB05A1 and stm32L4. I used light demo example and added a custom service, but I cannot interact with it because I cannot find the way for integrating my custom service callback. Is it possible? Thank you

  • November 18, 2019
  • 2 replies
  • 794 views

..

This topic has been closed for replies.
Best answer by mavv

Finally I solved it by calling "user_notify()" at HCI_Process():

void HCI_Process(void)

{

 tHciDataPacket * hciReadPacket = NULL;

  

 Disable_SPI_IRQ();

 uint8_t list_empty = list_is_empty(&hciReadPktRxQueue);     

 /* process any pending events read */

 while(list_empty == FALSE)

 {

  list_remove_head (&hciReadPktRxQueue, (tListNode **)&hciReadPacket);

  Enable_SPI_IRQ();

  HCI_Event_CB(hciReadPacket->dataBuff);

user_notify(hciReadPacket->dataBuff);

  Disable_SPI_IRQ();

  list_insert_tail(&hciReadPktPool, (tListNode *)hciReadPacket);

  list_empty = list_is_empty(&hciReadPktRxQueue);

 }

 /* Explicit call to HCI_Isr(), since it cannot be called by ISR if IRQ is kept high by

 BlueNRG. */

 HCI_Isr();

 Enable_SPI_IRQ();   

}

2 replies

mavv
mavvAuthorBest answer
Associate
November 28, 2019

Finally I solved it by calling "user_notify()" at HCI_Process():

void HCI_Process(void)

{

 tHciDataPacket * hciReadPacket = NULL;

  

 Disable_SPI_IRQ();

 uint8_t list_empty = list_is_empty(&hciReadPktRxQueue);     

 /* process any pending events read */

 while(list_empty == FALSE)

 {

  list_remove_head (&hciReadPktRxQueue, (tListNode **)&hciReadPacket);

  Enable_SPI_IRQ();

  HCI_Event_CB(hciReadPacket->dataBuff);

user_notify(hciReadPacket->dataBuff);

  Disable_SPI_IRQ();

  list_insert_tail(&hciReadPktPool, (tListNode *)hciReadPacket);

  list_empty = list_is_empty(&hciReadPktRxQueue);

 }

 /* Explicit call to HCI_Isr(), since it cannot be called by ISR if IRQ is kept high by

 BlueNRG. */

 HCI_Isr();

 Enable_SPI_IRQ();   

}

GF_it
Associate II
June 4, 2020

Hi mavv !

When you say "mix BLE + mesh" do you mean that you can communicate with (for example) a PC by BLE and then transfert this message to Mesh network, like that, you can act on Mesh with a computer ?

If yes, is that possible to explain me how you construct your custom ble service pls