Moved generation, transmission, and informing PC about heartbeats in TX to its own function.