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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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一区二区三区免费野_久草精品视频
成人毛片老司机大片| 欧美极品xxx| 成人欧美一区二区三区视频网页 | 欧美综合在线视频| 亚洲精品一区二区精华| 亚洲一区二区三区爽爽爽爽爽| 狠狠色丁香九九婷婷综合五月| 91免费视频大全| 国产人久久人人人人爽| 青青国产91久久久久久| 色婷婷精品久久二区二区蜜臀av| 国产欧美日韩综合| 韩国女主播一区| 欧美一级片在线看| 亚洲午夜视频在线观看| 色综合久久久久综合99| 国产精品伦理在线| 国产激情视频一区二区在线观看| 欧美一区二区性放荡片| 午夜精品久久久久久| 色综合天天综合给合国产| 久久久久久久电影| 国产经典欧美精品| 中国色在线观看另类| 激情综合色综合久久综合| 日韩欧美一区中文| 久久99久久99| 久久影音资源网| 国产精品亚洲第一| 国产精品美女www爽爽爽| 高清不卡一二三区| 国产精品福利电影一区二区三区四区| 国产一区二区三区国产| 26uuuu精品一区二区| 紧缚捆绑精品一区二区| 精品国产91乱码一区二区三区| 美洲天堂一区二卡三卡四卡视频| 91麻豆精品国产91| 九九九精品视频| 国产天堂亚洲国产碰碰| www.激情成人| 一区二区三区四区视频精品免费 | 亚洲成人av一区二区三区| 欧美视频完全免费看| 亚洲h在线观看| 日韩亚洲国产中文字幕欧美| 久久国产精品72免费观看| 久久久久久久久久久99999| 国产成人免费视频网站| 中文子幕无线码一区tr| 色婷婷精品大视频在线蜜桃视频| 亚洲线精品一区二区三区八戒| 欧美精品视频www在线观看| 热久久一区二区| 国产欧美精品一区aⅴ影院| 色悠悠久久综合| 麻豆一区二区三区| 中文字幕在线不卡一区二区三区 | 日韩欧美精品在线| 成人免费看片app下载| 亚洲一区二区影院| 久久久亚洲国产美女国产盗摄 | 9191精品国产综合久久久久久| 开心九九激情九九欧美日韩精美视频电影| 久久午夜老司机| 欧美亚洲动漫精品| 国产一区二区三区日韩| 亚洲欧美日韩在线| 久久综合久久99| 在线观看日韩毛片| 国产91精品一区二区麻豆网站 | 欧美日韩久久不卡| 国产99精品国产| 日本不卡免费在线视频| 中文字幕av一区 二区| 3751色影院一区二区三区| 成人免费不卡视频| 麻豆国产欧美一区二区三区| 亚洲人成网站精品片在线观看| 精品国精品自拍自在线| 欧美三级中文字幕| 91玉足脚交白嫩脚丫在线播放| 精品一区二区三区影院在线午夜 | 欧美伊人久久久久久午夜久久久久| 久久国内精品自在自线400部| 日韩理论电影院| 久久久久久电影| 91精品国产综合久久香蕉的特点| 99久久免费精品高清特色大片| 狠狠色丁香婷婷综合久久片| 亚洲一区二区三区不卡国产欧美| 国产精品日日摸夜夜摸av| 日韩欧美在线网站| 欧美理论电影在线| 欧美日韩色综合| 在线观看一区日韩| 在线免费观看日本一区| 成人av网址在线| 国产精品亚洲成人| 国产乱码字幕精品高清av| 久久av资源网| 免费在线观看一区二区三区| 亚洲va韩国va欧美va| 一区二区三区欧美激情| 亚洲视频综合在线| 亚洲精品日韩专区silk| 国产精品乱人伦| 国产精品高潮久久久久无| 国产性天天综合网| 国产欧美日韩综合| 国产精品久久久久精k8| 中文字幕日韩一区二区| 亚洲色图19p| 亚洲国产成人av网| 婷婷激情综合网| 免费在线看成人av| 韩国成人在线视频| 国产999精品久久久久久| 丁香五精品蜜臀久久久久99网站 | 国产在线精品视频| 国产精品综合二区| av色综合久久天堂av综合| 91亚洲永久精品| 欧美亚洲综合色| 日韩免费一区二区三区在线播放| 日韩欧美色综合网站| 久久久久久毛片| 日韩毛片高清在线播放| 亚洲一区二区在线免费观看视频| 天堂影院一区二区| 国产精品伊人色| 99re成人精品视频| 欧美高清视频一二三区| 精品成人一区二区三区四区| 国产欧美一区二区精品仙草咪| 最近日韩中文字幕| 日本sm残虐另类| 高清视频一区二区| 欧美三级视频在线| 久久久久久免费网| 亚洲六月丁香色婷婷综合久久| 亚洲福利视频一区| 国产精品小仙女| 欧美性受xxxx黑人xyx性爽| 日韩欧美国产综合| 亚洲精品一二三区| 老鸭窝一区二区久久精品| www.激情成人| 欧美一区二区播放| 国产精品高潮呻吟久久| 男男gaygay亚洲| 色婷婷久久久综合中文字幕| 欧美成人伊人久久综合网| 亚洲视频中文字幕| 久久疯狂做爰流白浆xx| 一本色道久久综合精品竹菊| 日韩精品一区二区三区视频| 亚洲欧洲精品一区二区三区不卡 | 91麻豆自制传媒国产之光| 91精品婷婷国产综合久久竹菊| 国产精品久久久久影院亚瑟| 日韩激情在线观看| 91网上在线视频| 国产日韩影视精品| 免费欧美高清视频| 欧日韩精品视频| 国产精品第一页第二页第三页| 久久综合综合久久综合| 色狠狠一区二区三区香蕉| 久久精品免视看| 日本麻豆一区二区三区视频| 99精品久久99久久久久| 久久人人97超碰com| 青草国产精品久久久久久| 欧美综合欧美视频| 亚洲免费成人av| 不卡的av在线播放| 国产清纯白嫩初高生在线观看91 | 中文字幕一区二区三区在线观看| 久久91精品久久久久久秒播| 色婷婷一区二区| 亚洲日穴在线视频| 成人自拍视频在线| 久久久99精品久久| 国产一区二区毛片| 精品国产乱码久久久久久蜜臀| 五月天激情综合| 欧美丰满高潮xxxx喷水动漫| 亚洲最大成人网4388xx| 91亚洲国产成人精品一区二三| 亚洲国产成人在线| 波多野结衣中文一区| 日本一区二区成人| 成人理论电影网| 国产精品免费av| 99精品一区二区三区| 亚洲欧美影音先锋| 色哟哟国产精品| 亚洲大型综合色站| 欧美一区二区免费观在线|