iOS Bluetooth Connection process Introduction-1

Source: Internet
Author: User

Bluetooth Connection Process Introduction 1.1-programmer to find a girlfriend process introduction
  • 0. Programmers looking for girlfriend participants

    • 1. You
    • 2. Victims (female compatriots)
      • (1) Her character 1
        • Characteristics of the character
      • (2) Her character 2
        • Analysis of character characteristics
  • 1. Finding women

    • Find all the women around you, even if you are sitting in the opposite UI sister and beside great Skin's Android
    • What if there is a blind one in the ditch when the nets are fishing?
  • 2. Lock target

    • We have a goal to do the next step.
  • 3. Connect with the target (chat)

    • Every couple starts with a friend. No! It started with your pen or the meal you ate.
    • iOS programmers earn much, die early
    • Be talented, have IQ, be humorous
  • 4. Become a regular friend and start dating

    • The purpose of communication is to understand each other's character, expertise
      • such as ABCD, cough ... Cough......
      • Like Sancongside, cough ... Cough......
  • 5. Through intercourse, acquire each other's character, begin to analyze

  • 6. Analysis of character characteristics

    • 1. The character of the human being
      • Yin Lady has a wood
    • 2. The character of Life
      • Laundry, cooking, dragging the belt.
    • 3. Other aspects of character
      • You know
  • 7. Lock a character, start a deep communication, send data to each other (Xxoo)

1.2-Bluetooth Connection process Introduction
  • 0. The parameters of the Bluetooth connection

    • 1. Bluetooth Center CBCentralManager : generally refers to the iphone phone
    • 2. Device (peripheral) CBPeripheral : Smart hardware with Bluetooth chip
      • Array of services for peripherals, peripheral.services CBService objects: Hardware can provide a lot of services, in fact, the function of the hardware modules, such as the vibration of the bracelet and light up the color is two different services
        • Service Characteristics CBCharacteristic : Responsible for the service to provide read and write data, a service can have a number of features, such as the color of the lamp bright RGB value, there is a length of time is a separate service
  • 1. Bluetooth Center starts Scanning peripherals

    • A Bluetooth center can scan all peripherals around the active range of Bluetooth distances (around 20m with obstructions)
    • One peripheral can also be scanned by multiple Bluetooth hubs
      • Men can pursue multiple women at the same time without being friends, and women can be pursued by multiple men at the same time.
  • 2. Scan to peripherals and start to identify

    • We scan all peripheral peripherals, but in general we only connect to our own company's smart hardware, so here we need to identify
      • CBPeripheralHas a identifier property that is a unique identifier for the device
        • Some apps by scanning the hardware of the QR code to establish a connection, in fact, the inside has been scanned peripherals, but the UI is not displayed, the QR code is placed in the peripheralidentifer
  • 3. Start Connecting Peripherals

  • 4. Connect peripherals successfully, start discovery service

    • Once the peripheral is connected to the Bluetooth hub, it cannot be scanned by other centers and cannot be connected by other centers.
    • iphone bluetooth can connect up to 8 peripherals at the same time: more peripheral bluetooth more unstable, easy to disconnect
      • A woman to find a husband, will only be single-minded to her good, but men have money to become bad, often there will be a room ER Fang three room four (peripheral), the more the more unstable, easy to divorce (disconnect)
  • 5. Discover the service and start searching for features

    • A peripheral will have a lot of services, service is just peripherals tell you what I have, and can't send data directly
      • In general development, the hardware engineer responsible for Bluetooth chip development will give you a copy of the Bluetooth protocol document, which will tell you what services provide what functions
        • Services CBService are UUID distinguished by attributes
  • 6. Search for the characteristics of a service

    • A service can have a number of features
      • Each feature is responsible for the reading or writing of a very small function point
        • Bluetooth chips are small and memory is low, so units are binary bytes byte , even bits in bytesbit
  • 7. Sending data to features

    • Reading data is also read from the feature
    • In general development, the Bluetooth protocol document will tell you what characteristics are responsible for sending what data, and the data format will tell you
      • Common Bluetooth protocol Data format has byte / bit / ASCII码 , will eventually be converted to binary send
1.3-Bluetooth connection Core Technology Point Introduction
      • 1. The Bluetooth send data is ultimately sent by feature CBCharacteristic , we scan the hardware (peripherals), discover the services of peripherals, the ultimate goal is to find the corresponding characteristics

      • 2. The core content of Bluetooth is not the code, the code is fixed. The core is the protocol, the general Bluetooth data protocol will be encrypted, if not encrypted, anyone can connect your hardware to send data to your hardware

        • Unfortunately, the first generation of millet bracelet is actually not encrypted, so we will write the demo can send data to Xiaomi bracelet
      • 3. In the development of Bluetooth, be sure to pay attention to the Bluetooth chip reception rate

        • For example, the poor quality of the chip, need 5ms to read the data, and we app2ms a frequent transmission of data, it will cause some data can not be hardware identification
          • This is called data loss.

iOS Bluetooth Connection process Introduction-1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.