aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcVoiceData.go
blob: b6c81d4689216cdd340ae2cd263276b518e2178e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package messages

import "github.com/pektezol/bitreader"

type SvcVoiceData struct {
	Client    int8
	Proximity int8
	Length    int16
	Data      []byte
}

func ParseSvcVoiceData(reader *bitreader.ReaderType) SvcVoiceData {
	svcVoiceData := SvcVoiceData{
		Client:    int8(reader.TryReadBits(8)),
		Proximity: int8(reader.TryReadBits(8)),
		Length:    int16(reader.TryReadBits(16)),
	}
	svcVoiceData.Data = reader.TryReadBitsToSlice(int(svcVoiceData.Length))
	return svcVoiceData
}