Deleted the unused code.
Switch message sending to setting deferred events that are checked when the TX buffer is empty.