All text-mode commands have an exact binary-mode equivalent which will cause the exact same result. The commands you would use to change UART parameters and default advertising timeout are system_set_uart_parameters ("STU" in text mode) and gap_set_adv_parameters ("SAP" in text mode). The structures of these commands are documented in the current Rev. *C of the User Guide on pages 97-99 and page 117, respectively. Make sure you read through all of the binary mode protocol characteristics in Section 126.96.36.199 and the text/binary similarities and differences listed in Section 2.4.3 to avoid any incorrect assumptions about how each mode works.
Also, note that UART settings in particular fall within the "protected" setting category, meaning it is not possible to directly write changed settings to flash before first writing them to RAM. This two-step process ensures that you do not accidentally lock yourself out of communication by permanently storing a communication setting that your external host cannot use. You must first write the new settings in RAM, then switch the host UART to match the new settings, then write the new settings to flash. If the host is unable to use the new settings applied in the first step, a simple soft reset with XRES or power-cycle will return the module to its previous state (115200,8/N/1 if using factory defaults). Protected settings are documented in Section 2.5.3 on page 26 of the User Guide.
For example, if you wanted to change the baud rate from 115200 to 9600 (keeping 8 data bits, no parity, 1 stop bit, no flow control) and then store it in flash, you should do the following:
- Set host at 115200 baud
- Send system_set_uart_parameters binary command:
=>[C0 0A 02 19 80 25 00 00 00 00 00 08 00 01 2C]
- Parse system_set_uart_parameters binary response:
<=[C0 02 02 19 00 00 76]
- Change host to 9600 baud
- Send system_store_config binary command:
=>[C0 00 02 04 5F]
- Parse system_store_config binary response:
<=[C0 02 02 04 00 00 61]
After this, the module will boot at 9600 baud and remain there unless you change it again or trigger a factory reset through an API command or GPIO signals.