/*********************************************************************
* @fn SimpleProfile_GetParameter 简单 profile 得到参数
*
* @brief Get a Simple Profile parameter. 得到一个简单的profile参数。
*
* @param param - Profile parameter ID 形参param:profile的参数ID
*
* @param value - pointer to data to put. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16 will be cast to
* uint16 pointer).
*
*
* 形参value:是一个空指针参数,指向输出数据的指针,这个依赖于参数的ID
* 并且 将被转换成适当的参数类似,例如:数据类型uint16将被转换成uint16指针。
*
* profile:描述了某个应用场景中设备有什么功能(执行什么工作)。在一个profile里会定义好角色。
* 角色会包含一个服务service或者多个service或者没有。profile一般定义两个角色,例如防丢器中定义了一个报告者和监视者。
*
* 2016年12月15日09:09:14,GXP
*
* @return bStatus_t BLE_STATUS_VALUES
*/
bStatus_t SimpleProfile_GetParameter( uint8 param, void *value )
{
bStatus_t ret = SUCCESS;
switch ( param )
{
case SIMPLEPROFILE_CHAR1:
*((uint8*)value) = simpleProfileChar1;
break; case SIMPLEPROFILE_CHAR2:
*((uint8*)value) = simpleProfileChar2;
break; case SIMPLEPROFILE_CHAR3:
*((uint8*)value) = simpleProfileChar3;
break; case SIMPLEPROFILE_CHAR4:
*((uint8*)value) = simpleProfileChar4;
break; case SIMPLEPROFILE_CHAR5:
VOID memcpy( value, simpleProfileChar5, SIMPLEPROFILE_CHAR5_LEN );
break; default:
ret = INVALIDPARAMETER;//无效的ID
break;
} return ( ret ); //返回函数调用的状态 是成功了 ,还是因为ID无效失败了
}
bStatus_t 的值在宏定义处被解释为BLE_STATUS_VALUES,下面是BLE_STATUS_VALUES的值的含义:

 /** @defgroup BLE_STATUS_VALUES BLE Default BLE Status Values
* returned as bStatus_t
* @{
*/
#define bleInvalidTaskID INVALID_TASK //!< Task ID isn't setup properly
#define bleNotReady 0x10 //!< Not ready to perform task
#define bleAlreadyInRequestedMode 0x11 //!< Already performing that task
#define bleIncorrectMode 0x12 //!< Not setup properly to perform that task
#define bleMemAllocError 0x13 //!< Memory allocation error occurred
#define bleNotConnected 0x14 //!< Can't perform function when not in a connection
#define bleNoResources 0x15 //!< There are no resource available
#define blePending 0x16 //!< Waiting
#define bleTimeout 0x17 //!< Timed out performing function
#define bleInvalidRange 0x18 //!< A parameter is out of range
#define bleLinkEncrypted 0x19 //!< The link is already encrypted
#define bleProcedureComplete 0x1A //!< The Procedure is completed
#define bleInvalidMtuSize 0x1B //!< MTU size is out of range

 SimpleProfile_SetParameter 和上面这个函数类似!

最新文章

  1. SQL Server 复制:事务发布
  2. HDOJ 1561 The more, The Better
  3. Java写的爬虫的基本程序
  4. BZOJ4134 : ljw和lzr的hack比赛
  5. JAVA 类中方法参数与返回值
  6. JS中遍历普通数组和字典数组的区别
  7. hdoj1325 Is It A Tree?
  8. ASP.NET MVC4 json序列化器
  9. Arch安装KDE5
  10. windows下pip安装python模块时报错
  11. July 10th, 2018. Tuesday, Week 28th
  12. flutter - 01 基础介绍以及ListView
  13. Fiddler Composer 模拟post请求
  14. .net core 中间件实战
  15. nginx配置静态资源访问
  16. Wisdom RESTClient支持自动化测试并可以生成API文档
  17. 3、Python编程之MySQLdb模块(0602)
  18. python3获得命令行输入的参数
  19. nginx安装扩展 sub_filter&amp;http_ssl_module
  20. eclipse使用git命令行

热门文章

  1. DataTables固定表格宽度(设置横向滚动条)
  2. 基于easyUI实现权限管理系统(四)——用户管理
  3. Spring Data JPA 缓存结合Ehcache介绍
  4. IO流之 commons-IO
  5. css-布局定位
  6. 什么是APP???APP的开发类型又分哪几种???
  7. MARS3.6 Programming
  8. Android网络通信库Volley简介(转)
  9. 关于Flume以及Kafka理解
  10. html的文件控件&lt;input type=&quot;file&quot;&gt;样式的改变