After establishing a connection with VSH101, the initial communication flow is as follows:
If the VSC MODE has not been executed, instructions must be transmitted every 10 seconds to maintain the connection.
The VSC MODE START and VSC MODE STOP command are simple. Like the other BLE commands introduced before. The VSC MODE READ command will be a little more complicated. When user issues the VSC_MODE_READ command, device will send back 968 or 576 bytes data. The next section will give you a more detail description about the VSC Mode Data Format. Each VSC MODE READ command carries 200 ms ECG data and related information. It means user has to issues at lease 5 times VSC MODE READ command every second or the data will be overflow.
When the APP uses VSC MODE READ for real-time ECG data and related information, the communication transmission interval should be less than 200 milliseconds.
Hour | Min | Sec | Delta Time | Delta Send | Event |
15 | 24 | 37.724 | [Cmd]Vsc Mode Read | ||
15 | 24 | 37.867 | 0.143 | BLE_VSC_MODE_READ ID = 1 | |
15 | 24 | 37.877 | 0.01 | 0.153 | [Cmd]Vsc Mode Read |
15 | 24 | 38.023 | 0.146 | BLE_VSC_MODE_READ ID = 2 | |
15 | 24 | 38.05 | 0.027 | 0.173 | [Cmd]Vsc Mode Read |
15 | 24 | 38.228 | 0.178 | BLE_VSC_MODE_READ ID = 3 | |
15 | 24 | 38.246 | 0.018 | 0.196 | [Cmd]Vsc Mode Read |
15 | 24 | 38.41 | 0.164 | BLE_VSC_MODE_READ ID = 4 | |
15 | 24 | 38.418 | 0.008 | 0.172 | [Cmd]Vsc Mode Read |
15 | 24 | 38.617 | 0.199 | BLE_VSC_MODE_READ ID = 5 |
PCode : The Write/Noitfy Characteristic command is same value, set same the ‘Cmd’ byte.
Group : The Group Command byte.
Cmd. : The Group sub Command byte.
ChkSum : The (Check Sum) is the sum of the entire packet.
MISO : Setting the notify receive length. (Little Endian)
MOSI : Setting the write command data length.(Little Endian)
Parameter Data : The parameter setting.(Little Endian)
Cmd Data : The data for command. (Little Endian)
PCode. : The write/notify command is same, usually same the “Cmd” byte.
Group : The group same the write command.
Ack : Confirm that the ‘Ack’ byte is ‘A’, then the command is correct this time and reply, otherwise will receive ‘N’.
ChkSum : (check sum) is the sum of bytes % 256 of the entire packet.
Index : The receive data memory index.(Little Endian)
Length : The packet data length.(Little Endian)
Cmd Data : The data for command.(Little Endian)
Check Sum Data Get Example Code:
Name | PCode | Group | Cmd | Description |
Version | 0x00 | 0xC0 | 0x00 | Device FW Version |
Time Set | 0x40 | 0xC0 | 0x40 | Set Device Time |
Time Get | 0x41 | 0xC0 | 0x41 | Get Device Time |
VSC Mode Start | 0x64 | 0xC2 | 0x64 | VSC MODE Measurement Start, VSC MODE Flow Chart |
VSC Mode Stop | 0x65 | 0xC2 | 0x65 | VSC MODE Measurement Stop, VSC MODE Flow Chart |
VSC Mode Read | 0x6A | 0xC2 | 0x6A | VSC MODE Read Data, VSC MODE Flow Chart |
VSC Mode Type Set | 0x70 | 0xC2 | 0x70 | VSC MODE TYPE Setting |
Soft Register Read | 0x00 | 0xA5 | 0x00 | Soft Register Command Read |
Soft Register Write | 0x01 | 0xA5 | 0x01 | Soft Register Command Write |
VSC File Mode Start | 0x71 | 0xC2 | 0x71 | VSC File mode start command |
VSC File Mode Stop | 0x72 | 0xC2 | 0x72 | VSC File mode stop command |
VSC File Mode Read | 0x73 | 0xC2 | 0x73 | VSC File mode Read Command ( read back same VSC Mode Read) |
VSC File Status Info | 0x74 | 0xC2 | 0x74 | Read VSC File status Info. |
File List Read | 0x71 | 0xAC | 0x71 | read the Data Flash File List Data |
File List Clear | 0x70 | 0xAC | 0x70 | Clear Data Flash List |
Name | Hex Data |
PCode | 0x00 |
Group Id | 0xC0 |
Cmd | 0x00 |
Check sum | 0xE0 |
MOSI | 0x0000 |
MISO | 0x0020 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Name | Hex Data |
PCode | 0x41 |
Group Id | 0xC0 |
Cmd | 0x41 |
Check sum | 0x52 |
MOSI | 0x0000 |
MISO | 0x0010 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Name | Hex Data |
PCode | 40 |
Group Id | C0 |
Cmd | 40 |
Check sum | 44 |
MOSI | 0x0010 |
MISO | 0x0000 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data | E7 07 05 11 13 13 17 08 3B D8 64 64 80 70 00 00 |
Name | Hex Data |
PCode | 0x70 |
Group Id | 0xC2 |
Cmd | 0x70 |
Check sum | 0xAB |
MOSI | 0x0004 |
MISO | 0x0000 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data | 01 00 00 00 |
Name | Hex Data |
PCode | 0x64 |
Group Id | 0xC2 |
Cmd | 0x64 |
Check sum | 0x8A |
MOSI | 0x0000 |
MISO | 0x0000 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Name | Hex Data |
PCode | 0x65 |
Group Id | 0xC2 |
Cmd | 0x65 |
Check sum | 0x8C |
MOSI | 0x0000 |
MISO | 0x0000 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Name | Hex Data |
PCode | 0x6A |
Group Id | 0xC2 |
Cmd | 0x6A |
Check sum | 0xE3 |
MOSI | 0x0000 |
MISO | 0x0238 |
Parameter Data | 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Cmd Data format “index” set loops back from 0 to 999 after VSC Mode starts executing.
When Packet “index” loops back from 0 to 999 after VSC Mode starts executing, if 8000 is received, the data is not ready or 8000 is received for more than 1 second in a row, the VSC MODE Queue is overflowed
As mentioned, There are 968 bytes of returning data of VSC MODE READ. It includes two parts:
ECG DATA (800 bytes) – 2 channel ECG datas
INFO DATA (168 bytes) – 42 information
The detail description is listed below:
The INFO Data included 26 information for user to do the monitoring. It is listed below:
It includes Time (1), temperature(2), ECG data(2, 3), G-Sensor (5, 6, 7), Battery Status (8, 9), HRV (10, 11, 12, 13, 14, 15, 16), Barometer values(17, 18), and 5 G-Sensor points during the period (GS_X0..5, GS_Y0..5, GS_Z0..5).
Since the G-Sensor inside will keep monitor patient’s activity in a sampling rate of 25 Hz. A VSC Mode Data includes 200 ms information and it means the VSC Mode Data will have 5 points of G-Sensor data and they are GS_X0..5, GS_Y0..5, GS_Z0..5.
As mentioned, There are 568 bytees of returning data of VSC MODE READ. It includes two parts:
ECG DATA (400 bytes) – 1 channel ECG datas
INFO DATA (168 bytes) – 42 information
The detail description is listed below:
The INFO Data included 26 information for user to do the monitoring. It is listed below:
It includes Time (1), temperature(2), ECG data(2, 3), G-Sensor (5, 6, 7), Battery Status (8, 9), HRV (10, 11, 12, 13, 14, 15, 16), Barometer values(17, 18), and 5 G-Sensor points during the period (GS_X0..5, GS_Y0..5, GS_Z0..5).
Since the G-Sensor inside will keep monitor patient’s activity in a sampling rate of 25 Hz. A VSC Mode Data includes 200 ms information and it means the VSC Mode Data will have 5 points of G-Sensor data and they are GS_X0..5, GS_Y0..5, GS_Z0..5.
SREG NAME | SREG TYPE | Value Byte Size | Note |
SREG_DEVICE_NAME | STRING | 20 | BLE Device Name |
SREG_DEVICE_RESET | 0 | SREG Write then reset device | |
SREG_DEVICE_SSN | STRING | 32 | Device SSN |
SREG_MEAS_LEAD_OFF | INT | 4 | 0: Disable, 1: Enable |
SREG_DEVICE_ID | INT | 4 | Device ID |
SREG_DEVICE_BEACON | INT | 4 | 0: Disable, 1: Enable |
SREG_VSC_MODE_TYPE | INT | 4 | 0: Type 0, 1: Type 1 |
SREG_CHARG_POWER_DOWN | INT | 4 | 0: Disable, 1: Enable |
SREG_ADVERTISING_INTERVAL | INT | 4 | advertising interval setting range : 20 ~ 1000 (mSec) |
SREG_ADVERTISING_FIXED | INT | 4 | 0: Disable, 1: Enable |
SREG_FILE_RING_MODE | INT | 4 | 0: Disable, 1: Enable |
Name | Hex Data |
PCode | 0x71 |
Group Id | 0xC2 |
Cmd | 0x71 |
Check sum | 0xA8 |
MOSI | 0x0000 |
MISO | 0x0004 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Name | Hex Data |
PCode | 0x72 |
Group Id | 0xC2 |
Cmd | 0x72 |
Check sum | 0xA6 |
MOSI | 0x0000 |
MISO | 0x0000 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Name | Hex Data |
PCode | 0x73 |
Group Id | 0xC2 |
Cmd | 0x73 |
Check sum | 0xDA |
MOSI | 0x0008 |
MISO | 0x0238 |
Parameter Data | 67 52 D3 64 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
When the read packet index is 8000, resend after a delay of 100 ~ 200 milliseconds.
Each individual data is generated every 200 milliseconds.and the data from to the next second is as follows:
Name | Hex Data |
PCode | 0x74 |
Group Id | 0xC2 |
Cmd | 0x74 |
Check sum | 0xCA |
MOSI | 0x0000 |
MISO | 0x0020 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Name | Hex Data |
PCode | 0x71 |
Group Id | 0xAC |
Cmd | 0x71 |
Check sum | 0xDA |
MOSI | 0x0000 |
MISO | 0x0144 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |
Each item in the file consists of the following information, each occupying 16 bytes:
There can be a maximum of 20 items. Additionally, there is a count represented using 4 bytes, indicating the total 324 bytes.
Name | Hex Data |
PCode | 0x70 |
Group Id | 0xC2 |
Cmd | 0x70 |
Check sum | 0x8C |
MOSI | 0x0000 |
MISO | 0x0000 |
Parameter Data | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Cmd Data |