完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
是否有可能将应用程序中的GATTEVANT用于BLE标准服务,如设备信息服务、电池服务等。 我查看了设备信息示例应用程序,在主init中设置了DB值,读取事件由堆栈处理。 实际上,我们要处理所有的事件在应用程序级,因为我们从外部MCU获得所有信息。 谢谢和问候, 沙朗 以上来自于百度翻译 以下为原文 Hi, Is it possible to handle the GATT events in the app level for the BLE standard services such as device information service, battery service etc. I looked at the device info example application, the db values are set during main init and the read events are handled by the stack. Actually we want to handle all the events at the application level as we get all information from an external MCU. Thanks & Regards, Sharan |
|
相关推荐
13个回答
|
|
所有标准服务事件都在堆栈中处理。请检查事件处理程序的BuryEvEnthDANL.C。
以上来自于百度翻译 以下为原文 All the standard service events are handled in the stack. Please check the BLE_eventhandler.c for the event handlers. |
|
|
|
你好,
那没有回答我的问题。 我的意思是为了接收标准服务事件,我需要做些什么。正如我在前面的文章中所说的,我们需要在应用程序中处理这些事件,因为我们与外部MCU接口。 请让我知道有没有办法接收这些事件? 谢谢和问候, 沙朗 以上来自于百度翻译 以下为原文 Hi, That didn't answer my question. I meant what do I need to do in order to receive the standard service events. As I said in my earlier post that we require these events to be handled in the application because we are interfacing with an external MCU. Please let me know is there way to receive these events? Thanks & Regards, Sharan |
|
|
|
36切53 发表于 2019-1-30 14:10 你好,沙兰, 你可能想看看最近发布的EZ系列固件平台: http://www.cypress.com/documentation/software-and-drivers/ez-serial-ez-ble-module-firmware-platform 用户指南页面上包含了所有的信息,你需要告诉是否适合你想要做什么。 这个平台或类似的东西,要做你所需要的;有一般的主机级的事件暴露到外部MCU没有通用的协议,因此它必须通过桥接的组件API某种主机接口模块应用固件实现。EZ serialdoes在UART接口使用文本模式和二进制模式的串行协议。 杰夫 以上来自于百度翻译 以下为原文 Hello Sharan, You may want to check out the recently released EZ-Serial firmware platform: http://www.cypress.com/documentation/software-and-drivers/ez-serial-ez-ble-module-firmware-platform The User Guide available on that page contains all of the information you should need to tell whether it would be a good fit for what you're trying to do. This platform or something like it will be necessary to do what you need; there is no universal protocol for exposing general host-level BLE events to an external MCU, so it has to be implemented in module application firmware by bridging the BLE Component APIs to some kind of host interface. EZ-Serial does this using a text-mode or binary-mode serial protocol over the UART interface. Jeff |
|
|
|
嗨,Jrow,
我明白你想说什么,但是我们不需要像BLE模块一样。我们在CyPress芯片上写下了完整的应用程序。我们有一个外部MCU的一些其他原因。 但是我们希望在APP级别处理所有服务器事件(标准和定制服务)(BLE事件回调)。对于E.G,可以在APP级别处理设备信息服务特性的读取请求,并发送读取响应。 这在市场上大部分的BLE解决方案中都是可能的。 注: 目前,我们正在评估CyPress BLE 4.2芯片为我们的未来产品。 谢谢和问候, 沙朗 以上来自于百度翻译 以下为原文 Hi Jrow, I understand what you're trying to say but we don't need serial like BLE module. We writing our complete application firmware on Cypress BLE chip. We have an external MCU for some other reasons. But we want handle all the servers events(standard and custom services) at the app level(BLE event callback). For e.g Is it possible to handle the read request of the device info service characteristic at the app level and send a read response. This is quite possible in most of the BLE solutions in the market. Note: Currently we are evaluating the Cypress BLE 4.2 chip for our future products. Thanks & Regards, Sharan |
|
|
|
36切53 发表于 2019-1-30 14:44 嗨,沙兰, 在这种情况下,是的,它是可能做您自己的自定义应用程序以及。有两个选项;第一是使所有的事件被传递到应用程序通过设置正确的旗帜: CybLyEvEnthand Leer-FLAG=CyBelyEnabl ALE事件; 这将保留的内置功能,但也允许事件后部分回调处理程序达到使用回调函数处理它。 另一种选择是增加或修改代码中的generated_source文件夹,PSoC Creator建立中的应用。例如,调整#定义宏在blename_gatt .h文件开始通常在50线左右,各种配置文件启用: 定义CyByLyDIS定义CyByLyDISServer 如果你评论这些线或完全删除它们,然后组件的内置事件处理程序,这些公司不会跑,只有你的应用程序将收到。另外,请记住,这种方法修改生成的代码-- PSoC Creator --将需要重新应用这些修改任何代码再生。这发生在一个“干净”的操作或项目示意图或设计变更后的广泛资源。 你提到的具体案例(读请求允许应用程序拦截响应)是通过cyble_evt_gatts_read_char_val_access_req事件处理,进行了源代码与下面的评论: /××事件参数的类型是cyble_gatts_char_val_read_req_t。它是触发服务器端,客户端发送的读请求和当特征有cyble_gatt_db_attr_char_val_rd_event属性设置。这一事件可以被应用程序除非需要通过错误响应,需要设置的参数gatterrorcode场响应事件。*/ 请注意,事件参数,指向型cyble_gatts_char_val_read_req_t数据,没有一个结构域的实际数据,返回。换句话说,事件参数(指针)不改变发送回客户端的数据提供了一种方法。然而,参数包括属性处理,和这个你应该能够修改与cyble_gattswriteattributevalue API方法属性的内容。 我不确定这是否发生之前或之后的属性数据被加载到用于传输的数据包的缓冲区,但我认为为了效率的缘故(如果一个错误代码集),它发生在。 以上来自于百度翻译 以下为原文 Hi Sharan, In this case, yes, it is possible to do this with your own custom application as well. There are two options; first is to enable all events being passed up to the application by setting the correct flag: cyBle_eventHandlerFlag |= CYBLE_ENABLE_ALL_EVENTS; This will retain the built-in functionality, but also allow the event to reach the application callback handler after the component callback handlers processes it. The other option is to augment or modify the code in the Generated_Source folder that PSoC Creator builds for the application. For example, tweaking the #define macros in the BLEName_gatt.h file starting usually around line 50 or so where various profiles are enabled: #define CYBLE_DIS #define CYBLE_DIS_SERVER If you comment these lines out or remove them entirely, then the component's built-in event handlers for these profiles won't be run, and only your application handler will receive them. Also, keep in mind that this approach--modifying PSoC Creator generated code--will require re-applying those modifications any time the code is regenerated. This occurs after a "clean" operation or after any change to the project schematic or design-wide resources. The specific case you mention as an example (read request to allow the application to intercept the response) is handled via the CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ event, described in the source code with the following comment: /** Event parameter type is CYBLE_GATTS_CHAR_VAL_READ_REQ_T. It is triggered on server side when client sends read request and when characteristic has CYBLE_GATT_DB_ATTR_CHAR_VAL_RD_EVENT property set. This event could be ignored by application unless it need to response by error response which needs to be set in gattErrorCode field of event parameter. */ Note that the event parameter, a pointer to data of type CYBLE_GATTS_CHAR_VAL_READ_REQ_T, does not have a structure field for the actual data which is returned. In other words, the event parameter (pointer) does not provide a way to change the value data that is sent back to the client. However, the parameter does include the attribute handle, and with this you should be able to modify the contents of the attribute with the CyBle_GattsWriteAttributeValue API method. I am not certain whether this occurs before or after the attribute data has been loaded into the packet buffer for transmission, but I would assume for efficiency's sake (in case an error code is set) that it happens before. |
|
|
|
嗨,Jrow,
感谢详细的解释。非常感谢。 我希望在响应于CyyBuffEvtGATSsIRead SkyChanValAccess的Req之后加载包缓冲区。否则,对于应用程序的逻辑来说将是棘手的。如果不是,修理它不是一个好主意吗? 不管怎样,我会验证这种行为。 谢谢和问候, 沙朗 以上来自于百度翻译 以下为原文 Hi Jrow, Appreciate the detailed explanation. Thank you very much. I hope that packet buffer is loaded after responding to the CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ. Otherwise it would be tricky for the application's logic. If not isn't it a good idea to fix it? Anyways I'll verify the behavior. Thanks & Regards, Sharan |
|
|
|
嗨,Jrow,
请告诉我如何以编程方式启用所有事件,是否有API可用? CybLyEvEnthand Leer-FLAG=CyBelyEnabl ALE事件; 谢谢和问候, 沙朗 以上来自于百度翻译 以下为原文 Hi Jrow, Can you please tell me how to enable all the events programmatically, is there an API available? cyBle_eventHandlerFlag |= CYBLE_ENABLE_ALL_EVENTS; Thanks & Regards, Sharan |
|
|
|
36切53 发表于 2019-1-30 15:29 嗨,沙兰, 直接将CybLyEnabeLeAlLePvices位掩码分配给CybLyEvEnthDelLeFrand变量的代码行是我知道设置该标志的唯一方式。我不相信有一个单独的API来设置它。 所有事件都是在内部生成的,不管这个设置如何,但是组件的自动生成的CyByLyEvEnthDrand方法可能会在应用程序处理程序获得该事件之前消耗一些事件。 以上来自于百度翻译 以下为原文 Hi Sharan, The line of code directly assigning the CYBLE_ENABLE_ALL_EVENTS bitmask to the cyBle_eventHandlerFlag variable is the only way that I know of to set that flag. I don't believe there is a separate API to set it. All events are generated internally regardless of this setting, but the component's auto-generated CyBle_EventHandler method may consume some events before your application handler gets them unless this flag is set. |
|
|
|
嗨,Jrow,
今天我试过了,应用程序没有收到EndoCyByEvtggssIAddixCalvaValAccess的Req。 主要的入口使所有事件都能发生。 谢谢和问候, 沙朗 以上来自于百度翻译 以下为原文 Hi Jrow, I tried it today, the application didn't receive the event CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ. Enabled cyBle_eventHandlerFlag in the main entry to receive all the events. Thanks & Regards, Sharan |
|
|
|
36切53 发表于 2019-1-30 15:46 嗨,沙兰, 在/派生的源代码/PSoC4/BLIG.GATT.C源文件中,有AybLygGATDB[]数组声明,它定义了应用程序的完整GATT结构。每个条目中的第三个字段是许可值。你能确认这个值是否与你想要接收CyByLyEvtgtsAgRead SkyChanValAccess?Req事件的每个特征值属性相匹配的等效的BasMaskApple应用程序,它与CyByLyGATHAdgBADCHARCHARYVARRADRD事件常量值相匹配? 如果您不完全确定如何做到这一点,您也可以简单地复制和粘贴从BLYGGAT.CTO到CyyBuffGATDB[]数组定义,这里是一个答复,我可以为您检查。 以上来自于百度翻译 以下为原文 Hi Sharan, In the /Generated_Source/PSoC4/BLE_gatt.c source file, there is a cyBle_gattDB[] array declaration which defines the complete GATT structure for your application. The 3rd field in each entry is the permissions value. Can you confirm that this value has the equivalent bitmask applied which matches the CYBLE_GATT_DB_ATTR_CHAR_VAL_RD_EVENT constant value, on each of the characteristic value attributes for which you want to receive the CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ event? If you aren't totally sure how to do this, you can also simply copy and paste the cyBle_gattDB[] array definition from BLE_gatt.c into a reply here, and I can check it for you. |
|
|
|
嗨,沙兰,
从您提供的内容: 28万U/*主服务*/,0x000 000 01U/**,0x000 07U,{0x180U,NULL}},{0x000 02U,0x2803U/*特征*/0x09000201U/*RD*/0x000 03U,{0x2A0U,NULL}},{0x000 03U,0x2A0U/*设备名称*/0x09000201U/*RD*/0x000 03U,CysLyggsStdBytCysLygGdBd[0x1Eu]={0x000 01u,0x.{ { 0x0013u,(void *)&;cyble_attvalueslen [ 0 ] } } },{ 0x0004u,0x2803u / * * /特点,0x00000201u / *路* /,0x0005u,{ {零} } },0x2a01u,{ 0x0005u,0x2a01u / * * /外观,0x00000201u / *路* /,0x0005u,{ { 0x0002u,(void *)&;cyble_attvalueslen [ 1 ] } } },{ 0x0006u,0x2803u / *特性C * / / * * / 0x00000201u RD,0x0007u,{ {零} } },0x2a04u,{ 0x0007u,0x2a04u / *周边优先连接杆* / / * * / 0x00000201u RD,0x0007u,{ { 0x0008u,(void *)&;cyble_attvalueslen [ 2 ] } } },{ 0x0008u,0x2800u / * * /初级服务,0x00000001u / * * /,0x000bu,{零} } } { 0x1801u,0x00,{09u,0x2803u / * * /特点,0x00002001u / * * /工业,0x000bu,{ {零} } },0x2a05u,{ 0x000au,0x2a05u / * * /服务的变化,0x00002000u / * * /工业,0x000bu,{ { 0x0004u,(void *)&;cyble_attvalueslen [ 3 ] } } },{ 0x000bu,0x2902u / * * /配置客户端的特点,0x00000a04u / * * / RD,WR,0x000bu,{ { 0x0002u,(void *)&;cyble_attvalueslen [ 4 ] } } },{ 0x000cu,0x2800u / * * /初级服务,0x00000001u / * * /,0x001eu,{ {零} } },0x180au,{ 0x000du,0x2803u / * * /特点,0x00000201u / *路* /,0x000eu,{ {零} } },0x2a29u,{ 0x000eu,0x2a29u / * * /制造商名称字符串,0x00000201u / *路* /,0x000eu,{ { 0x0015u,(void *)&;cyble_attvalueslen [ 5 ] } } },{ 0x000fu,0x2803u / * * /特点,0x00000201u / *路* /,0x0010u,{ {零} } },0x2a24u,{ 0x0010u,0x2a24u / *型号字符串*/,0x00000201u / *路* /,0x0010u,{ { 0x0008u,(void *)&;cyble_attvalueslen [ 6 ] } } },{ 0x0011u,0x2803u / * * /特点,0x00000201u / *路* /,0x0012u,{ {零} } },0x2a25u,{ 0x0012u,0x2a25u /编号字符串*/,0x00000201u / *路* /,0x0012u,{ { 0x000au,(void *)&;cyble_attvalueslen [ 7 ] } } },{ 0x0013u,0x2803u / * * /特点,0x00000201u / *路* /,0x0014u,{ { 0x2a27u零} } },{,0x0014u,0x2a27u / * * /硬件修改字符串,0x00000201u / *路* /,0x0014u,{ { 0x000fu,(void *)&;cyble_attvalueslen [ 8 ] } } },{ 0x0015u,0x2803u / * * /特点,0x00000201u / *路* /,0x0016u,{ {零} } },0x2a26u,{ 0x0016u,0x2a26u / * * /固件版本字符串,0x00000201u / *路* /,0x0016u,{ { 0x0009u,(void *)&;cyble_attvalueslen [ 9 ] } } },{ 0x0017u,0x2803u / * * /特点,0x00000201u / *路* /,0x0018u,{ {零} } },0x2a28u,{ 0x0018u,0x2a28u / *软件版本字符串*/,0x00000201u / *路* /,0x0018u,{ { 0x000cu,(void *)&;cyble_attvalueslen [ 10 ] }} },{ 0x0019u,0x2803u / * * /特点,0x00000201u / *路* /,0x001au,{ {零} } },0x2a23u,{ 0x001au,0x2a23u / * * /系统ID,0x00000201u / *路* /,0x001au,{ { 0x0008u,(void *)&;cyble_attvalueslen [ 11 ] } } },{ 0x001bu,0x2803u / * * /特点,0x00000201u / *路* /,0x001cu,{ { 0x2a2au,零} } },{ 0x001cu,0x2a2au / * * / IEEE 11073-20601监管认证,0x00000201u / *路* /,0x001cu,{ { 0x0001u,(void *)&;cyble_attvalueslen [12 ] } } },{ 0x001du,0x2803u / * * /特点,0x00000201u / *路* /,0x001eu,{ {零} } },0x2a50u,{ 0x001eu,0x2a50u / * * / PNP ID,0x00000201u / *路* /,0x001eu,{ { 0x0007u,(void *)&;cyble_attvalueslen [ 13 ] } } },};…标准的“读”permissionis启用(在本地权限字节(0x00000001)和特性(0x00000200字节),但这些其实都是失踪的单独的位使读访问事件。这一点是没有设置默认为最characteristicssince大多数应用程序不需要这个事件,并使它减慢的事件处理程序都那么。 theble_stackgattdb.hauto-generated最新发布版的PSoC Creator +双组分v3.10源文件包含以下这个属性标志的定义: #定义cyble_gatt_db_attr_char_val_rd_event 0x010000u这是位必须设置为启用cyble_evt_gatts_read_char_val_access_req事件。这将需要应用价值attributefor特征问题。例如,设置它的序列号的字符串值的属性(手柄0x0012),修改结构如下: { 0x0012u,0x2a25u /编号字符串*/,0x00010201u / *路* /,0x0012u,{ { 0x000au,(void *)&;cyble_attvalueslen [ 7 ] } } },然后重新编译和重新测试。 你应该把所有的汽车改装分离/备份生成的源文件的注意事项,因为IDE会恢复,如果你修改图或设计资源广覆盖您的更改,或“干净”的编译环境编译。保持一个备份使您能够以最小的努力重新定制。 以上来自于百度翻译 以下为原文 Hi Sharan, From the content you provided: const CYBLE_GATTS_DB_T cyBle_gattDB[0x1Eu] = { { 0x0001u, 0x2800u /* Primary service */, 0x00000001u /* */, 0x0007u, {{0x1800u, NULL}} }, { 0x0002u, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x0003u, {{0x2A00u, NULL}} }, { 0x0003u, 0x2A00u /* Device Name */, 0x00000201u /* rd */, 0x0003u, {{0x0013u, (void *)&cyBle_attValuesLen[0]}} }, { 0x0004u, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x0005u, {{0x2A01u, NULL}} }, { 0x0005u, 0x2A01u /* Appearance */, 0x00000201u /* rd */, 0x0005u, {{0x0002u, (void *)&cyBle_attValuesLen[1]}} }, { 0x0006u, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x0007u, {{0x2A04u, NULL}} }, { 0x0007u, 0x2A04u /* Peripheral Preferred Connection Par */, 0x00000201u /* rd */, 0x0007u, {{0x0008u, (void *)&cyBle_attValuesLen[2]}} }, { 0x0008u, 0x2800u /* Primary service */, 0x00000001u /* */, 0x000Bu, {{0x1801u, NULL}} }, { 0x0009u, 0x2803u /* Characteristic */, 0x00002001u /* ind */, 0x000Bu, {{0x2A05u, NULL}} }, { 0x000Au, 0x2A05u /* Service Changed */, 0x00002000u /* ind */, 0x000Bu, {{0x0004u, (void *)&cyBle_attValuesLen[3]}} }, { 0x000Bu, 0x2902u /* Client Characteristic Configuration */, 0x00000A04u /* rd,wr */, 0x000Bu, {{0x0002u, (void *)&cyBle_attValuesLen[4]}} }, { 0x000Cu, 0x2800u /* Primary service */, 0x00000001u /* */, 0x001Eu, {{0x180Au, NULL}} }, { 0x000Du, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x000Eu, {{0x2A29u, NULL}} }, { 0x000Eu, 0x2A29u /* Manufacturer Name String */, 0x00000201u /* rd */, 0x000Eu, {{0x0015u, (void *)&cyBle_attValuesLen[5]}} }, { 0x000Fu, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x0010u, {{0x2A24u, NULL}} }, { 0x0010u, 0x2A24u /* Model Number String */, 0x00000201u /* rd */, 0x0010u, {{0x0008u, (void *)&cyBle_attValuesLen[6]}} }, { 0x0011u, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x0012u, {{0x2A25u, NULL}} }, { 0x0012u, 0x2A25u /* Serial Number String */, 0x00000201u /* rd */, 0x0012u, {{0x000Au, (void *)&cyBle_attValuesLen[7]}} }, { 0x0013u, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x0014u, {{0x2A27u, NULL}} }, { 0x0014u, 0x2A27u /* Hardware Revision String */, 0x00000201u /* rd */, 0x0014u, {{0x000Fu, (void *)&cyBle_attValuesLen[8]}} }, { 0x0015u, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x0016u, {{0x2A26u, NULL}} }, { 0x0016u, 0x2A26u /* Firmware Revision String */, 0x00000201u /* rd */, 0x0016u, {{0x0009u, (void *)&cyBle_attValuesLen[9]}} }, { 0x0017u, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x0018u, {{0x2A28u, NULL}} }, { 0x0018u, 0x2A28u /* Software Revision String */, 0x00000201u /* rd */, 0x0018u, {{0x000Cu, (void *)&cyBle_attValuesLen[10]}} }, { 0x0019u, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x001Au, {{0x2A23u, NULL}} }, { 0x001Au, 0x2A23u /* System ID */, 0x00000201u /* rd */, 0x001Au, {{0x0008u, (void *)&cyBle_attValuesLen[11]}} }, { 0x001Bu, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x001Cu, {{0x2A2Au, NULL}} }, { 0x001Cu, 0x2A2Au /* IEEE 11073-20601 Regulatory Certifi */, 0x00000201u /* rd */, 0x001Cu, {{0x0001u, (void *)&cyBle_attValuesLen[12]}} }, { 0x001Du, 0x2803u /* Characteristic */, 0x00000201u /* rd */, 0x001Eu, {{0x2A50u, NULL}} }, { 0x001Eu, 0x2A50u /* PnP ID */, 0x00000201u /* rd */, 0x001Eu, {{0x0007u, (void *)&cyBle_attValuesLen[13]}} }, }; ...the standard "Read" permission is enabled (both in the local permissions byte (0x00000001) and the characteristic properties byte (0x00000200), but all of these are actually missing the separate bit which enables the read access event. This bit is not set by default for most characteristics since most applications don't need this event, and enabling it slows down the event processing routine ever so slightly. The BLE_StackGattDb.h auto-generated source file for the latest released version of PSoC Creator + BLE component v3.10 contains the following definition for this attribute flag: #define CYBLE_GATT_DB_ATTR_CHAR_VAL_RD_EVENT 0x010000u This is the bit which must be set to enable the CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ event. It would need to be applied to the value attribute for the characteristic in question. For example, to set it on the Serial Number String value attribute (handle 0x0012), modify the structure to the following: { 0x0012u, 0x2A25u /* Serial Number String */, 0x00010201u /* rd */, 0x0012u, {{0x000Au, (void *)&cyBle_attValuesLen[7]}} }, Then recompile and re-test. Note that you should keep separate/backup copies of all modified auto-generated source files, since the IDE will regenerate them and overwrite your changes if you modify the schematic or the design-wide resources, or "clean" the build environment and recompile. Keeping a backup copy enables you to reapply customizations with minimal effort. |
|
|
|
柱子图宁 发表于 2019-1-30 16:07 嗨,Jrow, 正如我从早先的帖子中了解到的那样,我们仍然可以使用CyByLyEvEnthalLeFrave} = CyByLyEnable AulsEvin来启用所有事件。这不可能吗? 谢谢和问候, 沙朗 以上来自于百度翻译 以下为原文 Hi Jrow, As I understood from your earlier post that we can still enable all events using the cyBle_eventHandlerFlag |= CYBLE_ENABLE_ALL_EVENTS. Isn't that possible? Thanks & Regards, Sharan |
|
|
|
36切53 发表于 2019-1-30 16:16 是的,但是你说的是两种不同的东西。 的cyble_enable_all_events标志控制是否内置的配置文件处理功能完全消耗一定的应用程序级别的事件或不。是指在ble_eventhandler.cfor这顶层实施cyble_eventhandler()实施。此事件处理程序称为前应用程序特定的事件处理程序调用,并有内canpreventyour特定于应用程序的事件处理程序被称为在一定条件下。 例如,thecyble_evt_gatts_write_cmd_reqcase包含一大套# ifdef把守的调用配置文件中的特定事件处理ascyble_iasswritecmdeventhandler(),分别只有thecyble_eventhandlerflagstill已经thecyble_callbackbit集称为。许多这些例程清楚这flagif事件处理符合一定的标准,例如引导指挥特点关贸总协定写的内部“基站”轮廓加工操作功能。在thecyble_eventhandler()函数结束,事件最后泡到你的applicationonly同时方法没有消耗itoryou都明确thecyble_enable_all_eventsflag: 如果(0U)!=(cyble_eventhandlerflag &;(cyble_callback | cyble_enable_all_events))){ cyble_eventhandlerflag &;=(卡片)~ cyble_callback;cyble_applcallback((uint32)EventCode,eventparam);} 另一方面,该cyble_gatt_db_attr_char_val_rd_event标志设置在关贸总协定的数据库定义表有一个非常不同的功能。这一点控制栈是否产生thecyble_evt_gatts_read_char_val_access_req事件都发生在读。如果该位被设置在任何给定的特性,那么不管你有cyble_enable_all_events标志设置,或没有,因为这个特定的事件将不会触发内部。 以上来自于百度翻译 以下为原文 Yes, but you're talking about two different things here. The CYBLE_ENABLE_ALL_EVENTS flag controls whether built-in profile handling functions fully consume certain application-level events or not. Refer to the CyBle_EventHandler() implementation in BLE_eventHandler.c for the top-level implementation of this. This event handler is called before your application-specific event handler is called, and there are some conditions inside which can prevent your application-specific event handler from being called at all. For instance, the CYBLE_EVT_GATTS_WRITE_CMD_REQ case contains a large set of #ifdef-guarded calls to profile-specific event handlers such as CyBle_IassWriteCmdEventHandler(), each of which is called only if the cyBle_eventHandlerFlag still has the CYBLE_CALLBACK bit set. Many of these routines clear this flag if the event being processed matches certain criteria, e.g a bootloader command characteristic GATT write operation processed by the internal "BTS" profile functions. At the end of the CyBle_EventHandler() function, the event finally bubbles up to your application only if another method hasn't consumed it or you have explicitly set the CYBLE_ENABLE_ALL_EVENTS flag: if(0u != (cyBle_eventHandlerFlag & (CYBLE_CALLBACK | CYBLE_ENABLE_ALL_EVENTS))) { cyBle_eventHandlerFlag &= (uint8)~CYBLE_CALLBACK; CyBle_ApplCallback((uint32)eventCode, eventParam); } On the other hand, the CYBLE_GATT_DB_ATTR_CHAR_VAL_RD_EVENT flag set in the GATT database definition table has a very different function. This bit controls whether the stack generates the CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ event at all when a read occurs. If this bit is unset on any given characteristic, then it doesn't matter whether you have the CYBLE_ENABLE_ALL_EVENTS flag set or not, because that specific event will never be triggered internally. |
|
|
|
只有小组成员才能发言,加入小组>>
716个成员聚集在这个小组
加入小组1901 浏览 1 评论
1652 浏览 1 评论
3405 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1568 浏览 6 评论
1380 浏览 1 评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
188浏览 2评论
184浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
323浏览 2评论
352浏览 1评论
63浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-25 01:35 , Processed in 0.816707 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号