CAPS Universe documentation  1.0.4
All you need to know to be successful
Functions | Variables
hl2-series.c File Reference

Definition of some printer features related to the HL2xxx printer family. More...

Functions

static int hl2_driver_job_finish (struct caps_drv *drvi, void *d)
 
static int hl2_driver_page_print (struct caps_drv *drvi, void *d)
 
static int hl2_driver_page_setup (struct caps_drv *drvi, void *d)
 
static int hl2_driver_job_start (struct caps_drv *drvi, void *d)
 
static void hl2_printer_setup (struct hl2_drv *t1)
 
static int hl2_driver_runtime_adaptions (struct caps_drv *drvi, void *d)
 
static int hl2_driver_module_exit (struct caps_drv *drvi, void *d)
 
static int hl2_driver_device_monitor (struct caps_drv *drvi, void *d)
 
static int hl2_driver_module_init (struct caps_drv *drvi, void *d)
 

Variables

static const struct hl_printer_name_to_id hl2_supported_printers []
 The list of printers the hl2 driver supports.
 
const struct caps_generic_driver caps_hl_driver
 
struct caps_arg_parser_list parser_list
 

Detailed Description

The printers seems to be able to handle some kind of media/paper typed differently when printing. Here a generic list of types is defined, at least shared by HL-20 and HL-21 printers.

Function Documentation

◆ hl2_driver_job_finish()

static int hl2_driver_job_finish ( struct caps_drv drvi,
void *  d 
)
static

◆ hl2_driver_page_print()

static int hl2_driver_page_print ( struct caps_drv drvi,
void *  d 
)
static

Called from the libcapsdriver framework

◆ hl2_driver_page_setup()

static int hl2_driver_page_setup ( struct caps_drv drvi,
void *  d 
)
static

◆ hl2_driver_job_start()

static int hl2_driver_job_start ( struct caps_drv drvi,
void *  d 
)
static

◆ hl2_printer_setup()

static void hl2_printer_setup ( struct hl2_drv t1)
static

Configure the printer when its corresponding driver lauches.

Parameters
[in]t1Our driver instance description

The configuration is sent once. It starts with 128 NUL bytes. It is unclear if the printer really needs this, but I found many drivers which start their printing with such kind of empty dummy data.

Precondition
hl2_driver_runtime_adaptions() must already be called
Todo:

Test, if these settings are valid as long as the printer is online, or if a PCL "\eE" reset command resets these settings as well (and thus, they must be repeated again and again).

Have the HL1 series the same power management like the HL2 family has?

◆ hl2_driver_runtime_adaptions()

static int hl2_driver_runtime_adaptions ( struct caps_drv drvi,
void *  d 
)
static

◆ hl2_driver_module_exit()

static int hl2_driver_module_exit ( struct caps_drv drvi,
void *  d 
)
static
Note
Called before termination to clean up memory use

◆ hl2_driver_device_monitor()

static int hl2_driver_device_monitor ( struct caps_drv drvi,
void *  d 
)
static

◆ hl2_driver_module_init()

static int hl2_driver_module_init ( struct caps_drv drvi,
void *  d 
)
static
Parameters
[in]drviThe libcapsdriver handle
[in]dThe private parameter from the caps_drv_run() call

Used to allocate some driver specific memory.

Variable Documentation

◆ hl2_supported_printers

const struct hl_printer_name_to_id hl2_supported_printers[]
static
Initial value:
= {
{ .printer_name = "HL-2030", .id = CAPS_BRLASER_HL_2030, },
{ .printer_name = "HL-2040", .id = CAPS_BRLASER_HL_2040, },
{ .printer_name = "HL-2070", .id = CAPS_BRLASER_HL_2070, },
{ .printer_name = "HL-2130", .id = CAPS_BRLASER_HL_2130, },
{ .printer_name = "HL-2140", .id = CAPS_BRLASER_HL_2140, },
{ .printer_name = "HL-2170", .id = CAPS_BRLASER_HL_2170, },
{ .printer_name = "HL-L2300", .id = CAPS_BRLASER_HL_L2300, },
{ .printer_name = "HL-L2340", .id = CAPS_BRLASER_HL_L2340, },
{ .printer_name = NULL, },
}
@ CAPS_BRLASER_HL_2170
Definition: hl-printer-series.h:44
@ CAPS_BRLASER_HL_L2300
Definition: hl-printer-series.h:46
@ CAPS_BRLASER_HL_2130
Definition: hl-printer-series.h:42
@ CAPS_BRLASER_HL_2030
Definition: hl-printer-series.h:39
@ CAPS_BRLASER_HL_2040
Definition: hl-printer-series.h:40
@ CAPS_BRLASER_HL_L2340
Definition: hl-printer-series.h:47
@ CAPS_BRLASER_HL_2070
Definition: hl-printer-series.h:41
@ CAPS_BRLASER_HL_2140
Definition: hl-printer-series.h:43
Note
Most of the printers here are untested (as of November 2022)

◆ caps_hl_driver

const struct caps_generic_driver caps_hl_driver
Initial value:
= {
.printer_adaptions = hl2_driver_runtime_adaptions,
.job_start = hl2_driver_job_start,
.job_finish = hl2_driver_job_finish,
.page_setup = hl2_driver_page_setup,
.page_print = hl2_driver_page_print,
.printer_monitor = hl2_driver_device_monitor,
}
static int hl2_driver_job_finish(struct caps_drv *drvi, void *d)
Definition: hl2-series.c:53
static int hl2_driver_device_monitor(struct caps_drv *drvi, void *d)
Definition: hl2-series.c:272
static int hl2_driver_module_exit(struct caps_drv *drvi, void *d)
Definition: hl2-series.c:258
static int hl2_driver_page_print(struct caps_drv *drvi, void *d)
Definition: hl2-series.c:69
static int hl2_driver_page_setup(struct caps_drv *drvi, void *d)
Definition: hl2-series.c:87
static int hl2_driver_job_start(struct caps_drv *drvi, void *d)
Definition: hl2-series.c:103
static int hl2_driver_runtime_adaptions(struct caps_drv *drvi, void *d)
Definition: hl2-series.c:203
static int hl2_driver_module_init(struct caps_drv *drvi, void *d)
Definition: hl2-series.c:283

◆ parser_list

struct caps_arg_parser_list parser_list
Initial value:
= {
.version = "caps-brother-hl2 (CAPS universe) " PACKAGE_VERSION,
.bugreport = PACKAGE_BUGREPORT,
.progname = "caps-brother-hl2",
.feature = ( "Printer driver for Brother HL2xxx monochrome laser printer series" ),
.domain = PACKAGE,
}