微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > 如何CC2540 把在BLE1.3的程序移植到 BLE1.4中去。

如何CC2540 把在BLE1.3的程序移植到 BLE1.4中去。

时间:10-02 整理:3721RD 点击:

大家好,我有个问题,我在BLE1.3 下用IAR 8.10.3 写了一个程序。然后我用 IAR 8.10.3 或者 IAR 8.20编译下载完全没有问题。

但是当我把我的peripheral, central 和profile 文件拷到 BLE 1.4目录下,用IAR 8.20 编译的时候,就报错了。

错误是: 

Error[Pe165]: too few arguments in function call C:\Texas Instruments\BLE-CC254x-1.4.0\Projects\ble\Profiles\Roles\peripheral.c 662

这里面指的代码是 这个函数的return 那行。这个函数是在peripheral.c中。

我的问题是 大概是怎样的一个思路如果我把代码从BLE1.3移植到BLE1.4当中呢?

bStatus_t GAPRole_TerminateConnection( void )
{
  if ( gapRole_state == GAPROLE_CONNECTED )
  {
    return ( GAP_TerminateLinkReq( gapRole_TaskID, gapRole_ConnectionHandle ) );
  }
  else
  {
    return ( bleIncorrectMode );
  }
}

应该是文件没有拷贝完整吧!建议用1.42版本,iar使用9.3及以上版本。

1.3到1.4是有比较明显的变化的.请参考如下porting建议:

http://processors.wiki.ti.com/index.php/LPRF_BLE_Porting_Projects

Porting BLEv1.3.2 Projects to BLEv1.4.0

  1. Move (or Copy) the project files from C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\$PROJECT$ to C:\Texas Instruments\BLE-CC254x-1.3\Projects\ble\$PROJECT$ where $PROJECT$ is your project folder.
  2. If you modifed any files from C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\Profiles, you will need to merge your changes with the new 1.4.0 version.
  3. Open your project (now in the 1.4.0 folder) with IAR 8.20
  4. When prompted, choose yes to convert for use with new version.
  5. Compile and save your project.

You should be aware of two project-specific changes:

  • The functionality of the PLUS_BROADCASTER define has changed so that the peripheralBroadcaster.c and peripheralBraodcaster.h files are no longer needed.  See the modified simpleBLEperipheral project for how to accomodate this.
  • Advertising will now begin again after a connection is dropped by default.  To remove this, comment out line 1021 of peripheral.c (shown below):

                  VOID osal_set_event( gapRole_TaskID, START_ADVERTISING_EVT );

  • All UUID's are now stored in centralized locations: gatt_uuid.h and gatt_profile_uuid.h

Also, the following API's have changed:

  • extern bStatus_t GAP_TerminateLinkReq( uint8 taskID, uint16 connectionHandle, uint8 reason );   
        - the third parameter "reason" has been added to allow the application to indicate the termination reason to the connected device
  • the GAPBondMgr_ProcessGAPMsg( gapEventHdr_t *pMsg ) function is no longer a void-type function. It returns a uint8 which indicates TRUE if safe to deallocate the incoming GAP message and FALSE otherwise

非常感谢。 您知道在哪能下到BLE 1.4.1么。因为要想升级到1.4.2得先升级到1.4.1

我最近从官网下载了非常成熟的1.42版本,然后使用iar 10.1编译,测试效果

不错,没有1.4版本不能读rssi信号强度bug。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top