Lines Matching +full:serial +full:- +full:port
4 <title>WebUSB Serial Sample Application</title>
9 var serial = {};
14 serial.getPorts = function() {
16 return devices.map(device => new serial.Port(device));
20 serial.requestPort = function() {
27 device => new serial.Port(device)
31 serial.Port = function(device) {
35 serial.Port.prototype.connect = function() {
60 serial.Port.prototype.disconnect = function() {
64 serial.Port.prototype.send = function(data) {
72 let port;
75 port.connect().then(() => {
76 port.onReceive = data => {
81 port.onReceiveError = error => {
84 port.disconnect();
90 console.log("sending to serial:" + string.length);
93 console.log("sending to serial: [" + string +"]\n");
95 let view = new TextEncoder('utf-8').encode(string);
97 if (port) {
98 port.send(view);
104 serial.requestPort().then(selectedPort => {
105 port = selectedPort;