HPInc / jipp

A Java-compatible implementation of IPP
MIT License
153 stars 42 forks source link

How to add custom types/attributes to a group for GetPrinterAttributes? #163

Closed Siedlerchr closed 1 year ago

Siedlerchr commented 1 year ago

I am currently implementing a server based on this library and I noticed that Windows rquestst attributes that are not available, in detail these are:

document-format-preferred
mopria-certified,  
mopria_certified

Full example of a packet :

request IppPacketData(packet=IppPacket(v=0x200, c=Get-Printer-Attributes(11), r=0x1e) [AttributeGroup(operation-attributes, [attributes-charset="utf-8" (charset), attributes-natural-language="en" (naturalLanguage), printer-uri=ipp://127.0.0.1:631/ipp/printer,
 requested-attributes=[printer-name, printer-uuid, printer-info, printer-more-info, printer-location, document-format-supported, document-format-preferred, document-format-default, printer-make-and-model, ipp-versions-supported, mopria-certified, mopria_certified, printer-firmware-name, printer-firmware-string-version, media-supported, media-type-supported, printer-uri-supported, uri-security-supported, printer-device-id]])], data=com.hp.jipp.encoding.IppInputStream@cdd3fdd)
Siedlerchr commented 1 year ago

Okay, I could sove it. Just added a new Types Object


object AdditionalTypes {
    @JvmField
    val mopriaMinuscertified = TextType("mopria-certified")

    @JvmField
    val mopria_certified = TextType("mopria_certified")

    @JvmField
    val document_prefered = StringType(Tag.mimeMediaType, "document-format-preferred")
}