BLE-NRF51822 Tutorial 1-Common Concepts

http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=28852942&id=5213583


1: How does the host know the existence of peripheral devices:

         Peripherals broadcast information.

The host actively scans, and the peripheral device replies to the scan response to inform the host.

2 : Discoverable mode: set by the flag in the broadcast .

         Limited discoverable mode: the broadcast interval is fast, but the maximum can only last up to 30s

         General discoverable mode: The broadcast interval is relatively slow, and the broadcast has no maximum time limit.

3 : Broadcast channel:

There are 3 broadcast channels and 37 data channels in BLE . Broadcast data will be sent in 3 broadcast channels after each broadcast interval expires

4 : Broadcast data:

The maximum data load of the BLE link layer is 296 bytes. Because the device address is required in the broadcast data, the effective data is 31 bytes.

5 : Address:

         You can use a random address or a registered public address .

         The highest two bits of the random address are 1

6 : More broadcast data:

         If you need to broadcast more than 31 bytes of data, you need to use a scan response. The host needs to send a scan request.

7 : Broadcast and scan parameters:

         Broadcast interval: broadcast transmission period

         Scan interval: scan period.

         Scan window: the duration of the device scan after the scan period comes.

8 : Connection parameters:

         Connection interval: The period of connection. The device can only exchange data when the connection period is up.

Slave delay: in units of connection interval. This parameter indicates how many connection events the slave device can ignore before it must listen to its own receiver to receive possible data sent by the master device.

         Monitoring timeout time: If the connection is lost within this time range, a timeout event will be generated.

9 : Notice and instructions:

BLE is based on the server - client method to transmit data. The server maintains a security device, which contains the state and information disclosed by the server. The client accesses the server through the attribute protocol. In this mode, it is usually initiated by the client and the server returns the data. However, in some applications, such as power services, it is impossible for the client ( such as a mobile phone ) to train the power value on the server, but the server should actively send data to the client when the power changes.

Notifications and instructions are the way that the server actively initiates data created for this application. The difference is that the notification only sends data without confirmation. The instructions require the client to reply and confirm, so it is considered a reliable transmission.

10:  Properties:

         A labeled piece of data that can be addressed. It consists of three types of values: handle, type, and value.

11 : Features:

It can be seen as a combination of one or several attributes. Contains three basic elements: declaration, value, and descriptor. ( Each of these three is an attribute )

声明:一条属性,值域中包含三个字段:特性性质(//通知等等),特性数值句柄(数值属性的地址),属性uuid(用来识别特性数值的类型)

数值:一条包含特性数值的属性。

描述符:一个特性可以包含0或多个特性描述符。客户端特性配置描述符(CCCD),特性表示描述符等。

12:属性协议(AP),通用属性规范(GATT),通用访问规范(GAP)

       低功耗蓝牙采用的是客户-服务器模型,属性协议定义了客户端与服务器如何相互发送符合标准的消息。属性协议由六种基本操作构成:请求,响应,命令,指示,通知,确认。(当然每种操作下又含有不同的‘操作’,比如请求又分读取请求,写入请求等)

       通用属性规范:定义了如何发现与使用服务,特性与描述符的标准方法。主要有发现规程(服务,特性的发现),客户端发起规程(客户端的读写等),服务器发起规程(通知,指示)

       通用访问规范:定义了设备如何彼此发现,建立连接以及如何实现绑定,同时描述了设备如何成为广播者和观察者,并且实现无连接的数据传输。

 

13:配对和绑定:

          起初并未提供安全性的两个设备如果希望做一些需要安全性的工作,首先必须配对。配对过程 涉及 :配对信息的交换,链路认证。如果设置了绑定位,还会有秘钥的分发,分发的秘钥可以存储下来。当下次需要安全链路时便可不必再次配对。


Guess you like

Origin blog.csdn.net/lilifang_2011/article/details/72876592