-
Notifications
You must be signed in to change notification settings - Fork 5
/
dscKeybusPrintData-RTOS.c
2222 lines (1972 loc) · 81 KB
/
dscKeybusPrintData-RTOS.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
DSC Keybus Interface
https://github.com/taligentx/dscKeybusInterface-RTOS
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dscKeybusInterface-RTOS.h"
/*
* Print messages
*/
void dscPrintPanelMessage() {
switch (dscPanelData[0]) {
case 0x05: dscPrintPanel_0x05(); return; // Panel status: partitions 1-4
case 0x0A: dscPrintPanel_0x0A(); return; // Panel status in alarm/programming, partitions 1-4
case 0x11: dscPrintPanel_0x11(); return; // Keypad slot query
case 0x16: dscPrintPanel_0x16(); return; // Zone wiring
case 0x1B: dscPrintPanel_0x1B(); return; // Panel status: partitions 5-8
case 0x1C: dscPrintPanel_0x1C(); return; // Verify keypad Fire/Auxiliary/Panic
case 0x27: dscPrintPanel_0x27(); return; // Panel status and zones 1-8 status
case 0x28: dscPrintPanel_0x28(); return; // Zone expander query
case 0x2D: dscPrintPanel_0x2D(); return; // Panel status and zones 9-16 status
case 0x34: dscPrintPanel_0x34(); return; // Panel status and zones 17-24 status
case 0x3E: dscPrintPanel_0x3E(); return; // Panel status and zones 25-32 status
case 0x4C: dscPrintPanel_0x4C(); return; // Unknown Keybus query
case 0x58: dscPrintPanel_0x58(); return; // Unknown Keybus query
case 0x5D: dscPrintPanel_0x5D(); return; // Flash panel lights: status and zones 1-32, partition 1
case 0x63: dscPrintPanel_0x63(); return; // Flash panel lights: status and zones 1-32, partition 2
case 0x64: dscPrintPanel_0x64(); return; // Beep - one-time, partition 1
case 0x69: dscPrintPanel_0x69(); return; // Beep - one-time, partition 2
case 0x75: dscPrintPanel_0x75(); return; // Beep pattern - repeated, partition 1
case 0x7A: dscPrintPanel_0x7A(); return; // Beep pattern - repeated, partition 2
case 0x7F: dscPrintPanel_0x7F(); return; // Beep - one-time long beep, partition 1
case 0x82: dscPrintPanel_0x82(); return; // Beep - one-time long beep, partition 1
case 0x87: dscPrintPanel_0x87(); return; // Panel outputs
case 0x8D: dscPrintPanel_0x8D(); return; // User code programming key response, codes 17-32
case 0x94: dscPrintPanel_0x94(); return; // Unknown - immediate after entering *5 programming
case 0xA5: dscPrintPanel_0xA5(); return; // Date, time, system status messages - partitions 1-2
case 0xB1: dscPrintPanel_0xB1(); return; // Enabled zones 1-32
case 0xBB: dscPrintPanel_0xBB(); return; // Bell
case 0xC3: dscPrintPanel_0xC3(); return; // Keypad status
case 0xCE: dscPrintPanel_0xCE(); return; // Unknown command
case 0xD5: dscPrintPanel_0xD5(); return; // Keypad zone query
case 0xE6: dscPrintPanel_0xE6(); return; // Extended status commands: partitions 3-8, zones 33-64
case 0xEB: dscPrintPanel_0xEB(); return; // Date, time, system status messages - partitions 1-8
default: {
printf("Unrecognized data");
if (!dscValidCRC()) {
printf("[No CRC or CRC Error]");
return;
}
else printf("[CRC OK]");
return;
}
}
}
void dscPrintModuleMessage() {
switch (dscModuleData[0]) {
case 0x77: dscPrintModule_0x77(); return; // Keypad fire alarm
case 0xBB: dscPrintModule_0xBB(); return; // Keypad auxiliary alarm
case 0xDD: dscPrintModule_0xDD(); return; // Keypad panic alarm
}
// Keypad and module responses to panel queries
switch (dscCurrentCmd) {
case 0x11: dscPrintModule_Panel_0x11(); return; // Keypad slot query response
case 0xD5: dscPrintModule_Panel_0xD5(); return; // Keypad zone query response
}
// Keypad and module status update notifications
if (dscModuleData[4] != 0xFF || dscModuleData[5] != 0xFF) {
dscPrintModule_Notification();
return;
}
// Keypad keys
dscPrintModule_Keys();
}
/*
* Print panel messages
*/
// Keypad lights for commands 0x05, 0x0A, 0x1B, 0x27, 0x2D, 0x34, 0x3E, 0x5D
void dscPrintPanelLights(byte dscPanelByte) {
if (dscPanelData[dscPanelByte] == 0) printf("none ");
else {
if (bitRead(dscPanelData[dscPanelByte],0)) printf("Ready ");
if (bitRead(dscPanelData[dscPanelByte],1)) printf("Armed ");
if (bitRead(dscPanelData[dscPanelByte],2)) printf("Memory ");
if (bitRead(dscPanelData[dscPanelByte],3)) printf("Bypass ");
if (bitRead(dscPanelData[dscPanelByte],4)) printf("Trouble ");
if (bitRead(dscPanelData[dscPanelByte],5)) printf("Program ");
if (bitRead(dscPanelData[dscPanelByte],6)) printf("Fire ");
if (bitRead(dscPanelData[dscPanelByte],7)) printf("Backlight ");
}
}
// Messages for commands 0x05, 0x0A, 0x1B, 0x27, 0x2D, 0x34, 0x3E
void dscPrintPanelMessages(byte dscPanelByte) {
switch (dscPanelData[dscPanelByte]) {
case 0x01: printf("Partition ready"); break;
case 0x02: printf("Stay/away zones open"); break;
case 0x03: printf("Zones open"); break;
case 0x04: printf("Armed stay"); break;
case 0x05: printf("Armed away"); break;
case 0x07: printf("Failed to arm"); break;
case 0x08: printf("Exit delay in progress"); break;
case 0x09: printf("Arming with no entry delay"); break;
case 0x0B: printf("Quick exit in progress"); break;
case 0x0C: printf("Entry delay in progress"); break;
case 0x0D: printf("Opening after alarm"); break;
case 0x10: printf("Keypad lockout"); break;
case 0x11: printf("Partition in alarm"); break;
case 0x14: printf("Auto-arm in progress"); break;
case 0x15: printf("Arming with bypassed zones"); break;
case 0x16: printf("Armed with no entry delay"); break;
case 0x22: printf("Recent closing"); break;
case 0x33: printf("Command output in progress"); break;
case 0x3D: printf("Disarmed after alarm in memory"); break;
case 0x3E: printf("Partition disarmed"); break;
case 0x40: printf("Keypad blanked"); break;
case 0x8A: printf("Activate stay/away zones"); break;
case 0x8B: printf("Quick exit"); break;
case 0x8E: printf("Invalid option"); break;
case 0x8F: printf("Invalid access code"); break;
case 0x9E: printf("Enter * function code"); break;
case 0x9F: printf("Enter access code"); break;
case 0xA0: printf("*1: Zone bypass programming"); break;
case 0xA1: printf("*2: Trouble menu"); break;
case 0xA2: printf("*3: Alarm memory display"); break;
case 0xA3: printf("Door chime enabled"); break;
case 0xA4: printf("Door chime disabled"); break;
case 0xA5: printf("Enter master code"); break;
case 0xA6: printf("*5: Access codes"); break;
case 0xA7: printf("*5: Enter new code"); break;
case 0xA9: printf("*6: User functions"); break;
case 0xAA: printf("*6: Time and Date"); break;
case 0xAB: printf("*6: Auto-arm time"); break;
case 0xAC: printf("*6: Auto-arm enabled"); break;
case 0xAD: printf("*6: Auto-arm disabled"); break;
case 0xAF: printf("*6: System test"); break;
case 0xB0: printf("*6: Enable DLS"); break;
case 0xB2: printf("*7: Command output"); break;
case 0xB7: printf("Enter installer code"); break;
case 0xB8: printf("* pressed while armed"); break;
case 0xB9: printf("*2: Zone tamper menu"); break;
case 0xBA: printf("*2: Zones with low batteries"); break;
case 0xC6: printf("*2: Zone fault menu"); break;
case 0xC8: printf("*2: Service required menu"); break;
case 0xD0: printf("*2: Handheld keypads with low batteries"); break;
case 0xD1: printf("*2: Wireless keys with low batteries"); break;
case 0xE4: printf("*8: Main menu"); break;
case 0xE5: printf("Keypad slot assignment"); break;
case 0xE6: printf("*8: Input required: 2 digits"); break;
case 0xE7: printf("*8: Input required: 3 digits"); break;
case 0xE8: printf("*8: Input required: 4 digits"); break;
case 0xEA: printf("*8: Reporting code: 2 digits"); break;
case 0xEB: printf("*8: Telephone number account code: 4 digits"); break;
case 0xEC: printf("*8: Input required: 6 digits"); break;
case 0xED: printf("*8: Input required: 32 digits"); break;
case 0xEE: printf("*8: Input required: 1 option per zone"); break;
case 0xF0: printf("Function key 1 programming"); break;
case 0xF1: printf("Function key 2 programming"); break;
case 0xF2: printf("Function key 3 programming"); break;
case 0xF3: printf("Function key 4 programming"); break;
case 0xF4: printf("Function key 5 programming"); break;
case 0xF8: printf("Keypad programming"); break;
default:
printf("Unrecognized data: 0x%02X", dscPanelData[dscPanelByte]);
break;
}
}
// Status messages for commands 0xA5, 0xEB
void dscPrintPanelStatus0(byte dscPanelByte) {
bool decoded = true;
switch (dscPanelData[dscPanelByte]) {
/*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00011000 01001111 10110000 11101100 01001001 11111111 11110000 [0xA5] 03/29/2018 16:59 | Duress alarm
* 10100101 0 00011000 01001111 11001110 10111100 01001010 11111111 11011111 [0xA5] 03/30/2018 14:47 | Disarmed after alarm in memory
* 10100101 0 00011000 01001111 11001010 01000100 01001011 11111111 01100100 [0xA5] 03/30/2018 10:17 | Partition in alarm
* 10100101 0 00011000 01010000 01001001 10111000 01001100 11111111 01011001 [0xA5] 04/02/2018 09:46 | Zone expander supervisory alarm
* 10100101 0 00011000 01010000 01001010 00000000 01001101 11111111 10100011 [0xA5] 04/02/2018 10:00 | Zone expander supervisory restored
* 10100101 0 00011000 01001111 01110010 10011100 01001110 11111111 01100111 [0xA5] 03/27/2018 18:39 | Keypad Fire alarm
* 10100101 0 00011000 01001111 01110010 10010000 01001111 11111111 01011100 [0xA5] 03/27/2018 18:36 | Keypad Aux alarm
* 10100101 0 00011000 01001111 01110010 10001000 01010000 11111111 01010101 [0xA5] 03/27/2018 18:34 | Keypad Panic alarm
* 10100101 0 00010001 01101101 01100000 00000100 01010001 11111111 11010111 [0xA5] 11/11/2011 00:01 | Keypad status check? // Power-on +124s, keypad sends status update immediately after this
* 10100101 0 00011000 01001111 01110010 10011100 01010010 11111111 01101011 [0xA5] 03/27/2018 18:39 | Keypad Fire alarm restored
* 10100101 0 00011000 01001111 01110010 10010000 01010011 11111111 01100000 [0xA5] 03/27/2018 18:36 | Keypad Aux alarm restored
* 10100101 0 00011000 01001111 01110010 10001000 01010100 11111111 01011001 [0xA5] 03/27/2018 18:34 | Keypad Panic alarm restored
* 10100101 0 00011000 01001111 11110110 00110100 10011000 11111111 11001101 [0xA5] 03/31/2018 22:13 | Keypad lockout
* 10100101 0 00011000 01001111 11101011 10100100 10111110 11111111 01011000 [0xA5] 03/31/2018 11:41 | Armed partial: Zones bypassed
* 10100101 0 00011000 01001111 11101011 00011000 10111111 11111111 11001101 [0xA5] 03/31/2018 11:06 | Armed special: quick-arm/auto-arm/keyswitch/wireless key/DLS
* 10100101 0 00010001 01101101 01100000 00101000 11100101 11111111 10001111 [0xA5] 11/11/2011 00:10 | Auto-arm cancelled
* 10100101 0 00011000 01001111 11110111 01000000 11100110 11111111 00101000 [0xA5] 03/31/2018 23:16 | Disarmed special: keyswitch/wireless key/DLS
* 10100101 0 00011000 01001111 01101111 01011100 11100111 11111111 10111101 [0xA5] 03/27/2018 15:23 | Panel battery trouble
* 10100101 0 00011000 01001111 10110011 10011000 11101000 11111111 00111110 [0xA5] 03/29/2018 19:38 | AC power failure // Sent after delay in *8 [370]
* 10100101 0 00011000 01001111 01110100 01010000 11101001 11111111 10111000 [0xA5] 03/27/2018 20:20 | Bell trouble
* 10100101 0 00011000 01001111 11000000 10001000 11101100 11111111 00111111 [0xA5] 03/30/2018 00:34 | Telephone line trouble
* 10100101 0 00011000 01001111 01101111 01110000 11101111 11111111 11011001 [0xA5] 03/27/2018 15:28 | Panel battery restored
* 10100101 0 00011000 01010000 00100000 01011000 11110000 11111111 01110100 [0xA5] 04/01/2018 00:22 | AC power restored // Sent after delay in *8 [370]
* 10100101 0 00011000 01001111 01110100 01011000 11110001 11111111 11001000 [0xA5] 03/27/2018 20:22 | Bell restored
* 10100101 0 00011000 01001111 11000000 10001000 11110100 11111111 01000111 [0xA5] 03/30/2018 00:34 | Telephone line restored
* 10100101 0 00011000 01001111 11100001 01011000 11111111 11111111 01000011 [0xA5] 03/31/2018 01:22 | System test
*/
// 0x09 - 0x28: Zone alarm, zones 1-32
// 0x29 - 0x48: Zone alarm restored, zones 1-32
case 0x49: printf("Duress alarm"); break;
case 0x4A: printf("Disarmed after alarm in memory"); break;
case 0x4B: printf("Partition in alarm"); break;
case 0x4C: printf("Zone expander supervisory alarm"); break;
case 0x4D: printf("Zone expander supervisory restored"); break;
case 0x4E: printf("Keypad Fire alarm"); break;
case 0x4F: printf("Keypad Aux alarm"); break;
case 0x50: printf("Keypad Panic alarm"); break;
case 0x51: printf("Auxiliary input alarm"); break;
case 0x52: printf("Keypad Fire alarm restored"); break;
case 0x53: printf("Keypad Aux alarm restored"); break;
case 0x54: printf("Keypad Panic alarm restored"); break;
case 0x55: printf("Auxilary input alarm restored"); break;
// 0x56 - 0x75: Zone tamper, zones 1-32
// 0x76 - 0x95: Zone tamper restored, zones 1-32
case 0x98: printf("Keypad lockout"); break;
// 0x99 - 0xBD: Armed by access code
case 0xBE: printf("Armed partial: Zones bypassed"); break;
case 0xBF: printf("Armed special: quick-arm/auto-arm/keyswitch/wireless key/DLS"); break;
// 0xC0 - 0xE4: Disarmed by access code
case 0xE5: printf("Auto-arm cancelled"); break;
case 0xE6: printf("Disarmed special: keyswitch/wireless key/DLS"); break;
case 0xE7: printf("Panel battery trouble"); break;
case 0xE8: printf("Panel AC power failure"); break;
case 0xE9: printf("Bell trouble"); break;
case 0xEA: printf("Power on +16s"); break;
case 0xEC: printf("Telephone line trouble"); break;
case 0xEF: printf("Panel battery restored"); break;
case 0xF0: printf("Panel AC power restored"); break;
case 0xF1: printf("Bell restored"); break;
case 0xF4: printf("Telephone line restored"); break;
case 0xFF: printf("System test"); break;
default: decoded = false;
}
if (decoded) return;
/*
* Zone alarm, zones 1-32
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00011000 01001111 01001001 11011000 00001001 11111111 00110101 [0xA5] 03/26/2018 09:54 | Zone alarm: 1
* 10100101 0 00011000 01001111 01001010 00100000 00001110 11111111 10000011 [0xA5] 03/26/2018 10:08 | Zone alarm: 6
* 10100101 0 00011000 01001111 10010100 11001000 00010000 11111111 01110111 [0xA5] 03/28/2018 20:50 | Zone alarm: 8
*/
if (dscPanelData[dscPanelByte] >= 0x09 && dscPanelData[dscPanelByte] <= 0x28) {
printf("Zone alarm: %d", dscPanelData[dscPanelByte] - 0x08);
return;
}
/*
* Zone alarm restored, zones 1-32
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00011000 01001111 10010100 11001100 00101001 11111111 10010100 [0xA5] 03/28/2018 20:51 | Zone alarm restored: 1
* 10100101 0 00011000 01001111 10010100 11010100 00101110 11111111 10100001 [0xA5] 03/28/2018 20:53 | Zone alarm restored: 6
* 10100101 0 00011000 01001111 10010100 11010000 00110000 11111111 10011111 [0xA5] 03/28/2018 20:52 | Zone alarm restored: 8
*/
if (dscPanelData[dscPanelByte] >= 0x29 && dscPanelData[dscPanelByte] <= 0x48) {
printf("Zone alarm restored: %d", dscPanelData[dscPanelByte] - 0x28);
return;
}
/*
* Zone tamper, zones 1-32
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00000001 01000100 00100010 01011100 01010110 11111111 10111101 [0xA5] 01/01/2001 02:23 | Zone tamper: 1
* 10100101 0 00000001 01000100 00100010 01011100 01010111 11111111 10111101 [0xA5] 01/01/2001 02:23 | Zone tamper: 2
* 10100101 0 00010001 01101101 01101011 10010000 01011011 11111111 01111000 [0xA5] 11/11/2011 11:36 | Zone tamper: 6
*/
if (dscPanelData[dscPanelByte] >= 0x56 && dscPanelData[dscPanelByte] <= 0x75) {
printf("Zone tamper: %d", dscPanelData[6] - 0x55);
return;
}
/*
* Zone tamper restored, zones 1-32
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00000001 01000100 00100010 01011100 01110110 11111111 11011101 [0xA5] 01/01/2001 02:23 | Zone tamper restored: 1
* 10100101 0 00000001 01000100 00100010 01011100 01111000 11111111 11011101 [0xA5] 01/01/2001 02:23 | Zone tamper restored: 2
* 10100101 0 00010001 01101101 01101011 10010000 01111011 11111111 10011000 [0xA5] 11/11/2011 11:36 | Zone tamper restored: 6
*/
if (dscPanelData[dscPanelByte] >= 0x76 && dscPanelData[dscPanelByte] <= 0x95) {
printf("Zone tamper restored: %d", dscPanelData[dscPanelByte] - 0x75);
return;
}
/*
* Armed by access code
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00011000 01001101 00001000 10010000 10011001 11111111 00111010 [0xA5] 03/08/2018 08:36 | Armed by user code 1
* 10100101 0 00011000 01001101 00001000 10111100 10111011 11111111 10001000 [0xA5] 03/08/2018 08:47 | Armed by master code 40
*/
if (dscPanelData[dscPanelByte] >= 0x99 && dscPanelData[dscPanelByte] <= 0xBD) {
byte dscCode = dscPanelData[dscPanelByte] - 0x98;
if (dscCode >= 35) dscCode += 5;
printf("Armed by ");
switch (dscCode) {
case 33: printf("duress "); break;
case 34: printf("duress "); break;
case 40: printf("master "); break;
case 41: printf("supervisor "); break;
case 42: printf("supervisor "); break;
default: printf("user "); break;
}
printf("code %d", dscCode);
return;
}
/*
* Disarmed by access code
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00011000 01001101 00001000 11101100 11000000 11111111 10111101 [0xA5] 03/08/2018 08:59 | Disarmed by user code 1
* 10100101 0 00011000 01001101 00001000 10110100 11100010 11111111 10100111 [0xA5] 03/08/2018 08:45 | Disarmed by master code 40
*/
if (dscPanelData[dscPanelByte] >= 0xC0 && dscPanelData[dscPanelByte] <= 0xE4) {
byte dscCode = dscPanelData[dscPanelByte] - 0xBF;
if (dscCode >= 35) dscCode += 5;
printf("Disarmed by ");
switch (dscCode) {
case 33: printf("duress "); break;
case 34: printf("duress "); break;
case 40: printf("master "); break;
case 41: printf("supervisor "); break;
case 42: printf("supervisor "); break;
default: printf("user "); break;
}
printf("code %d", dscCode);
return;
}
printf("Unrecognized data");
}
// Status messages for commands 0xA5, 0xEB
void dscPrintPanelStatus1(byte dscPanelByte) {
switch (dscPanelData[dscPanelByte]) {
/*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00011000 01001111 11001010 10001001 00000011 11111111 01100001 [0xA5] 03/30/2018 10:34 | Cross zone alarm
* 10100101 0 00010001 01101101 01101010 00000001 00000100 11111111 10010001 [0xA5] 11/11/2011 10:00 | Delinquency alarm
* 10100101 0 00010001 01101101 01100000 10101001 00100100 00000000 01010000 [0xA5] 11/11/2011 00:42 | Auto-arm cancelled by duress code 33
* 10100101 0 00010001 01101101 01100000 10110101 00100101 00000000 01011101 [0xA5] 11/11/2011 00:45 | Auto-arm cancelled by duress code 34
* 10100101 0 00010001 01101101 01100000 00101001 00100110 00000000 11010010 [0xA5] 11/11/2011 00:10 | Auto-arm cancelled by master code 40
* 10100101 0 00010001 01101101 01100000 10010001 00100111 00000000 00111011 [0xA5] 11/11/2011 00:36 | Auto-arm cancelled by supervisor code 41
* 10100101 0 00010001 01101101 01100000 10111001 00101000 00000000 01100100 [0xA5] 11/11/2011 00:46 | Auto-arm cancelled by supervisor code 42
* 10100101 0 00011000 01001111 10100000 10011101 00101011 00000000 01110100 [0xA5] 03/29/2018 00:39 | Armed by auto-arm
* 10100101 0 00011000 01001101 00001010 00001101 10101100 00000000 11001101 [0xA5] 03/08/2018 10:03 | Exit *8 programming
* 10100101 0 00011000 01001101 00001001 11100001 10101101 00000000 10100001 [0xA5] 03/08/2018 09:56 | Enter *8
* 10100101 0 00010001 01101101 01100010 11001101 11010000 00000000 00100010 [0xA5] 11/11/2011 02:51 | Command output 4
* 10100101 0 00010110 01010110 00101011 11010001 11010010 00000000 11011111 [0xA5] 2016.05.17 11:52 | Armed with no entry delay cancelled
*/
case 0x03: printf("Cross zone alarm"); return;
case 0x04: printf("Delinquency alarm"); return;
case 0x24: printf("Auto-arm cancelled by duress code 33"); return;
case 0x25: printf("Auto-arm cancelled by duress code 34"); return;
case 0x26: printf("Auto-arm cancelled by master code 40"); return;
case 0x27: printf("Auto-arm cancelled by supervisor code 41"); return;
case 0x28: printf("Auto-arm cancelled by supervisor code 42"); return;
case 0x2B: printf("Armed by auto-arm"); return;
// 0x6C - 0x8B: Zone fault restored, zones 1-32
// 0x8C - 0xAB: Zone fault, zones 1-32
case 0xAC: printf("Exit *8 programming"); return;
case 0xAD: printf("Enter *8 programming"); return;
// 0xB0 - 0xCF: Zones bypassed, zones 1-32
case 0xD0: printf("Command output 4"); return;
case 0xD2: printf("Armed with no entry delay cancelled"); return;
}
/*
* Zone fault restored, zones 1-32
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00010001 01101101 01101011 01000001 01101100 11111111 00111010 [0xA5] 11/11/2011 11:16 | Zone fault restored: 1
* 10100101 0 00010001 01101101 01101011 01010101 01101101 11111111 01001111 [0xA5] 11/11/2011 11:21 | Zone fault restored: 2
* 10100101 0 00010001 01101101 01101011 10000101 01101111 11111111 10000001 [0xA5] 11/11/2011 11:33 | Zone fault restored: 4
* 10100101 0 00010001 01101101 01101011 10001001 01110000 11111111 10000110 [0xA5] 11/11/2011 11:34 | Zone fault restored: 5
*/
if (dscPanelData[dscPanelByte] >= 0x6C && dscPanelData[dscPanelByte] <= 0x8B) {
printf("Zone fault restored: %d", dscPanelData[dscPanelByte] - 0x6B);
return;
}
/*
* Zone fault, zones 1-32
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00010001 01101101 01101011 00111101 10001100 11111111 01010110 [0xA5] 11/11/2011 11:15 | Zone fault: 1
* 10100101 0 00010001 01101101 01101011 01010101 10001101 11111111 01101111 [0xA5] 11/11/2011 11:21 | Zone fault: 2
* 10100101 0 00010001 01101101 01101011 10000001 10001111 11111111 10011101 [0xA5] 11/11/2011 11:32 | Zone fault: 3
* 10100101 0 00010001 01101101 01101011 10001001 10010000 11111111 10100110 [0xA5] 11/11/2011 11:34 | Zone fault: 4
*/
if (dscPanelData[dscPanelByte] >= 0x8C && dscPanelData[dscPanelByte] <= 0xAB) {
printf("Zone fault: %d", dscPanelData[dscPanelByte] - 0x8B);
return;
}
/*
* Zones bypassed, zones 1-32
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00011000 01001111 10110001 10101001 10110001 00000000 00010111 [0xA5] 03/29/2018 17:42 | Zone bypassed: 2
* 10100101 0 00011000 01001111 10110001 11000001 10110101 00000000 00110011 [0xA5] 03/29/2018 17:48 | Zone bypassed: 6
*/
if (dscPanelData[dscPanelByte] >= 0xB0 && dscPanelData[dscPanelByte] <= 0xCF) {
printf("Zone bypassed: %d", dscPanelData[dscPanelByte] - 0xAF);
return;
}
printf("Unrecognized data");
}
// Status messages for commands 0xA5, 0xEB
void dscPrintPanelStatus2(byte dscPanelByte) {
switch (dscPanelData[dscPanelByte]) {
/*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00011000 01001111 10101111 10000110 00101010 00000000 01101011 [0xA5] 03/29/2018 15:33 | Quick exit
* 10100101 0 00010001 01101101 01110101 00111010 01100011 00000000 00110101 [0xA5] 11/11/2011 21:14 | Keybus fault restored
* 10100101 0 00011000 01001111 11110111 01110110 01100110 00000000 11011111 [0xA5] 03/31/2018 23:29 | Enter *1 zone bypass programming
* 10100101 0 00010001 01101101 01100010 11001110 01101001 00000000 10111100 [0xA5] 11/11/2011 02:51 | Command output 3
* 10100101 0 00011000 01010000 01000000 00000010 10001100 00000000 11011011 [0xA5] 04/02/2018 00:00 | Loss of system time
* 10100101 0 00011000 01001111 10101110 00001110 10001101 00000000 01010101 [0xA5] 03/29/2018 14:03 | Power on
* 10100101 0 00011000 01010000 01000000 00000010 10001110 00000000 11011101 [0xA5] 04/02/2018 00:00 | Panel factory default
* 10100101 0 00011000 01001111 11101010 10111010 10010011 00000000 01000011 [0xA5] 03/31/2018 10:46 | Disarmed by keyswitch
* 10100101 0 00011000 01001111 11101010 10101110 10010110 00000000 00111010 [0xA5] 03/31/2018 10:43 | Armed by keyswitch
* 10100101 0 00011000 01001111 10100000 01100010 10011000 00000000 10100110 [0xA5] 03/29/2018 00:24 | Armed by quick-arm
* 10100101 0 00010001 01101101 01100000 00101110 10011001 00000000 01001010 [0xA5] 11/11/2011 00:11 | Activate stay/away zones
* 10100101 0 00011000 01001111 00101101 00011010 10011010 00000000 11101101 [0xA5] 03/25/2018 13:06 | Armed: stay
* 10100101 0 00011000 01001111 00101101 00010010 10011011 00000000 11100110 [0xA5] 03/25/2018 13:04 | Armed: away
* 10100101 0 00011000 01001111 00101101 10011010 10011100 00000000 01101111 [0xA5] 03/25/2018 13:38 | Armed with no entry delay
* 10100101 0 00011000 01001111 00101100 11011110 11000011 00000000 11011001 [0xA5] 03/25/2018 12:55 | Enter *5 programming
* 10100101 0 00011000 01001111 00101110 00000010 11100110 00000000 00100010 [0xA5] 03/25/2018 14:00 | Enter *6 programming
*/
case 0x2A: printf("Quick exit"); return;
case 0x63: printf("Keybus fault restored"); return;
case 0x66: printf("Enter *1 zone bypass programming"); return;
case 0x67: printf("Command output 1"); return;
case 0x68: printf("Command output 2"); return;
case 0x69: printf("Command output 3"); return;
case 0x8C: printf("Loss of system time"); return;
case 0x8D: printf("Power on"); return;
case 0x8E: printf("Panel factory default"); return;
case 0x93: printf("Disarmed by keyswitch"); return;
case 0x96: printf("Armed by keyswitch"); return;
case 0x97: printf("Armed by keypad away"); return;
case 0x98: printf("Armed by quick-arm"); return;
case 0x99: printf("Activate stay/away zones"); return;
case 0x9A: printf("Armed: stay"); return;
case 0x9B: printf("Armed: away"); return;
case 0x9C: printf("Armed with no entry delay"); return;
case 0xC3: printf("Enter *5 programming"); return;
// 0xC6 - 0xE5: Auto-arm cancelled by user code
case 0xE6: printf("Enter *6 programming"); return;
// 0xE9 - 0xF0: Supervisory restored, keypad slots 1-8
// 0xF1 - 0xF8: Supervisory trouble, keypad slots 1-8
}
/*
* Auto-arm cancelled by user code
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00010001 01101101 01100000 00111110 11000110 00000000 10000111 [0xA5] 11/11/2011 00:15 | Auto-arm cancelled by user code 1
* 10100101 0 00010001 01101101 01100000 01111010 11100101 00000000 11100010 [0xA5] 11/11/2011 00:30 | Auto-arm cancelled by user code 32
*/
if (dscPanelData[dscPanelByte] >= 0xC6 && dscPanelData[dscPanelByte] <= 0xE5) {
printf("Auto-arm cancelled by user code %d", dscPanelData[dscPanelByte] - 0xC5);
return;
}
/*
* Supervisory restored, keypad slots 1-8
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00010001 01101101 01110100 10001110 11101001 11111111 00001101 [0xA5] 11/11/2011 20:35 | Supervisory - module detected: Keypad slot 1
* 10100101 0 00010001 01101101 01110100 00110010 11110000 11111111 10111000 [0xA5] 11/11/2011 20:12 | Supervisory - module detected: Keypad slot 8
*/
if (dscPanelData[dscPanelByte] >= 0xE9 && dscPanelData[dscPanelByte] <= 0xF0) {
printf("Supervisory - module detected: Keypad slot %d", dscPanelData[dscPanelByte] - 0xE8);
return;
}
/*
* Supervisory trouble, keypad slots 1-8
*
* YYY1YYY2 MMMMDD DDDHHHHH MMMMMM
* 10100101 0 00010001 01101101 01110100 10000110 11110001 11111111 00001101 [0xA5] 11/11/2011 20:33 | Supervisory - module trouble: Keypad slot 1
* 10100101 0 00010001 01101101 01110100 00101110 11111000 11111111 10111100 [0xA5] 11/11/2011 20:11 | Supervisory - module trouble: Keypad slot 8
*/
if (dscPanelData[dscPanelByte] >= 0xF1 && dscPanelData[dscPanelByte] <= 0xF8) {
printf("Supervisory - module trouble: Keypad slot %d", dscPanelData[dscPanelByte] - 0xF0);
return;
}
printf("Unrecognized data");
}
// Status messages for commands 0xA5, 0xEB
void dscPrintPanelStatus3(byte dscPanelByte) {
printf("Unrecognized data: 0x%02X", dscPanelByte);
}
// Status messages for command 0xEB
void dscPrintPanelStatus4(byte dscPanelByte) {
if (dscPanelData[dscPanelByte] <= 0x1F) {
printf("Zone alarm: %d", dscPanelData[dscPanelByte] + 33);
return;
}
if (dscPanelData[dscPanelByte] >= 0x20 && dscPanelData[dscPanelByte] <= 0x3F) {
printf("Zone alarm restored: %d", dscPanelData[dscPanelByte] + 1);
return;
}
if (dscPanelData[dscPanelByte] >= 0x40 && dscPanelData[dscPanelByte] <= 0x5F) {
printf("Zone tamper: %d", dscPanelData[dscPanelByte] - 31);
return;
}
if (dscPanelData[dscPanelByte] >= 0x60 && dscPanelData[dscPanelByte] <= 0x7F) {
printf("Zone tamper restored: %d", dscPanelData[dscPanelByte] - 63);
return;
}
printf("Unrecognized data");
}
// Status messages for command 0xEB
void dscPrintPanelStatus14(byte dscPanelByte) {
if (dscPanelData[dscPanelByte] >= 0x40 && dscPanelData[dscPanelByte] <= 0x5F) {
printf("Zone fault restored: %d", dscPanelData[dscPanelByte] - 31);
return;
}
if (dscPanelData[dscPanelByte] >= 0x60 && dscPanelData[dscPanelByte] <= 0x7F) {
printf("Zone fault: %d", dscPanelData[dscPanelByte] - 63);
return;
}
printf("Unrecognized data");
}
// Prints individual bits as a number for partitions and zones
void dscPrintPanelBitNumbers(byte dscPanelByte, byte startNumber) {
for (byte bit = 0; bit < 8; bit++) {
if (bitRead(dscPanelData[dscPanelByte],bit)) {
printf("%d ", startNumber + bit);
}
}
}
/*
* 0x05: Status - partitions 1-4
* Interval: constant
* CRC: no
* Byte 2: Partition 1 lights
* Byte 3: Partition 1 status
* Byte 4: Partition 2 lights
* Byte 5: Partition 2 status
*
* PC5020/PC1616/PC1832/PC1864:
* Byte 6: Partition 3 lights
* Byte 7: Partition 3 status
* Byte 8: Partition 4 lights
* Byte 9: Partition 4 status
*
* // PC1555MX, PC5015
* 00000101 0 10000001 00000001 10010001 11000111 [0x05] Partition 1 | Lights: Ready Backlight | Partition ready | Partition 2: disabled
* 00000101 0 10010000 00000011 10010001 11000111 [0x05] Status lights: Trouble Backlight | Partition not ready
* 00000101 0 10001010 00000100 10010001 11000111 [0x05] Status lights: Armed Bypass Backlight | Armed stay
* 00000101 0 10000010 00000101 10010001 11000111 [0x05] Status lights: Armed Backlight | Armed away
* 00000101 0 10001011 00001000 10010001 11000111 [0x05] Status lights: Ready Armed Bypass Backlight | Exit delay in progress
* 00000101 0 10000010 00001100 10010001 11000111 [0x05] Status lights: Armed Backlight | Entry delay in progress
* 00000101 0 10000001 00010000 10010001 11000111 [0x05] Status lights: Ready Backlight | Keypad lockout
* 00000101 0 10000010 00010001 10010001 11000111 [0x05] Status lights: Armed Backlight | Partition in alarm
* 00000101 0 10000001 00110011 10010001 11000111 [0x05] Status lights: Ready Backlight | Partition busy
* 00000101 0 10000001 00111110 10010001 11000111 [0x05] Status lights: Ready Backlight | Partition disarmed
* 00000101 0 10000001 01000000 10010001 11000111 [0x05] Status lights: Ready Backlight | Keypad blanked
* 00000101 0 10000001 10001111 10010001 11000111 [0x05] Status lights: Ready Backlight | Invalid access code
* 00000101 0 10000000 10011110 10010001 11000111 [0x05] Status lights: Backlight | Quick armed pressed
* 00000101 0 10000001 10100011 10010001 11000111 [0x05] Status lights: Ready Backlight | Door chime enabled
* 00000101 0 10000001 10100100 10010001 11000111 [0x05] Status lights: Ready Backlight | Door chime disabled
* 00000101 0 10000010 00001101 10010001 11000111 [0x05] Status lights: Armed Backlight * Delay zone tripped after dscPrevious alarm tripped
* 00000101 0 10000000 00111101 10010001 11000111 [0x05] Status lights: Backlight * Disarmed after dscPrevious alarm tripped
* 00000101 0 10000000 00100010 10010001 11000111 [0x05] Status lights: Backlight * Disarmed after dscPrevious alarm tripped +4s
* 00000101 0 10000010 10100110 10010001 11000111 [0x05] Status lights: Armed Backlight * In *5 programming
*
* // PC5020, PC1616, PC1832, PC1864
* 00000101 0 10000000 00000011 10000010 00000101 10000010 00000101 00000000 11000111 [0x05] Status lights: Backlight | Zones open
*/
void dscPrintPanel_0x05() {
printf("Partition 1: ");
dscPrintPanelLights(2);
printf("- ");
dscPrintPanelMessages(3);
if (dscPanelData[5] == 0xC7) {
printf(" | Partition 2: disabled");
}
else {
printf(" | Partition 2: ");
dscPrintPanelLights(4);
printf("- ");
dscPrintPanelMessages(5);
}
if (dscPanelByteCount > 9) {
if (dscPanelData[7] == 0xC7) {
printf(" | Partition 3: disabled");
}
else {
printf(" | Partition 3: ");
dscPrintPanelLights(6);
printf("- ");
dscPrintPanelMessages(7);
}
if (dscPanelData[9] == 0xC7) {
printf(" | Partition 4: disabled");
}
else {
printf(" | Partition 4: ");
dscPrintPanelLights(8);
printf("- ");
dscPrintPanelMessages(9);
}
}
}
/*
* 0x0A: Status in alarm, programming
* Interval: constant in *8 programming
* CRC: yes
* Byte 2: Partition 1 lights
* Byte 3: Partition 1 status
* Byte 4-7: Zone lights
* Byte 8: Zone lights for *5 access codes 33,34,41,42
*
* 00001010 0 10000010 11100100 00000000 00000000 00000000 00000000 00000000 01110000 [0x0A] Status lights: Armed | Zone lights: none
* 00001010 0 10000001 11101110 01100101 00000000 00000000 00000000 00000000 11011110 [0x0A] Status lights: Ready | Zone lights: 1 3 6 7
*/
void dscPrintPanel_0x0A() {
if (!dscValidCRC()) {
printf("[CRC Error]");
return;
}
dscPrintPanelLights(2);
printf("- ");
dscPrintPanelMessages(3);
bool zoneLights = false;
printf(" | Zone lights: ");
for (byte dscPanelByte = 4; dscPanelByte < 8; dscPanelByte++) {
if (dscPanelData[dscPanelByte] != 0) {
zoneLights = true;
for (byte zoneBit = 0; zoneBit < 8; zoneBit++) {
if (bitRead(dscPanelData[dscPanelByte],zoneBit)) {
printf("%d ", (zoneBit + 1) + ((dscPanelByte-4) * 8));
}
}
}
}
if (dscPanelData[8] != 0 && dscPanelData[8] != 128) {
zoneLights = true;
if (bitRead(dscPanelData[8],0)) printf("33 ");
if (bitRead(dscPanelData[8],1)) printf("34 ");
if (bitRead(dscPanelData[8],3)) printf("41 ");
if (bitRead(dscPanelData[8],4)) printf("42 ");
}
if (!zoneLights) printf("none");
}
/*
* 0x11: Keypad slot query
* Interval: 30s
* CRC: no
*
* 00010001 0 10101010 10101010 10101010 10101010 10101010 [0x11] Keypad slot query
* 11111111 1 00111111 11111111 11111111 11111111 11111111 [Keypad] Slot 1
* 11111111 1 11111111 11111100 11111111 11111111 11111111 [Keypad] Slot 8
*/
void dscPrintPanel_0x11() {
printf("Keypad slot query");
}
/*
* 0x16: Zone wiring
* Interval: 4min
* CRC: yes
* Byte 2: TBD, identical with PC1555MX, PC5015, PC1832
* Byte 3: TBD, different between PC1555MX, PC5015, PC1832
* Byte 4 bits 2-7: TBD, identical with PC1555MX and PC5015
*
* 00010110 0 00001110 00100011 11010001 00011001 [0x16] PC1555MX | Zone wiring: NC | Exit *8 programming
* 00010110 0 00001110 00100011 11010010 00011001 [0x16] PC1555MX | Zone wiring: EOL | Exit *8 programming
* 00010110 0 00001110 00100011 11010011 00011001 [0x16] PC1555MX | Zone wiring: DEOL | Exit *8 programming
* 00010110 0 00001110 00100011 11100001 00101000 [0x16] PC1555MX | Zone wiring: NC | In *8
* 00010110 0 00001110 00100011 11100110 00101101 [0x16] PC1555MX | Zone wiring: EOL | Enter *8 programming
* 00010110 0 00001110 00100011 11110010 00111001 [0x16] PC1555MX | Zone wiring: EOL | Armed, Exit *8 +15s, Power-on +2m
* 00010110 0 00001110 00100011 11110111 00111101 [0x16] PC1555MX | Zone wiring: DEOL | Interval 4m
* 00010110 0 00001110 00010000 11110011 00100111 [0x16] PC5015 | Zone wiring: DEOL | Armed, Exit *8 +15s, Power-on +2m
* 00010110 0 00001110 01000001 11110101 01011010 [0x16] PC1832 | Zone wiring: NC | Interval 4m
* 00010110 0 00001110 01000010 10110101 00011011 [0x16] PC1864 | Zone wiring: NC | Interval 4m
* 00010110 0 00001110 01000010 10110001 00010111 [0x16] PC1864 | Zone wiring: NC | Armed
*/
void dscPrintPanel_0x16() {
if (!dscValidCRC()) {
printf("[CRC Error]");
return;
}
if (dscPanelData[2] == 0x0E) {
switch (dscPanelData[3]) {
case 0x10: printf("PC5015 "); break;
case 0x23: printf("PC1555MX "); break;
case 0x41: printf("PC1832 "); break;
case 0x42: printf("PC1864 "); break;
default: printf("Unknown panel "); break;
}
switch (dscPanelData[4] & 0x03) {
case 0x01: printf("| Zone wiring: NC "); break;
case 0x02: printf("| Zone wiring: EOL "); break;
case 0x03: printf("| Zone wiring: DEOL "); break;
}
switch (dscPanelData[4] >> 2) {
case 0x2C: printf("| Armed"); break;
case 0x2D: printf("| Interval 4m"); break;
case 0x34: printf("| Exit *8 programming"); break;
case 0x39: printf("| *8 programming"); break;
case 0x3C: printf("| Armed, Exit *8 +15s, Power-on +2m"); break;
case 0x3D: printf("| Interval 4m"); break;
default: printf("| Unrecognized data"); break;
}
}
else printf("Unrecognized data");
}
/*
* 0x1B: Status - partitions 5-8
* Interval: constant
* CRC: no
* Byte 2: Partition 5 lights
* Byte 3: Partition 5 status
* Byte 4: Partition 6 lights
* Byte 5: Partition 6 status
* Byte 6: Partition 7 lights
* Byte 7: Partition 7 status
* Byte 8: Partition 8 lights
* Byte 9: Partition 8 status
*
* 00011011 0 10010001 00000001 00010000 11000111 00010000 11000111 00010000 11000111 [0x1B]
*/
void dscPrintPanel_0x1B() {
if (dscPanelData[3] == 0xC7) {
printf("Partition 5: disabled");
}
else {
printf("Partition 5: ");
dscPrintPanelLights(2);
printf("- ");
dscPrintPanelMessages(3);
}
if (dscPanelData[5] == 0xC7) {
printf(" | Partition 6: disabled");
}
else {
printf(" | Partition 6: ");
dscPrintPanelLights(4);
printf("- ");
dscPrintPanelMessages(5);
}
if (dscPanelData[7] == 0xC7) {
printf(" | Partition 7: disabled");
}
else {
printf(" | Partition 7: ");
dscPrintPanelLights(6);
printf("- ");
dscPrintPanelMessages(7);
}
if (dscPanelData[9] == 0xC7) {
printf(" | Partition 8: disabled");
}
else {
printf(" | Partition 8: ");
dscPrintPanelLights(8);
printf("- ");
dscPrintPanelMessages(9);
}
}
/*
* 0x1C: Verify keypad Fire/Auxiliary/Panic
* Interval: immediate after keypad button press
* CRC: no
*
* 01110111 1 11111111 11111111 11111111 11111111 [Keypad] Fire alarm
* 00011100 0 [0x1C] Verify keypad Fire/Auxiliary/Panic
* 01110111 1 [Keypad] Fire alarm
*/
void dscPrintPanel_0x1C() {
printf("Verify keypad Fire/Auxiliary/Panic");
}
/*
* 0x27: Status with zones 1-8
* Interval: 4m
* CRC: yes
* Byte 2: Partition 1 lights
* Byte 3: Partition 1 status
* Byte 4: Partition 2 lights
* Byte 5: Partition 2 status
* Byte 6: Zones 1-8
*
* 00100111 0 10000001 00000001 10010001 11000111 00000000 00000001 [0x27] Status lights: Ready Backlight | Zones lights: none // Unarmed, zones closed
* 00100111 0 10000001 00000001 10010001 11000111 00000010 00000011 [0x27] Status lights: Ready Backlight | Zones lights: 2 // Unarmed, zone 2 open
* 00100111 0 10001010 00000100 10010001 11000111 00000000 00001101 [0x27] Status lights: Armed Bypass Backlight | Zones lights: none // Armed stay // Periodic while armed
* 00100111 0 10001010 00000100 11111111 11111111 00000000 10110011 [0x27] Status lights: Armed Bypass Backlight | Zones lights: none // Armed stay +1s
* 00100111 0 10000010 00000101 10010001 11000111 00000000 00000110 [0x27] Status lights: Armed Backlight | Zones lights: none // Armed away // Periodic while armed
* 00100111 0 10000010 00000101 11111111 11111111 00000000 10101100 [0x27] Status lights: Armed Backlight | Zones lights: none // Armed away +1s
* 00100111 0 10000010 00001100 10010001 11000111 00000001 00001110 [0x27] Status lights: Armed Backlight | Zones lights: 1 // Delay zone 1 tripped, entrance delay
* 00100111 0 10000010 00010001 10010001 11000111 00000001 00010011 [0x27] Status lights: Armed Backlight | Zones lights: 1 // Periodic after delay zone 1 tripped, alarm on * Periodic after fire alarm, alarm on
* 00100111 0 10000010 00001101 10010001 11000111 00000001 00001111 [0x27] Status lights: Armed Backlight | Zones lights: 1 // Immediate after delay zone 1 tripped after dscPrevious alarm tripped
* 00100111 0 10000010 00010001 11011011 11111111 00000010 10010110 [0x27] Status lights: Armed Backlight | Zones lights: 2 // Instant zone 2 tripped away
* 00100111 0 00000001 00000001 11111111 11111111 00000000 00100111 [0x27] Status lights: Ready | Zones open 1-8: none // Immediate after power on after panel reset
* 00100111 0 10010001 00000001 11111111 11111111 00000000 10110111 [0x27] Status lights: Ready Trouble Backlight | Zones open 1-8: none // +15s after exit *8
* 00100111 0 10010001 00000001 10100000 00000000 00000000 01011001 [0x27] Status lights: Ready Trouble Backlight | Zones open 1-8: none // +33s after power on after panel reset
* 00100111 0 10010000 00000011 11111111 11111111 00111111 11110111 [0x27] Status lights: Trouble Backlight | Zones open: 1 2 3 4 5 6 // +122s after power on after panel reset
* 00100111 0 10010000 00000011 10010001 11000111 00111111 01010001 [0x27] Status lights: Trouble Backlight | Zones open: 1 2 3 4 5 6 // +181s after power on after panel reset
* 00100111 0 10000000 00000011 10000010 00000101 00011101 01001110 [0x27] Status lights: Backlight | Zones open | Zones 1-8 open: 1 3 4 5 // PC1832
*/
void dscPrintPanel_0x27() {
if (!dscValidCRC()) {
printf("[CRC Error]");
return;
}
printf("Partition 1: ");
dscPrintPanelLights(2);
printf("- ");
dscPrintPanelMessages(3);
if (dscPanelData[5] == 0xC7) {
printf(" | Partition 2: disabled");
}
else if (dscPanelData[5] != 0xFF) {
printf(" | Partition 2: ");
dscPrintPanelLights(4);
printf("- ");
dscPrintPanelMessages(5);
}
printf(" | Zones 1-8 open: ");
if (dscPanelData[6] == 0) printf("none");
else {
dscPrintPanelBitNumbers(6,1);
}
}
/*
* 0x28: Zone expander query
* Interval: after zone expander status notification
* CRC: no
*
* 11111111 1 11111111 11111111 10111111 11111111 [Zone Expander] Status notification
* 00101000 0 11111111 11111111 11111111 11111111 11111111 [0x28] Zone expander query
* 11111111 1 01010111 01010101 11111111 11111111 01101111 [Zone Expander] Status
*/
void dscPrintPanel_0x28() {
printf("Zone expander query");
}
/*
* 0x2D: Status with zones 9-16
* Interval: 4m
* CRC: yes
* Byte 2: Partition 1 lights
* Byte 3: Partition 1 status
* Byte 4: Partition 2 lights
* Byte 5: Partition 2 status
* Byte 6: Zones 9-16
*
* 00101101 0 10000000 00000011 10000001 11000111 00000001 11111001 [0x2D] Status lights: Backlight | Partition not ready | Open zones: 9
* 00101101 0 10000000 00000011 10000010 00000101 00000000 00110111 [0x2D] Status lights: Backlight | Zones open | Zones 9-16 open: none // PC1832
*/
void dscPrintPanel_0x2D() {
if (!dscValidCRC()) {
printf("[CRC Error]");
return;
}
printf("Partition 1: ");
dscPrintPanelLights(2);
printf("- ");
dscPrintPanelMessages(3);
if (dscPanelData[5] == 0xC7) {
printf(" | Partition 2: disabled");
}
else if (dscPanelData[5] != 0xFF) {
printf(" | Partition 2: ");
dscPrintPanelLights(4);
printf("- ");
dscPrintPanelMessages(5);
}
printf(" | Zones 9-16 open: ");
if (dscPanelData[6] == 0) printf("none");
else {
dscPrintPanelBitNumbers(6,9);
}
}
/*
* 0x34: Status with zones 17-24
* Interval: 4m
* CRC: yes
* Byte 2: Partition 1 lights
* Byte 3: Partition 1 status
* Byte 4: Partition 2 lights
* Byte 5: Partition 2 status
* Byte 6: Zones 17-24
*/
void dscPrintPanel_0x34() {
if (!dscValidCRC()) {
printf("[CRC Error]");
return;
}
printf("Partition 1: ");
dscPrintPanelLights(2);
printf("- ");
dscPrintPanelMessages(3);
if (dscPanelData[5] == 0xC7) {
printf(" | Partition 2: disabled");
}
else if (dscPanelData[5] != 0xFF) {