Avoid panic if printer is off or unreachable for some reason.
Closes #16 Closes #17 Closes #15
This commit was merged in pull request #18.
This commit is contained in:
@@ -115,6 +115,7 @@ const (
|
||||
SuccessfulOkIgnoredOrSubstitutedAttributes statusCode = 0x0001
|
||||
SuccessfulOkConflictingAttributes statusCode = 0x0002
|
||||
ClientErrorBadRequest statusCode = 0x0400
|
||||
ServerErrorServiceUnavailable statusCode = 0x0502
|
||||
)
|
||||
|
||||
type versionNumber uint16
|
||||
|
||||
@@ -65,6 +65,7 @@ func (r *Request) RequestID() uint32 {
|
||||
return r.header.requestID
|
||||
}
|
||||
|
||||
// Operation returns the operation is of the request.
|
||||
func (r *Request) Operation() OperationID {
|
||||
return r.header.operationID
|
||||
}
|
||||
|
||||
@@ -52,6 +52,10 @@ func (r Response) String() string {
|
||||
return r.header.String() + "\n" + r.a.String()
|
||||
}
|
||||
|
||||
func (r Response) Header() ippResponseHeader {
|
||||
return r.header
|
||||
}
|
||||
|
||||
// Marshal converts the response object to a wire formatted byte stream.
|
||||
func (r *Response) Marshal() []byte {
|
||||
a := make([]byte, 0, 20)
|
||||
|
||||
Reference in New Issue
Block a user