diff --git a/README.md b/README.md index f7ab193..3a4101b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Implementation of SMS Standard Protocol in Go Language - [x] SMPP3.4 -- [ ] SMPP5.0 +- [x] SMPP5.0 - [x] CMPP2.0 - [x] CMPP3.0 - [ ] SGIP1.2 diff --git a/smpp/smpp50/pdu_bind.go b/smpp/smpp50/pdu_bind.go index 575e22e..cd59f72 100644 --- a/smpp/smpp50/pdu_bind.go +++ b/smpp/smpp50/pdu_bind.go @@ -65,7 +65,7 @@ type BindResp struct { // CString, max 16 SystemID string - tlvs map[uint16]smpp.TLV + tlvs smpp.TLVs } func (b *BindResp) IDecode(data []byte) error { @@ -74,11 +74,7 @@ func (b *BindResp) IDecode(data []byte) error { b.Header = smpp.ReadHeader(buf) b.SystemID = buf.ReadCString() - tlv, err := smpp.ReadTLVs(buf) - if err != nil { - return err - } - b.tlvs = tlv + b.tlvs = smpp.ReadTLVs1(buf) return buf.Error() } @@ -89,10 +85,7 @@ func (b *BindResp) IEncode() ([]byte, error) { smpp.WriteHeaderNoLength(b.Header, buf) buf.WriteCString(b.SystemID) - for _, value := range b.tlvs { - buf.WriteBytes(value.Bytes()) - } - + buf.WriteBytes(b.tlvs.Bytes()) return buf.BytesWithLength() }