void sinkHfpInit( void ) { hfp_init_params hfp_params; memset(&hfp_params, 0, sizeof(hfp_init_params)); sinkClearQueueudEvent(); /* get the extra hfp supported features such as supported sco packet types from pskey user 5 */ configManagerHFP_SupportedFeatures(); /* initialise the hfp library with parameters read from config*/ configManagerHFP_Init(&hfp_params); theSink.hfp_profiles = hfp_params.supported_profile; /* store the link loss time in the app */ theSink.linkLossReminderTime = hfp_params.link_loss_interval; /* initialise hfp library with pskey read configuration */ HfpInit(&theSink.task, &hfp_params, NULL); /* initialise the audio library, uses one malloc slot */ AudioLibraryInit(); }
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Description: This function is the execution for HFP sample. Arguments: BTUINT8 choice Return: void ---------------------------------------------------------------------------*/ void HfpExecCmd(BTUINT8 choice) { BTINT8 ch = 0; if (choice == '1') { HfpInit(); TestSelectRmtHFDev(); TestSelectHFSvc(); TestConnectAGSvc(); /* the initial state is in mute on state, so switch it to mute off state to hear music */ HfpAGShowMenu(); while (ch != 'r') { scanf(" %c", &ch); getchar(); if (ch == '\n') { printf(">>"); } else if('r' == ch) { break; } else { HfpAGExecCmd(ch); printf("\n"); HfpAGShowMenu(); } } } else if (choice == '2') { HfpInit(); TestSelectRmtHFDev(); TestSelectHFSvc(); TestConnectHFSvc(); HfpAPShowMenu(); while (ch != 'r') { scanf(" %c", &ch); getchar(); if (ch == '\n') { printf(">>"); } else if('r' == ch) { break; } else { HfpAPExecCmd(ch); printf("\n"); HfpAPShowMenu(); } } } else { printf("Invalid command.\n"); } }