你好,
我是da14580的新的,它的环境。我购买了基本的开发套件开始。有人可以让我知道我需要从哪里开始,以便我在短时间内掌握经验?喜欢 -
1. Code flow - Sequence of Execution i.e how the code executes after executing system_init() function in main_func()?
2. Where various BLE parameters are initialized like advertisement interval, type of advertisement, advertising data, scan response data etc.?
3. How can I make the device advertise continuously and start advertise after disconnect?
4.如何将外围设备转换为中央的角色,反之亦然?
Also, it would be great if some one can let me know the list of documents that I need to refer in sequence to understand the development environment.
Appreciate your quick reply.
Thanks,
DV
Device:
你好DV,
You can start by the examples in the SDK. You can have a look at the proximity example and then to the barebone example (only the diss profile is implemented, just advertising string manipulation) then you can have a look to custom profile examples (ble_app_peripheral and ble app_profile). Also you can check the documents for the new SDK UM-B-050 and UM-B-051. Finally you can search the forum most of the questions you have are allready answered on the site.
谢谢mt_dialog.
谢谢mt_dialog为您的回复!
实际上我目前关注UM-B-015软件架构7.0文档。这里,在第6节中,系统启动和系统初始化序列是用邻近记者的示例来解释的。但我认为它没有更新,因为应用程序代码中未存在他们在文档中提到的许多功能!因此,我仍然在努力从设备广告开始以及定义广告参数的位置。你能帮我吗?
It would be great if you can quickly help me with code execution sequence from main_func().
Also, I have BASIC development kit and I programmed it with Proximity Reporter project. So I am able discover DIALOG-PRXR device in BT Settings screen of my Nexus 5 phone, but I am not able to discover it using BLE Scanner application. Why is that so?
Thanks,
达伐
你好DV,
Since you are using the SDK 5 the only available docs are the one i mentioned in my previous post, the docs you are reading are based on SDK 3. Also to undestand the execution flow and the sleeping mechanisms i would recomend you to check UM-B-006 Sleep mode configuration. In the proximity reporter you can configure your advertising in the user_config.h file in line ~98. The advertising begins as soon as the databases are created, meaning the default_app_on_db_ini_complete() will invoke the default advertising operation. The default advertising operation can be configured in the user_callback_config,h. For the main_func check theUM-B-006有一些洞察力。关于发现的发现可能是一个应用程序或设备问题,Fyi我能够用BLE扫描仪跟踪Proximity Reporter,您是否尝试过任何其他应用程序?
谢谢mt_dialog.
你好MT_Dialog,
感谢您的回复!
So, there is no other document for SDK 5 except UM-B-050 and 051 and I should follow only those document to understand the environment, right?
Yes, I have tried to discover the device using nRF Master Control Panel(BLE) application, but it was also not able to discover the device. Let me explain you the setup:
1. I have DA14580DEVKT-B kit with me and it is powered by the USB cable that is connected to my laptop.
2. I installed BLE Scanner application on my android device which has support of BLE and I am able to discover and connect to other BLE enabled devices like fitness tracker. The strange thing is the device 'DIALOG-PRXR' is discovered on BT Settings, but it is not discovered with the applications.
3. I also tried with 'ble_app_peripheral' application, but same result.
Thanks,
DV
你好DV,
As far as the documents is concern yes, those two are the only ones for the SDK5 but since it is based on SDK3 the basic functionallity is more or less the same. For instance the UM-B-006 doc which describes the sleeping functionallity should be read in order to understand the concept of sleep. About the applications, have you tried with another phone, device?
谢谢mt_dialog.
你好MT_Dialog,
谢谢你的回复。
我在手机上安装了BLE Checker应用程序,它表示我的手机支持BLE。另一件事是我能够使用BLE扫描仪应用程序在手机上连接其他BLE支持的设备,但我甚至无法发现具有邻近报告的固件的设备。我尝试过其他应用程序,智能轻推,但结果雷竞技安卓下载是相同的。
Apart from that, I sniffed the data send by the device using BLE sniffer. The advertisement data shows by that software is not matching with the 'USER_ADVERTISE_DATA' defined in user_config.h file. Why is that so?
Thanks,
达伐
你好DV,
您可以看到具有嗅探器的广告字符串,但您不能使用手机?使用BLE扫描仪检查它,它发现并连接到邻近记者。您在嗅探器中看到的是什么,不符合广告数据?您是否尝试过任何其他示例BLE_APP_PERITWAL可能?您应该能够在广告字符串中看到强制标志02 01 06,然后在user_advertise_data中定义的十六进制值。
谢谢mt_dialog.
你好MT_Dialog,
谢谢你的回复。现在我能够发现the device on my phone with BLE Scanner application, but when I am trying to connect with the device it disconnects immediately after making connection. What is wrong here?
以下是我使用BLE Sniffer看到的字符串:
02 01 06 - 未定义
09 03 03 18 02 18 04 18 F5 FE - defined as 'USER_ADVERTISE_DATA' in user_config.h file
0C 09 44 49 41 4C 4F 47 2D 50 52 58 52 - 未定义
那么你能告诉我'未定义'广告数据来自哪里?
Thanks,
达伐
你好DV,
The first three bytes are the mandatory flags that indicate the type of the advertising message 02 - the length of the data that follows 01 - the AD tag of the data that follows and 06 - value of the flag (LE Discoverable mode and BR/EDR Not supported). The other undefined bytes is the name of your device as you specified it in your code 0C is the length and 09 is the tag for the complete local name DIALOG-PRXR. As far as the disconnection please try to check the reason of disconnection by using your sniffer i.e maybe the host is terminating the connection.
谢谢mt_dialog.
你好MT_Dialog,
感谢您的回复,抱歉我对这篇文章的延迟回复。
现在我能够了解广告数据。但是,如果我想改变前三个字节值,呢?我的意思是不是保持它'le_general_discoverablaplapl(02)',我想使它成为'le_limited_discoverable(01)'。我怎样才能做到这一点?我试图在整个代码中找到各个宏的用法,但没有找到它。
Also, is there any limitation on the length of the bytes that can be sent as Advertisement Data? If yes, how much is it? Can I add some custom details within this advertisement data?
Awaiting your reply.
Thanks,
DV
你好DV,
为了更改广告标志,您必须在广告命令中设置正确的配置。您必须在GAPM_ADV_HOST结构中设置GAP_LIM_DISCOVERABLE中的模式成员。这将在广告数据中设置标志。广告长度的限制为31个字节,但如果支持BR / EDR(由于不支持的是是的)和广告模式标志,则必须减去指示长度的3个强制性广告标志。
谢谢mt_dialog.
你好mt_dialog.,
谢谢你的回复。
I found that 'gapm_adv_host' structure is a part of 'gapm_start_advertise_cmd' structure. And there are multiple structure variable defined in the 'app.c' file of Proximity Reporter project. Which I need to follow and modify to update the AD flags?
I have few more queries as follows:
1. Where 'USER_ADVERTISE_DATA' is used in this project?
2.我想发送两个字节的制造商特定数据以及广告数据。所以我相应地更改了user_advertise_data,但在此之后我无法发现该设备。为什么会这样?如何添加那些额外的数据?
3. Where is the advertising interval is defined in Proximity Reporter project? I want to change the same.
Thanks,
DV
你好DV,
Most of the data in the advertising string are configured by the SDK in the user_config.h file. What is that you want to update ? If you check the app_easy_gap_undirected_advertise_start_create_msg() function you will see that the struct gapm_start_advertise_cmd is populated by the user_undirected_advertise_conf struct.
1. user_advertise_data填充了NVDS结构,在该功能中我提到的代码将获取数据并填充广告字符串。
2. The advertising string has limited space for advertising data, you will have to check if there is enough available space in your advertising data. Now, i suppose that you have enough space to place your data, you also have to set the size of your advertising data in the advertising string, the current length of the proximity reporter is "0x09" if you want to place a couple of etxra bytes ("0x55, 0x55") you have to set the length from "0x09" to "0x0B"
3. The advertising interval is placed in the user_config.h file in the user_undirected_advertise_conf struct in the .intv member.
谢谢mt_dialog.
你好mt_dialog.,
感谢您的回复,抱歉我的延迟回复。
As a beginner, how would I know that which function is used to start the advertisement and to create advertisement data string? Is it documented somewhere? How would I know that advertisement is connectable or non-connectable, is it directed or un-directed? Where all this defined in the code?
Along with adding few bytes in advertisement data, defined in user_config.h, I was updating the first byte accordingly, which indicates the size of the data, but still it is not working and device was not discoverable after changing the advertisement data.
Thanks,
DV
你好DV,
关于SDK 5的唯一文件是我在秒表上建议的那些,您可以更具体地查看8.2.3.2段并检查每个操作SDK正在使用的每个操作的回调,您可以检查这些功能的定义和看看如何执行广告。
如果例如,请检查它执行的示例的广告的类型,请查看user_callback_config.h文件中的.default_operation_adv.h文件,该文件将导致您指示设备通告的功能。对于要执行的大多数函数,都有一个不同的函数,所以所有类型的函数都位于app.c文件中。例如:
——app_easy_gap_undirected_advertise_start()——由我nvoking this function you will get an undirected advertising.
- app_easy_gap_directed_advertise_start() directed advertising
- app_easy_gap_non_connectable_advertise_start() - 不可连接的广告
You can change the parameters of the advertising procedures in the user_config.h files.
As far as updating the advertising string the barebone example is doing the exact same thing please use this as a reference.
谢谢mt_dialog.
你好
Could you advise if USER_DEVICE_NAME can be modified?
问候
尼基
你好nicky.whtsang.,
是的,您可以在User_device_name定义中更改user_config.h文件中的设备名称。
谢谢mt_dialog.