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.

CC2640R2F修改MAX_PDU问题

Other Parts Discussed in Thread: CC2640R2F

芯片:CC2640R2F

工程:simpleperipheral, hosttest两个工程配合

说明:想要修改MAX_PDU以便传输长包,但是在BTool上修改了之后,simpleperipheral打印出的日志显示与设置的值不同,查看了工程是因为定义了一些宏,想问下这些宏的作用是什么,具体说明见下图

查看了工程中的宏定义:

// Maximum size in bytes of the BLE HCI PDU. Valid range: 27 to 255
// The maximum ATT_MTU is MAX_PDU_SIZE - 4.
#ifndef MAX_PDU_SIZE
#if defined(BLE_V42_FEATURES) && (BLE_V42_FEATURES & SECURE_CONNS_CFG)
  #define MAX_PDU_SIZE                  69
#else
  #define MAX_PDU_SIZE                  27
#endif //(BLE_V42_FEATURES & SECURE_CONNS_CFG)
#endif

请问BLE_V42_FEATURES、SECURE_CONNS_CFG是什么作用?我现在使用的是ble5的工程啊,并且我没有找到这两个的定义,define文件里没有,predefine里也没有。

请问我该如何修改才能按照预期改大MAX_PDU

  • BLE_V42_FEATURES

    Features supported from the Bluetooth Core Specification Version 4.2.
    These include:
    - Data Length Extension (EXT_DATA_LEN_CFG)
    - Secure Connections (SECURE_CONNS_CFG)
    - Privacy 1.2 (PRIVACY_1_2_CFG)

    修改PDU请参考Configuring for Larger MTU Values: dev.ti.com/.../index.html
  • 这个文档我看过啦,也下发命令了,可以由于BLE_V42_FEATURES 宏定义的存在,peripheral端没有按照命令中数据长度修改,所以想问下,BLE_V42_FEATURES 这个宏定义在哪里,我找不到
  • 大神,我在等你的回答~~~
  • 在 build_config.opt 内

    BLE_V42_FEATURES Configure the stack to use features from the BLE 4.2 Specification
    The following BLE 4.2 features are enabled by default and cannot be disabled.
  • 这里面没有定义BLE_V42_FEATURES啊,只是注释说明

    路径:

    C:\ti\simplelink_cc2640r2_sdk_2_20_00_49\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral\tirtos

    文件:

    /******************************************************************************
    
     @file       build_config.opt
    
     @brief This file contains the Bluetooth Low Energy (BLE) build config options.
    
     Group: CMCU, SCS
     Target Device: CC2640R2
    
     ******************************************************************************
     
     Copyright (c) 2011-2018, Texas Instruments Incorporated
     All rights reserved.
    
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:
    
     *  Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
    
     *  Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.
    
     *  Neither the name of Texas Instruments Incorporated nor the names of
        its contributors may be used to endorse or promote products derived
        from this software without specific prior written permission.
    
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
     ******************************************************************************
     Release Name: simplelink_cc2640r2_sdk_02_20_00_49
     Release Date: 2018-07-16 13:19:56
     *****************************************************************************/
    
    /*
        The following is a list of all possible build defines and corresponding options
        that can be set for each define:
    
        GATT_DB_OFF_CHIP        - Indicates that the GATT database is maintained off the chip on the
                                  Application Processor (AP).
    
        GAP_BOND_MGR            - Used to include the Bond Manager
    
        HOST_CONFIG             (BLE Host Build Configurations) Possible Options:
            PERIPHERAL_CFG      - Used to include the GAP Peripheral Role support
            CENTRAL_CFG         - Used to include the GAP Central Role support
            BROADCASTER_CFG     - Used to include the GAP Broadcaster Role support
            OBSERVER_CFG        - Used to include the GAP Observer Role support
    
        BLE_V41_FEATURES        Configure the stack to use features from the BLE 4.1 Specification
            L2CAP_COC_CFG       - Enable L2CAP Connection Oriented Channels
    
        BLE_V42_FEATURES        Configure the stack to use features from the BLE 4.2 Specification
                                The following BLE 4.2 features are enabled by default and cannot
                                be disabled.
            EXT_DATA_LEN_CFG    - Enable the Extended Data Length Feature in the Controller
            SECURE_CONNS_CFG    - Enable Secure Connections Pairing Procedure
            PRIVACY_1_2_CFG     - Enable Enhanced Privacy
    
        BLE_V50_FEATURES        Configure the stack to use features from the BLE 5.0 Specification
                                The following BLE 5.0 features are enabled by default and cannot
                                be disabled.
            PHY_2MBPS_CFG       - Enable 2 Mbps data rate in the Controller
            HDC_NC_ADV_CFG      - Enable High Duty Cycle Non-Connectable Advertising
            CHAN_ALGO2_CFG      - Enable Channel Selection Algorithm 2
    
        HCI_TL_FULL             - All supported HCI commands are available via the Tranport Layer's NPI.
                                - Intended for NP solution.
        HCI_TL_PTM              - Only those HCI commands needed for Production Test Mode are available
                                via the Transport Layer's NPI
                                - Intended for SOC solutions where, during production, accesss is temporarily
                                  needed (e.g. for PHY testing using Direct Test Mode, etc.).
        HCI_TL_NONE             - No supported HCI commands are available via the Transport Layer's NPI.
                                - Intended for SOC solutions.
    
        Below is general information for using and/or changing this configuration option file:
    
        Combo Roles:        Combo roles can be set by defining multiple roles for HOST_CONFIG. The possible
                            combo roles and HOST_CONFIG defines are:
                            Peripheral + Observer  :    PERIPHERAL_CFG+OBSERVER_CFG
                            Central + Broadcaster  :    CENTRAL_CFG+BROADCASTER_CFG
                            Peripheral + Central   :    PERIPHERAL_CFG+CENTRAL_CFG
    
        lib_search tool:    There is a pre build action for every stack project that runs a tool
                            lib_search.exe. This tool aims to automatically import the correct library
                            files into your project based on the defines in this file.
    
                            The locations of all library files and their correspond options are
                            <install dir>/ble_core/ble_[host,ctrl]_lib/<device> for stack libs
                            and at <install dir>/ble_core/hci_tl_lib/<device> for
                            HCI Transport Layer libs
    
                            If an library is found that was built with matching options, it will be
                            copied into the project local directory at <App ewp dir>/../../lib/ and
                            subsequently linked with the stack.
    
                            If you experience a build error with lib_search.exe, expand the build error
                            message by clicking Tools->Options->Messages->Show build messages:->All.
                            The error messages printed out by the lib_search tool should now appear in
                            your Build Message window.
    
    */
    
    /* BLE Host Build Configurations */
    -DHOST_CONFIG=PERIPHERAL_CFG
    /* -DHOST_CONFIG=CENTRAL_CFG */
    /* -DHOST_CONFIG=BROADCASTER_CFG */
    /* -DHOST_CONFIG=OBSERVER_CFG */
    /* -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG */
    /* -DHOST_CONFIG=CENTRAL_CFG+BROADCASTER_CFG */
    /* -DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG */
    
    /* GATT Database being off chip */
    /* -DGATT_DB_OFF_CHIP */
    
    /* Include GAP Bond Manager */
    -DGAP_BOND_MGR
    
    /* BLE v4.1 Features */
    /* -DV41_FEATURES=L2CAP_COC_CFG */
    
    /* BLE v4.2 Features
     * Note: For advanced users who choose to explicitly build their BLE
     * Stack without ROM the following upper limit on RAM usage must be
     * observed when using the Secure Connections Feature:
     * R1: 0x20004F2C
     * R2: 0x20004F80
     * When using linker command files provided by this SDK, the linker
     * symbol ENCRYPTION_ROM=1 or ENCRYPTION_ROM=2 may be defined to set
     * this upper limit for R1 and R2 devices, respectively.
     */
    
    /* BLE v5.0 Features
     * Note: The Long Range and Advertising Extension features are
     * for evaluation only.
     */
    
    /* Include Transport Layer (Full or PTM) */
    -DHCI_TL_NONE
    /* -DHCI_TL_PTM */
    /* -DHCI_TL_FULL */
    

  • 在线等大神解答....