In DA14531 MOD, If i connecting to one BT module with mobile, the same BT module is not discovering to other mobiles.

Hi Team,

Iam using CodeLess Version: 6.380.14.22, working as peripheral.

In DA14531 MOD, If i connecting to one BT module with mobile, the same BT module is not discovering to other mobiles.

My requirement is BT modules should be discoverable to other mobiles even if it is paired to a smartphone (1st).  

Regards,

Laxmi Narayana.

Parents
  • Hi Laxmi,

    Thank you for posting your question online.

    In DA14531 MOD, If i connecting to one BT module with mobile, the same BT module is not discovering to other mobiles.

    My requirement is BT modules should be discoverable to other mobiles even if it is paired to a smartphone (1st).  

    That is not possible with the CodeLess SDK.
    When the DA14531 is connected ( connection has been established), it no longer advertises which makes it not discoverable by other devices at the same time.
    On the CodeLess SDK we do not support multiple connections at the same time. 
    In order to implement this, you will have to develop on the generic SDK6. Please refer on our Git Repo example: BLE_SDK6_examples/connectivity/multi_con_periph at main · dialog-semiconductor/BLE_SDK6_examples (github.com)

    In order to achieve this, there are required some SDK changes which are included on the patch folder of the example.

    Best Regards,
    OV_Renesas

  • Hi,

    Thank you for quick reply,

    I may not delivered my question correctly So, reframing my question,

    when paired with BT module  with 1st device(not connected), 2nd mobile is not able to discover the same BT module.

    Regards,

    Laxmi Narayana.

  • Hi Laxmi,

    Thank you for the reply and the clarifications.
    Let me try to get a better understanding:
    1) DA14531 is advertising
    2) C1 (Central 1) initiates connection and pairs with the DA14531
    3) C1 terminates the connection with the DA14531
    4) DA14531 is advertising again
    5) C2 (Central 2) cannot scan the advertisement packets from the DA14531?

    What is your security configuration?
    Is C1 still able to find the DA14531?
    Have you tried to capture with a BLE Sniffer the packets over  the air?

    Best Regards,
    OV_Renesas

  • Hi OV_Renesas,

    Thank you for quick response,

    Please find the attached video to preproduce the case.

    Have you tried to capture with a BLE Sniffer the packets over  the air?

    No i not tried to capture the BLE Sniffer.

    What is your security configuration?

    user_config.h is attached below.

    /**
     ****************************************************************************************
     *
     * @file user_config.h
     *
     * @brief User configuration file.
     *
     * Copyright (C) 2015-2020 Dialog Semiconductor.
     * This computer program includes Confidential, Proprietary Information
     * of Dialog Semiconductor. All Rights Reserved.
     *
     ****************************************************************************************
     */
    
    #ifndef _USER_CONFIG_585_H_
    #define _USER_CONFIG_585_H_
    
    /*
     * INCLUDE FILES
     ****************************************************************************************
     */
    
    #include "app_user_config.h"
    #include "arch_api.h"
    #include "app_default_handlers.h"
    #include "app_adv_data.h"
    #include "co_bt.h"
    #include "user_cmd_parser.h"
    
    /*
     * LOCAL VARIABLES
     ****************************************************************************************
     */
    
    #define FORCE_CCC_ENABLE
    #define AUTO_BIN_MODE_ON_CONNECT
    #define USER_MAX_MTU_ENABLE
    //#define USER_MAX_MTU_VALUE				185
    #define USER_MAX_MTU_VALUE				251
    #define CFG_USE_GENERATED_BLUETOOTH_ADDRESS
    
    
    /*************************************************************************
     * Privacy Capabilities and address configuration of local device:
     * - APP_CFG_ADDR_PUB               No Privacy, Public BDA
     * - APP_CFG_ADDR_STATIC            No Privacy, Random Static BDA
     * - APP_CFG_HOST_PRIV_RPA          Host Privacy, RPA, Public Identity
     * - APP_CFG_HOST_PRIV_NRPA         Host Privacy, NRPA (non-connectable ONLY)
     * - APP_CFG_CNTL_PRIV_RPA_PUB      Controller Privacy, RPA or PUB, Public Identity
     * - APP_CFG_CNTL_PRIV_RPA_RAND     Controller Privacy, RPA, Public Identity
     *
     * Select only one option for privacy / addressing configuration.
     **************************************************************************
     */
    #if defined (CFG_USE_GENERATED_BLUETOOTH_ADDRESS)
        #define USER_CFG_ADDRESS_MODE       APP_CFG_ADDR_STATIC
    #else
        #define USER_CFG_ADDRESS_MODE       APP_CFG_ADDR_PUB
    #endif
    
    /*************************************************************************
     * Controller Privacy Mode:
     * - APP_CFG_CNTL_PRIV_MODE_NETWORK Controler Privacy Network mode (default)
     * - APP_CFG_CNTL_PRIV_MODE_DEVICE  Controler Privacy Device mode
     *
     * Select only one option for controller privacy mode configuration.
     **************************************************************************
     */
    #define USER_CFG_CNTL_PRIV_MODE     APP_CFG_CNTL_PRIV_MODE_NETWORK
    
    /******************************************
     * Default sleep mode. Possible values are:
     *
     * - ARCH_SLEEP_OFF
     * - ARCH_EXT_SLEEP_ON
     * - ARCH_EXT_SLEEP_OTP_COPY_ON  (585) / ARCH_DEEP_SLEEP_ON (580)
     *
     ******************************************
     */
    static const sleep_state_t app_default_sleep_mode = ARCH_EXT_SLEEP_ON;
    
    /*
     ****************************************************************************************
     *
     * Advertising configuration
     *
     ****************************************************************************************
     */
    static const struct advertise_configuration user_adv_conf = {
        /**
         * Own BD address source of the device:
         * - GAPM_STATIC_ADDR: Public or Private Static Address according to device address configuration
         * - GAPM_GEN_RSLV_ADDR: Generated resolvable private random address
         * - GAPM_GEN_NON_RSLV_ADDR: Generated non-resolvable private random address
         */
        .addr_src = GAPM_STATIC_ADDR,
        /// Minimum interval for advertising
        .intv_min = MS_TO_BLESLOTS(687.5),                    // 687.5ms
    
        /// Maximum interval for advertising
        .intv_max = MS_TO_BLESLOTS(687.5),                    // 687.5ms
    
        /**
         *  Advertising channels map:
         * - ADV_CHNL_37_EN:   Advertising channel map for channel 37.
         * - ADV_CHNL_38_EN:   Advertising channel map for channel 38.
         * - ADV_CHNL_39_EN:   Advertising channel map for channel 39.
         * - ADV_ALL_CHNLS_EN: Advertising channel map for channel 37, 38 and 39.
         */
        .channel_map = ADV_ALL_CHNLS_EN,
    
        /*************************
         * Advertising information
         *************************
         */
    
        /// Host information advertising data (GAPM_ADV_NON_CONN and GAPM_ADV_UNDIRECT)
        /// Advertising mode :
        /// - GAP_NON_DISCOVERABLE: Non discoverable mode
        /// - GAP_GEN_DISCOVERABLE: General discoverable mode
        /// - GAP_LIM_DISCOVERABLE: Limited discoverable mode
        /// - GAP_BROADCASTER_MODE: Broadcaster mode
        .mode = GAP_GEN_DISCOVERABLE,
    
        /// Host information advertising data (GAPM_ADV_NON_CONN and GAPM_ADV_UNDIRECT)
        /// Advertising filter policy:
        /// - ADV_ALLOW_SCAN_ANY_CON_ANY: Allow both scan and connection requests from anyone
        /// - ADV_ALLOW_SCAN_WLST_CON_ANY: Allow both scan req from White List devices only and
        ///   connection req from anyone
        /// - ADV_ALLOW_SCAN_ANY_CON_WLST: Allow both scan req from anyone and connection req
        ///   from White List devices only
        /// - ADV_ALLOW_SCAN_WLST_CON_WLST: Allow scan and connection requests from White List
        ///   devices only
        .adv_filt_policy = ADV_ALLOW_SCAN_ANY_CON_ANY,
    
        /// Direct address information (GAPM_ADV_DIRECT/GAPM_ADV_DIRECT_LDC)
        /// (used only if reconnection address isn't set or privacy disabled)
        /// BD Address of device
        .peer_addr = {0x1, 0x2, 0x3, 0x4, 0x5, 0x6},
    
        /// Direct address information (GAPM_ADV_DIRECT/GAPM_ADV_DIRECT_LDC)
        /// (used only if reconnection address isn't set or privacy disabled)
        /// Address type of the device 0=public/1=private random
        .peer_addr_type = 0,
    };
    
    /*
     ****************************************************************************************
     *
     * Advertising or scan response data for the following cases:
     *
     * - ADV_IND: Connectable undirected advertising event.
     *    - The maximum length of the user defined advertising data shall be 28 bytes.
     *    - The Flags data type are written by the related ROM function, hence the user shall
     *      not include them in the advertising data. The related ROM function adds 3 bytes in
     *      the start of the advertising data that are to be transmitted over the air.
     *    - The maximum length of the user defined response data shall be 31 bytes.
     *
     * - ADV_NONCONN_IND: Non-connectable undirected advertising event.
     *    - The maximum length of the user defined advertising data shall be 31 bytes.
     *    - The Flags data type may be omitted, hence the user can use all the 31 bytes for
     *      data.
     *    - The scan response data shall be empty.
     *
     * - ADV_SCAN_IND: Scannable undirected advertising event.
     *    - The maximum length of the user defined advertising data shall be 31 bytes.
     *    - The Flags data type may be omitted, hence the user can use all the 31 bytes for
     *      data.
     *    - The maximum length of the user defined response data shall be 31 bytes.
     ****************************************************************************************
     */
    /// Advertising data
    #define USER_ADVERTISE_DATA                   ""          
    
    /// Advertising data length - maximum 28 bytes, 3 bytes are reserved to set
    #define USER_ADVERTISE_DATA_LEN               (sizeof(USER_ADVERTISE_DATA)-1)
    
    /// Scan response data
    #define USER_ADVERTISE_SCAN_RESPONSE_DATA     ""
    
    /// Scan response data length- maximum 31 bytes
    #define USER_ADVERTISE_SCAN_RESPONSE_DATA_LEN (sizeof(USER_ADVERTISE_SCAN_RESPONSE_DATA)-1)
    
    /*
     ****************************************************************************************
     *
     * Device name.
     *
     * - If there is space left in the advertising or scan response data the device name is
     *   copied there. The device name can be anytime read by a connected peer, if the
     *   application supports it.
     * - The Bluetooth device name can be up to 248 bytes.
     *
     ****************************************************************************************
     */
    extern BT_PARAMS g_bt_params;
    /// Device name
    #define USER_DEVICE_NAME        g_bt_params.name
    //#define USER_DEVICE_NAME        "BTTEST_BY Saankhya"
    
    /// Device name length
    #define USER_DEVICE_NAME_LEN    (sizeof(USER_DEVICE_NAME)-1)
    
    /*
     ****************************************************************************************
     *
     * GAPM configuration
     *
     ****************************************************************************************
     */
    static const struct gapm_configuration user_gapm_conf = {
        /// Device Role: Central, Peripheral, Observer, Broadcaster or All roles. (@see enum gap_role)
        .role = GAP_ROLE_PERIPHERAL,
    
        /// Maximal MTU. Shall be set to 23 if Legacy Pairing is used, 65 if Secure Connection is used,
        /// more if required by the application
        #ifdef __DA14531__
        //.max_mtu = 65, // TODO: Create a define for this constant	//RCVD //65
    		.max_mtu = 201, // TODO: Create a define for this constant	//RCVD //65
    		
    		#ifdef USER_MAX_MTU_ENABLE
    		.max_mtu = USER_MAX_MTU_VALUE,
    		#endif
    		
        #else		
        //.max_mtu = 123,		
    		.max_mtu = 201,		
        #endif
    
        /// Device Address Type
        /// - GAPM_CFG_ADDR_PUBLIC: Device Address is a Public Static address
        /// - GAPM_CFG_ADDR_PRIVATE: Device Address is a Private Static address
        /// - GAPM_CFG_ADDR_PRIVACY: Device Address generated using Privacy feature
        //.addr_type = GAPM_CFG_ADDR_PRIVATE,
    	.addr_type = APP_CFG_ADDR_TYPE(USER_CFG_ADDRESS_MODE),
    
        /***********************
         * Privacy configuration
         ***********************
         */
    
        /// Private static address
        // NOTE: The address shall comply with the following requirements:
        // - the two most significant bits of the address shall be equal to 1,
        // - all the remaining bits of the address shall NOT be equal to 1,
        // - all the remaining bits of the address shall NOT be equal to 0.
        // In case the {0x00, 0x00, 0x00, 0x00, 0x00, 0x00} null address is used, a
        // random static address will be automatically generated.
        .addr = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
    
        /// Duration before regenerate device address when privacy is enabled.
        .renew_dur = 0,
    
        /// Device IRK used for resolvable random BD address generation (LSB first)
        .irk = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f},
    
        // privacy 1.2 - Link Layer Privacy (4.2)
        //.priv1_2 = 0,
    
        /****************************
         * ATT database configuration
         ****************************
         */
    
        /// Attribute database configuration (@see enum gapm_att_cfg_flag)
        ///    7     6    5     4     3    2    1    0
        /// +-----+-----+----+-----+-----+----+----+----+
        /// | DBG | RFU | SC | PCP | APP_PERM |NAME_PERM|
        /// +-----+-----+----+-----+-----+----+----+----+
        /// - Bit [0-1]: Device Name write permission requirements for peer device (@see gapm_write_att_perm)
        /// - Bit [2-3]: Device Appearance write permission requirements for peer device (@see gapm_write_att_perm)
        /// - Bit [4]  : Slave Preferred Connection Parameters present
        /// - Bit [5]  : Service change feature present in GATT attribute database.
        /// - Bit [6]  : Reserved
        /// - Bit [7]  : Enable Debug Mode
        .att_cfg = GAPM_MASK_ATT_SVC_CHG_EN,
    
        /// GAP service start handle
        .gap_start_hdl = 0,
    
        /// GATT service start handle
        .gatt_start_hdl = 0,
    
        /**************************************************
         * Data packet length extension configuration (4.2)
         **************************************************
         */
    
        /// Maximal MPS
        .max_mps = 0,
    
        /// Maximal Tx octets (connInitialMaxTxOctets value, as defined in 4.2 Specification)
        .max_txoctets = 0,
    
        /// Maximal Tx time (connInitialMaxTxTime value, as defined in 4.2 Specification)
        .max_txtime = 0,
    };
    
    /*
     ****************************************************************************************
     *
     * Parameter update configuration
     *
     ****************************************************************************************
     */
    static const struct connection_param_configuration user_connection_param_conf = {
        /// Connection interval minimum measured in ble double slots (1.25ms)
        /// use the macro MS_TO_DOUBLESLOTS to convert from milliseconds (ms) to double slots
        .intv_min = MS_TO_DOUBLESLOTS(15),
    
        /// Connection interval maximum measured in ble double slots (1.25ms)
        /// use the macro MS_TO_DOUBLESLOTS to convert from milliseconds (ms) to double slots
        .intv_max = MS_TO_DOUBLESLOTS(15),
    
        /// Latency measured in connection events
        .latency = 0,
    
        /// Supervision timeout measured in timer units (10 ms)
        /// use the macro MS_TO_TIMERUNITS to convert from milliseconds (ms) to timer units
        .time_out = MS_TO_TIMERUNITS(2500),
    
        /// Minimum Connection Event Duration measured in ble double slots (1.25ms)
        /// use the macro MS_TO_DOUBLESLOTS to convert from milliseconds (ms) to double slots
        .ce_len_min = MS_TO_DOUBLESLOTS(0),
    
        /// Maximum Connection Event Duration measured in ble double slots (1.25ms)
        /// use the macro MS_TO_DOUBLESLOTS to convert from milliseconds (ms) to double slots
        .ce_len_max = MS_TO_DOUBLESLOTS(0),
    };
    
    /*
     ****************************************************************************************
     *
     * Default handlers configuration (applies only for @app_default_handlers.c)
     *
     ****************************************************************************************
     */
    static const struct default_handlers_configuration  user_default_hnd_conf = {
        // Configure the advertise operation used by the default handlers
        // Possible values:
        //  - DEF_ADV_FOREVER
        //  - DEF_ADV_WITH_TIMEOUT
        .adv_scenario = DEF_ADV_FOREVER,
    
        // Configure the advertise period in case of DEF_ADV_WITH_TIMEOUT.
        // It is measured in timer units (3 min). Use MS_TO_TIMERUNITS macro to convert
        // from milliseconds (ms) to timer units.
        .advertise_period = MS_TO_TIMERUNITS(180000),
    
        // Configure the security start operation of the default handlers
        // if the security is enabled (CFG_APP_SECURITY)
        // Possible values:
        //  - DEF_SEC_REQ_NEVER
        //  - DEF_SEC_REQ_ON_CONNECT
        .security_request_scenario = DEF_SEC_REQ_ON_CONNECT
    };
    
    /*
     ****************************************************************************************
     *
     * Central configuration (not used by current example)
     *
     ****************************************************************************************
     */
    static const struct central_configuration user_central_conf = {
        /// GAPM requested operation:
        /// - GAPM_CONNECTION_DIRECT: Direct connection operation
        /// - GAPM_CONNECTION_AUTO: Automatic connection operation
        /// - GAPM_CONNECTION_SELECTIVE: Selective connection operation
        /// - GAPM_CONNECTION_NAME_REQUEST: Name Request operation (requires to start a direct
        ///   connection)
        .code = GAPM_CONNECTION_DIRECT,
    
        /// Own BD address source of the device:
        ///  - GAPM_STATIC_ADDR: Public or Private Static Address according to device address configuration
        ///  - GAPM_GEN_RSLV_ADDR: Generated resolvable private random address
        ///  - GAPM_GEN_NON_RSLV_ADDR: Generated non-resolvable private random address
        .addr_src = GAPM_STATIC_ADDR,
    
        /// Scan interval
        .scan_interval = 0x180,
    
        /// Scan window size
        .scan_window = 0x160,
    
         /// Minimum of connection interval
        .con_intv_min = 100,
    
        /// Maximum of connection interval
        .con_intv_max = 100,
    
        /// Connection latency
        .con_latency = 0,
    
        /// Link supervision timeout
        .superv_to = 0x1F4,
    
         /// Minimum CE length
        .ce_len_min = 15,
    
        /// Maximum CE length
        .ce_len_max = 15,
    
        /**************************************************************************************
         * Peer device information (maximum number of peers = 8)
         **************************************************************************************
         */
    
        /// BD Address of device
        .peer_addr_0 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
    
        /// Address type of the device 0=public/1=private random
        .peer_addr_0_type = 0,
    
        /// BD Address of device
        .peer_addr_1 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
    
        /// Address type of the device 0=public/1=private random
        .peer_addr_1_type = 0,
    
        /// BD Address of device
        .peer_addr_2 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
    
        /// Address type of the device 0=public/1=private random
        .peer_addr_2_type = 0,
    
        /// BD Address of device
        .peer_addr_3 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
    
        /// Address type of the device 0=public/1=private random
        .peer_addr_3_type = 0,
    
        /// BD Address of device
        .peer_addr_4 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
    
        /// Address type of the device 0=public/1=private random
        .peer_addr_4_type = 0,
    
        /// BD Address of device
        .peer_addr_5 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
    
        /// Address type of the device 0=public/1=private random
        .peer_addr_5_type = 0,
    
        /// BD Address of device
        .peer_addr_6 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
    
        /// Address type of the device 0=public/1=private random
        .peer_addr_6_type = 0,
    
        /// BD Address of device
        .peer_addr_7 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
    
        /// Address type of the device 0=public/1=private random
        .peer_addr_7_type = 0,
    };
    
    
    //-------------------------SCAN---RELATED------------------------------
    
    #if 0
    struct scan_configuration {
        /// Operation code.
        uint8_t     code;
        /// Own BD address source of the device
        uint8_t     addr_src;
        /// Scan interval
        uint16_t    interval;
        /// Scan window size
        uint16_t    window;
        /// Scanning mode
        uint8_t     mode;
        /// Scan filter policy
        uint8_t     filt_policy;
        /// Scan duplicate filtering policy
        uint8_t     filter_duplic;
    };
    #endif
    
    static const struct scan_configuration user_scan_conf ={
        /// Operation code.
        .code = GAPM_SCAN_ACTIVE,//GAPM_SCAN_PASSIVE,
        /// Own BD address source of the device
        .addr_src = GAPM_STATIC_ADDR,
        /// Scan interval
        .interval = 10,
        /// Scan window size
        .window = 5,
        /// Scanning mode
        .mode = GAP_GEN_DISCOVERY,
        /// Scan filter policy
        .filt_policy = SCAN_ALLOW_ADV_ALL,
        /// Scan duplicate filtering policy
        .filter_duplic = SCAN_FILT_DUPLIC_EN
    };
    
    /*
     ****************************************************************************************
     *
     * Security related configuration
     *
     ****************************************************************************************
     */
    
    extern struct security_configuration user_security_conf;
    
    
    #endif // _USER_CONFIG_585_H_
    
    .

    Step to reproducible :

    1. Power ON the BT test jig

    2. Open the BT test application.

    3. Connect to the BT module in command mode through the COM port

    4. Now turn ON Bluetooth in any android smartphone (1st) and scan the BT module.

    5. Pair the BT module with Android smartphone (1st) with set password.

    6. In another smartphone (2nd) search for the BT module. (refresh/scan)

    7. Turn OFF the (1st) smartphone Bluetooth and now again try to scan BT module in another smartphone (2nd).

    8. Unpair the BT module from Android Smartphone (1st)

    9. Again, search for the BT module in another smartphone (2nd).

    10. Observe

    Actual Result : BT modules are not discoverable to 2nd (other mobile devices) once paired to 1st device.  

    Expected Result : BT modules should be discoverable to other mobiles even if it is paired to a smartphone (1st).  

    Edited:

    attached screen shot.

    Regards,

    Laxmi Narayana 

  • Hi OV_Renesas,

    Did you able to reproduce the same issue?

    Please let me know if we have any fix on this issue.

    Regards,

    Laxmi Narayana 

Reply Children