📜 ⬆️ ⬇️

Bay Fascists, or BLE for iOS


Hello workers from idlers.
Last year an event occurred that was poorly covered on the site.

This event - appearances in new iOS devices 4th Bluetooth. Or BLE - Bluetooth Low Energy. How is it nice for developers under ayos? Read and find out.
If you are too lazy to read, watch a 0x30-second video with an example of an application based on this technology.


No Apple MFI License Required

Until February 2012, a license was required to develop devices and applications that use the old bluetooth for iPhones. I received such a license, along with it came the PDF file with the seal Top Secret . I have not created anything useful with the help of this document.
')

No registration required in GameCenter

How many have not worked with GameCenter, I had the feeling that this is an alien Apple product. Nasty design and stupid functionality. And debugging? I do not argue, I Krivoruk, but they say the developer GameCenter fired from the company. I would have made it to the Minister of Culture of Mordovia. Yes, for this green wallpaper ...

What you need to develop

To write an application, you need to download a great example of BTLE Central Peripheral Transfer from Apple’s homepage.

The example is simple and clear - it connects 2 any iOS devices that have a new BLE installed on board. I remind you that BLE is installed on devices starting with iPhone 4S and iPad 3 and higher.
Run the application on two devices. I warn you, the BLE emulator is not supported.

A menu appears - one device is chosen central, another - peripheral - then the author’s imagination knows no boundaries. My fantasy was limited to several SHOOTERS, one of which I wrote specifically for this article.

Separation of devices

The program works only in conjunction with the iPad-iPhone. iPad, I mean the central shooting range, iPhone - peripheral rifle. I put the iPad on the IKEA sofa in the landscape position, I hold the iPhone at a distance of 30-60 cm from the iPada, like a policeman holding a gun. In the process of debugging, I checked the signal level from the periphery at the center and to be honest - the guys have no future from here . Signal strength is extremely unstable. Figures in the comments, if necessary.

Moreover, I have long been cursing at the launch of my native apple example, because the connection was lost and the reaction to the shot was sometimes up to 2 seconds! What kind of magic wand. But, picking up an example, I removed the minimum limit for signal strength and the application flew. On the rifle, I turned on the medium resolution video mode, I determine the location of the shooting range along the blue upper horizontal bar on the iPad, and then everything just got caught, did not hit.

Hot on the heels I made Biathlon and Tire applications and today I dared to put one of them into the store.
Having cooled down a bit, I made the application Snowboard - iPhone (board) and iPad (slope). The accelerometer from iphone 20 times per second drives 10 bytes to ipad. Everything works, the main thing is not to overload the channel - it does not miss more than 60 bytes in 0.020 seconds. Graphics for snowboarding already need three-dimensional, rather than pseudo-3D, so the project will probably die.

And for sweets. You can shoot at targets from several trunks. My children are already winning in the shootout.

Everyone does not get sick!

Source: https://habr.com/ru/post/164991/


All Articles