-
Notifications
You must be signed in to change notification settings - Fork 38
/
pdu_enquire_link.go
66 lines (51 loc) · 1.24 KB
/
pdu_enquire_link.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
package smpp34
var (
reqELFields = []string{}
)
type EnquireLink struct {
*Header
mandatoryFields map[string]Field
tlvFields map[uint16]*TLVField
}
func NewEnquireLink(hdr *Header) (*EnquireLink, error) {
s := &EnquireLink{Header: hdr}
return s, nil
}
func (s *EnquireLink) GetField(f string) Field {
return nil
}
func (s *EnquireLink) Fields() map[string]Field {
return s.mandatoryFields
}
func (s *EnquireLink) MandatoryFieldsList() []string {
return reqELFields
}
func (s *EnquireLink) Ok() bool {
return true
}
func (s *EnquireLink) GetHeader() *Header {
return s.Header
}
func (s *EnquireLink) SetField(f string, v interface{}) error {
return FieldValueErr
}
func (s *EnquireLink) SetSeqNum(i uint32) {
s.Header.Sequence = i
}
func (s *EnquireLink) SetTLVField(t, l int, v []byte) error {
return TLVFieldPduErr
}
func (s *EnquireLink) TLVFields() map[uint16]*TLVField {
return s.tlvFields
}
func (s *EnquireLink) writeFields() []byte {
return []byte{}
}
func (s *EnquireLink) Writer() []byte {
b := s.writeFields()
h := packUi32(uint32(len(b) + 16))
h = append(h, packUi32(uint32(ENQUIRE_LINK))...)
h = append(h, packUi32(uint32(s.Header.Status))...)
h = append(h, packUi32(s.Header.Sequence)...)
return append(h, b...)
}