近期做的一个项目需要在页面调用串口通信,于是选择了使用mscomm32这个控件,记录一下使用的过程。
控件的安装注册都没问题,按照教程调试时发现了2个问题,希望有大神帮忙解答一下:
1.
JS没有所谓的字节数组,不知道如何将16进制的字节数组发给串口;
JS规范里面是有ArrayBuffer的,之前查mscomm32控件的时候看到的大部分都是好多年前的文章。
2.控件的oncomm事件只有1,也就是发送数据事件能触发。当我试图接收数据时oncomm事件2始终无法触发。
其他的状态为0,可是关于这个控件没有找到oncomm事件为0的描述。