请教关于尿微量白蛋白HID的SetReport问题

他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)爱卡汽车_中国领先的汽车主题社区、汽车资讯、汽车论坛中心Mac-OS 开发 与USB HID通信 - 简书
Mac-OS 开发 与USB HID通信
macOS 开发
USBDeviceTool.h
Mac-USB-04
Created by nb616 on .
Copyright (C) 2017年 CNDotaIsBestDota. All rights reserved.
#import &Foundation/Foundation.h&
#import &IOKit/hid/IOHIDLib.h&
#import &IOKit/hid/IOHIDKeys.h&
@protocol USBDeviceDelegate &NSObject&
- (void)robotPenUSBRecvData:(uint8_t*)recvD
- (void)robotPenUSBConnectDevice:(IOHIDDeviceRef)deviceR
- (void)robotPenUSBRomveD
@interface USBDeviceTool : NSObject
+ (USBDeviceTool *)
@property (weak , nonatomic) id &USBDeviceDelegate&
@property (assign , nonatomic) IOHIDManagerRef managerR
@property (assign , nonatomic) IOHIDDeviceRef deviceR
- (void)connectD
- (void)disConnectD
发送数据USB
@param buffer buffer
- (void)sendData:(char *)
#import "USBDeviceTool.h"
#import "USBDeviceTool+robot.h"
static USBDeviceTool *_tool =
void Handle_DeviceOutgoingData(void* context, IOReturn result, void* sender, IOHIDReportType type, uint32_t reportID, uint8_t *report,CFIndex reportLength) {
[[USBDeviceTool share].delegate robotPenUSBRecvData:report];
void Handle_DeviceMatchingCallback(void *inContext,IOReturn inResult,void *inSender,IOHIDDeviceRef inIOHIDDeviceRef) {
BOOL isRot = [[USBDeviceTool share] isRobotProdut:inIOHIDDeviceRef];
if (isRot && ![USBDeviceTool share].deviceRef) {
IOReturn ret = IOHIDDeviceOpen(inIOHIDDeviceRef, 0L);
[USBDeviceTool share].deviceRef = inIOHIDDeviceR
[[USBDeviceTool share].delegate robotPenUSBConnectDevice:inIOHIDDeviceRef];
if (ret == kIOReturnSuccess) {
char *inputbuffer = malloc(64);
IOHIDDeviceRegisterInputReportCallback(inIOHIDDeviceRef, (uint8_t*)inputbuffer, 64, Handle_DeviceOutgoingData, NULL);
[[USBDeviceTool share] enterUSBState];
void Handle_DeviceRemovalCallback(void *inContext,IOReturn inResult,void *inSender,IOHIDDeviceRef inIOHIDDeviceRef) {
BOOL isRot = [[USBDeviceTool share] isRobotProdut:inIOHIDDeviceRef];
if (isRot) {
[[USBDeviceTool share].delegate robotPenUSBRomveDevice];
[USBDeviceTool share].deviceRef =
@interface USBDeviceTool ()
@implementation USBDeviceTool
+ (USBDeviceTool *)share
static dispatch_once_t onceT
dispatch_once(&onceToken, ^{
if (!_tool) {
_tool = [[USBDeviceTool alloc] init];
- (instancetype)init
self = [super init];
if (self) {
self.managerRef = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
IOHIDManagerScheduleWithRunLoop(self.managerRef, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
IOReturn ret = IOHIDManagerOpen(self.managerRef, kIOHIDOptionsTypeNone);
if (ret != kIOReturnSuccess) {
NSLog(@"打开失败");
IOHIDManagerRegisterDeviceMatchingCallback(self.managerRef, &Handle_DeviceMatchingCallback, NULL);
IOHIDManagerRegisterDeviceRemovalCallback(self.managerRef, &Handle_DeviceRemovalCallback, NULL);
IOHIDManagerSetDeviceMatching(self.managerRef, NULL);
- (void)connectDevice
if (!_deviceRef) {
IOHIDManagerSetDeviceMatching(self.managerRef, NULL);
- (void)disConnectDevice
if (!_deviceRef) {
if ([self isRobotProdut:_deviceRef]) {
[self exitOutUSBState];
IOReturn ret = IOHIDDeviceClose(_deviceRef, 0L);
if (ret == kIOReturnSuccess) {
_deviceRef =
[[USBDeviceTool share].delegate robotPenUSBRomveDevice];
- (void)sendData:(char *)buffer
if (!_deviceRef) {
BOOL isRot = [self isRobotProdut:_deviceRef];
if (isRot) {
IOReturn ret = IOHIDDeviceSetReport(_deviceRef, kIOHIDReportTypeOutput, 0, (uint8_t*)buffer, 64);
if (ret == kIOReturnSuccess) {
NSLog(@"发送数据成功");
本来,标题是「揭开 macOS 开发的神秘面纱」,可想想,以我目前对 macOS 开发的理解,还是去掉「揭开」二字吧 ? 本文不是系统性的文章,更像是 随笔。回想自己过去 1.6 年的 macOS 开发历程,挑些有意思的来说。如果想看完就去挖 macOS 这座金矿(如果是的...
毫无疑问,Unix的诞生,对于计算机的发展起到了至关重要的作用。人们可以通过操作系统去使用计算机。然而在当时,尽管DEC生产的小型机PDP系列和VAX系列比起早期的巨无霸已经算是比较苗条了,可是对于个人而言,计算机还是相当大的东西,并且造价昂贵,无法进行民用。 为了将大型计...
5.2 Mac OS安装说明 译者:Python 文档协作翻译小组,原文:Mac OS Installation Instructions。本文以 CC BY-NC-SA 4.0 协议发布,转载请保留作者署名和文章出处。Python 文档协作翻译小组人手紧缺,有兴趣的朋友可...
目录:http://blog.csdn.net/lovechris00/article/category/6942446 | MacOS 开发 - NSColorPanel & NSFontManager 选择颜色、字体 | MacOS 开发 - NSAlert | Mac...
常言: 工欲善其事,必先利其器。作为一名iOS开发工程师,必须是全能的。你不会点UI设计、不会点后台语言、不会点安卓开发...你都不好意思说自己是程序员。Mac上有很多好用的软件,有的能提升我们的开发效率,有的能提升我们的工作效率。今天我就来介绍一些Mac上对我们开发有帮助...
前几天去参加一个活动正好见到老朋友晓晓。我和她认识五六年了,同一年出生,又都是独生女,性格相似,爱好相同,关系很好的。搞完活动我们一起坐地铁回家,然后在那里聊家常。聊到她儿子的趣事。突然她贴近我耳朵说:‘我和他分开了。’我惊呆了!几年前他们可是模范夫妻!!! 去年闹了两次离...
第二篇 工具 2.1 网络请求 okhttp-utils okhttp(官方) OkHttpUtils(封装版) android-async-http retrofit:heart: android-volley volley 即时通信 asmack NIO-PRC框架 n...
这次微信对公众号的图文分析的数据进行升级,对我等运营够来说是多次升级中最为值得高兴的,因为数据是我们了解用户,了解内容方向,了解传播途径最佳的解读工具。 相信很多微信运营者运营公众号这么久一定遇到了粉丝瓶颈,阅读量瓶颈,那这次图文数据能不能在出现更多维度的数据之后找出原因,...
教会孩子接纳自己是送给孩子的最好礼物。 昨天学习了罗森塔尔效应,今天开始彻底应用。 有朋友说期待会给孩子压力,我觉得还是对罗森塔尔效应有误解。我们通常所谓的期待是:”你还有进步的空间,你还应该继续努力,取得更大的成果。“这种期待和赞许是有条件的,就是“你应该做到更好,甚至最...
离双十一还剩两天! 堪称史上最考验智力的双十一就要来啦 很多时尚界公号大v并没有在教大家攻略, 而是都教起了数学应用题! 这年头,数学不好的人,都不配过双十一了吗? 双十一临近公众号届的画风变成了这样 一起来看看吧 papi酱《往年阻挠我过双十一的只有钱,今年还有脑子》 平...请教关于php中sql插入语句的问题。
问题代码如下:error_reporting(E_ALL ^ E_NOTICE);
//包含excel读取类文件
require_once 'excel_reader2.php';
$data = new Spreadsheet_Excel_Reader();
//设置文本输出编码
$data-&setOutputEncoding('GBK');
//读取Excel文件 $tmp_name为服务器存储的临时文件
$data-&read($tmp_name);
//把文件内容存放到bhhn数据库的reports表格中
//屏蔽报错机制
error_reporting(E_ALL ^ E_DEPRECATED);
//连接sql数据库
$link=mysql_connect("127.0.0.1","root","");
mysql_select_db('bhhn');
//设置文本输出编码
mysql_query("set names 'GBK'");
//向reports数据表插入数据
$arr=array($data-&sheets[0]['cells'][2][3],$data-&sheets[0]['cells'][2][5],$data-&sheets[0]['cells'][2][8],$data-&sheets[0]['cells'][2][10],$data-&sheets[0]['cells'][5][2],$data-&sheets[0]['cells'][5][3],$data-&sheets[0]['cells'][5][4],$data-&sheets[0]['cells'][5][5],$data-&sheets[0]['cells'][5][6],$data-&sheets[0]['cells'][5][7],$data-&sheets[0]['cells'][5][8],$data-&sheets[0]['cells'][5][9],$data-&sheets[0]['cells'][5][10],$data-&sheets[0]['cells'][5][11],$data-&sheets[0]['cells'][7][2],$data-&sheets[0]['cells'][7][4],$data-&sheets[0]['cells'][7][5],$data-&sheets[0]['cells'][7][6],$data-&sheets[0]['cells'][7][7],$data-&sheets[0]['cells'][8][3],$data-&sheets[0]['cells'][8][8],$data-&sheets[0]['cells'][10][2],$data-&sheets[0]['cells'][10][3],$data-&sheets[0]['cells'][10][4],$data-&sheets[0]['cells'][10][5],$data-&sheets[0]['cells'][10][6],$data-&sheets[0]['cells'][10][7],$data-&sheets[0]['cells'][10][8],$data-&sheets[0]['cells'][10][9],$data-&sheets[0]['cells'][13][2],$data-&sheets[0]['cells'][13][3],$data-&sheets[0]['cells'][13][4],$data-&sheets[0]['cells'][13][5],$data-&sheets[0]['cells'][13][6],$data-&sheets[0]['cells'][13][7],$data-&sheets[0]['cells'][13][8],$data-&sheets[0]['cells'][13][9],$data-&sheets[0]['cells'][13][10],$data-&sheets[0]['cells'][13][11],$data-&sheets[0]['cells'][14][2],$data-&sheets[0]['cells'][15][2],$data-&sheets[0]['cells'][16][2]);
//在这个位置插入print_r($arr);可以看到arr数组中的数据是正确的
$sql="insert into reports(wellName,reportTime,DDName,tellNum,bigginDate,wellDepth,dateDrilling,bitTime,position,lithology,casingPipeDiameter,casingPipeDepth,KOPDepth,pipeDiameter,bitData,weightOnBit,rateOfFlow,RPM,pressure,deviceType,troubleAnalysis,density,viscosity,fluidLoss,mudCake,initialGelStrength,10-minutoGelStrength,PH,sandContent,MD,Inc,Azi,TVD,CloD,CloAz,forecastTargetDepth,targetTVD,forecastTargetCloD,forecastTargetCloAz,drillingToolStructure,projectPrograss,troubles) values('$arr[0]','$arr[1]','$arr[2]','$arr[3]','$arr[4]','$arr[5]','$arr[6]','$arr[7]','$arr[8]','$arr[9]','$arr[10]','$arr[11]','$arr[12]','$arr[13]','$arr[14]','$arr[15]','$arr[16]','$arr[17]','$arr[18]','$arr[19]','$arr[20]','$arr[21]','$arr[22]','$arr[23]','$arr[24]','$arr[25]','$arr[26]','$arr[27]','$arr[28]','$arr[29]','$arr[30]','$arr[31]','$arr[32]','$arr[33]','$arr[34]','$arr[35]','$arr[36]','$arr[37]','$arr[38]','$arr[39]','$arr[40]','$arr[41]')";
mysql_query($sql);运行的结果没有报错,但是刷新Mysql数据库没有接到数据。尝试了只对前边5个字段插入,可以成功是插入语句对values值有个数限制呢,还是有其他错误?初学,望不吝赐教
经过逐个增加值发现到字段“10-minutoGelStrength”开始插入失败,改为tenminutoGelStrength后问题解决是因为sql字段名不允许数字,还是不允许-符号?求科普
经过逐个增加值发现到字段“10-minutoGelStrength”开始插入失败,改为tenminutoGelStrength后问题解决是因为sql字段名不允许数字,还是不允许-符号?求科普
你还没有登录,请先登录或注册慕课网帐号
35310人关注
PHP一种被广泛应用的开放源代码的多用途脚本语言,和其他技术相比,php本身开源免费; 可以将程序嵌入于HTML中去执行, 执行效率比完全生成htmL标记的CGI要高许多,它运行在服务器端,消耗的系统资源相当少,具有跨平台强、效率高的特性,而且php支持几乎所有流行的数据库以及操作系统,最重要的是PHP还可以用C、C
进行程序的扩展,PHP语言在WEB开发方面有着非常广泛的应用,除此之外,PHP4,PHP5中,面向对象有了很大的改进,还可以用来开发大型商业程序。
15370人关注
Mysql是最流行的关系型数据库管理系统,在WEB应用方面MySQL是最好的RDBMS(Relational Database Management System:关系数据库管理系统)应用软件之一。
Copyright (C) 2018 imooc.com All Rights Reserved | 京ICP备 号-2HID_WIN_API_总结_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
HID_WIN_API_总结
&&USB HID API
阅读已结束,下载文档到电脑
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,方便使用
还剩21页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢}

我要回帖

更多关于 请教我恋爱的方法 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信