Пример #1
0
// MarshalBinary returns the pdu packet as a slice of bytes.
func (o *Open) MarshalBinary() ([]byte, error) {
	combined := marshaler.NewMulti(&o.Timeout, &o.ID, &o.Description)

	combinedBytes, err := combined.MarshalBinary()
	if err != nil {
		return nil, errgo.Mask(err)
	}

	return combinedBytes, nil
}
Пример #2
0
// MarshalBinary returns the pdu packet as a slice of bytes.
func (r *Register) MarshalBinary() ([]byte, error) {
	combined := marshaler.NewMulti(&r.Timeout, &r.Subtree)

	combinedBytes, err := combined.MarshalBinary()
	if err != nil {
		return nil, errgo.Mask(err)
	}

	return combinedBytes, nil
}