Create Rx Tx

I think that you are trying to adapt the sample code from this page. Is that correct?