Hi all,
I want to enable the advertising with 3 sec long key press. i tried below steps. but it is not working. it seem to be keyfob task blocked after doing below setting:
I set a 3 sec timer with CHECK_LONG_KEY_PRESS_EVT event , which will start adv . if user hold the key .
uint16 KeyFobApp_ProcessEvent( uint8 task_id, uint16 events )
{
if(events & CHECK_LONG_KEY_PRESS_EVT){
events ^= CHECK_LONG_KEY_PRESS_EVT;
if(gapProfileState != GAPROLE_CONNECTED ){
uint8 current_adv_enabled_status;
uint8 new_adv_enabled_status;
//Find the current GAP advertisement status
GAPRole_GetParameter(GAPROLE_ADVERT_ENABLED,¤t_adv_enabled_status );
if( current_adv_enabled_status == FALSE ){
new_adv_enabled_status = TRUE;
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &new_adv_enabled_status );
}
}
return (events ^ CHECK_LONG_KEY_PRESS_EVT);
}
}
static void keyfobapp_HandleKeys( uint8 shift, uint8 keys ){
uint8 SK_Keys = 0;
if ( keys & HAL_KEY_SW_1 ){
------
-------
osal_start_timerEx( keyfobapp_TaskID,CHECK_LONG_KEY_PRESS_EVT) , 3000 );//3 sec
}
is it a correct approach to do it ? or am i missing something? any pointer ?
thanks in advance.
robin