-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpkcapt.c
118 lines (93 loc) · 3.65 KB
/
pkcapt.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
/*
* Linux Canon LBP800 CAPT driver
* CAPT command packages routines header file
* Copyright (c) 2007 Massimo Del Fedele <[email protected]>
*
* Adapted from a printer driver for Samsung ML-85G laser printer
* (C) Copyleft, 2000 Rildo Pragana <[email protected]>
* and from Linux Canon CAPT LBP810 driver
* Copyright (C) 2004 Nicolas Boichat <[email protected]>
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "machine.h"
#include "llcapt.h"
#include "pkcapt.h"
///////////////////////////////////////////////////////////////
// PACCHETTI DI COMANDO STANDARD
BYTE Packet_a0_a0[4] = {0xa0, 0xa0, 0x04, 0x00};
BYTE StartDataPacket[] = {0xa0, 0xc0, 0x00, 0x00};
BYTE InterBandPacket[] = {0xa0, 0xe0, 0x04, 0x00};
BYTE Packet_a0_a2[4] = {0xa0, 0xa2, 0x04, 0x00};
BYTE PaperPacket[4] = {0xa1, 0xa0, 0x04, 0x00};
BYTE Packet_a1_a1[4] = {0xa1, 0xa1, 0x04, 0x00};
BYTE Packet_a1_d0[4] = {0xa1, 0xd0, 0x04, 0x00};
BYTE Packet_a4_e0[4] = {0xa4, 0xe0, 0x04, 0x00};
BYTE Packet_a0_d0[38] =
{ //0x00 ???
0xa0, 0xd0, 0x26, 0x00, 0x16, 0x00, 0xa4, 0x01,
0x02, 0x01, 0x00, 0x00, 0x1f, 0x1f, 0x1f, 0x1f,
0x00, 0x11, 0x03, 0x01, 0x01, 0x01, 0x02, 0x00,
0x00, 0x00, 0x70, 0x00, 0x78, 0x00, 0x50, 0x02,
0x7a, 0x1a, 0x60, 0x13, 0x67, 0x1b
};
BYTE Packet_a5_e0[12] =
{
0xa5, 0xe0, 0x0c, 0x00,
0xee, 0xdb, 0xea, 0xad, 0x00, 0x00, 0x00, 0x00
};
inline BYTE Send_StartDataPacket(int Device, UINT DataSize)
{
DataSize += sizeof(StartDataPacket); // LUNGHEZZA DELLO HEADER !
StartDataPacket[2] = DataSize & 0xFF;
StartDataPacket[3] = (DataSize & 0xFF00) >> 8;
return SendPacket(Device, StartDataPacket, sizeof(StartDataPacket), 0);
} // END Send_StartDataPacket()
inline BYTE Send_InterBandPacket(int Device)
{
return SendPacket(Device, InterBandPacket, sizeof(InterBandPacket), 255); //llcapt
} // END Send_InterBandPacket()
inline BYTE Send_Packet_a0_a0(int Device)
{
return SendPacket(Device, Packet_a0_a0, sizeof(Packet_a0_a0), 255); //llcapt
} // END Send_Packet_a0_a0()
inline BYTE Send_Packet_a0_a2(int Device)
{
return SendPacket(Device, Packet_a0_a2, sizeof(Packet_a0_a2), 255);
} // END Send_Packet_a0_a2()
inline BYTE Send_PaperPacket(int Device)
{
return SendPacket(Device, PaperPacket, sizeof(PaperPacket), 255);
} // END Send_PaperPacket()
inline BYTE Send_Packet_a1_a1(int Device)
{
return SendPacket(Device, Packet_a1_a1, sizeof(Packet_a1_a1), 255);
} // END Send_Packet_a1_a1()
inline BYTE Send_Packet_a1_d0(int Device)
{
return SendPacket(Device, Packet_a1_d0, sizeof(Packet_a1_d0), 0);
} // END Send_Packet_a1_d0()
inline BYTE Send_Packet_a4_e0(int Device)
{
return SendPacket(Device, Packet_a4_e0, sizeof(Packet_a4_e0), 255);
} // END Send_Packet_a4_e0
inline BYTE Send_Packet_a0_d0(int Device)
{
return SendPacket(Device, Packet_a0_d0, sizeof(Packet_a0_d0), 0);
} // END Send_Packet_a0_d0
inline BYTE Send_Packet_a5_e0(int Device)
{
return SendPacket(Device, Packet_a5_e0, sizeof(Packet_a5_e0), 255);
} // END Send_Packet_e5_a0