Beat the Fascists, or BLE for iOS


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

    This event is the appearance of 4th Bluetooth in new iOS devices. Or BLE - Bluetooth Low Energy. How is it pleasant for developers for ayios? Read and find out.
    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 using the old bluetooth for iPhones. I got such a license, along with it came a PDF file with a seal. Top secret . I did not create anything useful with this document.

    No need to register with GameCenter

    How many did not work with GameCenter, the feeling that this is an alien Apple product did not leave me. Nasty design and stupid functionality. What about debugging? I don’t argue, I’m a krivoruk, but they say the GameCenter developer was fired from the company. I would have made him still the Minister of Culture of Mordovia. Yes, for this green wallpaper ...

    What is needed for development

    To write an application, you must download the excellent BTLE Central Peripheral Transfer example from the Apple homepage.

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

    A menu appears - we select one device central, the other peripheral - then the author’s fantasies know no bounds. My fantasy was limited to a few SHOOTERS, one of which I wrote specifically for this article.

    Device sharing

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

    Moreover, I swore for a long time when starting a native apple example, because the connection was lost and the reaction to the shot was sometimes up to 2 seconds! What a magic wand. But, picking up an example, I removed the minimum boundary for signal strength and the application flew. On the rifle, I turned on the medium-resolution video mode, using the blue upper horizontal bar on the iPad, I determine the location of the shooting range - and then everything is simple - hit, missed.

    In hot pursuit, I made Biathlon and Tire applications and today dared to put one of them into the store.
    Cooling down a bit, I made the Snowboard app - iPhone (board) and iPad (slope). The accelerometer from the iPhone 20 times per second drives 10 bytes to the iPad. Everything works, the main thing is not to overload the channel - it does not pass more than 60 bytes in 0.020 seconds. The graphics for the snowboard already need three-dimensional, and not pseudo 3D, so the project will probably die.

    And for the sweet. You can shoot at targets from multiple barrels. My children are already winning the shootout.

    Do not get sick!

    Also popular now: