# For this example connect the RX pin to the TX pin on the same Bricklet

# Change XYZ to the UID of your RS232 Bricklet 2.0

setup:
	# Handle incoming read callbacks
	subscribe to tinkerforge/callback/rs232_v2_bricklet/XYZ/read # Received messages contain the message as string
	publish '{"register": true}' to tinkerforge/register/rs232_v2_bricklet/XYZ/read # Register read callback
	
	# Enable read callback
	publish '' to tinkerforge/request/rs232_v2_bricklet/XYZ/enable_read_callback 
	
	# Write "test" string
	publish '{"message": "test"}' to tinkerforge/request/rs232_v2_bricklet/XYZ/write 
