18045010223
9 小时以前 39d4048dc6fd5a138bd1128c06bccca08fbc72f0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cn.org.hentai.jtt1078.entity;
 
import cn.org.hentai.jtt1078.entity.enums.ProtocolVersion;
import lombok.Data;
 
@Data
public class AudioSendData {
    // 设备SIM卡号
    private String sim;
    // 逻辑通道号
    private byte channel;
    // 序列号
    private short sequenceNumber;
 
    // 原始音频数据
    private byte[] audioBytes;
 
    //协议版本
    private ProtocolVersion protocolVersion; // 2016 或 2019
    
    public AudioSendData(String sim, byte channel, byte[] audioBytes,ProtocolVersion protocolVersion) {
        this.sim = sim;
        this.channel = channel;
        this.audioBytes = audioBytes;
        this.sequenceNumber = generateSequence();
        this.protocolVersion = protocolVersion;
    }
    
    private static short sequence = 0;
    private static synchronized short generateSequence() {
        return sequence++;
    }
}