Add waste tray status and cleaner unit end-of-life supply states #4017

Closed
michaelrsweet opened this Issue Feb 3, 2012 · 5 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Feb 3, 2012

Version: 1.6-feature
CUPS.org User: peter.hurleysoftware

Subsystem: backend

Some printers generate waste which must periodically be emptied. Also, some printers have cleaner units which should be replaced at end-of-life. The supply state should evaluate and report these additional warnings.

Attached is the relevant portion of a printer MIB which demonstrates these supplies.

Note that the supplies are already reported; only their statuses are not evaluated.

Collaborator

michaelrsweet commented Feb 3, 2012

CUPS.org User: peter.hurleysoftware

Attached is a patch to generate the relevant supply states and output from 'testsupplies' after patching.

Collaborator

michaelrsweet commented Mar 5, 2012

CUPS.org User: mike

"cleaner-life-over" is not yet defined for printer-state-reasons. I will propose it in the current Job and Printer Extensions - Set 3 spec in progress in the Printer Working Group.

I will also add "almost full" and "life almost over" at 5%.

Collaborator

michaelrsweet commented Mar 5, 2012

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Mar 5, 2012

"0001-Add-status-reports-for-full-waste-trays-and-cleaner-.patch":

From af58d7e5b0094cf4f1ac968bb5a9ce6a283d243a Mon Sep 17 00:00:00 2001
From: Peter Hurley peter@hurleysoftware.com
Date: Wed, 1 Feb 2012 11:43:48 -0500
Subject: [PATCH 1/1] Add status reports for full waste trays and cleaner unit
EOL

Signed-off-by: Peter Hurley peter@hurleysoftware.com

backend/snmp-supplies.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/backend/snmp-supplies.c b/backend/snmp-supplies.c
index c58bf12..e2f6f49 100644
--- a/backend/snmp-supplies.c
+++ b/backend/snmp-supplies.c
@@ -44,6 +44,8 @@
#define CUPS_OPC_LIFE_OVER 32
#define CUPS_TONER_LOW 64
#define CUPS_TONER_EMPTY 128
+#define CUPS_WASTE_FULL 256
+#define CUPS_CLEANER_LIFE_OVER 512

/*
@@ -189,7 +191,9 @@ static const backend_state_t const supply_states[] =
{ CUPS_OPC_NEAR_EOL, "opc-near-eol-report" },
{ CUPS_OPC_LIFE_OVER, "opc-life-over-warning" },
{ CUPS_TONER_LOW, "toner-low-report" },

  •         { CUPS_TONER_EMPTY, "toner-empty-warning" }
    
  •         { CUPS_TONER_EMPTY, "toner-empty-warning" },
    
  •         { CUPS_WASTE_FULL, "waste-receptacle-full-warning" },
    
  •         { CUPS_CLEANER_LIFE_OVER, "cleaner-life-over-warning" }
        };
    

@@ -291,6 +295,9 @@ backendSNMPSupplies(
break;
case CUPS_TC_wasteToner :
case CUPS_TC_wasteInk :

  •      case CUPS_TC_wasteWax :
    
  •          if (percent <= 1)
    
  •            new_supply_state |= CUPS_WASTE_FULL;
           break;
       case CUPS_TC_ink :
       case CUPS_TC_inkCartridge :
    
    @@ -317,6 +324,10 @@ backendSNMPSupplies(
    else
    new_supply_state |= CUPS_OPC_NEAR_EOL;
    break;
  •      case CUPS_TC_cleanerUnit:
    
  •          if (percent <= 1)
    
  •            new_supply_state |= CUPS_CLEANER_LIFE_OVER;
    
  •          break;
     }
    

    }
    }

    1.7.5.4
Collaborator

michaelrsweet commented Mar 5, 2012

"str4017.patch":

Index: backend/snmp-supplies.c

--- backend/snmp-supplies.c (revision 10326)
+++ backend/snmp-supplies.c (working copy)
@@ -36,14 +36,18 @@
#define CUPS_MAX_SUPPLIES 32 /* Maximum number of supplies for a printer /
#define CUPS_SUPPLY_TIMEOUT 2.0 /
Timeout for SNMP lookups */

-#define CUPS_DEVELOPER_LOW 1
-#define CUPS_DEVELOPER_EMPTY 2
-#define CUPS_MARKER_SUPPLY_LOW 4
-#define CUPS_MARKER_SUPPLY_EMPTY 8
-#define CUPS_OPC_NEAR_EOL 16
-#define CUPS_OPC_LIFE_OVER 32
-#define CUPS_TONER_LOW 64
-#define CUPS_TONER_EMPTY 128
+#define CUPS_DEVELOPER_LOW 0x0001
+#define CUPS_DEVELOPER_EMPTY 0x0002
+#define CUPS_MARKER_SUPPLY_LOW 0x0004
+#define CUPS_MARKER_SUPPLY_EMPTY 0x0008
+#define CUPS_OPC_NEAR_EOL 0x0010
+#define CUPS_OPC_LIFE_OVER 0x0020
+#define CUPS_TONER_LOW 0x0040
+#define CUPS_TONER_EMPTY 0x0080
+#define CUPS_WASTE_ALMOST_FULL 0x0100
+#define CUPS_WASTE_FULL 0x0200
+#define CUPS_CLEANER_NEAR_EOL 0x0400 /* Proposed JPS3 /
+#define CUPS_CLEANER_LIFE_OVER 0x0800 /
Proposed JPS3 */

/*
@@ -173,7 +177,11 @@
{ CUPS_OPC_NEAR_EOL, "opc-near-eol-report" },
{ CUPS_OPC_LIFE_OVER, "opc-life-over-warning" },
{ CUPS_TONER_LOW, "toner-low-report" },

  •         { CUPS_TONER_EMPTY, "toner-empty-warning" }
    
  •         { CUPS_TONER_EMPTY, "toner-empty-warning" },
    
  •         { CUPS_WASTE_ALMOST_FULL, "waste-receptacle-almost-full-report" },
    
  •         { CUPS_WASTE_FULL, "waste-receptacle-full-warning" },
    
  •         { CUPS_CLEANER_NEAR_EOL, "cleaner-near-eol-report" },
    
  •         { CUPS_CLEANER_LIFE_OVER, "cleaner-life-over-warning" },
        };
    

@@ -245,9 +253,6 @@
else
new_supply_state |= CUPS_TONER_LOW;
break;

  •      case CUPS_TC_wasteToner :
    
  •      case CUPS_TC_wasteInk :
    
  •          break;
       case CUPS_TC_ink :
       case CUPS_TC_inkCartridge :
       case CUPS_TC_inkRibbon :
    
    @@ -273,6 +278,23 @@
    else
    new_supply_state |= CUPS_OPC_NEAR_EOL;
    break;
  •      case CUPS_TC_wasteInk :
    
  •      case CUPS_TC_wastePaper :
    
  •      case CUPS_TC_wasteToner :
    
  •      case CUPS_TC_wasteWater :
    
  •      case CUPS_TC_wasteWax :
    
  •          if (percent <= 1)
    
  •            new_supply_state |= CUPS_WASTE_FULL;
    
  •          else
    
  •            new_supply_state |= CUPS_WASTE_ALMOST_FULL;
    
  •          break;
    
  •      case CUPS_TC_cleanerUnit :
    
  •      case CUPS_TC_fuserCleaningPad :
    
  •          if (percent <= 1)
    
  •            new_supply_state |= CUPS_CLEANER_LIFE_OVER;
    
  •          else
    
  •            new_supply_state |= CUPS_CLEANER_NEAR_EOL;
    
  •          break;
     }
    
    }

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment