phin1x / go-ipp

Pure Go IPP library
Apache License 2.0
136 stars 34 forks source link

Add TagEnum encoding #3

Closed willglynn closed 5 years ago

willglynn commented 5 years ago

I need to specify the job attribute landscape mode printing. I can define the relevant attribute:

func init() {
    ipp.AttributeTagMapping["orientation-requested"] = ipp.TagEnum
}

I can then specify landscape (4) as a job attribute in a completely custom request, but encoding this request fails:

tag for attribte orientation-requested does not match with value type

This PR allows go-ipp to encode enumerations, clearing the blocker for my use case. It adds a test case for encoding/decoding enumerations. It also fixes the typo in the error message above.

phin1x commented 5 years ago

@willglynn thanx