当前位置: 首页>>代码示例>>C++>>正文


C++ GATTServApp_InitCharCfg函数代码示例

本文整理汇总了C++中GATTServApp_InitCharCfg函数的典型用法代码示例。如果您正苦于以下问题:C++ GATTServApp_InitCharCfg函数的具体用法?C++ GATTServApp_InitCharCfg怎么用?C++ GATTServApp_InitCharCfg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GATTServApp_InitCharCfg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ScanParam_AddService

/*********************************************************************
 * @fn      ScanParam_AddService
 *
 * @brief   Initializes the Battery Service by registering
 *          GATT attributes with the GATT server.
 *
 * @return  Success or Failure
 */
bStatus_t ScanParam_AddService( void )
{
  uint8 status = SUCCESS;

  // Initialize Client Characteristic Configuration attributes
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, scanParamRefreshClientCharCfg );

  // Register GATT attribute list and CBs with GATT Server App
  status = GATTServApp_RegisterService( scanParamAttrTbl, GATT_NUM_ATTRS( scanParamAttrTbl ),
                                        &scanParamCBs );

  return ( status );
}
开发者ID:ClarePhang,项目名称:CC2540,代码行数:21,代码来源:scanparamservice.c

示例2: SimpleProfile_AddService

/*********************************************************************
 * @fn      SimpleProfile_AddService
 *
 * @brief   Initializes the Simple Profile service by registering
 *          GATT attributes with the GATT server.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return  Success or Failure
 */
bStatus_t SimpleProfile_AddService( uint32 services )
{
  uint8 status = SUCCESS;

  // Initialize Client Characteristic Configuration attributes
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, simpleProfileChar4Config );
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, simpleProfileChar6Config );
  //GATTServApp_InitCharCfg( INVALID_CONNHANDLE, simpleProfileChar7Config );

  // Register with Link DB to receive link status change callback
  VOID linkDB_Register( simpleProfile_HandleConnStatusCB );  
  
  if ( services & SIMPLEPROFILE_SERVICE )
  {
    // Register GATT attribute list and CBs with GATT Server App
    status = GATTServApp_RegisterService( simpleProfileAttrTbl, 
                                          GATT_NUM_ATTRS( simpleProfileAttrTbl ),
                                          &simpleProfileCBs );
  }

  return ( status );
}
开发者ID:reyno123456,项目名称:android_bluetooth,代码行数:33,代码来源:simpleGATTprofile.c

示例3: Thermometer_AddService

/*********************************************************************
 * @fn      Thermometer_AddService
 *
 * @brief   Initializes the Thermometer   service by registering
 *          GATT attributes with the GATT server.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return  Success or Failure
 */
bStatus_t Thermometer_AddService( uint32 services )
{
  uint8 status = SUCCESS;

  // Initialize Client Characteristic Configuration attributes
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, thermometerTempConfig );
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, thermometerIMeasConfig );
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, thermometerIntervalConfig );

  // Register with Link DB to receive link status change callback
  VOID linkDB_Register( thermometer_HandleConnStatusCB );  
  
  if ( services & THERMOMETER_SERVICE )
  {
    // Register GATT attribute list and CBs with GATT Server App
    status = GATTServApp_RegisterService( thermometerAttrTbl, 
                                          GATT_NUM_ATTRS( thermometerAttrTbl ),
                                          &thermometerCBs );
  }

  return ( status );
}
开发者ID:yzkqfll,项目名称:baby,代码行数:33,代码来源:ther_profile.c

示例4: Accel_AddService

/*********************************************************************
 * @fn      Accel_AddService
 *
 * @brief   Initializes the Accelerometer service by
 *          registering GATT attributes with the GATT server. Only
 *          call this function once.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return  Success or Failure
 */
bStatus_t Accel_AddService( uint32 services )
{
  uint8 status = SUCCESS;

  // Initialize Client Characteristic Configuration attributes
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, accelXConfigCoordinates );
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, accelYConfigCoordinates );
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, accelZConfigCoordinates );

  // Register with Link DB to receive link status change callback
  VOID linkDB_Register( accel_HandleConnStatusCB );  

  if ( services & ACCEL_SERVICE )
  {
    // Register GATT attribute list and CBs with GATT Server App
    status = GATTServApp_RegisterService( accelAttrTbl, 
                                          GATT_NUM_ATTRS( accelAttrTbl ),
                                          &accelCBs );
  }

  return ( status );
}
开发者ID:AlfredHunter,项目名称:Oidpen,代码行数:34,代码来源:accelerometer.c

示例5: test_HandleConnStatusCB

/*********************************************************************
 * @fn          test_HandleConnStatusCB
 *
 * @brief       Test Profile link status change handler function.
 *
 * @param       connHandle - connection handle
 * @param       changeType - type of change
 *
 * @return      none
 */
static void test_HandleConnStatusCB( uint16 connHandle, uint8 changeType )
{
  // Make sure this is not loopback connection
  if ( connHandle != LOOPBACK_CONNHANDLE )
  {
    // Reset Client Char Config if connection has dropped
    if ( ( changeType == LINKDB_STATUS_UPDATE_REMOVED )      ||
         ( ( changeType == LINKDB_STATUS_UPDATE_STATEFLAGS ) &&
           ( !linkDB_Up( connHandle ) ) ) )
    {
      GATTServApp_InitCharCfg( connHandle, testDataConfig );
    }
  }
}
开发者ID:ClarePhang,项目名称:CC2540,代码行数:24,代码来源:testservice.c

示例6: Temp_AddService

/*********************************************************************
 * @fn      Temp_AddService
 *
 * @brief   Initializes the Heart Rate service by registering
 *          GATT attributes with the GATT server.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return  Success or Failure
 */
bStatus_t Temp_AddService( uint32 services )
{
    uint8 status = SUCCESS;

    VOID linkDB_Register( Temp_HandleConnStatusCB );
    
    GATTServApp_InitCharCfg( INVALID_CONNHANDLE, valueConfigCoordinates );    
    
    status = GATTServApp_RegisterService( tempAttrTbl, 
      GATT_NUM_ATTRS( tempAttrTbl ),
      &tempCBs );

    return ( status );
}
开发者ID:qodome,项目名称:Firmware,代码行数:25,代码来源:temperature.c

示例7: Batt_AddService

/*********************************************************************
 * @fn      Batt_AddService
 *
 * @brief   Initializes the Battery Service by registering
 *          GATT attributes with the GATT server.
 *
 * @return  Success or Failure
 */
bStatus_t Batt_AddService( void )
{
  uint8 status = SUCCESS;

  // Initialize Client Characteristic Configuration attributes
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, battLevelClientCharCfg );

  // Register GATT attribute list and CBs with GATT Server App
  status = GATTServApp_RegisterService( battAttrTbl,
                                        GATT_NUM_ATTRS( battAttrTbl ),
                                        &battCBs );

  return ( status );
}
开发者ID:zhangjie201412,项目名称:Study,代码行数:22,代码来源:battservice.c

示例8: UartProfile_AddService

/**
 * @fn      UartProfile_AddService
 *
 * @brief   Initializes the Simple Profile service by registering
 *          GATT attributes with the GATT server.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return  Success or Failure
 */
bStatus_t UartProfile_AddService(void)
{
	uint8	status = SUCCESS;

	// Initialize Client Characteristic Configuration attributes
	GATTServApp_InitCharCfg(INVALID_CONNHANDLE, uartServ2CharCfg);

	// Register with Link DB to receive link status change callback
	linkDB_Register(UartProfile_HandleConnStatusCB);

	// Register GATT attribute list and CBs with GATT Server App
	GATTServApp_RegisterService(uartServ1AttrTbl, GATT_NUM_ATTRS(uartServ1AttrTbl), &uartServ1CBs);
	GATTServApp_RegisterService(uartServ2AttrTbl, GATT_NUM_ATTRS(uartServ2AttrTbl), &uartServ2CBs);
	return (status);
}
开发者ID:wythe-lin,项目名称:ZTKBLE,代码行数:26,代码来源:uartserv.c

示例9: util_initCharacteristicConfig

/*********************************************************************
 * @fn      util_initCharacteristicConfig
 *
 * @brief   Initialise a characteristics configuration
 *
 * @param   pDataConfig - pointer to characteristics configuration
 *
 * @return  Success or bleMemAllocError
 */
bStatus_t util_initCharacteristicConfig( gattCharCfg_t **pDataConfig )
{
  // Allocate Client Characteristic Configuration table
  *pDataConfig = (gattCharCfg_t *)osal_mem_alloc(sizeof(gattCharCfg_t) *
                                                    linkDBNumConns);
  if (*pDataConfig == NULL)
  {
    return (bleMemAllocError);
  }
  
  // Register with Link DB to receive link status change callback
  GATTServApp_InitCharCfg(INVALID_CONNHANDLE, *pDataConfig);
  
  return SUCCESS;
}
开发者ID:aidaima,项目名称:RemoteControl-Car,代码行数:24,代码来源:st_util.c

示例10: Temp_HandleConnStatusCB

/*********************************************************************
 * @fn          Temp_HandleConnStatusCB
 *
 * @brief       Heart Rate Service link status change handler function.
 *
 * @param       connHandle - connection handle
 * @param       changeType - type of change
 *
 * @return      none
 */
void Temp_HandleConnStatusCB( uint16 connHandle, uint8 changeType )
{
  // Make sure this is not loopback connection
  if ( connHandle != LOOPBACK_CONNHANDLE )
  {
    // Reset Client Char Config if connection has dropped
    if ( ( changeType == LINKDB_STATUS_UPDATE_REMOVED )      ||
         ( ( changeType == LINKDB_STATUS_UPDATE_STATEFLAGS ) &&
           ( !linkDB_Up( connHandle ) ) ) )
    {
      GATTServApp_InitCharCfg( connHandle, valueConfigCoordinates );
      enable_fast_read = 0;
    }
  }
}
开发者ID:qodome,项目名称:Firmware,代码行数:25,代码来源:temperature.c

示例11: sensor_HandleConnStatusCB

/*********************************************************************
 * @fn          sensor_HandleConnStatusCB
 *
 * @brief       Sensor Profile link status change handler function.
 *
 * @param       connHandle - connection handle
 * @param       changeType - type of change
 *
 * @return      none
 */
static void sensor_HandleConnStatusCB( uint16 connHandle, uint8 changeType )
{
  // Make sure this is not loopback connection
  if ( connHandle != LOOPBACK_CONNHANDLE )
  {
    // Reset Client Char Config if connection has dropped
    if ( ( changeType == LINKDB_STATUS_UPDATE_REMOVED )      ||
         ( ( changeType == LINKDB_STATUS_UPDATE_STATEFLAGS ) &&
           ( !linkDB_Up( connHandle ) ) ) )
    {
      GATTServApp_InitCharCfg( connHandle, sensorDataConfig );
      GATTServApp_InitCharCfg( connHandle, sensorData1Config );
      GATTServApp_InitCharCfg( connHandle, sensorData2Config );
      GATTServApp_InitCharCfg( connHandle, sensorData3Config );
    }
    if ( changeType == LINKDB_STATUS_UPDATE_NEW )
    {
      GATTServApp_WriteCharCfg(connHandle,sensorDataConfig,GATT_CLIENT_CFG_NOTIFY);
      GATTServApp_WriteCharCfg(connHandle,sensorData1Config,GATT_CLIENT_CFG_NOTIFY);
      GATTServApp_WriteCharCfg(connHandle,sensorData2Config,GATT_CLIENT_CFG_NOTIFY);
      GATTServApp_WriteCharCfg(connHandle,sensorData3Config,GATT_CLIENT_CFG_NOTIFY);
    }
  }
}
开发者ID:jackchased,项目名称:ble-firmware,代码行数:34,代码来源:environmentalservice.c

示例12: HeartRate_AddService

/*********************************************************************
 * @fn      HeartRate_AddService
 *
 * @brief   Initializes the Heart Rate service by registering
 *          GATT attributes with the GATT server.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return  Success or Failure
 */
bStatus_t HeartRate_AddService( uint32 services )
{
  uint8 status = SUCCESS;

  // Initialize Client Characteristic Configuration attributes
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, heartRateMeasClientCharCfg );

  if ( services & HEARTRATE_SERVICE )
  {
    // Register GATT attribute list and CBs with GATT Server App
    status = GATTServApp_RegisterService( heartRateAttrTbl, 
                                          GATT_NUM_ATTRS( heartRateAttrTbl ),
                                          &heartRateCBs );
  }

  return ( status );
}
开发者ID:Mecabot,项目名称:BLE-CC254x-1.4.0,代码行数:28,代码来源:heartrateservice.c

示例13: ProxReporter_AddService

/*********************************************************************
 * @fn      proxReporter_AddService
 *
 * @brief   Initializes the Proximity Reporter service by
 *          registering GATT attributes with the GATT server.
 *          Only call this function once.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return   Success or Failure
 */
bStatus_t ProxReporter_AddService( uint32 services )
{
  uint8 status = SUCCESS;

  if ( services & PP_LINK_LOSS_SERVICE )
  {
    // Register Link Loss attribute list and CBs with GATT Server App  
    status = GATTServApp_RegisterService( linkLossAttrTbl, 
                                          GATT_NUM_ATTRS( linkLossAttrTbl ),
                                          GATT_MAX_ENCRYPT_KEY_SIZE,
                                          &proxReporterCBs );
  }

  if ( ( status == SUCCESS ) && ( services & PP_IM_ALETR_SERVICE ) )
  {
    // Register Link Loss attribute list and CBs with GATT Server App
    status = GATTServApp_RegisterService( imAlertAttrTbl, 
                                          GATT_NUM_ATTRS( imAlertAttrTbl ),
                                          GATT_MAX_ENCRYPT_KEY_SIZE,
                                          &proxReporterCBs );
  }
  
  if ( ( status == SUCCESS )  && ( services & PP_TX_PWR_LEVEL_SERVICE ) )
  {
    // Allocate Client Characteristic Configuration table
    txPwrLevelConfig = (gattCharCfg_t *)osal_mem_alloc( sizeof(gattCharCfg_t) *
                                                        linkDBNumConns );
    if ( txPwrLevelConfig != NULL )
    {
      // Initialize Client Characteristic Configuration attributes
      GATTServApp_InitCharCfg( INVALID_CONNHANDLE, txPwrLevelConfig ); 
      
      // Register Tx Power Level attribute list and CBs with GATT Server App
      status = GATTServApp_RegisterService( txPwrLevelAttrTbl, 
                                            GATT_NUM_ATTRS( txPwrLevelAttrTbl ),
                                            GATT_MAX_ENCRYPT_KEY_SIZE,
                                            &proxReporterCBs );
    }
    else
    {
      status = bleMemAllocError;
    }
  }

  return ( status );
}
开发者ID:DRuffer,项目名称:coinForth,代码行数:58,代码来源:proxreporter.c

示例14: Accel_AddService

/*********************************************************************
 * @fn      Accel_AddService
 *
 * @brief   Initializes the Sensor Profile service by registering
 *          GATT attributes with the GATT server.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return  Success or Failure
 */
bStatus_t Accel_AddService( uint32 services )
{
  uint8 status = SUCCESS;

  // Register with Link DB to receive link status change callback
  VOID linkDB_Register( acc_HandleConnStatusCB );
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, accelDataConfig );

  if (services & ACCELEROMETER_SERVICE )
  {
       // Register GATT attribute list and CBs with GATT Server App
    status = GATTServApp_RegisterService( accelAttrTbl,
                                          GATT_NUM_ATTRS( accelAttrTbl ),
                                          &accCBs );
  }

  return ( status );
}
开发者ID:ClarePhang,项目名称:CC2540,代码行数:29,代码来源:accelerometerservice.c

示例15: IRTemp_AddService

/*********************************************************************
 * @fn      IRTemp_AddService
 *
 * @brief   Initializes the Sensor Profile service by registering
 *          GATT attributes with the GATT server.
 *
 * @param   services - services to add. This is a bit map and can
 *                     contain more than one service.
 *
 * @return  Success or Failure
 */
bStatus_t IRTemp_AddService( uint32 services )
{
  uint8 status = SUCCESS;

  // Register with Link DB to receive link status change callback
  VOID linkDB_Register( irTemp_HandleConnStatusCB );
  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, irTempDataConfig );

  if (services & IRTEMPERATURE_SERVICE )
  {
       // Register GATT attribute list and CBs with GATT Server App
    status = GATTServApp_RegisterService( irTempAttrTbl,
                                          GATT_NUM_ATTRS( irTempAttrTbl ),
                                          &irTempCBs );
  }

  return ( status );
}
开发者ID:backman-git,项目名称:EcoSim-sample-project,代码行数:29,代码来源:irtempservice.c


注:本文中的GATTServApp_InitCharCfg函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。