Introduction to the Bluetooth Sig Mesh concept ③——Layered architecture


Insert picture description here

一、Model layer

model defines a node support 功能特性, each model defines its own op codeand status.

  • For example generic onoff model, defined Generic ON/OFF/GET/STATUS.
  • such as……

When Provisioner is networking

  • It will pass get composition datacommand to get all the support node model id
  • Then Provisioner can know what functions the node specifically supports
  • Then the Provisioner knows what to send to the nodeop code

Model is divided into server model and client model.

  • server model: It is a controlled character with its own state, which can be changed and acquired by other nodes
    • For example, a Led device withonoff server model
    • You may receive onoff set/getcommands (issued by the command control switch App)
    • Can reply onoff statuscommand (command App query Led state)
    • But the LED can not own it sends out onoff set/get 命令and onoff statuscommand
  • client model: It is a role that controls the server node, without its own state
    • For example, a Bluetooth remote control withonoff client model
    • May send a onoff set/getcommand (remote control LED or other device)
    • You may send a onoff statuscommand (Check status LED or other device)
    • But can not reply to received onoff statuscommands, it will not process the received onoff set/getcommand

二、Foundation Model layer

Foundation Model and the model is basically the same model, is the foundation model, includes Configuration Server model, Configuration Client model, Health Server model, Health Client model.

  • All nodes to be distributed must containConfiguration Server model
  • The provisioner node must containConfiguration Client model

The common op codes contained in these two models are subscription add/delete (group number addition/delete), etc., and the encryption of the access layer layer of these two models uses the device key, so generally speaking, only the provisioner node can send the configuration The set/get commands of model.

Three, Access layer

In short, one sentence

Combine op code and parameter in a prescribed format.

四、Transport layer

Use app key or device key (used by configuration model) for encryption and decryption. Determine and confirm whether it is necessary to implement subcontracting and grouping agreements.

At present, in order to be compatible with devices that do not support long broadcast packets such as BLE4.2, the maximum payload of adv is uniformly set to 31 bytes.

Five, Network layer

For the sending process

  1. Add a sequence number to the data packet, etc.
  2. And use network key, iv index to encrypt the data
  3. After sending, the sequence number will perform the "plus 1" operation

For the receiving process

  1. Use network key, iv index to decrypt the data
  2. After decryption, determine whether the sequence number is valid (that is, whether it is greater than the received value)
  3. If it is invalid, discard it

六、Bearer layer

The encrypted data has been performed by the packet typeis LL_TYPE_ADV_NONCONN_IND(0x02)transmitted to the broadcast packet meshnetworks.

If you think it’s good, just one click for three consecutive chants (Like+Favorite+Follow)

Guess you like

Origin blog.csdn.net/kangweijian/article/details/115264253