Auto dectecting Baud rate - aarduino MKRZRO

hello, i'm making driver (arduino -GPS CARD) that i can change the configuration of GPS card by using buttons. for example if i click on the buttons i send the configuration REST, the communication is done througth UART1, the REST change many thing of the GPS card, and the baud rate change 38400. while arduino still on 9600. so i can't send any other command any more because the two card doesn't have the same speed of communication. i want the arduino to be adaptive to any baude rate. do you have any code that can do that?

Incomprehensible.

Assuming that what you say about the GPS is true, why don't you set Arduino at 38400?

the 9600 speed is the classic speed of many electronics cards; i need to keep the arduino and the GPS on this speed, for that after the apply of the reset command, i send another command that re-configure the GPS to 9600 but the arduino can't understand it because of the REST that changed the GPS to 38400

After you have connected at 9600 and set the baud rate of the GPS then why not set the Arduino to the same baud rate and connect at the new baud rate

You set the baud rate so there is no need to detect what it is

Hello, i'm making driver (arduino -GPS CARD) that i can change the configuration of GPS card by using buttons. for example if i click on the buttons i send the configuration REST, the communication is done througth UART1, the REST change many thing of the GPS card, and the baud rate change 38400. while arduino still on 9600. so i can't send any other command any more because the two card doesn't have the same speed of communication. i want the arduino to be adaptive to any baude rate. do you have any code that can do that?