您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GATTServApp_InitCharCfg函数代码示例

51自学网 2021-06-01 20:49:19
  C++
这篇教程C++ GATTServApp_InitCharCfg函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例16: Humidity_AddService

/********************************************************************* * @fn      Humidity_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 Humidity_AddService( uint32 services ){  uint8 status = SUCCESS;  // Register with Link DB to receive link status change callback  VOID linkDB_Register( humid_HandleConnStatusCB );  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, humidDataConfig );  if (services & HUMIDITY_SERVICE )  {       // Register GATT attribute list and CBs with GATT Server App    status = GATTServApp_RegisterService( humidAttrTbl,                                          GATT_NUM_ATTRS( humidAttrTbl ),                                          &humidCBs );  }  return ( status );}
开发者ID:element14,项目名称:nocturne,代码行数:29,


示例17: Pir_AddService

/********************************************************************* * @fn      Pir_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 Pir_AddService( uint32 services ){  uint8 status = SUCCESS;  // Register with Link DB to receive link status change callback  VOID linkDB_Register( sensor_HandleConnStatusCB );  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, sensorDataConfig );  if (services & SENSOR_SERVICE )  {       // Register GATT attribute list and CBs with GATT Server App    status = GATTServApp_RegisterService( sensorAttrTable,                                          GATT_NUM_ATTRS( sensorAttrTable ),                                          &sensorCBs );  }  return ( status );}
开发者ID:jackchased,项目名称:ble-firmware,代码行数:29,


示例18: AHRS_addService

/********************************************************************* * @fn      AHRS_addService * * @brief   Initializes the AHRS Profile service by registering *          GATT attributes with the GATT server. * * @return  Success or Failure */bStatus_t AHRS_addService(void){  // Allocate Client Characteristic Configuration table  sensorDataConfig = (gattCharCfg_t *)ICall_malloc(sizeof(gattCharCfg_t) *                                                    linkDBNumConns);  if (sensorDataConfig == NULL)  {    return (bleMemAllocError);  }    // Register with Link DB to receive link status change callback  GATTServApp_InitCharCfg(INVALID_CONNHANDLE, sensorDataConfig);  // Register GATT attribute list and CBs with GATT Server App  return GATTServApp_RegisterService(sensorAttrTable,                                     GATT_NUM_ATTRS (sensorAttrTable),                                     GATT_MAX_ENCRYPT_KEY_SIZE,                                     &sensorCBs);}
开发者ID:PolymorphicLabs,项目名称:PML-Firmware,代码行数:27,


示例19: CcService_addService

/********************************************************************** @fn      CcService_addService** @brief   Initializes the service by registering*          GATT attributes with the GATT server.** @return  Success or Failure*/bStatus_t CcService_addService(void){  // Allocate Client Characteristic Configuration table  ccDataConfig = (gattCharCfg_t *)ICall_malloc(sizeof(gattCharCfg_t) *                                                linkDBNumConns);  if (ccDataConfig == NULL)  {    return (bleMemAllocError);  }    // Initialize Client Characteristic Configuration attributes  GATTServApp_InitCharCfg(INVALID_CONNHANDLE, ccDataConfig);    // Register GATT attribute list and CBs with GATT Server App  return GATTServApp_RegisterService(ccServiceAttrTbl,                                     GATT_NUM_ATTRS(ccServiceAttrTbl),                                     GATT_MAX_ENCRYPT_KEY_SIZE,                                     &ccServiceCBs);}
开发者ID:PolymorphicLabs,项目名称:PML-Firmware,代码行数:27,


示例20: Test_AddService

/********************************************************************* * @fn      Test_AddService * * @brief   Initializes the Test 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 Test_AddService( uint32 services ){  uint8 status = SUCCESS;  // Initialize Client Characteristic Configuration attributes  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, testDataConfig );  // Register with Link DB to receive link status change callback  VOID linkDB_Register( test_HandleConnStatusCB );  if ( services & TEST_SERVICE )  {    // Register GATT attribute list and CBs with GATT Server App    status = GATTServApp_RegisterService( testAttrTbl,                                          GATT_NUM_ATTRS( testAttrTbl ),                                          &testCBs );  }  return ( status );}
开发者ID:ClarePhang,项目名称:CC2540,代码行数:31,


示例21: 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;  scanParamRefreshClientCharCfg = (gattCharCfg_t *)osal_mem_alloc( sizeof(gattCharCfg_t) *                                                                   linkDBNumConns);    if (scanParamRefreshClientCharCfg == NULL)  {         return ( bleMemAllocError );  }    // 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 ),                                        GATT_MAX_ENCRYPT_KEY_SIZE, &scanParamCBs );  return ( status );}
开发者ID:billy-wang,项目名称:IOT,代码行数:29,


示例22: 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 ),                                          &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 ),                                          &proxReporterCBs );  }    if ( ( status == SUCCESS )  && ( services & PP_TX_PWR_LEVEL_SERVICE ) )  {        // Initialize Client Characteristic Configuration attributes    GATTServApp_InitCharCfg( INVALID_CONNHANDLE, txPwrLevelConfig );    // Register with Link DB to receive link status change callback    VOID linkDB_Register( proxReporter_HandleConnStatusCB );          // Register Tx Power Level attribute list and CBs with GATT Server App    status = GATTServApp_RegisterService( txPwrLevelAttrTbl,                                           GATT_NUM_ATTRS( txPwrLevelAttrTbl ),                                          &proxReporterCBs );  }  return ( status );}
开发者ID:AubrCool,项目名称:BLE,代码行数:50,


示例23: DataService_AddService

/* * DataService_AddService- Initializes the DataService service by registering *          GATT attributes with the GATT server. * *    rspTaskId - The ICall Task Id that should receive responses for Indications. */extern bStatus_t DataService_AddService( uint8_t rspTaskId ){  uint8_t status;  // Allocate Client Characteristic Configuration table  ds_StreamConfig = (gattCharCfg_t *)ICall_malloc( sizeof(gattCharCfg_t) * linkDBNumConns );  if ( ds_StreamConfig == NULL )  {    return ( bleMemAllocError );  }  // Initialize Client Characteristic Configuration attributes  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, ds_StreamConfig );  // Register GATT attribute list and CBs with GATT Server App  status = GATTServApp_RegisterService( Data_ServiceAttrTbl,                                        GATT_NUM_ATTRS( Data_ServiceAttrTbl ),                                        GATT_MAX_ENCRYPT_KEY_SIZE,                                        &Data_ServiceCBs );  Log_info1("Registered service, %d attributes", (IArg)GATT_NUM_ATTRS( Data_ServiceAttrTbl ));  ds_icall_rsp_task_id = rspTaskId;  return ( status );}
开发者ID:EinSoldiatGott,项目名称:ProjectZeroApp_CC2650LAUNCHXL,代码行数:29,


示例24: blueBasic_HandleConnStatusCB

static void blueBasic_HandleConnStatusCB(uint16 connHandle, uint8 changeType){  if (connHandle == LOOPBACK_CONNHANDLE)  {    return;  }#ifdef ENABLE_BLE_CONSOLE  if (changeType == LINKDB_STATUS_UPDATE_REMOVED || (changeType == LINKDB_STATUS_UPDATE_STATEFLAGS && !linkDB_Up(connHandle)))  {    GATTServApp_InitCharCfg(connHandle, consoleProfileCharCfg);    uint8 i;    for (i = 0; i < GATT_MAX_NUM_CONN; i++)    {      if (consoleProfileCharCfg[i].value == 1)      {        goto done;      }    }    ble_console_enabled = 0;  done:;  }#endif  ble_connection_status(connHandle, changeType, 0);}
开发者ID:JBtje,项目名称:BlueBasic,代码行数:24,


示例25: HidKbM_AddService

/********************************************************************* * @fn      HidKbM_AddService * * @brief   Initializes the HID Service by registering *          GATT attributes with the GATT server. * * @return  Success or Failure */bStatus_t HidKbM_AddService( void ){  uint8 status = SUCCESS;  // Initialize Client Characteristic Configuration attributes  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportMouseInClientCharCfg );  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportKeyInClientCharCfg );  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportCCInClientCharCfg );  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportBootKeyInClientCharCfg );  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportBootMouseInClientCharCfg );  // Register GATT attribute list and CBs with GATT Server App  status = GATTServApp_RegisterService( hidAttrTbl, GATT_NUM_ATTRS( hidAttrTbl ), &hidKbdMsCBs );  // Set up included service  Batt_GetParameter( BATT_PARAM_SERVICE_HANDLE,                     &GATT_INCLUDED_HANDLE( hidAttrTbl, HID_INCLUDED_SERVICE_IDX ) );  // Construct map of reports to characteristic handles  // Each report is uniquely identified via its ID and type  // Mouse input report  hidRptMap[0].id = hidReportRefMouseIn[0];  hidRptMap[0].type = hidReportRefMouseIn[1];  hidRptMap[0].handle = hidAttrTbl[HID_REPORT_MOUSE_IN_IDX].handle;  hidRptMap[0].cccdHandle = hidAttrTbl[HID_REPORT_MOUSE_IN_CCCD_IDX].handle;  hidRptMap[0].mode = HID_PROTOCOL_MODE_REPORT;  // Key input report  hidRptMap[1].id = hidReportRefKeyIn[0];  hidRptMap[1].type = hidReportRefKeyIn[1];  hidRptMap[1].handle = hidAttrTbl[HID_REPORT_KEY_IN_IDX].handle;  hidRptMap[1].cccdHandle = hidAttrTbl[HID_REPORT_KEY_IN_CCCD_IDX].handle;  hidRptMap[1].mode = HID_PROTOCOL_MODE_REPORT;  // Consumer Control input report  hidRptMap[2].id = hidReportRefCCIn[0];  hidRptMap[2].type = hidReportRefCCIn[1];  hidRptMap[2].handle = hidAttrTbl[HID_REPORT_CC_IN_IDX].handle;  hidRptMap[2].cccdHandle = hidAttrTbl[HID_REPORT_CC_IN_CCCD_IDX].handle;  hidRptMap[2].mode = HID_PROTOCOL_MODE_REPORT;  // LED output report  hidRptMap[3].id = hidReportRefLedOut[0];  hidRptMap[3].type = hidReportRefLedOut[1];  hidRptMap[3].handle = hidAttrTbl[HID_REPORT_LED_OUT_IDX].handle;  hidRptMap[3].cccdHandle = 0;  hidRptMap[3].mode = HID_PROTOCOL_MODE_REPORT;  // Boot keyboard input report  // Use same ID and type as key input report  hidRptMap[4].id = hidReportRefKeyIn[0];  hidRptMap[4].type = hidReportRefKeyIn[1];  hidRptMap[4].handle = hidAttrTbl[HID_BOOT_KEY_IN_IDX].handle;  hidRptMap[4].cccdHandle = hidAttrTbl[HID_BOOT_KEY_IN_CCCD_IDX].handle;  hidRptMap[4].mode = HID_PROTOCOL_MODE_BOOT;  // Boot keyboard output report  // Use same ID and type as LED output report  hidRptMap[5].id = hidReportRefLedOut[0];  hidRptMap[5].type = hidReportRefLedOut[1];  hidRptMap[5].handle = hidAttrTbl[HID_BOOT_KEY_OUT_IDX].handle;  hidRptMap[5].cccdHandle = 0;  hidRptMap[5].mode = HID_PROTOCOL_MODE_BOOT;  // Boot mouse input report  hidRptMap[6].id = HID_RPT_ID_MOUSE_IN;  hidRptMap[6].type = HID_REPORT_TYPE_INPUT;  hidRptMap[6].handle = hidAttrTbl[HID_BOOT_MOUSE_IN_IDX].handle;  hidRptMap[6].cccdHandle = hidAttrTbl[HID_BOOT_MOUSE_IN_CCCD_IDX].handle;  hidRptMap[6].mode = HID_PROTOCOL_MODE_BOOT;  // Feature report  hidRptMap[7].id = hidReportRefFeature[0];  hidRptMap[7].type = hidReportRefFeature[1];  hidRptMap[7].handle = hidAttrTbl[HID_FEATURE_IDX].handle;  hidRptMap[7].cccdHandle = 0;  hidRptMap[7].mode = HID_PROTOCOL_MODE_REPORT;  // Battery level input report  VOID Batt_GetParameter( BATT_PARAM_BATT_LEVEL_IN_REPORT, &(hidRptMap[8]) );  // Setup report ID map  HidDev_RegisterReports( HID_NUM_REPORTS, hidRptMap );  return ( status );}
开发者ID:backman-git,项目名称:EcoSim-sample-project,代码行数:95,


示例26: BlueBasic_ProcessEvent

/********************************************************************* * @fn      BlueBasic_ProcessEvent * * @brief   Blue Basic Application Task event processor.  This function *          is called to process all events for the task.  Events *          include timers, messages and any other user defined events. * * @param   task_id  - The OSAL assigned task ID. * @param   events - events to process.  This is a bit map and can *                   contain more than one event. * * @return  events not processed */uint16 BlueBasic_ProcessEvent( uint8 task_id, uint16 events ){  unsigned char i;  VOID task_id; // OSAL required parameter that isn't used in this function  if ( events & SYS_EVENT_MSG )  {    uint8 *pMsg;    if ( (pMsg = osal_msg_receive( blueBasic_TaskID )) != NULL )    {      // Release the OSAL message      VOID osal_msg_deallocate( pMsg );    }    // return unprocessed events    return (events ^ SYS_EVENT_MSG);  }  if ( events & BLUEBASIC_START_DEVICE_EVT )  {    // Start the Device    VOID GAPRole_StartDevice( &blueBasic_PeripheralCBs );#ifdef GAP_BOND_MGR    // Start Bond Manager    VOID GAPBondMgr_Register( &blueBasic_BondMgrCBs );#endif    // Start monitoring links    VOID linkDB_Register( blueBasic_HandleConnStatusCB );#ifdef ENABLE_BLE_CONSOLE    GATTServApp_InitCharCfg(INVALID_CONNHANDLE, consoleProfileCharCfg);    GATTServApp_RegisterService(consoleProfile, GATT_NUM_ATTRS(consoleProfile), &consoleProfileCB);#endif    // Start Interpreter    interpreter_setup();    return ( events ^ BLUEBASIC_START_DEVICE_EVT );  }#ifdef ENABLE_BLE_CONSOLE  if ( events & BLUEBASIC_CONNECTION_EVENT )  {    while (io.writein != io.writeout)    {      uint8* save = io.writeout;      if (GATTServApp_ProcessCharCfg(consoleProfileCharCfg, io.write, FALSE, consoleProfile, GATT_NUM_ATTRS(consoleProfile), INVALID_TASK_ID) != SUCCESS)      {        io.writeout = save;        break;      }    }    return ( events ^ BLUEBASIC_CONNECTION_EVENT );  }#endif  if ( events & BLUEBASIC_INPUT_AVAILABLE )  {    interpreter_loop();    return (events ^ BLUEBASIC_INPUT_AVAILABLE);  }  if ( events & BLUEBASIC_EVENT_INTERRUPTS )  {    for (i = 0; i < OS_MAX_INTERRUPT; i++)    {      if (blueBasic_interrupts[i].linenum && (events & (BLUEBASIC_EVENT_INTERRUPT << i)))      {        interpreter_run(blueBasic_interrupts[i].linenum, 1);      }    }    return (events ^ (events & BLUEBASIC_EVENT_INTERRUPTS));  }  if ( events & BLUEBASIC_EVENT_TIMERS )  {    for (i = 0; i < OS_MAX_TIMER; i++)    {      if (blueBasic_timers[i].linenum && (events & (BLUEBASIC_EVENT_TIMER << i)))      {        interpreter_run(blueBasic_timers[i].linenum, i == DELAY_TIMER ? 0 : 1);      }    }    return (events ^ (events & BLUEBASIC_EVENT_TIMERS));//.........这里部分代码省略.........
开发者ID:JBtje,项目名称:BlueBasic,代码行数:101,


示例27: HidKbd_AddService

/********************************************************************* * @fn      HidKbd_AddService * * @brief   Initializes the HID Service by registering *          GATT attributes with the GATT server. * * @return  Success or Failure */bStatus_t HidKbd_AddService( void ){  uint8 status;  // Allocate Client Charateristic Configuration tables.  hidReportKeyInClientCharCfg = (gattCharCfg_t *)osal_mem_alloc( sizeof(gattCharCfg_t) *                                                                 linkDBNumConns);    if (hidReportKeyInClientCharCfg == NULL)  {    return ( bleMemAllocError );  }    hidReportBootKeyInClientCharCfg = (gattCharCfg_t *)osal_mem_alloc( sizeof(gattCharCfg_t) *                                                                     linkDBNumConns);    if (hidReportBootKeyInClientCharCfg == NULL)  {    osal_mem_free(hidReportKeyInClientCharCfg);        return ( bleMemAllocError );  }    hidReportBootMouseInClientCharCfg = (gattCharCfg_t *)osal_mem_alloc( sizeof(gattCharCfg_t) *                                                                       linkDBNumConns);  if (hidReportBootMouseInClientCharCfg == NULL)  {         osal_mem_free(hidReportKeyInClientCharCfg);        osal_mem_free(hidReportBootKeyInClientCharCfg);        return ( bleMemAllocError );  }    // Initialize Client Characteristic Configuration attributes  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportKeyInClientCharCfg );  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportBootKeyInClientCharCfg );  GATTServApp_InitCharCfg( INVALID_CONNHANDLE, hidReportBootMouseInClientCharCfg );  // Register GATT attribute list and CBs with GATT Server App  status = GATTServApp_RegisterService( hidAttrTbl, GATT_NUM_ATTRS( hidAttrTbl ),                                        GATT_MAX_ENCRYPT_KEY_SIZE, &hidKbdCBs );  // Set up included service  Batt_GetParameter( BATT_PARAM_SERVICE_HANDLE,                     &GATT_INCLUDED_HANDLE( hidAttrTbl, HID_INCLUDED_SERVICE_IDX ) );  // Construct map of reports to characteristic handles  // Each report is uniquely identified via its ID and type  // Key input report  hidRptMap[0].id = hidReportRefKeyIn[0];  hidRptMap[0].type = hidReportRefKeyIn[1];  hidRptMap[0].handle = hidAttrTbl[HID_REPORT_KEY_IN_IDX].handle;  hidRptMap[0].pCccdAttr = &hidAttrTbl[HID_REPORT_KEY_IN_CCCD_IDX];  hidRptMap[0].mode = HID_PROTOCOL_MODE_REPORT;  // LED output report  hidRptMap[1].id = hidReportRefLedOut[0];  hidRptMap[1].type = hidReportRefLedOut[1];  hidRptMap[1].handle = hidAttrTbl[HID_REPORT_LED_OUT_IDX].handle;  hidRptMap[1].pCccdAttr = NULL;  hidRptMap[1].mode = HID_PROTOCOL_MODE_REPORT;  // Boot keyboard input report  // Use same ID and type as key input report  hidRptMap[2].id = hidReportRefKeyIn[0];  hidRptMap[2].type = hidReportRefKeyIn[1];  hidRptMap[2].handle = hidAttrTbl[HID_BOOT_KEY_IN_IDX].handle;  hidRptMap[2].pCccdAttr = &hidAttrTbl[HID_BOOT_KEY_IN_CCCD_IDX];  hidRptMap[2].mode = HID_PROTOCOL_MODE_BOOT;  // Boot keyboard output report  // Use same ID and type as LED output report  hidRptMap[3].id = hidReportRefLedOut[0];  hidRptMap[3].type = hidReportRefLedOut[1];  hidRptMap[3].handle = hidAttrTbl[HID_BOOT_KEY_OUT_IDX].handle;  hidRptMap[3].pCccdAttr = NULL;  hidRptMap[3].mode = HID_PROTOCOL_MODE_BOOT;  // Boot mouse input report  hidRptMap[4].id = HID_RPT_ID_MOUSE_IN;  hidRptMap[4].type = HID_REPORT_TYPE_INPUT;  hidRptMap[4].handle = hidAttrTbl[HID_BOOT_MOUSE_IN_IDX].handle;  hidRptMap[4].pCccdAttr = &hidAttrTbl[HID_BOOT_MOUSE_IN_CCCD_IDX];  hidRptMap[4].mode = HID_PROTOCOL_MODE_BOOT;  // Feature report  hidRptMap[5].id = hidReportRefFeature[0];  hidRptMap[5].type = hidReportRefFeature[1];  hidRptMap[5].handle = hidAttrTbl[HID_FEATURE_IDX].handle;  hidRptMap[5].pCccdAttr = NULL;//.........这里部分代码省略.........
开发者ID:DRuffer,项目名称:coinForth,代码行数:101,



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


C++ GATTServApp_ProcessCCCWriteReq函数代码示例
C++ GAP_SetParamValue函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。