/*********************************************************************
* @brief   Does the device initialization.
*
* Public function defined in peripheral.h.
*/
bStatus_t GAPRole_StartDevice( gapRolesCBs_t *pAppCallbacks, gapObserverRoleCB_t *observerCallback)
{
  
  
  if ( gapRole_state == GAPROLE_INIT )
  {
    // Clear all of the Application callbacks
    if ( pAppCallbacks )
    {
      pGapRoles_AppCGs = pAppCallbacks;
    }
    
    if ( observerCallback )
    {
      pGapObserverRoleCB = observerCallback;
    }
    
    // Start the GAP
    gapRole_SetupGAP();
    
    return ( SUCCESS );
  }
  else
  {
    return ( bleAlreadyInRequestedMode );
  }
}
Ejemplo n.º 2
0
/*********************************************************************
 * @brief   Does the device initialization.
 *
 * Public function defined in peripheral.h.
 */
bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks)
{
  // Clear all of the Application callbacks
  if (pAppCallbacks)
  {
    pGapRoles_AppCGs = pAppCallbacks;
  }
  
  // Start the GAP
  gapRole_SetupGAP();
  
  return (SUCCESS);
}
/*********************************************************************
 * @brief   Does the device initialization.
 *
 * Public function defined in peripheral.h.
 */
bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks) {
	// Clear all of the Application callbacks
	if (gapRole_peripheralState == GAPROLE_INIT) {
		if (pAppCallbacks) {
			pGapRoles_AppCGs = pAppCallbacks;
		}

		// Start the GAP
		gapRole_SetupGAP();

		return (SUCCESS);
	} else {
		return (bleAlreadyInRequestedMode);
	}
}