sdk/modules/bluetooth/bluetooth_le_gatt.c
/****************************************************************************
 * Name: ble_create_service
 *
 * Description:
 *   BLE Create GATT Service
 *   Create GATT Service instance and return instance pointer via *service.
 *
 ****************************************************************************/
ble_create_service
Description:
BLE Create GATT Service
Create GATT Service instance and return instance pointer via *service.
ble_create_service Description : BLE Create GATT Service Create GATT Service instance and return instance pointer via * service .
int ble_create_service(struct ble_gatt_service_s **service)
{
  if (g_ble_gatt_state.num < BLE_MAX_SERVICES)
    {
      *service = &g_ble_gatt_state.services[g_ble_gatt_state.num];
      g_ble_gatt_state.num ++;
    }
  else
    {
      _err("%s [BLE][GATT] BLE create service failed(max services reached).\n", __func__);
      return BT_FAIL;
    }
  return BT_SUCCESS;
}
int ble_create_service ( struct ble_gatt_service_s * * service ) { if ( g_ble_gatt_state . num < BLE_MAX_SERVICES ) { * service = & g_ble_gatt_state . services [ g_ble_gatt_state . num ] ; g_ble_gatt_state . num ++ ; } else { _err ( " \n " , __func__ ) ; return BT_FAIL ; } return BT_SUCCESS ; }
Name: ble_create_service
 Description:
   BLE Create GATT Service
   Create GATT Service instance and return instance pointer via *service.
Name : ble_create_service Description : BLE Create GATT Service Create GATT Service instance and return instance pointer via * service .