Which mavros file sends heartbeat packets to the FC?

Use the t265 camera and mavros to realize the UAV’s GPS flight by waypoint. Now I know that the flight control terminal will send heartbeat packets to mavros. I want to ask if mavros will send heartbeat packets to the flight control? And where is the file location of the heartbeat packet received by flight control? Because I want to power off and restart when there is a problem with t265,thank you.