This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Establishing connection problem

Hi.

I use device with FW from project simpleBLEmulti and device with FW form project simpleBLEPeripheral. This device "multi" connected with usb-donlge via Btool. In multi project I created an event which establishes a connection to a peripheral device. In Btool i send notification to 'multi' for start event 

Inside the event GAPRole_EstablishLink(DEFAULT_LINK_HIGH_DUTY_CYCLE, DEFAULT_LINK_WHITE_LIST, 0, peerConnAddr) returns SUCCESS.

But in 

static void SimpleBLEMulti_processRoleEvent(gapMultiRoleEvent_t *pEvent)
{
switch (pEvent->gap.opcode)
{ .....

case GAP_LINK_ESTABLISHED_EVENT:
{
if (pEvent->gap.hdr.status == SUCCESS)   pEvent->gap.hdr.status = 0x12 What is mean this code?

....

and connection is not established.

In preprocessor MAX_NUM_BLE_CONNS=2

  • Also I can not to star advertising in 'multi' after terminated:

    case GAP_LINK_TERMINATED_EVENT:
          {
            connHandle = GAP_CONNHANDLE_INIT;
    #ifndef RSSI
            rssiStarted = FALSE;
    #endif //RSSI        
            discState = BLE_DISC_STATE_IDLE;
            charHdl = 0;
              
            uint8_t i;
            for (i=0; i < MAX_NUM_BLE_CONNS; i++)
            {
              if (multiConnInfo[i].gapRole_ConnectionHandle == GAPROLE_CONN_JUST_TERMINATED)
              {
                  multiConnInfo[i].gapRole_ConnectionHandle = INVALID_CONNHANDLE;
                  if (LCDmenu == MAIN_MENU)
                  {
                    LCD_WRITE_STRING("", 5+i);
                    LCD_WRITE_STRING_VALUE("Connected to ", gapRoleNumLinks(GAPROLE_ACTIVE_LINKS) ,10, LCD_PAGE4);
                  }
              }
              if ((gapRoleNumLinks(GAPROLE_ACTIVE_LINKS) == (MAX_NUM_BLE_CONNS-1))) //now we can advertise again
              {
                uint8_t advertEnabled = TRUE;        
                uint8_t stat = GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &advertEnabled, NULL);  <---stat = 0x60 What is it mean?
                LCD_WRITE_STRING("Ready to Advertise", LCD_PAGE2);
              }
            }        
          }
          break;

  • Comment to the first post:

     if I change the sequence of connections -> first step: "multi" connect to peripheral

    second step: usb-dongle via Btool connect to "multi"

    then all good working. All devices in connection.

  • Does this work without the default simpleBLEMulti software without your changes?
  • I do not have Smart RF06 so I can not check the default simpleBLEMulti software without my changes. My change is the only way to scan and establish the connection without using the buttons. Scanning is performed successfully. It is implemented events in SimpleBLEMulti_taskFxn.

  • Were somebody tested project multi in variant, when device "multi" was first connection as slave, and second as master?
  • help me please