zhaochongyi
2024-09-02 af92a5138042c26b6460bcdbe4746caebc6f0b4b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const { Controller } = require("ee-core");
const { SerialPort } =  require("serialport");
const Services = require('ee-core/services')
 
class PortController extends Controller{
 
  constructor(ctx){
    super(ctx)
  }
 
  async initPort(bool){
    if(bool){
        return SerialPort.list();
    }
  }
 
}
PortController.toString = () => '[class PortController]';
module.exports = PortController;