DIAG 命令适配
  Qgw4UHkx7saV 2023年11月02日 48 0

poky/meta-qti-bsp/recipes-android/adb/adbd_git.bb


vendor/qcom/proprietary/coretech-config-vendor/diag/include/diagcmd.h

你项目里有这个文件吗?

不不不,我的意思添加了那些,头文件还是找不着: 在app_proc/system/core/adb/adb_utils.CPP里包含#include "diag.h",error:找不到#include "diag.h" 文件。。。

thanks for your sharing .

Any question, feel free to contact me .


添加内容为:PKG_CHECK_MODULES([DIAG], [diag]) AC_SUBST([DIAG_CFLAGS]) AC_SUBST([DIAG_LIBS])

是否还有其他配置项需要配置?

添加后,头文件还是找不到呢


请在 对应 configure.ac 添加 PKG_CHECK_MODULES([DIAG], [diag])

如果想在app_proc/system/core/adb/这里用diag这个接口,需要makefile需要包含? 之前做过一次头文件找不到:fatal error: diagcmd.h: No such file or directory | #include "diagcmd.h" 是否是缺了什么没配置?

send_data 75 18 152 0 xx xxx xxx xxx xx 这里的xx为传入处理函数的数据?

关于diag的命令组成可以看如下文档:

Diagnostic System User Guide -- 80-NA157-61 Command code – 1 byte SSID –1 byte Subsystem command code – 2 bytes Payload – Up to 4 K - 4 bytes There are single response commands and delayed response commands for which multiple response packets are sent at certain intervals, for example, modem loopback command (75 18 41 0 1 2 3) can be broken down as: Command code (1 byte): 75 Subsystem ID (1 byte): 18 Subsystem command code (2 bytes): 0 41 Payload: 1 2 3


以这个为例: " DIAGPKT_DISPATCH_TABLE_REGISTER( DIAG_SUBSYS_DIAG_SERV, fmc_adb_diag_func_table); " send_data 75 18 152 0 xx xxx xxx xxx xx send_data 75 18 153 0 xx xxx xxx xxx xx


Description 如附件在原有·的test_diag中添加diag: /[begin] add by huaming.chi@flairmicro.com/ #define FMC_FORHID_ROOT_CMD 0x0098 #define FMC_FORHID_ROOT_CMD1 0x0099

static const diagpkt_user_table_entry_type fmc_adb_diag_func_table[] = { {FMC_FORHID_ROOT_CMD, FMC_FORHID_ROOT_CMD, fmc_forhid_root_diag_dispatch}, {FMC_FORHID_ROOT_CMD1, FMC_FORHID_ROOT_CMD1, fmc_forhid_root_diag_dispatch} }; static void *fmc_forhid_root_diag_dispatch(void req_pkt, uint16 pkt_len) { void rsp = NULL; printf("test_diag: fmc_forhid_root_diag_dispatch succeeded\n\n"); return rsp; } /[end] add by huaming.chi@flairmicro.com/ int main(int argc, char *argv[]) { unsigned int i = 0; boolean status = FALSE; verbose = 0; max_num_tasks = 1; pthread_mutex_init(&test_hdl_lock, NULL); parse_args(argc, argv);

test_info = malloc(max_num_tasks * sizeof(diag_stress_test_hdl_t));
if (!test_info) {
	printf("test_diag: Unable to allocate memory for stress test handle\n");
	exit(0);
}
memset(test_info, 0, sizeof(max_num_tasks * sizeof(diag_stress_test_hdl_t)));

status = Diag_LSM_Init(NULL);
if (!status) {
	printf("test_diag: Diag_LSM_Init failed, error: %d\n", errno);
	free(test_info);
	return -1;
}
printf("test_diag: Diag_LSM_Init succeeded <=my test diag\n\n");

/* Register Apps Test Commands */
DIAGPKT_DISPATCH_TABLE_REGISTER(DIAG_SUBSYS_DIAG_SERV, diag_test_tbl);
/* Register Delayed Response Test Command */
DIAGPKT_DISPATCH_TABLE_REGISTER_V2_DELAY(DIAG_SUBSYS_CMD_VER_2_F,
					 DIAG_SUBSYS_DIAG_SERV,
					 diag_test_tbl_delay);
/*[begin] add by*/
DIAGPKT_DISPATCH_TABLE_REGISTER( DIAG_SUBSYS_DIAG_SERV, fmc_adb_diag_func_table);
DIAGPKT_DISPATCH_TABLE_REGISTER_V2_DELAY(DIAG_SUBSYS_CMD_VER_2_F,
					 DIAG_SUBSYS_DIAG_SERV,
					 fmc_adb_diag_func_table);
/*[end] add by */
while (1);

然后在qxdm中测试命令: send_data 128 0x12 0x03 0x99 0x99
send_data 128 0x12 0x03 0x98 0x98 好像没啥反应,我想问是我输入命令错误还是?如果错误应该输入什么?如果代码错误,那需要怎么改他才会有反应打印:printf("test_diag: fmc_forhid_root_diag_dispatch succeeded\n\n");


当然,要注意避免命令冲突,18 是 DIAG_SUBSYS_DIAG_SERV = 18, /* DIAG Services */

vendor/qcom/proprietary/coretech-config-vendor/diag/include/diagcmd.h

//下边是留给OEM使用的。 602

/* Subsystem IDs reserved for OEM use */

603 DIAG_SUBSYS_RESERVED_OEM_0 = 250,

604 DIAG_SUBSYS_RESERVED_OEM_1 = 251,

605 DIAG_SUBSYS_RESERVED_OEM_2 = 252,

606 DIAG_SUBSYS_RESERVED_OEM_3 = 253,

607 DIAG_SUBSYS_RESERVED_OEM_4 = 254,

608 DIAG_SUBSYS_LEGACY = 255


Please upload test_diag for review . and share your mobile phone number for sync.

 the case is rounted to China CE team, and we will provide update ASAP. Please also check whether (KBA-190212000805) can be useful to you. Thanks!

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  gBkHYLY8jvYd   2023年12月06日   48   0   0 #includecii++
  gBkHYLY8jvYd   2023年11月19日   27   0   0 #includecic++
  gBkHYLY8jvYd   2023年11月19日   14   0   0 #includeios数据
  gBkHYLY8jvYd   2023年11月19日   20   0   0 #includei++数据
  gBkHYLY8jvYd   2023年11月19日   23   0   0 #include数组ci
  gBkHYLY8jvYd   2023年12月10日   17   0   0 #include邻域灰度图像
  gBkHYLY8jvYd   2023年12月10日   22   0   0 #include数组i++
  gBkHYLY8jvYd   2023年12月06日   19   0   0 #includeios数据
  gBkHYLY8jvYd   2023年12月08日   20   0   0 #includecii++
  gBkHYLY8jvYd   2023年11月19日   19   0   0 #includeiosci
  gBkHYLY8jvYd   2023年11月22日   20   0   0 #include十进制高精度
  gBkHYLY8jvYd   2023年11月22日   23   0   0 #includeiosci
Qgw4UHkx7saV
作者其他文章 更多

2023-11-02

2023-11-02

ddr

2023-11-02