cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in receiving Notification from multiple servers in P2P router

AAyac.1
Associate
  1. Working on STM32WB50
  2. P2P server client (one to one) working perfectly. Server sends notification which is 240 bytes long.
  3. Shifted from Client to router to connect to multiple servers and transfer collected data to an Application.
  4. In router application was able to connect to multiple servers but notification was being received from only one server.
  5. More testing revealed that sometimes data from multiple servers was being received.
  6. Further testing revealed that if delay is introduced in the function:
aci_gatt_write_char_desc(aP2PClientContext[index].connHandle,
		                                   aP2PClientContext[index].P2PClientDescHandle,
		                                   2,
		                                   (uint8_t *)&enable);

then notification is received correctly.

  • Our assumption is that the software is designed to allow the connection of servers one by one. But since our servers are in advertisement mode all the time, they connect to the router immediately.
  • Our code looks like this now:
            case APP_BLE_ENABLE_NOTIFICATION_DESC:
		          APP_DBG_MSG("* GATT : Enable Server Notification\n");
		          tBleStatus lclStat = aci_gatt_write_char_desc(aP2PClientContext[index].connHandle,
		                                   aP2PClientContext[index].P2PClientDescHandle,
		                                   2,
		                                   (uint8_t *)&enable);
		          for(dly2 = 0; dly2 < 0x1FF; dly2++)
		        	  for(dly = 0; dly < 0xFFFF; dly++);
		          lclStat = 0;
		          for(dly = 0; dly < 0xFFFF; dly++);
		          aP2PClientContext[index].state = APP_BLE_CONNECTED;
            	break;
  • Is this the correct approach?
  • Could you suggest alternative method/approach for the same?
  • Making changes in the server software will be very difficult now. But is not ruled out.

Thanks in advance.

Kind Regards,

Aditya Ayachit

0 REPLIES 0