wxCTB : cross-platform serial (OSX project)

BlitzMax Modules Forums/Brucey's Modules/wxCTB : cross-platform serial (OSX project)

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

A small snippet to get people started:
	Const baudrate:Int	= wxBAUD_1200
	Const devname:String = "/dev/tty.PL2303-0000101D"
	Const timeout:Int = 1000

	Global dev:wxSerialPort = New wxSerialPort.Create()
		
	' Try To open the given port
	If dev.Open(devname) < 0
		'
		wxMessageBox("Cannot open " + devname )
		dev.free()
		
	Else
		
		' set the baudrate
		dev.SetBaudRate(baudrate)
			
		Global buffer:Byte[1024]
	
		For Local i:Int=0 To 1000
			dev.Read(buffer,2)
			Delay(250)
			DebugLog "data = " + Hex(buffer[0]) + " : " + Hex(buffer[1])
		Next
			
	    dev.Close()
		dev.free()

	EndIf