-
Notifications
You must be signed in to change notification settings - Fork 38
/
pdu_enquire_link_resp.go
70 lines (54 loc) · 1.36 KB
/
pdu_enquire_link_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 (
reqELRespFields = []string{}
)
type EnquireLinkResp struct {
*Header
mandatoryFields map[string]Field
tlvFields map[uint16]*TLVField
}
func NewEnquireLinkResp(hdr *Header) (*EnquireLinkResp, error) {
s := &EnquireLinkResp{Header: hdr}
return s, nil
}
func (s *EnquireLinkResp) GetField(f string) Field {
return nil
}
func (s *EnquireLinkResp) SetField(f string, v interface{}) error {
return FieldValueErr
}
func (s *EnquireLinkResp) SetSeqNum(i uint32) {
s.Header.Sequence = i
}
func (s *EnquireLinkResp) SetTLVField(t, l int, v []byte) error {
return TLVFieldPduErr
}
func (s *EnquireLinkResp) Fields() map[string]Field {
return s.mandatoryFields
}
func (s *EnquireLinkResp) MandatoryFieldsList() []string {
return reqELRespFields
}
func (s *EnquireLinkResp) Ok() bool {
if s.Header.Status == ESME_ROK {
return true
}
return false
}
func (s *EnquireLinkResp) GetHeader() *Header {
return s.Header
}
func (s *EnquireLinkResp) TLVFields() map[uint16]*TLVField {
return s.tlvFields
}
func (s *EnquireLinkResp) writeFields() []byte {
return []byte{}
}
func (s *EnquireLinkResp) Writer() []byte {
b := s.writeFields()
h := packUi32(uint32(len(b) + 16))
h = append(h, packUi32(uint32(ENQUIRE_LINK_RESP))...)
h = append(h, packUi32(uint32(s.Header.Status))...)
h = append(h, packUi32(s.Header.Sequence)...)
return append(h, b...)
}