1 Summary: 2 Data Package Format
1 Summary: 2 Data Package Format
Summary
Generally, the Remote Display Box shows below information. 1) Display time in standby state. 2) Display the call charge and duration when in conversation. 3) Display call times and total charge of this customer after finished calls. 4) Check more than 15 call bills. The baud rate is 9600. At present, the display box only receives data and shows data. The host sends all data to every display box. There is a byte address data in every data package. The display box only deal with the data package for itself.
3. Communication Protocol
3.1 Date Time Data Package 0x0A
Data Package:
Data
Unsigned char Address; 0xFD Unsigned char Length; Unsigned char Code; Unsigned char Status1;
Description
Address of display box (0xA0); As common message
Data Head
Length of data Message ID, Status1 (bit0:sign of put up phone, bit1:PayMode (Multi-Pay Mode or Single-Pay Mode) bit2:whether in billing state, bit3:whether in check-out state, bit4:whether it is incoming call bit5:the sign of incoming call or outgoing call bit6:Line state (Lock/Unlock) , bit7:reserved for the Date Time Data Package, it is 0x0A
Unsigned char Status2; Unsigned Data[length-2] Unsigned char Code; 0xff 0xff char
A0 FD 11 0A 0F 00 06 00 49 47 46 42 49 40 47 40 41 40 48 40 46 94 FF FF --------4line on hook and line2 line3 lock, show 06 A0 FD 11 0A 0E 00 0E 00 48 41 41 40 41 40 46 40 42 40 47 40 42 82 FF FF --------the first line is in the pay mode, so not send date time.... show 0E A0 FD 11 0A 0F 00 0F 00 43 43 44 41 41 40 46 40 42 40 47 40 42 85 FF FF --------all the line is idel, so send all date time. Show 0F 2007-02-06 tuesday 01:14:33
2
///state word 1 ///state word 2 //// sum 0 duration // CRC //include finish code // include finish code
43 FD 18 0B 07 00 40 48 C9 49 44 42 10 10 40 42 C0 40 C0 40 0C A8 54 44 54 54 44 00 0C FF FF 0854445454 00:00: 20 2499.80 40 48 C9 49 44 42 10 10 is for charge, these byte position is fixed,and the C is :, 10 is empty. 40 42 C0 40 C0 40 is duration, position is fixed,and the C is :, 0C A8 54 44 54 54 440C is how many numbers,if more than 14,only get 14, A8 54 44 54 54 44 is telephone 08544445454 43 FD 18 0B 07----07= 0000 0111----bit2 is judge if connected, 0 not connected, 1 connected, bit1 is for incoming call or outgoing call ,bit3 is for pay mode(if have onhook, and pay) 43 FD 19 0B 07 00 45 45 C1 42 46 10 10 10 42 40 C0 40 C0 40 0E AA 81 23 45 67 89 AA 00 D2 FF FF 00812345678900 00:00:02 621.55
// state word 1 // state word 2 // subtotal sum 0 subtotal call count // CRC
Unsigned char Data[length-2] Unsigned char Code; 0xff //include finish code 0xff //include finish code
Unsigned char Data[length-2] Unsigned char Code; 0xff //include finish code 0xff //include finish code 40 FD 03 0D 03 00 00 10 FF FF
Line4 hand
up , not dial
0D 03---03= 0000 0011-----bit4 is for incoming call, bit1 is for ougoing call state bit. 00 10 FF FF------00 byte is for how many dial numbers, if more than 14, only show 14 43 FD 04 0D 03 00 01 49 5A FF FF Line1 hand up , dial number '9' 43 FD 11 0D 03 00 1B 49 48 48 48 48 48 48 48 48 48 48 48 48 48 1C FF FF Line1 hand up , dial number '98888888888888' 00 1B 49------1B byte is for how many dial numbers, if more than 14, only show 14 The byte is fixed, is 7th . 40 FD 11 0D 03 00 0E 42 43 43 43 43 43 43 43 43 43 43 43 43 43 C7 FF FF Line4 hand up , dial number'23333333333333' Address 40 is for tpj-04 line4, 43 is for tpj-04 line1
// state word 1 // state word 1 // call list // CRC // include finish code // include finish code
40 FD 13 0F 4A 00 18 03 12 45 6B CA AA 02 A9 07 81 06 B3 00 1E 11 A8 6D FF FF 0312456*# 00:11:21 19706.00 07 81 06 B3------07 is for day, 81 half byte 8 is for year ,is 2008, half byte 1 for month is 01, 06-----for hour state bit, and minute------0000 0110--bit7 is for hour state, if is 1, hour must add 12, 0 not neead, 000 0110 is for minute. B3 ---is for hour and second ---B=11, because the hour bit is 0, so not add 12. 3----is second. 43 FD 13 0F 4A 00 19 00 81 23 45 67 89 02 AB 07 81 06 B3 00 14 3C C3 4C FF FF 008123456789 00:11:23 13262.75