Bluetooth 40 BLE protocol stack study TI CC2540 CC2541 OSAL

 

1. Bluetooth:

Support A is a short-range wireless communications technology, the main work in the 2.4GHz band. Now divided into five versions 1.1,1.2,2.0,3.0,4.0 (4.1), three devices are now available in the popular tradition Bluetooth (Bluetooth referred to as BR), low-power Bluetooth (bluetoothSmart that is referred to as Bluetooth Low Energy BLE, Bluetooth 4.0 (BluetoothSmartReady i.e., a BR + BLE))

b traditional Bluetooth Bluetooth 4.0, Bluetooth low energy and high-speed Bluetooth three conventional synthesis. There are two general modes in which (SM -> Support (BLE) and a dual mode -> Support (BLE + BR)). We use the CC2540 single-mode chip.

c the BLE Bluetooth (Bluetooth low energy Bluetooth Low Energy) 4.0 defines two bands 2.4Ghz (16 channels 896 / 915MHz (896M 915M a ten channel channel), a total of 27 channels.

  Speed: Support short packet data rate at 1Mbps. All connections are Bluetooth 2.1 breath added deceleration mode (sniff subrating) to achieve ultra-low duty cycle

  FH: Bluetooth specification adaptive frequency hopping

  The main control: more intelligent, can sleep longer and wake up only when needed before performing an action.

  Delay: allows the connection and the data transmission is provided in 3ms.

  Range: modulation index increase, the maximum range to 100m

  Robustness: All packets have been 24bitCRC check. To ensure maximum withstand interference.

  Security: AES128 CCM encryption algorithm for data packet encryption and authentication.

  Topology: each packet is received with each of 32-bit addressing, in theory, can be connected to one billion devices. For connecting one connection, and supports many new topologies.

d Bluetooth 4.0 total of 40 channels are distributed in 2.4GHz, which 0.12.39 three channels to broadcast information.

e bluetooth 4.0 low power consumption due to attracting attention. Is an upgraded version 3.0, more than 3.0 power, lower cost, low-latency 3ms, operably linked to long distance, AES-128 encryption;

 

2.BLE

One kind of a. Bluetooth 4.0 specification, there are up to 7 wherein the master peripherals, low power, low latency, low throughput.

b.

Six kinds of device status

  Standby state (standby): and the transmission device does not transmit data, and nothing is connected to

  Broadcast state (Advertiser): periodically broadcasting state

  Scan Status (Scanner): actively looking for is broadcasting equipment

  Link initialization state (Initiator): initiate connections to the scanning device.

  The master device (Master): to connect to other devices as a master device.

  Connected as a slave device to other devices: slave (Slave).

Five operating state

  Ready (standby), broadcasting (advertising), monitor scan (Scanning), initiate a connection (Initiating), connected (Connected)

Four kinds of device type

  Cnetral host (often as the client): such as mobile phones, PC

  Peripheral slave (often as a Service end): The heart rate meter, blood glucose meter

  Observer observer:

  Broadcast Broadcasters:

The connection process:

Peripheral Open Broadcast -> Central scanned from broadcasts -> Peripheral Central receiving the scan request, the Peripheral Central sends a scan response data -> Central initiates a connection to Peripheral -> start communication.

c. BLE connection parameter in (connection confirmation response signal ConnectionEvent == -> most cases the devices are in the Sleep state, each packet ConnectionEvent initiated by the Master, the reply Slaver)

Parameter 1: Connection Interva -> l idle value between two ConnectionEvent, in units of 1.25ms, the minimum 7.5ms, maximum 4s.

Parameter 2: Slave Latency -> Slaver device has no data to send, to skip a certain number of values ​​of ConnectionEvent, Rang: 0-499.

Parameter 3: Supervision Timeout -> timeout, that is, two communication devices do not occur at this time a value resulting from connection of the connector is automatically disconnected. Range (10ms ----- 32s) but must meet the following criteria parameters 3> = Parameter 1 * (2 + 1 parameters).

d. compatibility

BLE protocol structure

  1. Structure can be divided into three layers (

Control layer (controller) à (HCI, LL, PHY))

Protocol layer (Host) à (L2CAP, SM, ATT, GATT, GAP)

Application layer (App) à (GATT Profile and GAP Role / Security Profiles)

  1. The layers logic unit

A PHY à Physical layer: The main circuit portion and the radio frequency

LL à link control layer: to control the physical layer is provided by the calculator

The HCI à communication layer: providing a standardized interface and to the host controller, the api layer may be implemented by software or hardware UART SPI USB interface to be controlled

The L2CAP à Logical Link Control and Adaptation Layer: responsible for distributing events and logical link connection located above the baseband protocol.

L2CAP provides connection-oriented data services and connections to the upper free. Its features include: protocol multiplexing capability, packet segmentation and reassembly, and extracting data set. L2CAP permits higher level protocols and applications to send and receive data packets up to 64Byte

SM à security service layer: Provides key pair issued, to achieve security and data exchange link

ATT à attribute level: BLE is a very important one, all the data go through this layer, called the display attribute server, the client called paired. The host device can be a server can also be a client

Client and Server provides two roles, data exists Service end, there is to Attribute form, Client places to read or write way to operate the Server side data

The GATT à defined using ATT's service framework

GATT provisions of the profile (profile) structure. BLE data blocks in all of the profile or service use are called "characteristic" characteristic, more refined depending on the nature of the data transmission into classes based on a specific and marked ATT layer UUID (ATT each class has a unique UUID)

The GAP à mainly used for device discovery, connection establishment, some control of broadcast transmission and reception

APP layer: Profile is defined in a specific environment, also has the same UUID

 

  1. Glossary

Profile <br> : can be understood as a specification, Bluetooth provides a series of organized Profile, such as heart rate monitor, anti-lost the like. Each Profile will be included in multiple Service

Service : service can be understood as a slave by a plurality of services (e.g., service charge information, system information services, etc.), each of which contains a plurality of Service Characteristic feature values ble. Characteristic feature value is bel subject, (eg: 80% of the amount of points from the profile in the machine, so that the host can read the data by 80% by the presence of this will Characteristic Characteristic features of the value of electricity.)

Characteristic : Characteristic features of value, the main communication machines are all achieved by Characteristic from, can be understood as a label, you can get what you want or written by this tag

UUID : unified identification code we have just mentioned Service and Characteristic, requires a unique UUID to identify.

 

CC2540

  1. Chip features

Internally by a 51 constituted substantially peripheral and core clock frequency of up to 32MHz , the machine cycle is one clock cycle,

It has an internal RC oscillator, 8KBRAM , 256KBFlash

5 channels the DMA , . 1 th 16 bits two . 8 -bit timers, infrared generating circuit, 32KHz a capture sleep timer function

Digital signal strength indicator ( the RSSI ), and a battery monitoring temperature sensor, 8 -channel 12 is bit the ADC , 2 th the UART , the USB

Has SmartReadyBlueTooth two modes , CC2541 supports ( BR and BLE mode)

Transfer rate: less than 100kbps

  1. Pin assignment

  1. smallest system

  1. OSAL system

  1.  
Published 25 original articles · won praise 4 · views 20000 +

Guess you like

Origin blog.csdn.net/zhou8400/article/details/90411434