Providing Notification/Status

When a printer problem occurs, the gateway must perform two actions:

When the PSM creates a printer agent, it also creates six abstract event objects. The PSM uses these objects to inform users what notification can be provided. The PSM also uses them as triggering mechanisms for generating event notifications. The PSM populates these abstract event objects with the events for which it will generate notification. The gateway can also add attributes to the abstract event objects to indicate those events for which it will generate notifications.

For example, assume that the gateway has added paper jam to the printer error abstract event object and that the printer has just jammed. The gateway needs to report the event. The gateway does this by filling out the JPMReportXferStruct and passing the information to the PSM (opcode JPM_OP_REPORT_EVENT). (See the ReportEvent function in psmcomm.c in the example code.)

In addition to generating an event, it is usually necessary to update the ndps-att-printer-state-reasons attribute in the MOD. The ndps-att-printer-state-reasons attribute is a multi-valued attribute used by the PSM to set the printer agent's severity and is referenced in setting the printer agent state. The ndps-att-printer-state-reasons attribute also gives additional information about the printer's state.

The ndps-att-printer-state-reasons attribute contains the following information:

identifier

This field is the alert OID (for example, NDPSATT_ALERT_TONEREMPTY).

severity

There are three choices:

  • NWDP_STATE_SEVERITY_OTHER
  • NWDP_STATE_SEVERITY_WARNING
  • NWDP_STATE_SEVERITY_CRITICAL

If severity is set to NWDP_STATE_SEVERITY_CRITICAL, the PSM sets the printer state severity to critical, and the printer state to an error state.

Set severity to NWDP_STATE_SEVERITY_CRITICAL if the gateway/printer cannot print with this problem.

Set severity to NWDP_STATE_SEVERITY_WARNING if something is wrong (for example, the toner is low) but the printer can still print.

trainingLevel

This field specifies the training level required to correct a specified error condition.

objectClassOid

This field specifies which object class has the problem.

objectIdentification

This field indicates which instance of the object class has the problem. For instance, if a paper tray is out of paper, which one is it.

time

This field specifies when the problem occurred.

messageOptionPtr

This field is for any additional information that might be useful to pass along for display in the user interface.