简体   繁体   中英

Sensor to iOS connection

We're looking to build a small device connected to a sensor that transmits data to an iPhone, which subsequently takes the data, stores it and graphs it. However we want the iPhone to be able to change the polling data on the device by sending small amounts of data. I've been doing some reading and it seems like bluetooth LE does not allow for this type of streaming connection. Is this correct? Would switching to an Android platform be better? What would you all suggest?

With Bluetooth LE, you have complete control over the flow, even on iOS.

That said, there are a couple of things to know:

  • BTLE devices only have read-only "characteristics" (but can be dynamic)
  • There is no way to "push" data, only notify a change to the listening devices

So instead of saying - "Hey, 'streaming_type' should change from 'wind' to 'temperature'", you would say - "Hey, 'streaming_type' has changed, come read it".

It is not specific to iOS, it is the way BTLE works. So if you want an iPhone to be able to control your device, your application simply needs to setup a BTLE "streaming_type" characteristic, and then update it when the user wants to change the type of data being streamed.

Your BTLE device would then look for this specific "streaming_type" characteristic, and go read it when it receives a update notification.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM