BLE属性格式权限属性声明
前言:
BLE属性的分类(四大类):
Primary Service(首要服务项)
Secondary Service(次要服务项)
Include(包含服务项)
Characteristic(特征)
本次主要对属性权限的使用进行描述:
先看协议
Attribute permissions are a combination of access permissions, encryption permissions, authentication permissions and authorization permissions.
The following access permissions are possible: //访问权限
• Readable //可读
• Writeable //可写
• Readable and writable //可读可写
The following encryption permissions are possible://加密权限
• Encryption required //需要加密
• No encryption required //无需加密
The following authentication permissions are possible://身份认证权限
• Authentication Required //需要身份验证
• No Authentication Required //无需身份验证
The following authorization permissions are possible://授权权限
• Authorization Required //需要授权
• No Authorization Required //无需授权
CH57X/CH58X/CH59X中关于这部分的声明:
#define GATT_PERMIT_READ 0x01 //!< Attribute is Readable #define GATT_PERMIT_WRITE 0x02 //!< Attribute is Writable #define GATT_PERMIT_AUTHEN_READ 0x04 //!< Read requires Authentication #define GATT_PERMIT_AUTHEN_WRITE 0x08 //!< Write requires Authentication #define GATT_PERMIT_AUTHOR_READ 0x10 //!< Read requires Authorization #define GATT_PERMIT_AUTHOR_WRITE 0x20 //!< Write requires Authorization #define GATT_PERMIT_ENCRYPT_READ 0x40 //!< Read requires Encryption #define GATT_PERMIT_ENCRYPT_WRITE 0x80 //!< Write requires Encryption
后续补充实际应用;