#include "comdef.h"
#include "OEMFeatures.h"
#include "BRIDLEInit.h"
#include "BRIDLEInit_OEM.h"

extern int bridle_self_init(void *p);

static const PFNBRIDLEINIT gBridleInit[] = {
   
   bridle_self_init,

   bridle_aee_RegisterSubSystem,

   bridle_fs_RegisterSubSystem,

   RegisterOEMOSForSWI,

   RegisterSNDForSWI,

   bridle_sock_RegisterSubSystem,

   bridle_kcb_RegisterSubSystem,

   bridle_fifo_RegisterSubSystem,

   RegisterRanForSWI,

   RegisterCriticalSectionForSWI,

   RegisterMutexForSWI,

#ifdef FEATURE_POSITION_DETERMINATION
   RegisterPosDetForSWI,
#endif /* FEATURE_POSITION_DETERMINATION */

#ifdef FEATURE_IVOCODER
   RegisterVocoderForSWI,
#endif /* FEATURE_IVOCODER */

#ifdef FEATURE_BREW_TAPI
   RegisterTAPIForSWI,
#endif /* FEATURE_BREW_TAPI */

   RegisterDebugForSWI,

#ifdef FEATURE_BREW_CAMERA
   bridle_camera_RegisterSubSystem,
#endif //FEATURE_BREW_CAMERA

#ifdef FEATURE_BREW_SIO
   bridle_sio_RegisterSubSystem,
#endif /* FEATURE_BREW_SIO */

#ifdef FEATURE_BREW_SMS
   RegisterSMSForSWI,
#endif /* FEATURE_BREW_SMS */

#ifdef FEATURE_BREW_BATTERY
   RegisterBatteryForSWI,
#endif /* FEATURE_BREW_BATTERY */
   
   NULL
};

/*===========================================================================

FUNCTION   

DESCRIPTION
  
DEPENDENCIES

RETURN VALUE

SIDE EFFECTS

===========================================================================*/
int bridle_Init(void *po)
{
   int i, nRet = SUCCESS;

   for (i = 0; SUCCESS == nRet && 
           (PFNBRIDLEINIT)0 != gBridleInit[i]; i++) {
      nRet = (gBridleInit[i])(po);
   }

   for (i = 0; SUCCESS == nRet && 
           (PFNBRIDLEINIT)0 != gOEMBridleInit[i]; i++) {
      nRet = (gOEMBridleInit[i])(po);
   }

   return nRet;
}


void brew_pwrup_init()
{
	bridle_Init(NULL);
}


