完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我有两个BLE设备,一个为中心,一个为外围设备。对于中央设备,我检查了这个盒子,以便从骰子产生MAC地址。我需要在其固件中读取中央设备的完整MAC地址。我在哪里找到MAC地址在所有的头文件和源文件中生成的BLE库。
其次,在外围设备中,我通过BLE模块的设计块分配了一个广告名称。我想在外围代码中更改这个名称,这样我既可以添加到现有的名称,也可以完全更改它。基本上有一个默认的广告名称,然后改变其他东西,一旦建立了一些设置。我以为我找到了这个数据,但是每次我构建代码,它默认回到设计块中的原始数据。如何更改固件中的广告名称? 最后,在应用程序和外围设备之间如何设置PIN使用有什么好的参考或例子。我有一个不同的项目,需要使用PIN,不知道如何实现。 以上来自于百度翻译 以下为原文 I have two BLE devices, one as central and one as peripheral. For the central device, I have the box checked to generate the mac address from the die. I have a need to read the full mac address of the central device within its firmware. Where do I find the mac address within all of the header and source file generated in the BLE library. Secondly in the peripheral, I assigned an advertising name through the design block of the BLE module. I would like to change that name within the peripheral code so I can either add to the existing name or change it completely. Basically have a default advertising name then change to something else once some settings are established. I thought I found the data for this but everytime I build the code, it defaults back to original data in design block. How can I change the adversting name within the firmware? Lastly, are there any good references or examples how to set up pin usage between an app and the peripheral device. I have a different project that requires usage of a pin and not sure how to implement. |
|
相关推荐
1个回答
|
|
问题1:MAC地址是用程序代码获取设备的BLE地址的“MAC”地址的一个线程。这将不是由软件生成的,而是在程序代码运行时从硬件中轮询的,因为芯片值在每个板上都是不同的,并且软件不能预先知道哪个硬件在运行代码。(可能你可以用MixPrim3或类似的东西阅读它)
问题2:我修改我的外围广告数据,如果你想要的话,它是相当类似的(低级用法)。否则,CysLygGAPStLoSaleNobe(const CAR8名称[])是CyPress API,用于更改广告名称(而不是广告),或者(因为您希望能够添加到名称长度)项目009:动态广播-改变广告包。关于广播动态更新的例子。显然,您需要修改示例来进行广告而不是广播,但这应该是一件简单的事情。 问题3:从我所看到的,它确实是一个特定于应用程序的需求;一个简单的ON/OFF按钮控件将是最简单的,然后您只需添加层/条件来控制来自更复杂函数的PIN,如果您有一个更为复杂的应用程序。只需创建一个特性/属性,PIN值为OFF为0,ON为0(可能为整个端口控件的字节值?)然后,从电话/中心读取/写入该特性,外围设备通过设置PIN值或返回PIN的值来处理写/读请求事件的事件。 以上来自于百度翻译 以下为原文 Question 1: MAC address is a thread on the matter of getting the "mac" address of the BLE address of the device with program code. This will not be generated from software, but polled from the hardware when the program code runs, as the die values are written on each board differently, and the software can't know which hardware is running the code beforehand. (Possibly you could read it using a miniProg3 or something similar) Question 2: I modify my peripheral advertisement data which is pretty similar if you want that instead (lower level usage). Otherwise, the function CyBle_GapSetLocalName(const char8 name[]) is the cypress API for changing the advertising name (while not advertising), or (since you wanted to be able to add to the name length) Project #009: Dynamic Broadcaster - Changing Advertising Packets | Cypress Semiconductor has a good example on dynamic updates to broadcasting. Obviously you would need to modify the example to advertise instead of broadcast, but that should be a simple matter. Question 3: It is really an application-specific need from what I've seen; A simple on/off button control would be the simplest, and then you just add layers/conditions to control the pin from more complicated functions if you have a more involved application. Simply create a characteristic/attribute with the pin value being 0 for off, and not zero for on (possibly byte value for the entire port control?). Then, read/write to the characteristic from the phone/central, with the peripheral handling the event of a write/read request event by setting the pin value or returning the value of the pin respectively. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2103 浏览 1 评论
1849 浏览 1 评论
3667 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1784 浏览 6 评论
1534 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
566浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
420浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
435浏览 2评论
381浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
913浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 21:27 , Processed in 0.910423 second(s), Total 77, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号