aboutsummaryrefslogtreecommitdiffstats
path: root/abcprint.txt
blob: 1ebd5e5ad26e6256ec8676a8e0cff291b85d9345 (plain)
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
abcprintd protocol

FF 00	-> end of print job

FF 01	-> FF as part of print job (FF FF in older firmware)

All other bytes are part of a print job


File sharing commands:
----------------------

All commands start with FF <opcode> <seq>, and all responses begin
with FF <opcode> <seq> <err>, where <err> is 0 for OK and otherwise
0x80+ABC80 error code.

All multibyte arguments are sent in littleendian order.

FF A0 ss ixix NNNNNNNNEEE		OPEN TEXT

   	ixix = Address of IX-map (used as a handle)

	Open an existing file for reading in text mode
	If the filename is empty (all spaces), read the directory

FF A1 ss ixix NNNNNNNNEEE		OPEN BINARY

	Open an existing file for reading in binary (block) mode

FF A2 ss ixix NNNNNNNNEEE		PREPARE TEXT

   	Create a new file for writing in text mode

FF A3 ss ixix NNNNNNNNEEE		PREPARE BINARY

   	Create a new file for writing in binary (block) mode

FF A4 ss ixix				INPUT

   	Read a text line; response followed by len (2 bytes) + data

FF A5 ss ixix len2			GET

	Read binary of specified len; response: len + data. No end of
	line conversion even if opened as a text file

FF A6 ss ixix len2 data...		PRINT

   	Write a text line or data block

FF A7 ss ixix				CLOSE

   	Close a file handle

FF A8 ss xxxx				CLOSE ALL

	All files are closed and forgotten.  xxxx ignored.

FF A9 ss xxxx				INIT

	All files are closed and forgotten.  Block size is set to 253.
	xxxx ignored.  No response token is sent.

FF AA ss xxxx NNNNNNNNEEE NNNNNNNNEEE	RENAME

	Rename the first filename to the second filename.

FF AB ss xxxx NNNNNNNNEEE		DELETE

	Delete the named file

FF AC ss ixix blk2			PREAD

	Read a block starting at offset blk2*block size.  This moves
	the file pointer as if it had been a SEEK followed by READ
	BLOCK. No end of line conversion even if opened as a text file.

FF AD ss ixix blk2 data...		PWRITE

	Write a block starting at offset blk2*block size.  This moves
	the file pointer as if it had been a SEEK followed by WRITE
	BLOCK/PRINT. No end of line conversion even if opened as a
	text file.

FF AE ss xxxx len2			SET BLOCK SIZE

	Set the block size for the PREAD and PWRITE commands and for
	directory listing.

FF AF ss xxxx len2			INITSZ

	All files are closed and forgotten.  Block size is set to len2.
	xxxx ignored.  No response token is sent.

FF Bn ss ixix posn			REWIND, SEEK1..SEEK8

	Seek to a specific position (n bytes, 0-8).
	REWIND is effectively "SEEK0".

FF B9 ss ixix len2 data...		PUT

	Write a data block of specified length.
	No end of line conversion even if opened as a text file.


Debug console
-------------

FF C0 .... 00

	Text between FF C0 and terminating 00 are written out on
	stdout for abcprintd if the -c option was given.  Intended to
	be used for debugging messages.