QCC30XX如何查找本地地址码

2024-05-30 06:28

本文主要是介绍QCC30XX如何查找本地地址码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

查找本地地址段/**********************************************************************
Copyright (c) 2016 - 2017 Qualcomm Technologies International, Ltd.
 
 
FILE NAME
    sink_private_data.c
 
DESCRIPTION
    This module works as a container for all private and common data that is used across sink
    qpplication. It provides API to access the data from outside. It interacts with configuration
    entities to read/write configuration data. More over this module contains module specific
    run time data (as a common runtime data for entire sink application), and those data also
    exposed using defined API's
 
 NOTES
      Module does not have any intelligence to manipulate the data, or verify the data or its
      contents ,it is the user to decide hoe to use this data and when to update the data.
*/
 
#include <stdlib.h>
#include <ps.h>
#include <vmtypes.h>
#include <bdaddr.h>
#include <byte_utils.h>
 
#include "sink_private_data.h"
#include "sink_dut.h"
#include "sink_malloc_debug.h"
#include "sink_configmanager.h"
 
#include <local_device.h>
 
#ifdef DEBUG_SINK_PRIVATE_DATA
#define SINK_DATA_DEBUG(x) DEBUG(x)
#define SINK_DATA_ERROR(x) TOLERATED_ERROR(x)
#else
#define SINK_DATA_DEBUG(x)
#define SINK_DATA_ERROR(x)
#endif
 
#ifdef DEBUG_MAIN
    #define MAIN_DEBUG(x) DEBUG(x)
#else
    #define MAIN_DEBUG(x)
#endif
/* Referance to Global Data for sink private module */
typedef struct __sinkdata_globaldata_t
{
    unsigned panic_reconnect:1; /* Are we using panic action? Bit to inidcate panic reconnection action is used  */
    unsigned paging_in_progress:1; /* Bit to indicate that device is curretly paging whilst in connectable state*/
    unsigned powerup_no_connection:1; /* Bit to indicate device has powered and no connections yet */
    unsigned confirmation:1; /* Bit to indicate user auth confirmation status */
    unsigned SinkInitialising:1; /* Bit to indicate sink is in initialising state */
    unsigned PowerOffIsEnabled:1; /* Bit to indicate power off is enabled */
    unsigned debug_keys_enabled:1; /* Bit to indicate debug keys enabled */
    unsigned stream_protection_state:2; /* Holds stream protection state */
    unsigned MultipointEnable:1; /* Bit to indicate multipoint enabled */
    unsigned _spare1_:6;
    unsigned gEventQueuedOnConnection:8; /* variable to hold evet queued while in connection */
    unsigned dfu_access:1;              /* Link Policy expedites DFU data transfer */
    unsigned display_link_keys:1; /* Bit used to indicate if link keys should be displayed */
    unsigned _spare2_:6;
    uint16 NoOfReconnectionAttempts; /* Holdes current number of reconnection attempts */
    uint16 connection_in_progress;  /* flag used to block role switch requests until all connections are complete or abandoned */
#ifdef ENABLE_SQIFVP
    unsigned               partitions_mounted:8;
    unsigned               unused:8;
#endif
    bdaddr                   *linkloss_bd_addr;  /** bdaddr of a2dp device that had the last link loss. */
    tp_bdaddr                *confirmation_addr;
    bdaddr local_bd_addr; /* Local BD Address of the sink device available in ps */
    power_table              *user_power_table;  /* pointer to user power table if available in ps */
}sinkdata_globaldata_t;
 
/* PSKEY for BD ADDRESS */
#define PSKEY_BDADDR   0x0001
#define LAP_MSW_OFFSET 0
#define LAP_LSW_OFFSET 1
#define UAP_OFFSET 2
#define NAP_OFFSET 3
 
/* Global data strcuture element for sink private data */
static sinkdata_globaldata_t gSinkData;
#define GSINKDATA  gSinkData
 
 
/**********************************************************************
***************  External Interface Function Implemetations  **********************
***********************************************************************/
 
/**********************************************************************
        Interfaces for accessing Configurable Items
*/
/**********************************************************************
  Interfaces for Initializing Local Address, which read the local address.
*/
bool  sinkDataInitLocalBdAddrFromPs(void)
{
    bool result = FALSE;
 
    uint16 size = PS_SIZE_ADJ(sizeof(GSINKDATA.local_bd_addr));
    uint16* bd_addr_data = (uint16*)PanicUnlessNew(bdaddr);
 
    BdaddrSetZero(&GSINKDATA.local_bd_addr);
 
    if(size == PsFullRetrieve(PSKEY_BDADDR, bd_addr_data, size))
    {
        GSINKDATA.local_bd_addr.nap = bd_addr_data[NAP_OFFSET];
        GSINKDATA.local_bd_addr.uap = bd_addr_data[UAP_OFFSET];
        GSINKDATA.local_bd_addr.lap = MAKELONG(bd_addr_data[LAP_LSW_OFFSET], bd_addr_data[LAP_MSW_OFFSET]);
 
        SINK_DATA_DEBUG(("CONF: PSKEY_BDADDR [%04x %02x %06lx]\n",
                GSINKDATA.local_bd_addr.nap, GSINKDATA.local_bd_addr.uap, GSINKDATA.local_bd_addr.lap));
        result = TRUE;
    }
    else
    {
        GSINKDATA.local_bd_addr = LocalDeviceGetBdAddr();
    }
    MAIN_DEBUG(("CONF: PSKEY_BDADDR [%04x %02x %06lx]\n",
            GSINKDATA.local_bd_addr.nap, GSINKDATA.local_bd_addr.uap, GSINKDATA.local_bd_addr.lap));
    free(bd_addr_data);
 
    return result;
}
 
/**********************************************************************
  Interfaces for checking reconnect on panic configuration is enabled or not
*/
bool sinkDataIsReconnectOnPanic(void)
{
    bool reconnect_on_panic = FALSE;
    sinkdata_readonly_config_def_t *read_configdata = NULL;
    SINK_DATA_DEBUG(("SinkData:sinkDataIsReconnectOnPanic()\n"));
 
    if (configManagerGetReadOnlyConfig(SINKDATA_READONLY_CONFIG_BLK_ID, (const void **)&read_configdata))
    {
        reconnect_on_panic = read_configdata->ReconnectOnPanic;
        configManagerReleaseConfig(SINKDATA_READONLY_CONFIG_BLK_ID);
    }
    SINK_DATA_DEBUG(("SinkData:reconnect_on_panic = %d \n",reconnect_on_panic));
    return (reconnect_on_panic)?TRUE : FALSE;
}
 
/**********************************************************************
  Interfaces for checking power of after PDL reset configuration is enabled or not
*/
bool sinkDataIsPowerOffAfterPDLReset(void)
{
    bool poweroff_pdl_reset = FALSE;
    sinkdata_readonly_config_def_t *read_configdata = NULL;
    SINK_DATA_DEBUG(("SinkData:sinkDataIsPowerOffAfterPDLReset()\n"));
 
    if (configManagerGetReadOnlyConfig(SINKDATA_READONLY_CONFIG_BLK_ID, (const void **)&read_configdata))
    {
        poweroff_pdl_reset = read_configdata->PowerOffAfterPDLReset;
        configManagerReleaseConfig(SINKDATA_READONLY_CONFIG_BLK_ID);
    }
    SINK_DATA_DEBUG(("SinkData: poweroff_pdl_reset = %d \n",poweroff_pdl_reset));
    return (poweroff_pdl_reset)?TRUE : FALSE;
}
 
/**********************************************************************
  Interfaces  for checking does sink shoule be in discoverable mode all time
  configuration is enabled or not
*/
bool sinkDataIsDiscoverableAtAllTimes(void)
{
    bool discoverable_alltime = FALSE;
    sinkdata_readonly_config_def_t *read_configdata = NULL;
    SINK_DATA_DEBUG(("SinkData:sinkDataIsDiscoverableAtAllTimes()\n"));
 
    if (configManagerGetReadOnlyConfig(SINKDATA_READONLY_CONFIG_BLK_ID, (const void **)&read_configdata))
    {
        discoverable_alltime = read_configdata->RemainDiscoverableAtAllTimes;
        configManagerReleaseConfig(SINKDATA_READONLY_CONFIG_BLK_ID);
    }
    SINK_DATA_DEBUG(("SinkData: discoverable_alltime = %d\n",discoverable_alltime));
    return (discoverable_alltime)?TRUE : FALSE;
}
 
/**********************************************************************
  Interfaces  for checking DisablePowerOffAfterPowerOn configuration is enabled or not
*/
bool sinkDataCheckDisablePowerOffAfterPowerOn(void)
{
    bool disable_poweroff = FALSE;
    sinkdata_readonly_config_def_t *read_configdata = NULL;
    SINK_DATA_DEBUG(("SinkData:sinkDataCheckDisablePowerOffAfterPowerOn()\n"));
 
    if (configManagerGetReadOnlyConfig(SINKDATA_READONLY_CONFIG_BLK_ID, (const void **)&read_configdata))
    {
        disable_poweroff = read_configdata->DisablePowerOffAfterPowerOn;
        configManagerReleaseConfig(SINKDATA_READONLY_CONFIG_BLK_ID);
    }
    SINK_DATA_DEBUG(("SinkData: disable_poweroff = %d\n",disable_poweroff));
    return (disable_poweroff)?TRUE : FALSE;
}
 
/**********************************************************************
  Interfaces  for checking pairing mode on connection failure configuration is enabled or not
*/
bool sinkDataEntrePairingModeOnConFailure(void)
{
    bool failuretoconnect = FALSE;
    sinkdata_readonly_config_def_t *read_configdata = NULL;
    SINK_DATA_DEBUG(("SinkData:sinkDataPairingModeOnConnectionFailure()\n"));
 
    if (configManagerGetReadOnlyConfig(SINKDATA_READONLY_CONFIG_BLK_ID, (const void **)&read_configdata))
    {
        failuretoconnect = read_configdata->EnterPairingModeOnFailureToConn;
        configManagerReleaseConfig(SINKDATA_READONLY_CONFIG_BLK_ID);
    }
    SINK_DATA_DEBUG(("SinkData: failuretoconnect = %d\n",failuretoconnect));
    return (failuretoconnect)?TRUE : FALSE;
}
 
/**********************************************************************
  Interfaces for checking Power Off OnlyIf VReg Enble is low configuration is enabled or not
*/
bool sinkDataIsPowerOffOnlyIfVRegEnlow(void)
{
    bool vreg_enlow = FALSE;
    sinkdata_readonly_config_def_t *read_configdata = NULL;
    SINK_DATA_DEBUG(("SinkData:sinkDataIsPowerOffOnlyIfVRegEnlow()\n"));
 
    if (configManagerGetReadOnlyConfig(SINKDATA_READONLY_CONFIG_BLK_ID, (const void **)&read_configdata))
    {
        vreg_enlow = read_configdata->PowerOffOnlyIfVRegEnLow;
        configManagerReleaseConfig(SINKDATA_READONLY_CONFIG_BLK_ID);
    }
    SINK_DATA_DEBUG(("SinkData: vreg_enlow = %d\n",vreg_enlow));
    return (vreg_enlow)?TRUE : FALSE;
}
 
/**********************************************************************/
bool sinkDataAllowAutomaticPowerOffWhenCharging(void)
{
    bool power_off_when_charging = FALSE;
    sinkdata_readonly_config_def_t *read_configdata = NULL;
    SINK_DATA_DEBUG(("SinkData:sinkDataAllowAutomaticPowerOffWhenCharging()\n"));
 
    if (configManagerGetReadOnlyConfig(SINKDATA_READONLY_CONFIG_BLK_ID, (const void **)&read_configdata))
    {
        power_off_when_charging = read_configdata->AllowAutomaticPowerOffWhenCharging;
        configManagerReleaseC

这篇关于QCC30XX如何查找本地地址码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1015813

相关文章

Android实现打开本地pdf文件的两种方式

《Android实现打开本地pdf文件的两种方式》在现代应用中,PDF格式因其跨平台、稳定性好、展示内容一致等特点,在Android平台上,如何高效地打开本地PDF文件,不仅关系到用户体验,也直接影响... 目录一、项目概述二、相关知识2.1 PDF文件基本概述2.2 android 文件访问与存储权限2.

python连接本地SQL server详细图文教程

《python连接本地SQLserver详细图文教程》在数据分析领域,经常需要从数据库中获取数据进行分析和处理,下面:本文主要介绍python连接本地SQLserver的相关资料,文中通过代码... 目录一.设置本地账号1.新建用户2.开启双重验证3,开启TCP/IP本地服务二js.python连接实例1.

使用Python开发一个简单的本地图片服务器

《使用Python开发一个简单的本地图片服务器》本文介绍了如何结合wxPython构建的图形用户界面GUI和Python内建的Web服务器功能,在本地网络中搭建一个私人的,即开即用的网页相册,文中的示... 目录项目目标核心技术栈代码深度解析完整代码工作流程主要功能与优势潜在改进与思考运行结果总结你是否曾经

使用Python实现快速搭建本地HTTP服务器

《使用Python实现快速搭建本地HTTP服务器》:本文主要介绍如何使用Python快速搭建本地HTTP服务器,轻松实现一键HTTP文件共享,同时结合二维码技术,让访问更简单,感兴趣的小伙伴可以了... 目录1. 概述2. 快速搭建 HTTP 文件共享服务2.1 核心思路2.2 代码实现2.3 代码解读3.

在java中如何将inputStream对象转换为File对象(不生成本地文件)

《在java中如何将inputStream对象转换为File对象(不生成本地文件)》:本文主要介绍在java中如何将inputStream对象转换为File对象(不生成本地文件),具有很好的参考价... 目录需求说明问题解决总结需求说明在后端中通过POI生成Excel文件流,将输出流(outputStre

SpringBoot配置Ollama实现本地部署DeepSeek

《SpringBoot配置Ollama实现本地部署DeepSeek》本文主要介绍了在本地环境中使用Ollama配置DeepSeek模型,并在IntelliJIDEA中创建一个Sprin... 目录前言详细步骤一、本地配置DeepSeek二、SpringBoot项目调用本地DeepSeek前言随着人工智能技

OpenManus本地部署实战亲测有效完全免费(最新推荐)

《OpenManus本地部署实战亲测有效完全免费(最新推荐)》文章介绍了如何在本地部署OpenManus大语言模型,包括环境搭建、LLM编程接口配置和测试步骤,本文给大家讲解的非常详细,感兴趣的朋友一... 目录1.概况2.环境搭建2.1安装miniconda或者anaconda2.2 LLM编程接口配置2

Windows系统下如何查找JDK的安装路径

《Windows系统下如何查找JDK的安装路径》:本文主要介绍Windows系统下如何查找JDK的安装路径,文中介绍了三种方法,分别是通过命令行检查、使用verbose选项查找jre目录、以及查看... 目录一、确认是否安装了JDK二、查找路径三、另外一种方式如果很久之前安装了JDK,或者在别人的电脑上,想

在VSCode中本地运行DeepSeek的流程步骤

《在VSCode中本地运行DeepSeek的流程步骤》本文详细介绍了如何在本地VSCode中安装和配置Ollama和CodeGPT,以使用DeepSeek进行AI编码辅助,无需依赖云服务,需要的朋友可... 目录步骤 1:在 VSCode 中安装 Ollama 和 CodeGPT安装Ollama下载Olla

C#集成DeepSeek模型实现AI私有化的流程步骤(本地部署与API调用教程)

《C#集成DeepSeek模型实现AI私有化的流程步骤(本地部署与API调用教程)》本文主要介绍了C#集成DeepSeek模型实现AI私有化的方法,包括搭建基础环境,如安装Ollama和下载DeepS... 目录前言搭建基础环境1、安装 Ollama2、下载 DeepSeek R1 模型客户端 ChatBo