Hi OV_Renesas,
Module: DA14531MODApplication: Ultrasonic Flow Meter (Battery powered)IDE & Tools: Keil Uvision, SEGGER J-Link (JTAG connector)SDK version: DA145xx_CodeLess_6.380.18.63
In general, the AT command firmware operates by maintaining two states: query and execute. However, there are a few limitations we've observed:
There are no available commands to check whether the device is currently in broadcaster or peripheral role.
It's not possible to retrieve the current status of commands like ADVSTART, ADVSTOP, AT+BROADCASTER, AT+PERIPHERAL, AT+GAPDISCONNECT. If these commands are issued again while already active or in an incompatible state, an error is returned.
Ideally, the firmware should internally maintain the state of these commands and provide a valid response when the same command is issued again, rather than throwing an error. This behavior adds complexity to our application. If the command sequence is disrupted or missed, it results in an error, leaving us with no option but to perform a soft reset and start over.
This is a significant concern for us, especially since our product is battery-powered, and unnecessary resets can impact power efficiency and reliability.
Hi Anu,Thank you for posting your question online.Let me check on this and I will get back to you as soon as possible.Best Regards,OV_Renesas
Hi Anu,Apologies for the delay.Generally you should not issue an AT command if you have not received a reply message from the last AT command. Now on my side, I created a custom AT command to get you the current status (Role, GAP Activity and connection activity) each time you call it.Please follow the instructions here: 6. Adding Custom Commands — DA145XX Tutorial SDK Getting startedOn my side I worked on the latest CodeLess SDK v6.380.20.66Please follow the user manual for all the necessary changes. The final user_at_status function I implemented is the following:
#ifdef USE_AT_STATUS void user_at_status(struct at_cmd_params_t* arg, char* reply_string) { char current_role[12]; char current_gap_activity[25]; bool conn_status; if(codeless_env.bt_role == GAP_ROLE_CENTRAL){ memcpy(¤t_role, "Central", sizeof(current_role)); }else if(codeless_env.bt_role == GAP_ROLE_PERIPHERAL) { memcpy(¤t_role, "Peripheral", sizeof(current_role)); }else if(codeless_env.bt_role == GAP_ROLE_BROADCASTER){ memcpy(¤t_role, "Broadcaster", sizeof(current_role)); }else if(codeless_env.bt_role == GAP_ROLE_OBSERVER){ memcpy(¤t_role, "Observer", sizeof(current_role)); }else if(codeless_env.bt_role == GAP_ROLE_NONE){ memcpy(¤t_role, "No Role", sizeof(current_role)); }else if(codeless_env.bt_role == GAP_ROLE_ALL){ memcpy(¤t_role, "Role All", sizeof(current_role)); } if(codeless_env.gap_activity == IDLE){ memcpy(¤t_gap_activity, "IDLE", sizeof(current_gap_activity)); }else if(codeless_env.gap_activity == SCANNING) { memcpy(¤t_gap_activity, "SCANNING", sizeof(current_gap_activity)); }else if(codeless_env.gap_activity == ADVERTISING) { memcpy(¤t_gap_activity, "ADVERTISING", sizeof(current_gap_activity)); }else if(codeless_env.gap_activity == DISCOVERING){ memcpy(¤t_gap_activity, "DISCOVERING", sizeof(current_gap_activity)); }else if(codeless_env.gap_activity == BONDING){ memcpy(¤t_gap_activity, "BONDING", sizeof(current_gap_activity)); }else if(codeless_env.gap_activity == INITIATING_CONNECTION){ memcpy(¤t_gap_activity, "INITIATING_CONNECTION", sizeof(current_gap_activity)); }else if(codeless_env.gap_activity == DISCONNECTING){ memcpy(¤t_gap_activity, "DISCONNECTING", sizeof(current_gap_activity)); } if(is_connected()){ conn_status = true; }else{ conn_status = false; } arch_sprintf(reply_string, "Role is: %s, Activity is:%s, Connection Status is : %d", current_role, current_gap_activity, conn_status); arg->success_flag = true; } #endif
Great! Thank you for your input. I will check on this.