Skip to content

tesonep/SerialPort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pharo SerialPort

I am a FFI implementation of the SerialPort interface for Pharo.

To install, just use:

Metacello new
	baseline: 'SerialPort';
	repository: 'github://tesonep/SerialPort:main';
	load.

I am implemented using purely the FFI support in the image. I am tested to run in Linux, OSX and Windows.

For an easy example of use check: SerialPortTest >> #testOpenArduino.

Here there is a code snippet.

| stringToSend receivedString |
	sp := SerialPort new.
	sp baudRate: 38400.
	sp openPort: self portName.

	stringToSend := DateAndTime now printString.

	sp writeByteArray: stringToSend utf8Encoded.
	receivedString := (sp readByteArray: 10000) utf8Decoded.
	self assert: receivedString equals: stringToSend size printString ]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published