Lines Matching +full:open +full:- +full:firmware

14 This driver may be used if you are writing printer firmware using Linux as
24 This driver is structured for printer firmware that runs in user mode. The
25 user mode printer firmware will read and write data from the kernel mode
28 user space firmware can read or write this status byte using a device file
29 /dev/g_printer . Both blocking and non-blocking read/write calls are supported.
62 to put your firmware version here.
97 gcc prn_example.c -o prn_example
103 # prn_example -read_data
108 # cat data_file | prn_example -write_data
113 # prn_example -get_status
121 To set printer to Selected/On-line::
123 # prn_example -selected
126 To set printer to Not Selected/Off-line::
128 # prn_example -not_selected
133 # prn_example -paper_out
138 # prn_example -paper_loaded
143 # prn_example -no_error
148 # prn_example -error
171 * 'usage()' - Show program usage.
175 usage(const char *option) /* I - Option string or NULL */
183 fputs("Usage: prn_example -[options]\n", stderr);
186 fputs("-get_status Get the current printer status.\n", stderr);
187 fputs("-selected Set the selected status to selected.\n", stderr);
188 fputs("-not_selected Set the selected status to NOT selected.\n",
190 fputs("-error Set the error status to error.\n", stderr);
191 fputs("-no_error Set the error status to NO error.\n", stderr);
192 fputs("-paper_out Set the paper status to paper out.\n", stderr);
193 fputs("-paper_loaded Set the paper status to paper loaded.\n",
195 fputs("-read_data Read printer data from driver.\n", stderr);
196 fputs("-write_data Write printer sata to driver.\n", stderr);
197 fputs("-NB_read_data (Non-Blocking) Read printer data from driver.\n",
210 /* Open device file for printer gadget. */
211 fd[0].fd = open(PRINTER_FILE, O_RDWR);
215 return(-1);
237 return(-1);
260 /* Open device file for printer gadget. */
261 fd[0].fd = open (PRINTER_FILE, O_RDWR);
265 return(-1);
293 return(-1);
295 bytes_read -= retval;
321 /* Open device file for printer gadget. */
322 fd = open(PRINTER_FILE, O_RDWR|O_NONBLOCK);
326 return(-1);
354 /* Open device file for printer gadget. */
355 fd = open(PRINTER_FILE, O_RDWR);
359 return(-1);
366 return(-1);
385 return(-1);
388 /* Open device file for printer gadget. */
389 fd = open(PRINTER_FILE, O_RDWR);
394 return(-1);
406 return(-1);
424 return(-1);
462 if (argv[i][0] != '-') {
466 if (!strcmp(argv[i], "-get_status")) {
471 } else if (!strcmp(argv[i], "-paper_loaded")) {
476 } else if (!strcmp(argv[i], "-paper_out")) {
481 } else if (!strcmp(argv[i], "-selected")) {
486 } else if (!strcmp(argv[i], "-not_selected")) {
491 } else if (!strcmp(argv[i], "-error")) {
496 } else if (!strcmp(argv[i], "-no_error")) {
501 } else if (!strcmp(argv[i], "-read_data")) {
506 } else if (!strcmp(argv[i], "-write_data")) {
511 } else if (!strcmp(argv[i], "-NB_read_data")) {