func Attributes2Bytes()

in binary/util.go [100:113]


func Attributes2Bytes(fow int, frc int, bear int, lfrcnp int, reserved int) []byte {
	bearfloat := (float64(bear) - BEAR_SECTOR/2.0) / BEAR_SECTOR

	bearInt := int(math.Round(bearfloat))
	fow = fow & 0b111
	frc = frc & 0b111
	bearInt = bearInt & 0b11111
	lfrcnp = lfrcnp & 0b111
	reserved = reserved & 0b11
	bytesFowFrcReserved := Int2Bytes(fow+(frc<<3)+(reserved<<6), 1, false)
	bytesBearLFRCNP := Int2Bytes(bearInt+(lfrcnp<<5), 1, false)

	return append(bytesFowFrcReserved, bytesBearLFRCNP...)
}