4)清除EIK(Clear ephemeral identity key) 如果Seeker设备要移除Provider设备,解除它们之间的配置关系,可以发送这条命令。Seeker传递数据的additional data部分的数据: The first 8 bytes of SHA256(ephemeral identity key || the last nonce read from the characteristic) SHA256(临时身份密钥 || 从特征值读取的最后一个随机数)结果的前 8 个字节。所以Provider需要验证两次,一次是一次性认证密钥认证,一次是SHA256哈希值验证。确保了Seeker要删除的EIK和Provider拥有的EIK是同一个EIK。验证通过后,Provider删除EIK,并立刻停止FMDN frames广播。 具体的处理过程可以参考函数: static ssize_t ephemeral_identity_key_clear_handle(struct bt_conn *conn, const struct bt_gatt_attr *attr, struct net_buf_simple *req_data_buf)1.6.2信标配置密钥恢复请求命令(Beacon provisioning key recovery request)如果Seeker的EIK丢失了,可以通过这条命令,从Provider设备上读取EIK。这个读取的过程是有条件的,Provider需要处于Recovery mode。协议建议用户执行一个操作进入Recovery mode 。我们例子是按下DK上的button4,按键时间3-7秒。Recovery mode持续一段时间后( CONFIG_BT_FAST_PAIR_FMDN_READ_MODE_FMDN_RECOVERY_TIMEOUT)自动退出。 命令格式如下: Provider设备验证一次性认证密钥通过之后返回加密的EIK(32 bytes that are the ephemeral identity key, AES-ECB-128 encrypted with the account key)给Seeker。 具体的处理过程可以参考函数: static ssize_t ephemeral_identity_key_read_handle(struct bt_conn *conn, const struct bt_gatt_attr *attr, struct net_buf_simple *req_data_buf)1.6.3响铃请求命令(Ringing request)Seeker通过发送响铃请求命令控制Provider播放声音或获取响铃状态。格式如下: 有两个子命令,Ring和Read ringing state。Ring命令的additional data的数据如下: 对ring命令的回复数据格式如下: Read ringing state命令没有additional data, 回复Read ringing state命令的数据格式如下: Ring和Read ringing state命令的处理函数是 static ssize_t ring_handle(struct bt_conn *conn, const struct bt_gatt_attr *attr, struct net_buf_simple *req_data_buf)和static ssize_t ringing_state_read_handle(struct bt_conn *conn, const struct bt_gatt_attr *attr, struct net_buf_simple *req_data_buf)1.6.4不必要的跟踪保护请求命令(Unwanted tracking protection request)这个命令用于使能或禁止unwanted tracking protection功能。功能禁止的状态下, unwanted tracking protection相关的Bluetooth LE特征不允许被访问。命令格式如下: 命令处理函数是 static ssize_t activate_utp_mode_handle(struct bt_conn *conn, const struct bt_gatt_attr *attr, struct net_buf_simple *req_data_buf)和static ssize_t deactivate_utp_mode_handle(struct bt_conn *conn, const struct bt_gatt_attr *attr, struct net_buf_simple *req_data_buf)1.6.5命令响应Provider通过write response响应Seeker,通过notification返回数据给Seeker。 如何命令错误或是验证不通过,write response的GATT error code如下所示: 正常的notification返回数据的格式如下:
|