-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdu_unbind_resp.go
70 lines (54 loc) · 1.29 KB
/
pdu_unbind_resp.go
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package smpp34
var (
reqUnbindRespFields = []string{}
)
type UnbindResp struct {
*Header
mandatoryFields map[string]Field
tlvFields map[uint16]*TLVField
}
func NewUnbindResp(hdr *Header) (*UnbindResp, error) {
s := &UnbindResp{Header: hdr}
return s, nil
}
func (s *UnbindResp) GetField(f string) Field {
return nil
}
func (s *UnbindResp) SetField(f string, v interface{}) error {
return FieldValueErr
}
func (s *UnbindResp) SetSeqNum(i uint32) {
s.Header.Sequence = i
}
func (s *UnbindResp) SetTLVField(t, l int, v []byte) error {
return TLVFieldPduErr
}
func (s *UnbindResp) Fields() map[string]Field {
return s.mandatoryFields
}
func (s *UnbindResp) MandatoryFieldsList() []string {
return reqUnbindRespFields
}
func (s *UnbindResp) Ok() bool {
if s.Header.Status == ESME_ROK {
return true
}
return false
}
func (s *UnbindResp) GetHeader() *Header {
return s.Header
}
func (s *UnbindResp) TLVFields() map[uint16]*TLVField {
return s.tlvFields
}
func (s *UnbindResp) writeFields() []byte {
return []byte{}
}
func (s *UnbindResp) Writer() []byte {
b := s.writeFields()
h := packUi32(uint32(len(b) + 16))
h = append(h, packUi32(uint32(UNBIND_RESP))...)
h = append(h, packUi32(uint32(s.Header.Status))...)
h = append(h, packUi32(s.Header.Sequence)...)
return append(h, b...)
}