加密过程如下:
**次打开串口
[00000000] IOCTL_SERIAL_SET_BAUD_RATE Baud Rate: 9600 (此处设置波特率)
[00000000] IOCTL_SERIAL_SET_LINE_CONTROL StopBits: 1, Parity: Even, DataBits: 7(通讯格式)
[00000001] IRP_MJ_WRITE Length: 0001, Data: 02 ( "STX"通讯起始符02H)
[00000001] IRP_MJ_WRITE Length: 0005, Data: 37 32 35 30 46(此处CMD的置位指令37H,32 35 30 46及是要置位的地址‘250F’操作位元件的)
[00000001] IRP_MJ_WRITE Length: 0001, Data: 03 (此处是終,及到这里结束的意思代码‘03H’)
[00000001] IRP_MJ_WRITE Length: 0002, Data: 31 37 (校验和,从37H到此处的03H的和,如果有溢出,取*后两位)
[00000008] IRP_MJ_WRITE Length: 0001, Data: 02 ( "STX"通讯起始符02H)
[00000008] IRP_MJ_WRITE Length: 0005, Data: 37 32 35 30 46(此处CMD的置位指令37H,32 35 30 46及是要置位的地址‘250F’
[00000008] IRP_MJ_WRITE Length: 0001, Data: 03 (此处是終,及到这里结束的意思代码‘03H’)
[00000008] IRP_MJ_WRITE Length: 0002, Data: 31 37 (校验和,从37H到此处的03H的和,如果有溢出,取*后两位)
[00000015] IRP_MJ_WRITE Length: 0001, Data: 02 ( "STX"通讯起始符02H)
[00000015] IRP_MJ_WRITE Length: 0011, Data: 31 38 30 30 30 30 32 30 30 30 30 (此处的CMD功能码31H,就是写入数据,38 30 30 30就是写入数据的首地址‘8000’30 32就是写入的操作位数这里是2位 那就是一个双字,30 30 30 30就是这个双字的数据为'0'
[00000015] IRP_MJ_WRITE Length: 0001, Data: 03 (此处是終,及到这里结束的意思代码‘03H’)
[00000016] IRP_MJ_WRITE Length: 0002, Data: 31 45 (校验和,从37H到此处的03H的和,如果有溢出,取*后两位)
[00000022] IRP_MJ_WRITE Length: 0001, Data: 02 ( "STX"通讯起始符02H)
[00000022] IRP_MJ_WRITE Length: 0011, Data: 31 38 30 30 30 30 32 30 30 30 30 (此处的CMD功能码31H,就是写入数据,38 30 30 30就是写入数据的首地址‘8000’30 32就是写入的操作位数这里是2位 那就是一个双字,30 30 30 30就是这个双字的数据为'0'
[00000023] IRP_MJ_WRITE Length: 0001, Data: 03 (此处是終,及到这里结束的意思代码‘03H’)
[00000023] IRP_MJ_WRITE Length: 0002, Data: 31 45 (校验和,从37H到此处的03H的和,如果有溢出,取*后两位)
[00000030] IRP_MJ_CLOSE Port Closed 关闭串口
第二次打开串口
[00000000] IOCTL_SERIAL_SET_BAUD_RATE Baud Rate: 9600
[00000000] IOCTL_SERIAL_SET_LINE_CONTROL StopBits: 1, Parity: Even, DataBits: 7
[00000000] IRP_MJ_WRITE Length: 0001, Data: 02 ( "STX"通讯起始符02H)
[00000000] IRP_MJ_WRITE Length: 0005, Data: 38 32 35 30 46 (此处CMD的复位指令38H,32 35 30 46及是要复位的地址‘250F’操作位元件的,这里把刚刚置位的205F的地址复位了)
[00000001] IRP_MJ_WRITE Length: 0001, Data: 03 (此处是終,及到这里结束的意思代码‘03H’)
[00000001] IRP_MJ_WRITE Length: 0002, Data: 31 38 (校验和,从37H到此处的03H的和,如果有溢出,取*后两位)
[00000007] IRP_MJ_WRITE Length: 0001, Data: 02 ( "STX"通讯起始符02H)
[00000007] IRP_MJ_WRITE Length: 0005, Data: 38 32 35 30 46 (此处CMD的复位指令38H,32 35 30 46及是要复位的地址‘250F’操作位元件的,这里把刚刚置位的250F的地址复位了)
[00000008] IRP_MJ_WRITE Length: 0001, Data: 03 (此处是終,及到这里结束的意思代码‘03H’)
[00000008] IRP_MJ_WRITE Length: 0002, Data: 31 38 (校验和,从37H到此处的03H的和,如果有溢出,取*后两位)
[00000010] IRP_MJ_CLOSE Port Closed
|