Search for the first line below, and make the changes shown. The lines in bold or new or modified. With the changes below, the serial send command, which doesn't use a cr or eol, will convert any hex string entered for its parameter, and send it. So, you can send hex without converting to decimal. You'll make this change to the autorun.brs file published with any brightauthor project. You can attach your modified project file to any project by going to the File Menu, Presentation Properties, Autorun. Custom. Keep in mind that a modified autorun for one brightauthor version, won't work with a newer BrightAuthor. But, you can always move the changes to a newer autorun.
else if command$ = "sendSerialBlockCommand" then
portParameter = parameters["port"]
port$ = portParameter.GetCurrentParameterValue()
serialStringParameter = parameters["serialString"]
serialString$ = serialStringParameter.GetCurrentParameterValue()
'lca 852013 hex support
'm.diagnostics.PrintDebug("sendSerialBlockCommand " + serialString$ + " to port " + port$)
tmpcommand$=serialString$
m.diagnostics.PrintDebug("Sending Hex Byte Array " + tmpcommand$)
mybytes=createobject("roByteArray")
mybytes.FromHexString(tmpcommand$) 'assume string recevied is hex string, convert to bytes
if type(m.serial) = "roAssociativeArray" then
serial = m.serial[port$]
if type(serial) = "roSerialPort" then
'serial.SendBlock(serialString$)
serial.SendBlock(mybytes)
endif
endif
Note: You can use the same process to send a byte array using UDP instead of just a string. Just search for this line:
else if command$ = "sendUDPCommand" then