到目前为止,我所有的自定义特性都有一个数据字段,例如一个U
tiT8。当使用多个数据字段时,它们是如何单独管理的?下面是更新特性的代码:
空更新特性(UTI8*数据,UTIN 16 LUN,UIT16 16)
{
/*'句柄'存储数据参数*/
CyBLY-GATHAL
/*用新的值更新句柄*/
FACTHORACLE = FACTHART;
Val.Val.=数据;
把手;
*更新属性值。这将允许
*客户端设备读取现有值
*特性*/
CyByggAgsRead属性值(&
错误的,
CysLy-Con句柄,
CysLyggtAdBdPeer-Surl启动;
/*向接收的写入请求发送响应。*/
聚伞花序柄;
}
谢谢
丰富的
以上来自于百度翻译
以下为原文
Up until now all my custom characteristics have had a single data field, e.g. one uint8. When using multiple data fields, how are they individually managed? Here is my code that updates a characteristic:
void Updatecharacteristic(uint8* Data, uint16 len, uint16 attrHandle)
{
/* 'Handle' stores data parameters */
CYBLE_GATT_HANDLE_VALUE_PAIR_T Handle;
/* Update handle with new values */
Handle.attrHandle = attrHandle;
Handle.value.val = Data;
Handle.value.len = len;
/* Update the attribute value. This will allow
* Client device to read the existing values over
* characteristic */
CyBle_GattsWriteAttributeValue(&Handle,
FALSE,
&cyBle_connHandle,
CYBLE_GATT_DB_PEER_INITIATED);
/* Send the response to the write request received. */
CyBle_GattsWriteRsp(cyBle_connHandle);
}
Thanks
Rich