iOS(iPhone/iPad)中的串行或HID(USB)通信

iOS(iPhone/iPad)中的串行或HID(USB)通信

问题描述:

我想通过连接到iPhone或iPad设备从血糖仪设备获取数据.我有不同的血糖仪供应商,有些使用简单的HID接口进行通信,而另一些使用串行通信.

I want to get data from glucose meter devices by connecting into iPhone or iPad devices. I have different vendors glucose meters some uses simple HID interface for communicate and other uses serial communication.

这是两种可能的交流方式:

These are the two possible ways of communication:

  • USB到30针连接器.
  • 3.5插孔到30针连接器.

将USB或3.5插孔连接到血糖仪,并将30针连接器连接到iDevice.

USB or 3.5 jack will be connected to glucose meter and 30 pin connector will be attached with iDevice.

经过数小时的研究,我没有发现iOS专用的互联网帮助很大.

After having hours of research I did not find much help on internet for iOS specific.

我确实找到了ORSSerialPort,但我认为它仅适用于OS X应用程序.

I do find ORSSerialPort but I think it is for OS X apps only.

有RedPark串行电缆,但是用于RS232到30针的通信,其次只能在内部项目中使用.我想在Apple Store上出售我的应用程序.

There is RedPark serial Cable but that is for RS232 to 30-Pin communication and secondly that can be only used in internal projects. I want to sell my application on Apple Store.

也有人在讨论有关使用IOKit框架的问题.我们可以与iDevie进行通信,但这是私有框架.

Someone also was discussing about using IOKit framework. We can communicate with iDevie but that is private framework.

有人可以帮助我解决此问题,或者让我知道在iOS应用程序中是否有可能.

Someone help me with this issue or let me know if that is even possible in iOS application.

Apple是否对这种工作方式有任何考虑?

Do Apple have any consideration on this type of working?

iOS设备只能通过以下通信方式与外部设备进行通话:

An iOS device can talk to external devices by following means of communications only:

  1. Wifi
  2. 蓝牙
  3. GPRS和
  4. GSM
  5. USB(不完全知道它叫什么)

无法与iOS设备进行RS232串行端口通信.

There is no possible way to have RS232 serial port communication with iOS device.

现在还有什么选择?

  1. 在您的外部设备与设备之间获取通信转换器. iOS设备.可以是

  1. Get a communication convertor in between your external device & iOS device. It can be

  • 串行到以太网适配器
  • 串行到USB适配器等

在外部设备中嵌入了wifi/蓝牙模块(如果您/您的公司正在制造)

Embedd a wifi/bluetooth module in the external device (If it is being manufactured by you/your firm)

使用USB电缆和放大器; mfi.(从没有做过,但是已经看到了与此相关的东西).用我的意思说,请在MFI许可和许可下注册您的外部设备.在设备之间实现USB(再次缺乏关于USB东西的清晰度).这段时间,我会感谢那些可能会使用USB东西来改善答案的人所做的编辑.

Have something with USB cable & mfi .(Never worked on this, but have seen stuff working with this). By something I meant, register your external device under MFI license & implement USB between devices (Again lack of clarity about USB stuff). Menwhile, I would appreciate edits on my answer by people who might improve it with USB stuff.

更新:

我访问了您的供应商"glooko"的站点.我找不到任何有关他们为开发人员提供任何库的线索.因此,根据我的观点,他们将图书馆保密.他们不希望您根据他们的通信协议来开发应用程序.如果您仍需要为其开发应用程序,请在此处与他们联系&让他们知道您的热情.确保他们会给您他们的私人密码.无论如何,您现在不需要注册任何MFI或任何东西.您所需要的只是他们用于通讯&的代码.关于这一点,除了他们之外没有其他人可以帮助您.所以,最好的..:)

I visited the site of your vendor "glooko". I could not find any clue about them having any libraries for developers. So according to my opinion, they have kept their library private. They don't want you to develop apps based on their communication protocol. If you still need to develop apps for them, contact them here & let them know about your zeal.. M sure they will give you their private code. Anyhow, you don't need to register for any MFI or anything now. What you need is just the code they are using for communication & about that, nobody other than them can help you. So, all the best .. :)

更新2:

我从更新后的问题中了解到,您想创建一个可与来自不同供应商的各种血糖仪一起使用的iOS应用程序.您可以将其称为"通用血糖仪应用"

What I understood from your updated question is, you want to create an iOS application that works with various Glucose meters, from different vendors. In a way you can call it as "universal Glucose meter app"

简短而直接的答案是.."您不能".但是等等,苹果对此不负责.也不是不可能.

The short and straight answer for this is .."You Can't" . But wait, apple is not responsible for this. Neither it is impossible.

让我告诉你为什么.当您希望您的应用程序与硬件设备通信时,您之间也必须有一个通信通道.您很清楚这两个可用选项.现在,如果您的应用程序必须在iDevices上运行,则必须为mfi注册通信通道电缆.这也不是问题.

Let me tell you why. When you want your application to talk with a hardware device, there must be a communication channel between you too. You are well aware of those two options available. now, if your app must run on iDevices, the communication channel cables must be registered for mfi. Here that is also not the issue.

那是什么问题? 不同的vendon通常在其硬件和硬件之间不遵循相同的通信协议.软件.如果德国指挥官指挥印度士兵会发生什么情况.显然,没有人会理解.

What is the issue then? Different vendons don't generally follow the same communication protocols between their hardware & softwares. What happens if a german commander commands to indian soldier. Obviously, nobody will understand.

因此,要实现您的目标,唯一的方法是,必须在应用程序中包含每个受支持的供应商提供的SDK.让我知道你是否还不清楚..:)

So, to achieve your objective, the only way is, you have to include SDK provided by each supported vendors in your app. Let me know if you are not yet clear..:)