void hfpHandlerInitCfm( const HFP_INIT_CFM_T *cfm ) { /* Make sure the profile instance initialisation succeeded. */ if (cfm->status == hfp_init_success) { /* Check for an hfp instance, that's registered first */ if (!theHeadset.hfp) { /* This must be the hfp instance */ theHeadset.hfp = cfm->hfp; } else { /* Its not HFP so must be HSP */ theHeadset.hsp = cfm->hfp; /* HFP/HSP Library initialisation was a success, initailise the next library. */ InitA2dp(); } } else /* If the profile initialisation has failed then things are bad so panic. */ Panic(); }
void configManagerInit( void ) { /* use a memory allocation for the lengths data to reduce stack usage */ lengths_config_type * keyLengths = mallocPanic(sizeof(lengths_config_type)); /* Read key lengths */ configManagerKeyLengths(keyLengths); /* Allocate the memory required for the configuration data */ InitConfigMemory(keyLengths); /* Read and configure the button translations */ configManagerButtonTranslations( ); /* Read and configure the button durations */ configManagerButtonDurations( ); /* Read the system event configuration and configure the buttons */ configManagerButtons( ); /*configures the pattern button events*/ configManagerButtonPatterns( ) ; /*Read and configure the event tones*/ configManagerEventTones( keyLengths->no_tones ) ; /* Read and configure the system features */ configManagerFeatureBlock( ); /* Read and configure the automatic switch off time*/ configManagerConfiguration( ); /* Must happen between features and session data... */ InitA2dp(); /* Read and configure the user defined tones */ configManagerUserDefinedTones( keyLengths->userTonesLength ); /* Read and configure the LEDs */ configManagerLEDS(); /* Read and configure the voume settings */ configManagerVolume( ); /* Read and configure the power management system */ configManagerPower( ); /* Read and configure the radio parameters */ configManagerRadio(); /* Read and configure the volume orientation, LED Disable state, and tts_language */ configManagerReadSessionData ( ) ; configManagerReadDspData(); /* Read and configure the sniff sub-rate parameters */ configManagerSetupSsr ( ) ; configManagerEventTTSPhrases( keyLengths->no_tts ) ; configManagerVoicePromptsInit( keyLengths->no_vp , keyLengths->no_tts_languages ); #if defined (ENABLE_REMOTE) && defined (ENABLE_SOUNDBAR) /* Read the hid remote control key mapping. */ configManagerHidkeyMap(); #endif /* don't allocate memory for AT commands if they're not required */ if (keyLengths->size_at_commands) { InitConfigMemoryAtCommands(keyLengths->size_at_commands); configManagerAtCommands(keyLengths->size_at_commands + sizeof(config_block3_t) - 1); } #ifdef ENABLE_FM /* read the fm configuration data */ configManagerReadFmData(); #endif /* release the memory used for the lengths key */ freePanic(keyLengths); }