VSM004 is an USB serial port device. It helps to simplify the complicated BLE protocol to several serial port commands
Here is a simple communiucation protocol chart to make you understand the command and data flow.
VS-ECG will send serial com port command to VSM004 and VSM004 will help to translate the simple serial com commands to complicated BLE protocols and send the request data to VSH101.
After the VSH101 finished the request and the data will be sent back via BLE to VS Dongle.
In this case the connect to computer first, connect the BLE Dongle to the computer via USB. When viewed through the device administrator, the computer will have an additional ComPort (as shown in the figure below), which is the COM used by the computer.
Example :
Com port Setting 921600 8N1 – 921600 baud, 8 data bits, no parity, and 1 stop bit.
The PC can communicate with the VSH101 device via the following instructions from VSM004
PC begins communication with BLE via VSM004 connection
When VSM004 BLE is connected, BLE communication packet can be used to communicate。
PC send to VSM004 Packet Command format
Transmit Packet Format:
Transmit VSH101 BLE Packet Format:
UPCode : Transmit and receive the packet command is same value, set same the ‘Cmd’ data.
UGroup : The Group Command byte.
UCmd. : The Group sub Command byte.
UChkSum : The (Check Sum) is the sum of bytes % 256 of the entire packet.
UMISO : Setting the notify receive length.(Little Endian)
UMOSI : Setting the write command data length.(Little Endian)
UParameter Data : The parameter setting.(Little Endian)
UCmd Data : The data for command.(Little Endian)
1.Create [VSM004 -> VSH101] packet data : “BLE Command Data”
2.Calculate checksum of “BLE Command Data” packet : CheckSum
3.Insert the CheckSum to ”ChkSum” field of “BLE Command Data” packet
4.Create [PC -> VSM004] packet data : “UART Command Data”
5.Inset “BLE Command Data” to ”UCmdData” field of “UART Command Data” packet
6.Calculate checksum of “UART Command Data” packet : CheckSum
7.Insert the CheckSum to ”UChkSum” field of “UART Command Data” packet
Receive Packet Format:
Receive VSH101 BLE Packet Format:
UPCode. : Received is the same as that transmitted.
UGroup : The group same the write command.
UAck : Confirm that the ‘Ack’ byte is ‘A’, then the command is correct this time and reply, otherwise will receive ‘N’.
UChkSum : (check sum) is the sum of bytes % 256 of the entire packet.
UIndex : The receive data memory index.(Little Endian)
ULength : The packet data length.(Little Endian)
UCmd Data : The data for command.(Little Endian)
Name | PCode | Group | Cmd | Description |
Dongle FW Version | 0x00 | 0xC0 | 0x00 | VSM004 FW Version & module name |
BLE Scan List Table | 0x10 | 0xC2 | 0x10 | get BLE scan table |
BLE Connect Device | 0x20 | 0xC2 | 0x20 | Set BLE connect device |
BLE Disconnect Device | 0x2F | 0xC2 | 0x2F | Set BLE Disconnect device |
BLE Connect Status | 0x66 | 0xC2 | 0x66 | Get BLE Connect status 1 : BLE connected 0: BLE disconnected |
BLE Communication Packet | 0x61 | 0xC2 | 0x61 | BLE Communication packet command |
Name | Hex Data |
UPCode | 0x00 |
UGroup Id | 0xC0 |
UCmd | 0x00 |
UCheck sum | 0xE0 |
UMOSI | 0x0000 |
UMISO | 0x0020 |
UParameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
UCmd Data |
Name | Hex Data |
UPCode | 0x10 |
UGroup Id | 0xC2 |
UCmd | 0x10 |
UCheck sum | 0xE6 |
UMOSI | 0x0000 |
UMISO | 0x0400 |
UParameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
UCmd Data |
Name | Hex Data |
UPCode | 0x20 |
UGroup Id | 0xC2 |
UCmd | 0x20 |
UCheck sum | 0xA3 |
UMOSI | 0x0006 |
UMISO | 0x0000 |
UParameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
UCmd Data | 47 4E DA 9F FD 90 |
Name | Hex Data |
UPCode | 0x66 |
UGroup Id | 0xC2 |
UCmd | 0x66 |
UCheck sum | 0x95 |
UMOSI | 0x0000 |
UMISO | 0x0007 |
UParameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
UCmd Data |
Name | Hex Data |
UPCode | 0x2F |
UGroup Id | 0xC2 |
UCmd | 0x2F |
UCheck sum | 0x20 |
UMOSI | 0x0000 |
UMISO | 0x0000 |
UParameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
UCmd Data |
Name | Hex Data |
UPCode | 0x61 |
UGroup Id | 0xC2 |
UCmd | 0x61 |
UCheck sum | 0x84 |
UMOSI | 0x0018 |
UMISO | 0x0028 |
UParameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
UCmd Data | 00 C0 00 E0 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |