完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我可以得到一个真正的明确的例子,如何做只读BLE调用,我已经阅读了10个应用笔记,我的代码不起作用。
我的代码在这一步的结尾。 Re: CyLay-EvtgGATSsRead Syrq-识别哪个特性被读取 以上来自于百度翻译 以下为原文 Could I get a real clear example of how to do read only BLE call, I have read through 10 app notes and my code does not function. My code is at the end of this tread. Re: CYBLE_EVT_GATTS_READ_REQ - Identify which characteristic was read |
|
相关推荐
7个回答
|
|
你好,
我认为你需要作出修改指向特性处理如下,点属性处理 CysLyEvtggsStRead SuthChan-ValasAccess Req: 如果(cyble_status_status_char_handle = = read_request_param - >;attrhandle) { Stavas.Trac句柄=6; Stay.Value.Val=和状态; Stuts.Value.StimelLee=1; } 断裂; 以上来自于百度翻译 以下为原文 Hello, I think you need to make the modification to point to the characteristic handle as below, point to the attribute handle case CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ: if(CYBLE_STATUS_STATUS_CHAR_HANDLE == read_request_param->attrHandle) { STATUS.attrHandle = 6; STATUS.value.val = &Status; STATUS.value.actualLen = 1; } break; |
|
|
|
sdfjaslkdjf1 发表于 2018-8-14 07:52 我感谢您的努力,但这似乎与文档不一致。事件的结构没有值或长度字段。这是我的尝试。此外,还必须将事件指定为PARAM并定义状态。 CyLeLeVeT.GATSDS-Read SkyCalvAvAccess CyLuxGaStS.CalasValaRead CyBLY-GATSSA-CHARYA VALL Read 数据字段 CysLy-Couth-Hand CyBLY-GATHYBDADARTHOADYLE CyBLY-GATHEGETRIELCODET反恐代码 为什么没有一个简单的只读命令,比如写? 以上来自于百度翻译 以下为原文 I thank you for your effort, but this seems inconsistent with the documentation. The structure for the event has no value or length field. Here is my attempt to use this. Also you have to assign the event a param and define the status. CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ Event parameter type is CYBLE_GATTS_CHAR_VAL_READ_REQ_T. struct CYBLE_GATTS_CHAR_VAL_READ_REQ_T Data Fields • CYBLE_CONN_HANDLE_T connHandle • CYBLE_GATT_DB_ATTR_HANDLE_T attrHandle • CYBLE_GATT_ERR_CODE_T gattErrorCode Why is there not a simple read only command, like the write? |
|
|
|
hvyweyrrwwrr 发表于 2018-8-14 08:08 CyblieEvtgAgtsgRead SkyChanValAccess的Req事件是每当客户端从服务器读取数据时生成的。 使用事件参数,您可以识别从客户端请求读取的属性句柄。 例如,在下面的情况下,检查属性句柄是否为RGB数据,并且相应地打印一条消息。 cyble_gatts_char_val_read_req_t rdresponse; . . . 案例cyble_evt_gatts_read_char_val_access_req: RdRease= *(CyLygGasthsChan-ValeRead)ReqPrAt*; 如果(rdReff.AtHuffRe= = CyByrgbbLeDyService)RgbbEdLyPrimixgCARIAL句柄) { uart_uartputstring(“读取RGB数据n”); } 断裂; 请让我们知道你想更详细地完成什么,这样我们可以帮助你。 谢谢, 兰吉特 自定义profile_readresponse.zip 4.7兆字节 以上来自于百度翻译 以下为原文 CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ event is generated every time a client reads data from the server. Using the event parameters you can identify the attribute handle for which the Read was requested from the Client. For example in the below case the attribute handle is checked if it is for RGB data and correspondingly a message is printed. CYBLE_GATTS_CHAR_VAL_READ_REQ_T rdresponse ; . . . case CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ: rdresponse = *( CYBLE_GATTS_CHAR_VAL_READ_REQ_T * ) eventParam; if( rdresponse.attrHandle == CYBLE_RGB_LED_SERVICE_RGB_LED_CHARACTERISTIC_CHAR_HANDLE ) { UART_UartPutString("Read RGB datan"); } break; Can you please let us know what are you trying to accomplish in more detail, so that we can help you. Thanks, Ranjith |
|
|
|
sdfjaslkdjf1 发表于 2018-8-14 08:26 如果我不清楚,我很抱歉。我要做的是让应用程序在GATT数据库中读取数据,作为电池值的例子,他在启动时读取它,如果状态字指示电池问题。否则,嵌入式程序只跟踪它并更新其值,不需要通知。 所以我要的是一个应用程序只做一个读取值的嵌入式程序不断更新的例子。 在你的例子中,读好像激活了一个函数,但是那个事件是如何把数据传递给应用程序的呢? 以上来自于百度翻译 以下为原文 I am sorry if I was not clear. What I am trying to do is have the app read data in the gatt data base, as an example the battery value, he reads it on start up, and if the status word indicates a battery issue. Otherwise the embedded program just tracks it and updates the value, there is no need for a notification. So want I want is an example of the app do a read only of a value the embedded program updates continuously. In your example is seems the read is activating a function, but how does that event pass the data back to the app? |
|
|
|
hvyweyrrwwrr 发表于 2018-8-14 08:38 一个读请求从客户端到服务器的处理由堆栈。不需要任何事情都要从应用程序中的服务器端进行。 上述事件发生在服务器端,你可以跟踪如果读取客户端发送的请求。 以上来自于百度翻译 以下为原文 A read request from the client to server is handled by Stack. There is no need for anything to be done from the server side in the application. The above event is generated on server side so that you can track if a read request was sent by client. |
|
|
|
sdfjaslkdjf1 发表于 2018-8-14 08:44 我一直在阅读你发送的文件,谢谢。 如果我理解正确,读取数据的方法是建立一个服务写了这样,这个应用程序服务的地位将回读的价值地位。即使状态是已知的有一个很好的价值,应用程序读取返回10,如果我能写,写它,它的值写入和读取应用程序发送,嵌入式程序的数据是不让它通过? CyBLY-GATHAL; 定义StasuxCARYA DATAYLLN 1 UIT8 8 BLULYSTATE=0; UIT8状态=0; /*状态* 如果(cyble_status_status_value_char_handle = = write_request_param - >;handlevalpair。attrhandle) { / / ble_status = write_request_param - >;handlevalpair。价值。价值[ 0 ]; 状态; 状态句柄= CyLabyStasuStAuthSuValueS.Curl句柄; Sturas.Value.Val=和BulyStand; Stasual.Val.Le= StutsSuxCaldDaaaLLeN; cyble_gattswriteattributevalue(&;地位,虚假,&;connhandle,假); } 以上来自于百度翻译 以下为原文 I have been reading through the files you sent, thank you. If I am understanding correctly, the way to read data is to set up a service and write to it like this, with this the app service for STATUS would read back the value in Status. Even when Status is known to have a good value, the app reads back a zero, if I enable write, and write to it, it writes and reads only the value the app sends, the embedded program data is not making it through? CYBLE_GATT_HANDLE_VALUE_PAIR_T STATUS; #define STATUS_CHAR_DATA_LEN 1 uint8 BLE_Status = 0; uint8 Status = 0; /*STATUS*/ if(CYBLE_STATUS_STATUS_VALUE_CHAR_HANDLE == write_request_param->handleValPair.attrHandle) { //BLE_Status = write_request_param->handleValPair.value.val[0]; BLE_Status = Status; STATUS.attrHandle = CYBLE_STATUS_STATUS_VALUE_CHAR_HANDLE; STATUS.value.val = &BLE_Status; STATUS.value.len = STATUS_CHAR_DATA_LEN; CyBle_GattsWriteAttributeValue(&STATUS,FALSE,&connHandle,FALSE); } |
|
|
|
hvyweyrrwwrr 发表于 2018-8-14 08:58 Gyan,我想我现在明白了,要阅读,GATT数据库的更新必须在事件处理程序之外完成,必须在事件处理程序内完成写入操作。如果我是正确的,我想这就是逃避我的答案。 我现在可以正确地阅读我的价值观,谢谢。 草本植物 以上来自于百度翻译 以下为原文 Gyan, I think I understand now, to read, the update to the GATT database must be done outside the event handler, a write must be done inside the event handler? I think this is the answer that escaped me, if I am correct. I can now read my values correctly, thank you. Herb |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2071 浏览 1 评论
1827 浏览 1 评论
3642 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1762 浏览 6 评论
1513 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
511浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
362浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
860浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 10:08 , Processed in 0.946602 second(s), Total 91, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号