aboutsummaryrefslogtreecommitdiff
path: root/pkg/messages/types/svcVoiceData.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-17 18:24:18 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-09-20 11:10:20 +0300
commit6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75 (patch)
treee925740a5c04b1c5c44e725dab04f9b1833cf9e3 /pkg/messages/types/svcVoiceData.go
parentparse netSignOnState flags (diff)
downloadsdp.go-6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75.tar.gz
sdp.go-6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75.tar.bz2
sdp.go-6aa511f2ae3d5c84e7db02627ffd4d7f6796ce75.zip
decide what message types are left
Diffstat (limited to 'pkg/messages/types/svcVoiceData.go')
-rw-r--r--pkg/messages/types/svcVoiceData.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/pkg/messages/types/svcVoiceData.go b/pkg/messages/types/svcVoiceData.go
index 9609d80..efcae85 100644
--- a/pkg/messages/types/svcVoiceData.go
+++ b/pkg/messages/types/svcVoiceData.go
@@ -3,17 +3,19 @@ package messages
3import "github.com/pektezol/bitreader" 3import "github.com/pektezol/bitreader"
4 4
5type SvcVoiceData struct { 5type SvcVoiceData struct {
6 Client int8 6 FromClient uint8
7 Proximity int8 7 Proximity bool
8 Length int16 8 Length int16
9 Data []byte 9 Data []byte
10} 10}
11 11
12func ParseSvcVoiceData(reader *bitreader.Reader) SvcVoiceData { 12func ParseSvcVoiceData(reader *bitreader.Reader) SvcVoiceData {
13 svcVoiceData := SvcVoiceData{ 13 svcVoiceData := SvcVoiceData{
14 Client: int8(reader.TryReadBits(8)), 14 FromClient: reader.TryReadUInt8(),
15 Proximity: int8(reader.TryReadBits(8)), 15 }
16 Length: int16(reader.TryReadBits(16)), 16 proximity := reader.TryReadUInt8()
17 if proximity != 0 {
18 svcVoiceData.Proximity = true
17 } 19 }
18 svcVoiceData.Data = reader.TryReadBitsToSlice(uint64(svcVoiceData.Length)) 20 svcVoiceData.Data = reader.TryReadBitsToSlice(uint64(svcVoiceData.Length))
19 return svcVoiceData 21 return svcVoiceData