CYBLE224110-00- same device address

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
umg_4380326
Level 3
Level 3
First like received

Hi,

I have 4 CYBLE-2241100 BLE modules and i am advertising them with different TX level and device names.But when i  am checking for the advertising device in the cysmart and  nrf app. I am able to see the  advertising devices but the BD_ADDR is same for all the devices (00:a0:00:88:99:77).

Why is the BLE device address same?

If it is same how to limit the devices in central with respect to their address ?

How can i search devices based on the advertising device name?

Thanks,

Uma

0 Likes
1 Solution
PHBR_4374921
Level 1
Level 1

Dear Uma,

May be you do not select the "Silicon generated "Company Assigned" Device address in the configuration ?

Best regards

Philippe

View solution in original post

0 Likes
5 Replies
PHBR_4374921
Level 1
Level 1

Dear Uma,

May be you do not select the "Silicon generated "Company Assigned" Device address in the configuration ?

Best regards

Philippe

0 Likes

HI,

Thanks it worked.

I want to establish connection between a peripheral(device A) and central (device B)cyble2241100-00 modules.
I am able to advertise , scan the device get the advertising report and then displaying the rssi value in the event CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:

I am trying for assest tracking  , now i have to try and establish connection between cyble2241100 modules and then get that data  from the peripheral and switch the central device to peripheral mode and then send that data over to another device.

1) how do i establish connection bwtween device A and device B ?

2) how can i switch from central mode to peripheral mode in device B?

3) how to send the for Device B after switching mode?

Thanks

0 Likes

Please refer to the thread link connection between two CYBLE-2241100-00 (central and peripheral)

Thanks,

P Yugandhar.

0 Likes

This is correct?

switch(event)

    {

      

      case CYBLE_EVT_STACK_ON:

        CyBle_GapcStartScan(CYBLE_SCANNING_FAST);

         break;

     

       case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:

   

        CyBle_GapcStartScan(CYBLE_SCANNING_FAST);

        printf("Disconnection reason is %x\r\n", (uint8)(*disconnectionreason));

        break;

     case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:

       scanreport = (CYBLE_GAPC_ADV_REPORT_T *) eventParam;

         if(scanreport->peerBdAddr[0]==0xD0 && scanreport->peerBdAddr[1]==0x37 && scanreport->peerBdAddr                    [2]==0x84&&                  scanreport->peerBdAddr[3]==0x00 && scanreport->peerBdAddr[4]==0xa0 && scanreport-                        >peerBdAddr[5]==0x00)

       {

              UART_UartPutString("CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT - Peripheral found\r\n");

                CyBle_GapcStopScan();

        }

               

        break;

       case CYBLE_EVT_GAPC_SCAN_START_STOP:      

     

        CyBle_GapcConnectDevice(&peerdevice);

         printf("RSSI value is %d \r\n", scanreport->rssi); 

        

        break;

Also i found a code

/* ========================================

*

* Copyright YOUR COMPANY, THE YEAR

* All Rights Reserved

* UNPUBLISHED, LICENSED SOFTWARE.

*

* CONFIDENTIAL AND PROPRIETARY INFORMATION

* WHICH IS THE PROPERTY OF your company.

*

* ========================================

*/

#include "project.h"

void ble(uint32 eventCode, void *eventParam);

uint8     type =0;

CYBLE_GATTC_WRITE_REQ_T writeReqParam;

static volatile CYBLE_API_RESULT_T res;

//static CYBLE_GAP_BD_ADDR_T  add;

uint8     add[CYBLE_GAP_BD_ADDR_SIZE]= {0};

void v_workerBLE_slaveSelectionHandler(CYBLE_GAPC_ADV_REPORT_T* eventParam);

void resolveErr(CYBLE_HCI_ERROR_T *eventParam);

uint8 u8slaveFound;

int main(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

  

    CyBle_Start(ble);

while(1)

{

  

        CyBle_ProcessEvents();

}

}

void ble(uint32 eventCode, void *eventParam)

{

    switch(eventCode)

    {

        case CYBLE_EVT_STACK_ON:

        case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:

      

        //CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);

        CyBle_GapcStartScan(CYBLE_SCANNING_FAST);

      

        break;

      

        // Master events

        case CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT:

            v_workerBLE_slaveSelectionHandler((CYBLE_GAPC_ADV_REPORT_T *)eventParam);

          

          

            break;

          

        case  CYBLE_EVT_GAPC_SCAN_START_STOP: 

        {  

            if(u8slaveFound)

            {

                //peerAddr.type = 0u;

            

                static CYBLE_GAP_BD_ADDR_T  add1;

              

                add1.bdAddr[0] = add[0];

                add1.bdAddr[1] = add[1];

                add1.bdAddr[2] = add[2];

                add1.bdAddr[3] = add[3];

                add1.bdAddr[4] = add[4];

                add1.type = type;

                //  connect to the device

                 res = CyBle_GapcConnectDevice((const CYBLE_GAP_BD_ADDR_T* )&add);

            }

        }  

            break;

      

          

        case CYBLE_EVT_GAP_DEVICE_CONNECTED:

            CyBle_GattcStartDiscovery(cyBle_connHandle);

         

        break;

         

        case CYBLE_EVT_GATTC_DISCOVERY_COMPLETE:

          

            // do some work

          

            CyBle_GattcWriteCharacteristicDescriptors

            (

                 cyBle_connHandle,  //CYBLE_CONN_HANDLE_T   connHandle,

                  &writeReqParam

            );

                   break;

     

        case CYBLE_EVT_HCI_STATUS:

   

            resolveErr(eventParam);

            break;

        default:

                    CyBle_GapcStartScan(CYBLE_SCANNING_FAST);

          

            break;

      

    }

}

void v_workerBLE_slaveSelectionHandler(CYBLE_GAPC_ADV_REPORT_T* eventParam)

{

  

  

   // memcpy(add.bdAddr, eventParam->peerBdAddr, CYBLE_GAP_BD_ADDR_SIZE);

   // add.type = eventParam->eventType;

 

//    if( (eventParam->peerBdAddr[5] == 0x00) && (eventParam->peerBdAddr[4] == 0xA0) && (eventParam->peerBdAddr[3] == 0x50))

    {

        // handle little endian as of now

        add[0] = eventParam->peerBdAddr[5];

        add[1] = eventParam->peerBdAddr[4];

        add[2] = eventParam->peerBdAddr[3];

        add[3] = eventParam->peerBdAddr[2];

        add[4] = eventParam->peerBdAddr[1];

        add[5] = eventParam->peerBdAddr[0];

      

        type = eventParam->eventType;

      

        u8slaveFound = 1u;

        CyBle_GapcStopScan();

    }

  

  

    //ptr = eventParam->data;

  

    // TODO : COMPARE THE ADDRESS OF THE PEER DEVICE WITH THE LIST OF ADDRESSES

    // allow only simpa slaves to interact with the master.

  

}

void resolveErr(CYBLE_HCI_ERROR_T *eventParam)

{

    volatile uint8 err = *eventParam;

}

/* [] END OF FILE */

to this code i  am getting error undefined reference to  cyble_gattcstart discovery and a warning implicit  declaration  of function cyble_gattcstart discovery

What i do ?

Thanks

0 Likes

Dear Uma,

Can you please close the subject, and make a new topic, with the new questions.
Otherwise, when we search/look for some response on a subject, it will be horrible to follow.
Thanks in advance.


Philippe

0 Likes