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.

LAUNCHXL-CC1350: cc1350 ble passkey

Part Number: CC1350
Other Parts Discussed in Thread: CC2640R2F

Hello,

 I am working on simple_peripheral_cc1350lp_app_FlashROM example. In this example i changed passkey value from 000000 to 123456. im trying to pair with mobile. sometimes when i enter  wrong passkey it showing wrong passkey, but sometimes mobile paired with my device. what is problem?? can i need to change anything else???

  • Hi,

    Do you have sniffer log? What phone(s) are you using?
  • i don't have sniffer log, i am using motoE4plus phone
  • Part Number: CC1350

    Hello,

    I am working on  simple_peripheral_cc1350lp_app_FlashROM example. I would like to pair my peripheral device with phone using passkey entry pairing method .For that  i did some changes in this example as follows

    1. -DBLE_V41_FEATURES=L2CAP_COC_CFG

      -DBLE_V42_FEATURES=SECURE_CONNS_CFG+PRIVACY_1_2_CFG uncommented these two lines in build_config.opt on my Stack Project.
     
    2. #define HEAPMGR_SIZE                 3690  // 1024  in heapmgr.h on application project.
    i tried to pair with phone , when i entered wrong passkey intentionally just to test,  sometimes its showing wrong password but sometimes paired with phone. should i change anything else??? 
  • i tried to pair with phone , when i entered wrong passkey intentionally just to test, sometimes its showing wrong password but sometimes paired with phone. should i change anything else???
  • If that all the changes you did to the SW?

    Have you checked out our GAP Bond Manager and LE Secure Connections Section in our software user's guide?

    Can you post the code snippet here?

  • ya i checked GAP Bond Manager and LE Secure Connections Section in software user's guide. i did some more changes also


    In simple_peripheral.c
    {

    // uint32_t passkey = 0; // passkey "000000"
    status_snv=osal_snv_read(BLEPIN_NVID ,1,blepin);
    passkey=atoi((char *)blepin);
    uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
    uint8_t mitm = TRUE;
    uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
    uint8_t bonding = TRUE;
    uint8_t gapbondSecure = GAPBOND_SECURE_CONNECTION_ALLOW;

    GAPBondMgr_SetParameter(GAPBOND_DEFAULT_PASSCODE, sizeof(uint32_t),
    &passkey);
    GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
    GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
    GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
    GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bonding);
    GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &gapbondSecure);
    }




    In build_config.opt on Stack Project

    /* BLE Host Build Configurations */
    -DHOST_CONFIG=PERIPHERAL_CFG
    /* -DHOST_CONFIG=CENTRAL_CFG */
    /* -DHOST_CONFIG=OBSERVER_CFG */
    /* -DHOST_CONFIG=BROADCASTER_CFG */
    /* -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG */
    /* -DHOST_CONFIG=CENTRAL_CFG+BROADCASTER_CFG */
    /* -DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG */
    /* -DHOST_CONFIG=OBSERVER_CFG+BROADCASTER_CFG */

    /* GATT Database being off chip */
    /* -DGATT_DB_OFF_CHIP */

    /* Include GAP Bond Manager */
    -DGAP_BOND_MGR

    /* BLE v4.1 Features */
    /* -DBLE_V41_FEATURES=L2CAP_COC_CFG+V41_CTRL_CFG */
    -DBLE_V41_FEATURES=L2CAP_COC_CFG
    /* -DBLE_V41_FEATURES=V41_CTRL_CFG */

    /* BLE v4.2 Features */
    /* -DBLE_V42_FEATURES=SECURE_CONNS_CFG+PRIVACY_1_2_CFG+EXT_DATA_LEN_CFG */
    -DBLE_V42_FEATURES=SECURE_CONNS_CFG+PRIVACY_1_2_CFG
    /* -DBLE_V42_FEATURES=PRIVACY_1_2_CFG+EXT_DATA_LEN_CFG */
    /* -DBLE_V42_FEATURES=SECURE_CONNS_CFG+EXT_DATA_LEN_CFG */
    /*-DBLE_V42_FEATURES=SECURE_CONNS_CFG */
    /* -DBLE_V42_FEATURES=PRIVACY_1_2_CFG */
    /* -DBLE_V42_FEATURES=EXT_DATA_LEN_CFG */

    /* Include Transport Layer (Full or PTM) */
    -DHCI_TL_NONE
    /* -DHCI_TL_PTM */
    /* -DHCI_TL_FULL */



    In heapmgr.h
    #define HEAPMGR_SIZE 3690 // 1024
  • Did you also implemented all the needed call back and event process in the application layer? ex: the following is the example of processPasscode event.

    You can find the software user's guide for cc2640R2F documentation for all the needed event/CB.(

    Even though the documentation is made for cc2640R2F, but the software architecture is pretty similar to the one you are using now. Please take a look at it and hopefully it will solve your problem

    static void SimpleBLEPeripheral_processPasscode(uint16_t connectionHandle, uint8_t uiOutputs)
    {
      // This app uses a default passcode. A real-life scenario would handle all
      // pairing scenarios and likely generate this randomly.
      uint32_t passcode = 123456;
    
      // Display passcode to user
      if (uiOutputs != 0)
      {
          Display_print1(dispHandle, 4, 0, "Passcode: %d", passcode);
      }
    
      // Send passcode response
      GAPBondMgr_PasscodeRsp(connectionHandle, SUCCESS, passcode);
    }
    

    I am not able to reproduce it on my phone(however, I don't have the phone you are using.)