二维码扫码模组国产麒麟系统C语言SDK二次开发

在国产系统麒麟V10系统上面上使用的 USB HID POS 的 SDK 包.

特别说明涉及到永久参数的函数接口,请勿频繁使用.如果是出厂或者偶尔设置推荐使用永久参数,如果是每次读码都进行参数修改,请使用临时参数.频繁进行永久参数操作会减小扫码设备的使用寿命.

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include <ctype.h>

#include "tx_scanner.h"

/*************************************************************************
内部宏定义
*************************************************************************/


/*************************************************************************
内部结构、枚举、公用体等结构声明
*************************************************************************/

/*************************************************************************
内部静态变量定义

全局变量定义

extern 外部变量声明

*************************************************************************/


/*************************************************************************
静态函数声明

extern 外部函数声明
*************************************************************************/
/**解码数据回调函数**/
static int32 tx_scanner_sdk_decode_data_cb(uint8 ucCodeType, uint8 *pBuf, uint32 uiBufLen);

/**连接状态回调函数**/
static void tx_scanner_sdk_comm_state_cb_fun(uint8 ucState);
static void tx_scanner_sdk_show_menu(void);
/*************************************************************************
函数定义
*************************************************************************/
int32 main(void)
{
	int32 iRet;
	uint8 ucVer[64] = "";
	uint8 ucTemp1;
	uint8 ucTemp2;
	uint8 ucTemp3[50];
	int length = 0;

	tx_scanner_get_version(ucVer, sizeof(ucVer));
	printf("linux c/c++ usb hidpos demo ver:%s\r\n", ucVer);

	/**注册解码数据回调函数**/
	iRet = tx_scanner_decode_data_fun_register(tx_scanner_sdk_decode_data_cb);
	if(iRet < 0)
	{
		printf("tx_scanner_decode_data_fun_register fail!!!\r\n");
		return 1;
	}

	/**注册设备连接状态回调函数**/
	iRet = tx_scanner_comm_state_fun_register(tx_scanner_sdk_comm_state_cb_fun);
	if(iRet < 0)
	{
		printf("tx_scanner_comm_state_fun_register fail!!!\r\n");
		return 1;
	}

	/**初始化**/
	iRet = tx_scanner_init();
	if(iRet < 0)
	{
		printf("tx_scanner_init fail!!!\r\n");
		return 1;
	}

	printf("******************************************************\r\n");
	printf("a:start decode\r\n");
	printf("b:stop decode\r\n");
	printf("c:no time decode start\r\n");
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值