Professional Documents
Culture Documents
Product Name:
Autor: Harald Eer
ECG-Loop-Event-Recorder
Content:
1 Purpose ............................................................................................................... 3
2 Application ........................................................................................................... 3
3 Description .......................................................................................................... 3
3.1 Parameter: ................................................................................................... 3
3.2 Synchronisation: ........................................................................................... 3
3.3 Communication block: .................................................................................. 3
3.4 Checksum: ................................................................................................... 4
4 Commands: ......................................................................................................... 5
4.5 Time/Date..................................................................................................... 5
4.5.1 Set time/date ......................................................................................... 5
4.5.2 Read time/date ...................................................................................... 5
4.6 Tests ............................................................................................................ 6
4.6.1 Buzzers test .......................................................................................... 6
4.6.2 Battery Voltage...................................................................................... 6
4.6.3 Firmware Version .................................................................................. 6
4.7 Patient Keys ................................................................................................. 6
4.7.1 Programming patient keys .................................................................... 6
4.7.2 Read patient keys ................................................................................. 6
4.8 Serialnumber ................................................................................................ 7
4.8.1 Set serialnumber ................................................................................... 7
4.8.2 Read serialnumber ................................................................................ 7
4.9 Boardnumber ............................................................................................... 7
4.9.1 Set Boardnumber .................................................................................. 7
4.9.2 Read Boardnumber ............................................................................... 7
4.10 Bluetooth Settings ........................................................................................ 8
4.10.1 Set Bluetooth_Pin ................................................................................. 8
4.10.2 Read Bluetooth _Pin ............................................................................. 8
4.10.3 Set Bluetooth_Config ............................................................................ 8
4.10.4 Read Bluetooth _Config ........................................................................ 8
4.10.5 Set Gateway Name ............................................................................... 8
4.10.6 Read Gateway Name ............................................................................ 8
1 Purpose
This document describes the communication interface for the I.E.M ECG Loop-Event
Recorder.
2 Application
It is described how data has to be handled between the PC and the Loop-Event
Recorder. The data is transferred using a Bluetooth dongle connected to the PC.
Note: All numbers mentioned in this Transmission Protocol are decimal numbers.
3 Description
The Loop-Event Recorder will be named as LER in the rest of the document.
3.1 Parameter:
115200 baud, 1 startbit, 1 stopbit, no parity
3.2 Synchronisation:
PC sends 5, ENQ LER returns 6, ACK
Any communication block which was received by the LER correctly, is confirmed by
6, ACK, in case of transmission errors, the LER will returned 21, NAK.
The return of ACK does only mean the block was received correctly NOT that the
command could be executed by the LER in the correct way!
3.4 Checksum:
The checksum is calculated by addition of the command byte and all data bytes. This
simply can be done by the following function:
#define BLOCK_SIZE 25
int i;
unsigned char Check; //checksum
Check=0;
for (i=1; i<(BLOCK_SIZE-2); Check += Buffer[i++]) ;
return Check;
}
4 Commands:
Syntax : <z> represents a comunication block with command byte z!
4.5 Time/Date
4.6 Tests
4.8 Serialnumber
4.9 Boardnumber
PC sends <126>
LER answers <126>
And 15 byte Boardnumber in the first data bytes
15 byte ASCII + 1 byte CRC
4.10.1Set Bluetooth_Pin
PC sends <236>
LER answers <236>
And Bluetooth Pin in the data bytes
4.10.3Set Bluetooth_Config
PC sends <238>
LER answers <238>
And Bluetooth Config byte in the first data byte
PC sends <240>
LER answers <240>
And Bluetooth gateway name in the data bytes
PC sends <242>
LER answers <242>
And GPRS APN in the data bytes
PC sends <244>
LER answers <244>
And GPRS Name in the data bytes
PC sends <246>
LER answers <246>
And GPRS Password in the data bytes
PC sends <248>
LER answers <248>
And GPRS DNS in the data bytes
PC sends <250>
LER answers <250>
And GPRS Pin in the data bytes
The highest nibble of each channel contains the channel flag in highest bit.
The channel flag is located in bit 15: 0 marks channel 1 and 1 marks channel 2.
4.16 UpdateECGHistory
PC sends <10> or <116> with the number of the measurement in the first databyte
different from 0!
The measurement will be marked as sent via Bluetooth. Code 100 indicates Loop
and Code 200 indicates Event.
Data BYTE 0 Channel CRC CRC CRC BIT11 BIT10 BIT9 BIT8
Data BYTE 1 BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0
CRC = (BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0) XOR (BIT11 BIT10 BIT9 BIT8)
CRC = (CRC High Nibble) XOR (CRC Low Nibble)
Data BYTE 2 Channel CRC CRC CRC BIT11 BIT10 BIT9 BIT8
Data BYTE 3 BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0
CRC = (BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0) XOR (BIT11 BIT10 BIT9 BIT8)
CRC = (CRC High Nibble) XOR (CRC Low Nibble)
CRC = CRC AND (BIT2 BIT1 BIT0)
CRC (K1) = (K1) BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0) XOR (BIT9 BIT8)
CRC (K2) = (K2) BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0) XOR (BIT9 BIT8)
CRC = CRC (K1) XOR CRC (K2)
CRC = CRC AND (BIT1 BIT0)
5.1 Codes
LOOP_SENT 100
LOOP 101
EVENT_SENT 200
EVENT 201
DELETED 202
5.2 Errors
ERR_POSITIONING 1
ERR_LEADS_OFF 2
ERR_BATT_LOW 10
Hardware error
ERR_WRITE_START_DATA 70
ERR_WRITE_EKG_TIME 71
ERR_WRITE_PUFFER2FLASH 72
ERR_STORE_HIST_DATA 73
ERR_RAM_WRITE 74
ERR_RAM_READ 75
ERR_RAM_START 76
ERR_FLASH_START 77
ERR_FLASH_READ 78
ERR_FLASH_WRITE 79