Serial Port configuration

Hi,
I’m new on meteor,
I’m developing a simple serial terminal using meteor:
something like that:
image

So, I had to first start the client app, set the port config (port name and baud rate) and then click on connect.
I can make the server connecting to a hard-coded serial port name, but the issue I’m facing is how to start connection only when the client clicks the “Open” button.

Thank you.

You could use a Meteor method, actioned on the Open button.

robfallows,
Thank you for the quick answer,
issue fixed.

Just for sharing, I was using this:

Meteor.methods({
// function openSerialPort
openSerialPort: function(serialPortName, serialBaudRate) {
// Open serial Port
var port = new SerialPort(serialPortName, {
baudRate: parseInt(serialBaudRate)
});

// serial port events
port.on('open',...);
port.on('data',...);
port.on('error',...);

}
});

I had to remove the var for port declaration, so it will be considered as global variable…
It works.
Thnaks

@delared i am interested in this too. can you please share it i GitHub? Thanks