这里介绍了将一个协议栈版本换到新协议栈的过程.
Porting BLEv1.2 Projects to BLEv1.3
- Move (or Copy) the project files from C:\Texas Instruments\BLE-CC254x-1.2\Projects\ble to C:\Texas Instruments\BLE-CC254x-1.3\Projects\ble
- Move (or Copy) the necessary profiles from C:\Texas Instruments\BLE-CC254x-1.3\Projects\ble\Profiles toC:\Texas Instruments\BLE-CC254x-1.3\Projects\ble\Profiles
- Open the project and in the LIB group of the project.
- Remove all files
- Add CC254x_BLE.lib (or GAP role specific, for a more memory optimized library)
- Add CC254x_BLE_HCI_TL_None.lib for SoC solutions
- Add NPI group (Right click in the workspace > "Add" > "Add Group..."). Add files npi.h, npi.c (npi_uart.c and npi_spi.c as well if needed)
- Go to "Project" > "Options" > "General Options" > "Target" > "Number of virtual registers": Set number to16
- Go to "Project" > "Options" > "C/C++ Compiler" > "Additional include directories": Add the line$PROJ_DIR$\..\..\common\npi\npi_np
- Done
Porting BLEv1.3.2 Projects to BLEv1.4.0
- Move (or Copy) the project files from C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\$PROJECT$ toC:\Texas Instruments\BLE-CC254x-1.3\Projects\ble\$PROJECT$ where $PROJECT$ is your project folder.
- 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.
- Open your project (now in the 1.4.0 folder) with IAR 8.20.
- When prompted, choose yes to convert for use with new version.
- 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
摘自维基百科(http://processors.wiki.ti.com/index.php/LPRF_BLE_Porting_Projects)