aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcVoiceData.go
blob: 9609d80d079a6bf7437300418c9badd156abc286 (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.Reader) SvcVoiceData {
	svcVoiceData := SvcVoiceData{
		Client:    int8(reader.TryReadBits(8)),
		Proximity: int8(reader.TryReadBits(8)),
		Length:    int16(reader.TryReadBits(16)),
	}
	svcVoiceData.Data = reader.TryReadBitsToSlice(uint64(svcVoiceData.Length))
	return svcVoiceData
}