 			callback = args[0]
 			writeCmd = 'writeByte'
 
+		callback ?= ->
+
 		writeArgs.push (error) ->
 			callback()
 			debug.log "Send", data, 'to port', port


		wire[readCmd] readArgs...

	write: ( type, port, data, callback ) ->
		send CMD[type].write, port, data, callback

	read: ( type, args... ) ->
		send CMD[type].read, args...

	input: (callback) ->
		wire.writeByte CMD.mode, 0, -> # Switch to input
			callback() # Do what you want
			wire.writeByte CMD.mode, 1, -> # Switch to output

	ranger: ( port, callback ) ->
		send CMD.ranger, port, [0,0], ->
			receive port, 3, (data) ->



	receive = ( port, args... ) ->
		@mode port, MODES.input
		readArgs = []
		if args[1]
			length = args[0]
