@file gap.h API 翻译 翻译的不对的地方 请指正
时间:10-02
整理:3721RD
点击:
1、GAP_DeviceInit
/*-------------------------------------------------------------------
* FUNCTIONS - Initialization and Configuation
功能:初始化和配置,2017年5月8日10:24:25,SuoZhang
*/
/**
* @brief Called to setup the device. Call just once on initialization.
调用这个函数进行GAP 初始化(建立设备),仅仅在初始化中调用一次!
*
* NOTE: When initialization is complete, the calling app will be
* sent the GAP_DEVICE_INIT_DONE_EVENT
注意: 当初始化完成的时候,会给APP发送 GAP_DEVICE_INIT_DONE_EVENT 事件
*
* @param taskID - Default task ID to send events.预先配置(初始化完成后)发送事件 的任务ID
* @param profileRole - GAP Profile Roles: @ref GAP_PROFILE_ROLE_DEFINES
* @param maxScanResponses - maximum number to scan responses 最大数量扫描响应应答
* we can receive during a device discovery.我们能接收 在一个设备搜寻期间!
* @param pIRK - pointer to Identity Root Key, NULLKEY (all zeroes) if the app
* wants the GAP to generate the key. 指针指向 身份
* @param pSRK - pointer to Sign Resolving Key, NULLKEY if the app
* wants the GAP to generate the key. 指针指向 签名分解
* @param pSignCounter - 32 bit value used in the SM Signing
* algorithm that shall be initialized to zero and incremented
* with every new signing. This variable must also be maintained
* by the application.
*
* @return SUCCESS - Processing, expect GAP_DEVICE_INIT_DONE_EVENT, <BR>
* INVALIDPARAMETER - for invalid profile role or role combination, <BR>
* bleIncorrectMode - trouble communicating with HCI
*/
extern bStatus_t GAP_DeviceInit( uint8 taskID,
uint8 profileRole,
uint8 maxScanResponses,
uint8 *pIRK,
uint8 *pSRK,
uint32 *pSignCounter );
2、extern bStatus_t GAP_SetAdvToken( gapAdvDataToken_t *pToken );
/**
* @brief Called to setup a GAP Advertisement/Scan Response data token.
* 调用这个函数建立 GAP 广播和 扫描应答数据获取
* SuoZhang,2017年5月9日08:54:24
*
* NOTE: The data in these items are stored as low byte first (OTA format).
* The passed in structure "token" should be allocated by the calling app/profile
* and not released until after calling GAP_RemoveAdvToken().
注意: 这些项目中的数据被存储为低字节(OTA格式)。通过结构分配的“令牌”应该调用应用程序/配置文件*和没有公布,直到后调用GAP_RemoveAdvToken()。
*
* @param pToken - Advertisement/Scan response token to write. 广播/扫描 应答或者写。
*
* @return SUCCESS - advertisement token added to the GAP list <BR> 成功:广播成功加入 GAP 的 表中!
* INVALIDPARAMETER - Invalid Advertisement Type or pAttrData is NULL <BR> 无效的广播类型或者数据为NULL.
* INVALID_MEM_SIZE - The tokens take up too much space and don't fit into Advertisment data and Scan Response Data<BR>
* 令牌占用太多的空间和不符合广告数据和扫描响应数据.
* bleInvalidRange - token ID already exists.<BR> 令牌ID 已经存在.
* bleIncorrectMode - not a peripheral device<BR> 不是从机设备.
* bleMemAllocError - memory allocation failure, 内存分配失败.
*/
extern bStatus_t GAP_SetAdvToken( gapAdvDataToken_t *pToken );
没什么大问题,这句“maximum number to scan responses we can receive during a device discovery”的翻译我觉得有点拗口,在一次设备发现过程中可以接收到的最大扫描响应数 改成这样会比较好
其实没必要咬文嚼字,自己能看懂就行了
