Low Level Serial PlugIn
Hi All,
Here's a simple 'low-level' serial plugin for all to use, at present I've only compiled the DLL for Windows64.
It differs from SerialPlugin as it's sending RAW bytes not strings, so can be used for talking to Arduino's, Raspberry Pi's etc.
eg..
If you want to send a packet like an address poll..
[ destination address, nof bytes, host address, command, checksum ]
[ 0, 0, 1, 254, 2 ] ( decimal / hex )
Usage and Commands:
#import_plugin LokiPlugin as loki_port
Basic COM handling..
get_nof_ports( max_ports as Integer )
open_com_port( "COM8", 9600, TRUE or FALSE )
close_com_port( TRUE or FALSE to clear rx & tx buffers )
Buffer Handling..
clear_rx_buffer( )
clear_tx_buffer( )
get_rx_byte( offset into rx_buffer )
set_tx_byte( offset into tx_buffer )
/*-- Anything recieved? --*/
is_byte_available( )
reutrns nof bytes available as Integer
/*-- Read nof bytes from COM Port into Rx_Buffer --*/
read_nof_bytes_in( nof_bytes as Integer )
// return number of bytes written as Integer
read_byte( )
// return the byte value as a Integer
/*-- Write nof bytes from Tx_Buffer to COM Port --*/
write_nof_bytes_out( nof_bytes as Integer )
// return number of bytes written as Integer
write_byte( byte to send )
// return number of bytes written as Integer ( in this case 1 on success, 0 on fail )