亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? headset_configmanager.c

?? bluelab的一個很好的例程
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004

FILE NAME
    headset_configmanager.c
    
DESCRIPTION
    Configuration manager for the headset - resoponsible for extracting user information out of the 
    PSKEYs and initialising the configurable nature of the headset components
    
*/

#include "headset_configmanager.h"
#include "headset_config.h"
#include "headset_buttonmanager.h"
#include "headset_LEDmanager.h"
#include "headset_soundmanager.h"
#include "headset_statemanager.h"
#include "headset_powermanager.h"
#include "headset_volume.h"

#include "headset_private.h"
#include "headset_events.h"

#include <csrtypes.h>
#include <ps.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>


#ifdef DEBUG_CONFIG
#define CONF_DEBUG(x) DEBUG(x)
#else
#define CONF_DEBUG(x) 
#endif

#define HCI_PAGESCAN_INTERVAL_DEFAULT  (0x800)
#define HCI_PAGESCAN_WINDOW_DEFAULT   (0x12)
#define HCI_INQUIRYSCAN_INTERVAL_DEFAULT  (0x800)
#define HCI_INQUIRYSCAN_WINDOW_DEFAULT   (0x12)


#define DEFAULT_VOLUME_MUTE_REMINDER_TIME_SEC 10


/****************************************************************************
LOCAL FUNCTIONS
*/
static void   	configManagerButtons(hsTaskData* theHeadset);
static void  	configManagerLEDS(hsTaskData* theHeadset);
static void  	configManagerButtonDurations(hsTaskData* theHeadset);
static void  	configManagerFeatureBlock(hsTaskData* theHeadset);
static void     configManagerPIOBlock(hsTaskData * theHeadset);
static void 	configManagerPower(hsTaskData* theHeadset);
static void  	configManagerRadio(hsTaskData* theHeadset);
static void     configManagerVolume(hsTaskData * theHeadset);
static void     configManagerEventTones(hsTaskData* theHeadset );
static void     configManagerTimeouts(hsTaskData* theHeadset);
static void     configManagerReadVolumeOrientation ( hsTaskData * theHeadset ) ;

static void configManagerButtonPatterns(hsTaskData * theHeadset)  ;

/****************************************************************************
NAME 
  	configManagerInit

DESCRIPTION
  	The Configuration Manager is responsible for reading the user configuration
  	from the persistent store are setting up the system.  Each system component
  	is initialised in order.  Where appropriate, each configuration parameter
  	is limit checked and a default assigned if found to be out of range.

RETURNS
  	void
    
*/
void configManagerInit(hsTaskData* theHeadset)  
{ 
  	/* Read and configure the button durations */
  	configManagerButtonDurations(theHeadset);
    
  	/* Read the system event configuration and configure the buttons */
    configManagerButtons(theHeadset);

        /*configures the pattern button events*/
    configManagerButtonPatterns(theHeadset) ;

    /*Read and configure the event tones*/
    configManagerEventTones( theHeadset ) ;

  	/* Read and configure the LEDs */
    configManagerLEDS(theHeadset);
 
  	/* Read and configure the voume settings */
  	configManagerVolume(theHeadset);
 
  	/* Read and configure the system features */
  	configManagerFeatureBlock(theHeadset);
    
    /* Read and configure the system PIOs*/    
    configManagerPIOBlock ( theHeadset ) ;

    /* Read and configure the automatic switch off time*/
    configManagerTimeouts(theHeadset);
 
  	/* Read and configure the power management system */
  	configManagerPower(theHeadset);
 
  	/* Read and configure the radio parameters */
  	configManagerRadio(theHeadset);
 
    /*Read and configure the HFP 1.5 supported features*/
    configManagerHFP_1_5_SupportedFeatures ( theHeadset) ;
    
    /*read and configurethe volume orientation*/
    configManagerReadVolumeOrientation ( theHeadset ) ;
 
}


/****************************************************************************
NAME 
  	configManagerButtons

DESCRIPTION
 	Read the system event configuration from persistent store and configure
  	the buttons by mapping the associated events to them
 
RETURNS
  	void
*/  

static void configManagerButtons(hsTaskData* theHeadset)
{ 
  	uint16 no_events = 20;
 
	/* Allocate enough memory to hold event configuration */
    event_config_type* config = (event_config_type*) mallocPanic(no_events * sizeof(event_config_type));
   
    
    /* Now read in event configuration */
    if(config)
    {   
            /*read in the events for the first PSKEY*/                
        if(ConfigRetrieve(PSKEY_EVENTS_A, config, no_events * sizeof(event_config_type)))
      	{
            uint16 n;
     
        		/* Now we have the event configuration, map required events to system events */
            for(n = 0; n < no_events; n++)
            { 
                CONF_DEBUG(("Co : AddMap Ev[%x]\n", config[n].event )) ;
                        
                if ( config[n].pio_mask )
                {
                        /* Map PIO button event to system events in specified states */
                    buttonManagerAddMapping (config[n].pio_mask, 
                     						(config[n].event + EVENTS_EVENT_BASE) ,
                    						 config[n].state_mask, 
                    						(ButtonsTime_t)config[n].type); 
                }                                            
        	}
      	}
   		else
   		{
    	   CONF_DEBUG(("Co: !EvLen\n")) ;
        }
        
            /*now do the same for the second PSKEY*/
        if(ConfigRetrieve(PSKEY_EVENTS_B, config, no_events * sizeof(event_config_type)))
      	{
            uint16 n;
     
        		/* Now we have the event configuration, map required events to system events */
            for(n = 0; n < no_events; n++)
            { 
                CONF_DEBUG(("Co : AddMap Ev[%x]\n", config[n].event )) ;
                        
                if ( config[n].pio_mask )
                {
                        /* Map PIO button event to system events in specified states */
                    buttonManagerAddMapping (config[n].pio_mask, 
                     						(config[n].event + EVENTS_EVENT_BASE) ,
                    						 config[n].state_mask, 
                    						(ButtonsTime_t)config[n].type); 
                }          
        	}
      	}
   		else
   		{
    	   CONF_DEBUG(("Co: !EvLen2\n")) ;
        }        

        	/* Free up memory */
      	free(config);
    }
}
/****************************************************************************
NAME 
  	configManagerButtonPatterns

DESCRIPTION
  	Read and configure any buttonpattern matches that exist
 
RETURNS

*/
static void configManagerButtonPatterns(hsTaskData * theHeadset) 
{  
      		/* Allocate enough memory to hold event configuration */
    button_pattern_config_type* config = (button_pattern_config_type*) mallocPanic(BM_NUM_BUTTON_MATCH_PATTERNS * sizeof(button_pattern_config_type));
   
    CONF_DEBUG(("Co: No Button Patterns - %d\n", BM_NUM_BUTTON_MATCH_PATTERNS));
   
        /* Now read in event configuration */
    if(config)
    {
                
        if(ConfigRetrieve(PSKEY_BUTTON_PATTERN_CONFIG, config, BM_NUM_BUTTON_MATCH_PATTERNS * sizeof(button_pattern_config_type)))
        {
            uint16 n;
     
           /* Now we have the event configuration, map required events to system events */
            for(n = 0; n < BM_NUM_BUTTON_MATCH_PATTERNS ; n++)
            {	 
     	      CONF_DEBUG(("Co : AddPattern Ev[%x]\n", config[n].event )) ;
                        
          			   /* Map PIO button event to system events in specified states */
          	    BMAddPatternMapping (config[n].event , config[n].pattern ) ;
            }
        }
        else
 	    {
 	      CONF_DEBUG(("Co: !EvLen\n")) ;
        }
    }    
}


/****************************************************************************
NAME 
  	config

DESCRIPTION
  	Read the LED configuration from persistent store and configure the LEDS 
 
RETURNS
  	TRUE or FALSE
*/ 
static bool config(hsTaskData * theHeadset , configType type, uint16 pskey_no, uint16 pskey_config, uint16 max) 
{ 
  	bool success = FALSE;
  	uint16 no_events = 0;
 
  	/* First read the number of states/events configured */
  	if(ConfigRetrieve(pskey_no, &no_events, sizeof(uint16)))
  	{	  
    	/* Providing there are states to configure */
    	if((no_events > 0) && (no_events < max))
    	{
      		/* Allocate enough memory to hold state/event configuration */
      		led_config_type* config = (led_config_type*) mallocPanic(no_events * sizeof(led_config_type));
   
      		/* Now read in configuration */
      		if(config)
      		{  
       			if(ConfigRetrieve(pskey_config, config, no_events * sizeof(led_config_type)))
       			{
         			uint16    n;
         			LEDPattern_t  pattern;
    
         			/* Now we have the configuration, map to system states/events */
         			for(n = 0; n < no_events; n++)
         			{ 
           				pattern.LED_A       = config[n].led_a;
           				pattern.LED_B       = config[n].led_b;
             			pattern.OnTime      = config[n].on_time * 10;
           				pattern.OffTime     = config[n].off_time * 10;
           				pattern.RepeatTime  = config[n].repeat_time * 50;
           				pattern.NumFlashes  = config[n].number_flashes;
           				pattern.Dimming     = 0;
          				pattern.TimeOut     = config[n].timeout;
           				pattern.Colour      = config[n].colour;
      
           				switch(type)
           				{
             				case led_state_pattern:
              					LEDManagerAddLEDStatePattern(&theHeadset->theLEDTask , config[n].state, &pattern);
              					break;
             				case led_event_pattern:
              					LEDManagerAddLEDEventPattern(&theHeadset->theLEDTask , EVENTS_EVENT_BASE + config[n].state, &pattern);
              					break;
           				}       
         			}
         			success = TRUE;
       			}
                else
                {
                    CONF_DEBUG(("Co: !LedLen\n")) ;
                }
                /* Free up memory */
       			free(config);
      		}
  		}
  	}
  	return success;
}


/****************************************************************************
NAME 
 	config_led_filter

DESCRIPTION
 	Read the LED filter configuration from persistent store and configure the
 	LED filters
 
RETURNS
 	TRUE or FALSE
*/ 
static bool config_filter( hsTaskData * theHeadset , uint16 pskey_no, uint16 pskey_filter, uint16 max)
{
 	bool success = FALSE;
 	uint16 no_filters = 0;
 
  	/* First read the number of filters configured */
  	if(ConfigRetrieve(pskey_no, &no_filters, sizeof(uint16)))
  	{  
    	/* Providing there are states to configure */
    	if((no_filters > 0) && (no_filters < max))
    	{
      		/* Allocate enough memory to hold filter configuration */
      		led_filter_config_type* config = (led_filter_config_type*) mallocPanic(no_filters * sizeof(led_filter_config_type));
   
      		/* Now read in configuration */
      		if(config)
      		{  
       			if(ConfigRetrieve(pskey_filter, config, no_filters * sizeof(led_filter_config_type)))
       			{
         			uint16    n;
         			LEDFilter_t  filter;
   
         			/* Now we have the configuration, map to system states/events */
         			for(n = 0; n < no_filters; n++)
         			{ 
           				filter.Event                = EVENTS_EVENT_BASE + config[n].event;
           				filter.Speed                = config[n].speed;
           				filter.IsFilterActive       = config[n].active;
           				filter.SpeedAction          = config[n].speed_action;
           				filter.Colour               = config[n].colour;
                        filter.FilterToCancel       = config[n].filter_to_cancel ;
                        filter.OverideLED           = config[n].overide_led ;

                        filter.OverideLEDActive     = config[n].overide_led_active ;
                        filter.FollowerLEDActive    = config[n].follower_led_active ;
    
                        filter.FollowerLEDDelay     = config[n].follower_led_delay_50ms ;
  
                            /*add the filter*/
          				LEDManagerAddLEDFilter(&theHeadset->theLEDTask , &filter);
                                    			} 
       			}
                else
                {
                    CONF_DEBUG(("Co :!FilLen\n")) ;
                }
        		/* Free up memory */
       			free(config);
      		}
      		success = TRUE;
    	}
  	} 
  	return success;
}


/****************************************************************************
NAME 
  	configManagerLEDS

DESCRIPTION
  	Read the system LED configuration from persistent store and configure
  	the LEDS 
 
RETURNS
  	void
*/ 
static void configManagerLEDS(hsTaskData* theHeadset)
{ 
  	/* 1. LED state configuration */
  	config(theHeadset , led_state_pattern, PSKEY_NO_LED_STATES, PSKEY_LED_STATES, MAX_LED_STATES);
 
  	/* 2. LED event configuration */
  	config(theHeadset , led_event_pattern, PSKEY_NO_LED_EVENTS, PSKEY_LED_EVENTS, MAX_LED_EVENTS);
 
  	/* 3. LED event filter configuration */
  	config_filter(theHeadset , PSKEY_NO_LED_FILTERS, PSKEY_LED_FILTERS, MAX_LED_FILTERS);         
}


/****************************************************************************
NAME 
  	configManagerFeatureBlock

DESCRIPTION
  	Read the system feature block and configure system accordingly
 
RETURNS
  	void
*/
static void configManagerFeatureBlock(hsTaskData* theHeadset) 
{
  	/* Get pairing timeout */
  	uint16 timeout; 
	if(!ConfigRetrieve(PSKEY_PAIRING_TIMEOUT, &timeout, sizeof(uint16)))
		timeout = 0;
 
    /* Read the feature block from persistent store */
  	if(ConfigRetrieve(PSKEY_FEATURE_BLOCK, &theHeadset->features, sizeof(feature_config_type)))
  	{
    	/* D0 - Pairing mode enable */
    	if(theHeadset->features.pair_mode_en)
      		stateManagerConfigureConnDiscoState(0, TRUE);
    	else
      		stateManagerConfigureConnDiscoState(timeout, FALSE);
    } 
 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合九色综合欧美就去吻 | 韩国三级中文字幕hd久久精品| 欧美成人免费网站| 国产成人精品免费网站| 中文字幕在线一区| 91丝袜美女网| 日韩一区精品视频| 国产精品你懂的在线欣赏| 91在线视频18| 久久99精品视频| 亚洲午夜激情av| 亚洲理论在线观看| 国产日韩影视精品| 欧美岛国在线观看| 欧美精品日日鲁夜夜添| 色婷婷av一区二区三区软件 | 成人免费视频caoporn| 午夜激情久久久| 亚洲综合在线观看视频| 国产蜜臀av在线一区二区三区| 日韩一区二区三区四区五区六区| 欧美最新大片在线看| 色综合一个色综合亚洲| 成人午夜免费视频| 国产99精品在线观看| 国产精品中文字幕日韩精品 | 久久免费国产精品| 欧美xfplay| 日韩精品一区二区在线| 日韩视频免费观看高清完整版 | 国产精品色呦呦| 亚洲国产激情av| 国产精品久久久久久久浪潮网站| 久久精品一区二区| 久久久精品中文字幕麻豆发布| 精品久久国产字幕高潮| 日韩欧美一区在线观看| 日韩一区二区三区在线视频| 欧美一级二级三级蜜桃| 5566中文字幕一区二区电影| 69久久99精品久久久久婷婷 | 久久久久久久久久久黄色| 久久综合精品国产一区二区三区| 欧美大白屁股肥臀xxxxxx| 欧美sm美女调教| 久久久.com| 一区二区中文视频| 依依成人综合视频| 丝袜亚洲另类欧美| 老司机午夜精品| 国产成人久久精品77777最新版本| 成人性生交大合| 日本韩国欧美在线| 8x8x8国产精品| 日韩欧美一区二区视频| 久久久电影一区二区三区| 国产精品久久久久aaaa| 一区二区三区欧美视频| 日韩黄色一级片| 国产二区国产一区在线观看| av成人动漫在线观看| 欧美午夜寂寞影院| 欧美大片日本大片免费观看| 久久在线观看免费| 亚洲欧美激情小说另类| 午夜视频一区在线观看| 国内外成人在线视频| 99热这里都是精品| 欧美日韩国产乱码电影| 一区二区三区在线观看视频| 亚洲成a人在线观看| 久久99国产精品成人| 99在线精品观看| 欧美一区二区三区免费大片| 国产亚洲午夜高清国产拍精品| 亚洲天堂a在线| 麻豆精品久久久| 51精品国自产在线| 99re亚洲国产精品| 欧亚洲嫩模精品一区三区| 51精品国自产在线| 日本一区二区在线不卡| 成人欧美一区二区三区视频网页| 亚洲二区在线观看| 91麻豆精品国产| 久久综合狠狠综合久久综合88 | 日韩欧美在线不卡| 亚洲国产裸拍裸体视频在线观看乱了 | 极品少妇xxxx精品少妇| 91麻豆精品国产综合久久久久久| 一区二区三区在线免费观看| 99久久国产综合精品女不卡| 国产精品视频一二三| 国产精品99久久久久久宅男| 日韩欧美精品三级| 久久av资源站| 日韩精品中午字幕| 精品一区二区三区av| 日韩欧美一级片| 蜜臀av性久久久久蜜臀aⅴ| 在线不卡的av| 欧美aaaaaa午夜精品| 日韩一级黄色片| 麻豆国产精品官网| 精品国产免费久久| 国产一区在线观看视频| 久久久噜噜噜久久人人看| 国产精品一区2区| 国产欧美一区视频| 成人av中文字幕| 中文字幕一区二区在线观看| 99视频热这里只有精品免费| 综合欧美一区二区三区| 在线观看欧美黄色| 午夜影院久久久| 91精品在线免费| 国产一区二区三区av电影| 久久久精品2019中文字幕之3| 国产成人午夜电影网| 国产精品免费久久久久| 一本大道久久a久久综合婷婷| 亚洲国产成人91porn| 538prom精品视频线放| 精品一区二区三区欧美| 中文字幕av不卡| 在线观看日韩国产| 日本不卡123| 久久久精品欧美丰满| 91视视频在线观看入口直接观看www | 亚洲永久免费视频| 国产日韩av一区| av成人免费在线| 石原莉奈在线亚洲二区| 精品国产乱子伦一区| 成人免费看的视频| 亚洲福中文字幕伊人影院| 精品蜜桃在线看| caoporn国产精品| 亚洲国产精品久久不卡毛片 | 国产日韩欧美精品在线| jlzzjlzz亚洲女人18| 午夜av一区二区三区| 久久久亚洲精品一区二区三区| av亚洲精华国产精华精华| 三级在线观看一区二区 | 麻豆极品一区二区三区| 日韩一区在线免费观看| 91精品国产综合久久精品app| 国产酒店精品激情| 一区二区三区国产| 精品国产1区二区| 91丝袜美腿高跟国产极品老师| 麻豆91免费观看| 亚洲精品国产a| 精品99一区二区| 欧美视频在线观看一区| 国产很黄免费观看久久| 亚洲成人自拍偷拍| 亚洲国产精品精华液2区45| 欧美电影一区二区| 91在线观看视频| 国产福利一区在线| 日本不卡免费在线视频| 自拍偷拍欧美精品| 久久久国产综合精品女国产盗摄| 欧美丝袜自拍制服另类| 春色校园综合激情亚洲| 日本不卡123| 亚洲综合图片区| 国产精品久久久久久久蜜臀| 精品国产免费人成电影在线观看四季 | 成人一区二区三区视频| 日韩av一区二区在线影视| 亚洲天堂成人网| 成人综合婷婷国产精品久久| 一区二区三区av电影| 国产日韩欧美精品一区| 日韩女优视频免费观看| 欧美影院一区二区| 成人午夜av影视| 国产精品资源在线看| 老司机午夜精品99久久| 五月天一区二区三区| 亚洲男人天堂一区| 国产精品久久精品日日| 国产亚洲精品7777| 日韩一区二区电影| 91精品国产福利| 3atv一区二区三区| 欧美午夜理伦三级在线观看| 91蜜桃婷婷狠狠久久综合9色| 国产精品资源在线| 韩国女主播成人在线| 秋霞午夜鲁丝一区二区老狼| 午夜精品国产更新| 亚洲高清免费视频| 亚洲电影在线播放| 性做久久久久久| 天堂蜜桃一区二区三区| 午夜精品福利在线|