Hello everyone,
Is it possible to change BLE(nordic 52840) advertising name change on the fly through UART and is there way I can pull serial number of UWB via UART ?
Hello @carlos.silva,
I’m using QANI Type2AB example and nRF5SDK version 17
Hi @melson !
UART communication has not been implemented in the QANI example, so you’d need to add it.
For the “set advertising name” command, you may need to stop advertising, change the advertising settings (set the new name), and start advertising again.
For the “get uwb serial number” you’ll need the function “uwbmac_get_device_info()” like in the CLI example:
REG_FN(f_decaid)
{
struct uwbmac_context *uwbmac_ctx = NULL;
struct uwbmac_device_info device_info;
enum qerr r = uwb_stack_init(&uwbmac_ctx);
if (r != QERR_SUCCESS)
return CMD_FN_RET_KO;
uwbmac_get_device_info(uwbmac_ctx, &device_info);
diag_printf("Qorvo Device ID = 0x%08lx\r\n", device_info.dev_id);
/* PRIx64 does not work properly, so print uint64_t using 2x uint32_t. */
diag_printf("Qorvo Lot ID = 0x%08lx%08lx\r\n", (uint32_t)(device_info.lot_id >> 32), (uint32_t)device_info.lot_id);
diag_printf("Qorvo Part ID = 0x%08lx\r\n", device_info.part_id);
diag_printf("Qorvo SoC ID = %08lx%08lx%08lx\r\n", (uint32_t)(device_info.lot_id >> 32), (uint32_t)device_info.lot_id, device_info.part_id);
uwb_stack_deinit(uwbmac_ctx);
return CMD_FN_RET_OK;
}
Kind regards!
Hi @Carlos,
is there nordic UART example which I can look into ?
Hi @melson !
Yes! In the same QANI package, you’ll find the Nordic SDK, there are many examples, including uart:
SDK_BSP\Nordic\NORDIC_SDK_17_1_0\examples\peripheral
Also, if you download the DW3_QM33 SDK you’ll find the USB CDC (Communications Device Class) implementation in the CLI code, which works as a USB virtual COM Port. (I think the Nordic SDK example folder has a USB CDC example too)
Kind regards!
Hi @carlos.silva,
Actually, our company is working on IoT solution, where we integrated UWB on PCB. Here, we exposed UART, and we are utilizing the UART for firmware upgrade. And using same UART we are planning to integrate AT command in order to set and get Bluetooth Adv name including other details.
May I know in DWM3001CDK example where the #include "cmd.h
header file located or is it an API call that calls from some .a
based binary file, because I want to integrate cmd into QANI.
Hi @melson !
You can find the cmd.h and the other files related to the CLI example in:
Src\Apps\Src\common\cmd
Please make sure to download the latest SDK version.
Also inside the Nordic SDK folder, there are examples of their CLI library:
SDK_BSP\Nordic\NORDIC_SDK_17_1_0\examples\peripheral\cli
SDK_BSP\Nordic\NORDIC_SDK_17_1_0\examples\peripheral\cli_libuarte
If you’re implementing the AT commands from scratch, this may be a better approach.
Kind regards!
Hi @carlos.silva,
cmd.h
file supposed to be in this folder, but it’s not here
CLI example code I got from other GitHub repo, does nordic provide CLI or UCI example source code ?
Hi @melson !
The folder structure I mentioned refers to DW3xxx & QM3xxx SDK v1.0.2 (Released November 2024)
The Nordic CLI example only concerns the command line interface itself, it does nothing with UWB. As you’re adding AT commands to a project that doesn’t have any UART or command parse implementation, the Nordic example is probably easier to add than adapting the Qorvo SDK CLI example to do the same task.
Kind regards!
Hi @carlos.silva ,
Thank you.
Hi @carlos.silva,
I wanted to know since I’m using Cli
based example and doing it from scratch, for above example which header file and libraries I need to include.
Is there any documentation that I can look into.
Thank you,
Hi @melson!
I’m not sure, here is what is included in cmd_fn.c:
#include "cmd_fn.h"
#include "fira_app_config.h"
#include "reporter.h"
#include "uwb_translate.h"
#include "rtls_version.h"
#include "appConfig.h"
#include "flushTask.h"
#include "deca_dbg.h"
#include "usb_uart_tx.h"
#include "EventManager.h"
#include "thread_fn.h"
#include "driver_app_config.h"
#include "fira_app.h"
#include "qplatform.h"
#include "llhw.h"
#include <stdio.h>
#include "qirq.h"
#if defined(GP_APP_DIVERSITY_BLE_PERIPHERAL) || defined(GP_APP_DIVERSITY_BLE_CENTRAL)
#include "qpg6200_ble.h"
#endif
I think the best way to do that is to include this code in your project and build, the compiler will report the missing dependencies and you can include only what you really need.
Also, maybe it will require files/functions from the SDK v1.0.2 I mentioned above, as this code snippet was taken from there.
Kind regards!