| | |
| | | import { Controller } from "ee-core"; |
| | | import { SerialPort } from "serialport"; |
| | | const { Controller } = require("ee-core"); |
| | | const { SerialPort } = require("serialport"); |
| | | const Services = require('ee-core/services') |
| | | |
| | | class Port extends Controller{ |
| | | class PortController extends Controller{ |
| | | |
| | | constructor(ctx){ |
| | | super(ctx) |
| | | } |
| | | |
| | | async initPort(bool){ |
| | | console.log(bool) |
| | | if(bool){ |
| | | SerialPort.list().then((ports)=>{ |
| | | setTimeout(()=>{ |
| | | }) |
| | | }) |
| | | return SerialPort.list(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | PortController.toString = () => '[class PortController]'; |
| | | module.exports = PortController; |