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

相关文章

Verybot之OpenCV应用二:霍夫变换查找圆

其实我是想通过这个程序来测试一下,OpenCV在Verybot上跑得怎么样,霍夫变换的原理就不多说了,下面是程序: #include "cv.h"#include "highgui.h"#include "stdio.h"int main(int argc, char** argv){cvNamedWindow("vedio",0);CvCapture* capture;i

本地如何快速启动静态服务器

本地快速启动静态服务器 有许多第三方库可以帮助你快速启动一个静态服务器,甚至无需编写代码。通过命令行运行这些库后,它们会自动启动一个服务器并打开指定端口,展示当前目录下的文件内容: 电脑得提前安装NodeJS 1、http-server http-server 是一个轻量级的命令行工具,允许你快速启动一个静态文件服务器。 安装 npm install -g http-server

Win8下如何快速查找和删除电脑中的病毒

Win8系统如何查找和删除病毒?检查你的电脑是否存在病毒的一种快速方法是使用 Windows Defender. 此恶意软件防护随 Windows 提供,可帮助识别和删除病毒、间谍软件和其他恶意软件。   注意:如果你使用的是 Windows RT,则 Windows Defender 会始终启用,并且不能关闭。   如果你使用的是 Windows 8,则可以根据自己的喜好运行由其他

nyoj 685 查找字符串

当初一开始没做出来。 后来,学习过一段时间之后,在返回来做这道题,忽然发现,map类容器可以做。 PS:需要注意的是:此题如果用c++的输入输出的话,会超时。 O(time):gets()<  scanf() < cin。   附上代码: #include<stdio.h>#include<map>#include<string>#include<string.h>usin

【C++二分查找】2439. 最小化数组中的最大值

本文涉及的基础知识点 C++二分查找 LeetCode2439. 最小化数组中的最大值 给你一个下标从 0 开始的数组 nums ,它含有 n 个非负整数。 每一步操作中,你需要: 选择一个满足 1 <= i < n 的整数 i ,且 nums[i] > 0 。 将 nums[i] 减 1 。 将 nums[i - 1] 加 1 。 你可以对数组执行 任意 次上述操作,请你返回可以得到的 n

七、Maven继承和聚合关系、及Maven的仓库及查找顺序

1.继承   2.聚合   3.Maven的仓库及查找顺序

notepad++ 正则表达式多条件查找替换

基础语法参考: https://www.cnblogs.com/winstonet/p/10635043.html https://www.linuxidc.com/Linux/2019-05/158701.htm   通常情况下我们查找的内容和要被替换掉的内容是一样的,我们只需要使用正则表达式精确框定查找内容,替换直接输入要替换的内容即可。 但有时会比较复杂,查找的内容,只需要替换其中

【20240907问题记录(未解决)】Conda环境问题:SSH与本地环境变量不一致

Conda 允许用户在同一系统上创建多个独立的Python环境。然而,最近遇到了一个奇怪的问题:通过SSH连接到远程Ubuntu机器时,Conda环境变量的行为与本地机器不一致。以下是具体遇到的问题: 1. 问题描述 在本地Ubuntu机器上,我的conda的python版本是3.6,而pip版本可以通过命令 pip --version 查看,显示为: pip 21.3.1 from /ho

我成功在本地打开了Cesium啦!

1首先下载Node.js,我是跟着这篇下载的,https://zhuanlan.zhihu.com/p/77594251,不过这后面的我没弄对Cesium环境配置也没影响。 另外:我看其他推文说,在终端写node -v和npm-v查node和npm的版本可以检测node和npm是否下载成功。 2然后我在CesiumB站官号看的教学视频,跟着下载Cesium源代码。 Cesium基础入门1-零

html 本地存储(localStorage and sessionStorage)

刚刚学习anjularJS和html的项目开发,其中在ui库中使用一种步骤类型的样式,其实就是form表单的ng-if判断显示,样式好用但也伴随着很多的问题,其中一个bug就是刷新会回到第一步,回到第一步的原因是刷新时会从新加载js代码,因为状态没变,所以就会出现无论刷新的哪一步,都会回到第一步,解决该问题的方法就是本地存储。 百度发现有两种存储方式,一个是sessionStorage,还有个