diff --git a/README.md b/README.md index f58502d..c42a879 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,13 @@ on [IEC 61162-1:2016 (Edition 5.0 2016-08)](https://webstore.iec.ch/publication/ | HSS | Hull stress surveillance systems | | | HTC | Heading/track control command | | | HTD | Heading /track control data | | +| KLDS | Kenwood LMR - FleetSync AVL | | +| KLID | Kenwood LMR - FleetSync | | +| KLSH | Kenwood LMR - FleetSync AVL | | +| KNDS | Kenwood LMR - Digital AVL | | +| KNID | Kenwood LMR - Digital | | +| KNSH | Kenwood LMR - Digital AVL | | +| KWDWPL | Kenwood Waypoint Location - Amateur Radio | [direwolf](https://github.com/wb2osz/direwolf/blob/master/src/waypoint.c) | | LR1 | AIS long-range reply sentence 1 | | | LR2 | AIS long-range reply sentence 2 | | | LR3 | AIS long-range reply sentence 3 | | diff --git a/pklds.go b/pklds.go new file mode 100644 index 0000000..86d1367 --- /dev/null +++ b/pklds.go @@ -0,0 +1,59 @@ +package nmea + +import ( + "strings" +) + +const ( + // TypePKLDS type for PKLDS sentences + TypePKLDS = "KLDS" +) + +// PKLDS is Kenwood propirtary sentance it is RMC with the addition of Fleetsync ID and status information. +// http://aprs.gids.nl/nmea/#rmc +// +// Format: $PKLDS,hhmmss.ss,A,ddmm.mm,a,dddmm.mm,a,x.x,x.x,xxxx,x.x,a*hh +// Example: $PKLDS,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W00,100,2000,25,00*6E +type PKLDS struct { + BaseSentence + Time Time // Time Stamp + Validity string // validity - A-ok, V-invalid + Latitude float64 // Latitude + Longitude float64 // Longitude + Speed float64 // Speed in knots + Course float64 // True course + Date Date // Date + Variation float64 // Magnetic variation + SentanceVersion string // 00 to 15 + Fleet string // 100 to 349 + UnitID string // 1000 to 4999 + Status string // 10 to 99 + Extension string // 00 to 99 +} + +// newPKLDS constructor +func newPKLDS(s BaseSentence) (Sentence, error) { + p := NewParser(s) + p.AssertType(TypePKLDS) + m := PKLDS{ + BaseSentence: s, + Time: p.Time(0, "time"), + Validity: p.EnumString(1, "validity", ValidRMC, InvalidRMC), + Latitude: p.LatLong(2, 3, "latitude"), + Longitude: p.LatLong(4, 5, "longitude"), + Speed: p.Float64(6, "speed"), + Course: p.Float64(7, "course"), + Date: p.Date(8, "date"), + Variation: p.Float64(9, "variation"), + SentanceVersion: p.String(10, "sentance version, range of 00 to 15"), + Fleet: p.String(11, "fleet, range of 100 to 349"), + UnitID: p.String(12, "subscriber unit id, range of 1000 to 4999"), + Status: p.String(13, "subscriber unit status id, range of 10 to 99"), + Extension: p.String(14, "reserved for future use, range of 00 to 99"), + } + if strings.HasPrefix(m.SentanceVersion, "W") == true { + m.Variation = 0 - m.Variation + } + m.SentanceVersion = strings.TrimPrefix(strings.TrimPrefix(m.SentanceVersion, "W"), "E") + return m, p.Err() +} diff --git a/pklds_test.go b/pklds_test.go new file mode 100644 index 0000000..909301b --- /dev/null +++ b/pklds_test.go @@ -0,0 +1,76 @@ +package nmea + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +var pkldstests = []struct { + name string + raw string + err string + msg PKLDS +}{ + { + name: "good sentence West", + raw: "$PKLDS,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W00,100,2000,15,00,*60", + msg: PKLDS{ + Time: Time{true, 22, 05, 16, 0}, + Validity: "A", + Latitude: MustParseGPS("5133.82 N"), + Longitude: MustParseGPS("00042.24 W"), + Speed: 173.8, + Course: 231.8, + Date: Date{true, 13, 06, 94}, + Variation: -4.2, + SentanceVersion: "00", + Fleet: "100", + UnitID: "2000", + Status: "15", + Extension: "00", + }, + }, + { + name: "good sentence East", + raw: "$PKLDS,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,E00,100,2000,15,00,*72", + msg: PKLDS{ + Time: Time{true, 22, 05, 16, 0}, + Validity: "A", + Latitude: MustParseGPS("5133.82 N"), + Longitude: MustParseGPS("00042.24 W"), + Speed: 173.8, + Course: 231.8, + Date: Date{true, 13, 06, 94}, + Variation: 4.2, + SentanceVersion: "00", + Fleet: "100", + UnitID: "2000", + Status: "15", + Extension: "00", + }, + }, + + { + name: "bad sentence", + raw: "$PKLDS,220516,D,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W00,100,2000,15,00,*65", + err: "nmea: PKLDS invalid validity: D", + }, +} + +func TestPKLDS(t *testing.T) { + for _, tt := range pkldstests { + t.Run(tt.name, func(t *testing.T) { + m, err := Parse(tt.raw) + if tt.err != "" { + assert.Error(t, err) + assert.EqualError(t, err, tt.err) + } else { + assert.NoError(t, err) + pklds := m.(PKLDS) + pklds.BaseSentence = BaseSentence{} + assert.Equal(t, tt.msg, pklds) + } + }) + } +} diff --git a/pklid.go b/pklid.go new file mode 100644 index 0000000..c564656 --- /dev/null +++ b/pklid.go @@ -0,0 +1,34 @@ +package nmea + +const ( + // TypePKLID type for PKLID sentances + TypePKLID = "KLID" +) + +// PKLID is a Kenwood Propritary sentance used for GPS data communications in FleetSync. +// $PKLID,<0>,<1>,<2>,<3>,<4>*hh +// Format: $PKLID,xx,xxx,xxxx,xx,xx,*xx +// Example: $PKLID,00,100,2000,15,00,*?? +type PKLID struct { + BaseSentence + SentanceVersion string // 00 to 15 + Fleet string // 100 to 349 + UnitID string // 1000 to 4999 + Status string // 10 to 99 + Extension string // 00 to 99 +} + +// newPKLID constructor +func newPKLID(s BaseSentence) (Sentence, error) { + p := NewParser(s) + p.AssertType(TypePKLID) + + return PKLID{ + BaseSentence: s, + SentanceVersion: p.String(0, "sentance version, range of 00 to 15"), + Fleet: p.String(1, "fleet, range of 100 to 349"), + UnitID: p.String(2, "subscriber unit id, range of 1000 to 4999"), + Status: p.String(3, "subscriber unit status id, range of 10 to 99"), + Extension: p.String(4, "reserved for future use, range of 00 to 99"), + }, p.Err() +} diff --git a/pklid_test.go b/pklid_test.go new file mode 100644 index 0000000..d484905 --- /dev/null +++ b/pklid_test.go @@ -0,0 +1,43 @@ +package nmea + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +var pklidtests = []struct { + name string + raw string + err string + msg PKLID +}{ + { + name: "typical sentance", + raw: "$PKLID,00,100,2000,15,00,*6D", + msg: PKLID{ + SentanceVersion: "00", + Fleet: "100", + UnitID: "2000", + Status: "15", + Extension: "00", + }, + }, +} + +func TestPKLID(t *testing.T) { + for _, tt := range pklidtests { + t.Run(tt.name, func(t *testing.T) { + m, err := Parse(tt.raw) + if tt.err != "" { + assert.Error(t, err) + assert.EqualError(t, err, tt.err) + } else { + assert.NoError(t, err) + pklid := m.(PKLID) + pklid.BaseSentence = BaseSentence{} + assert.Equal(t, tt.msg, pklid) + } + }) + } +} diff --git a/pklsh.go b/pklsh.go new file mode 100644 index 0000000..741c4d2 --- /dev/null +++ b/pklsh.go @@ -0,0 +1,39 @@ +package nmea + +const ( + // TypePKLSH type for PKLSH sentances + TypePKLSH = "KLSH" +) + +// PKLSH is a Kenwood Propritary sentance used for GPS data communications in FleetSync. +// +// adds UnitID and Fleet to $GPGLL sentance +// +// $PKLSH,<0>,<1>,<2>,<3>,<4>,<5>,<6>,<7>*hh +// Format: $PKLSH,xxxx.xxxx,x,xxxxx.xxxx,x,xxxxxx,x,xxx,xxxx,*xx +// Example: $PKLSH,4000.0000,N,13500.0000,E,021720,A,100,2000,*?? +type PKLSH struct { + BaseSentence + Latitude float64 // Latitude + Longitude float64 // Longitude + Time Time // Time Stamp + Validity string // validity - A=valid, V=invalid + Fleet string // 100 to 349 + UnitID string // 1000 to 4999 +} + +// newPKLSH constructor +func newPKLSH(s BaseSentence) (Sentence, error) { + p := NewParser(s) + p.AssertType(TypePKLSH) + + return PKLSH{ + BaseSentence: s, + Latitude: p.LatLong(0, 1, "latitude"), + Longitude: p.LatLong(2, 3, "longitude"), + Time: p.Time(4, "time"), + Validity: p.EnumString(5, "validity", ValidGLL, InvalidGLL), + Fleet: p.String(6, "fleet, range of 100 to 349"), + UnitID: p.String(7, "subscriber unit id, range of 1000 to 4999"), + }, p.Err() +} diff --git a/pklsh_test.go b/pklsh_test.go new file mode 100644 index 0000000..1e30365 --- /dev/null +++ b/pklsh_test.go @@ -0,0 +1,55 @@ +package nmea + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +var pklshtests = []struct { + name string + raw string + err string + msg PKLSH +}{ + { + name: "good sentence", + raw: "$PKLSH,3926.7952,N,12000.5947,W,022732,A,100,2000*1A", + msg: PKLSH{ + Latitude: MustParseLatLong("3926.7952 N"), + Longitude: MustParseLatLong("12000.5947 W"), + Time: Time{ + Valid: true, + Hour: 2, + Minute: 27, + Second: 32, + Millisecond: 0, + }, + Validity: "A", + Fleet: "100", + UnitID: "2000", + }, + }, + { + name: "bad validity", + raw: "$PKLSH,3926.7952,N,12000.5947,W,022732,D,100,2000*1F", + err: "nmea: PKLSH invalid validity: D", + }, +} + +func TestPKLSH(t *testing.T) { + for _, tt := range pklshtests { + t.Run(tt.name, func(t *testing.T) { + m, err := Parse(tt.raw) + if tt.err != "" { + assert.Error(t, err) + assert.EqualError(t, err, tt.err) + } else { + assert.NoError(t, err) + pklsh := m.(PKLSH) + pklsh.BaseSentence = BaseSentence{} + assert.Equal(t, tt.msg, pklsh) + } + }) + } +} diff --git a/pknds.go b/pknds.go new file mode 100644 index 0000000..accbb7f --- /dev/null +++ b/pknds.go @@ -0,0 +1,57 @@ +package nmea + +import ( + "strings" +) + +const ( + // TypePKNDS type for PKLDS sentences + TypePKNDS = "KNDS" +) + +// PKNDS is Kenwood propirtary sentance it is RMC with the addition of NEXTEDGE and status information. +// http://aprs.gids.nl/nmea/#rmc +// +// Format: $PKNDS,hhmmss.ss,A,ddmm.mm,a,dddmm.mm,a,xxx.x,x,x.x,xxx,Uxxxx,xxx.xx,*hh +// Example: $PKNDS,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W00,U00001,207,00,*6E +type PKNDS struct { + BaseSentence + Time Time // Time Stamp + Validity string // validity - A-ok, V-invalid + Latitude float64 // Latitude + Longitude float64 // Longitude + Speed float64 // Speed in knots + Course float64 // True course + Date Date // Date + Variation float64 // Magnetic variation + SentanceVersion string // 00 to 15 + UnitID string // U00001 to U65519 or U00000001 to U16776415 (U is FIXED) + Status string // 001 to 255 + Extension string // 00 to 99 +} + +// newPKNDS constructor +func newPKNDS(s BaseSentence) (Sentence, error) { + p := NewParser(s) + p.AssertType(TypePKNDS) + m := PKNDS{ + BaseSentence: s, + Time: p.Time(0, "time"), + Validity: p.EnumString(1, "validity", ValidRMC, InvalidRMC), + Latitude: p.LatLong(2, 3, "latitude"), + Longitude: p.LatLong(4, 5, "longitude"), + Speed: p.Float64(6, "speed"), + Course: p.Float64(7, "course"), + Date: p.Date(8, "date"), + Variation: p.Float64(9, "variation"), + SentanceVersion: p.String(10, "sentance version, range of 00 to 15"), + UnitID: p.String(11, "unit ID, NXDN range U00001 to U65519, DMR range of U00000001 to U16776415"), + Status: p.String(12, "subscriber unit status id, range of 001 to 255"), + Extension: p.String(13, "reserved for future use, range of 00 to 99"), + } + if strings.HasPrefix(m.SentanceVersion, "W") == true { + m.Variation = 0 - m.Variation + } + m.SentanceVersion = strings.TrimPrefix(strings.TrimPrefix(m.SentanceVersion, "W"), "E") + return m, p.Err() +} diff --git a/pknds_test.go b/pknds_test.go new file mode 100644 index 0000000..f03de80 --- /dev/null +++ b/pknds_test.go @@ -0,0 +1,74 @@ +package nmea + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +var pkndstests = []struct { + name string + raw string + err string + msg PKNDS +}{ + { + name: "good sentence West", + raw: "$PKNDS,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W00,U00001,207,00,*28", + msg: PKNDS{ + Time: Time{true, 22, 05, 16, 0}, + Validity: "A", + Latitude: MustParseGPS("5133.82 N"), + Longitude: MustParseGPS("00042.24 W"), + Speed: 173.8, + Course: 231.8, + Date: Date{true, 13, 06, 94}, + Variation: -4.2, + SentanceVersion: "00", + UnitID: "U00001", + Status: "207", + Extension: "00", + }, + }, + { + name: "good sentence East", + raw: "$PKNDS,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,E00,U00001,207,00,*3A", + msg: PKNDS{ + Time: Time{true, 22, 05, 16, 0}, + Validity: "A", + Latitude: MustParseGPS("5133.82 N"), + Longitude: MustParseGPS("00042.24 W"), + Speed: 173.8, + Course: 231.8, + Date: Date{true, 13, 06, 94}, + Variation: 4.2, + SentanceVersion: "00", + UnitID: "U00001", + Status: "207", + Extension: "00", + }, + }, + + { + name: "bad sentence", + raw: "$PKNDS,220516,D,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,E00,U00001,207,00,*3F", + err: "nmea: PKNDS invalid validity: D", + }, +} + +func TestPKNDS(t *testing.T) { + for _, tt := range pkndstests { + t.Run(tt.name, func(t *testing.T) { + m, err := Parse(tt.raw) + if tt.err != "" { + assert.Error(t, err) + assert.EqualError(t, err, tt.err) + } else { + assert.NoError(t, err) + pknds := m.(PKNDS) + pknds.BaseSentence = BaseSentence{} + assert.Equal(t, tt.msg, pknds) + } + }) + } +} diff --git a/pknid.go b/pknid.go new file mode 100644 index 0000000..ca52107 --- /dev/null +++ b/pknid.go @@ -0,0 +1,32 @@ +package nmea + +const ( + // TypePKNID type for PKNID sentances + TypePKNID = "KNID" +) + +// PKNID is a Kenwood Propritary sentance used for GPS data communications in NEXTEDGE Digital. +// $PKNID,<0>,<1>,<2>,<3>,*hh +// Format: $PKNID,xx,Uxxxx,xxx,xx,*xx +// Example: $PKNID,00,U00065519,207,00,*?? +type PKNID struct { + BaseSentence + SentanceVersion string // 00 to 15 + UnitID string // U00001 to U65519 or U00000001 to U16776415 (U is FIXED) + Status string // 001 to 255 + Extension string // 00 to 99 +} + +// newPKNID constructor +func newPKNID(s BaseSentence) (Sentence, error) { + p := NewParser(s) + p.AssertType(TypePKNID) + + return PKNID{ + BaseSentence: s, + SentanceVersion: p.String(0, "sentance version, range of 00 to 15"), + UnitID: p.String(1, "unit ID, NXDN range U00001 to U65519, DMR range of U00000001 to U16776415"), + Status: p.String(2, "status NXDN, range of 001 to 255"), + Extension: p.String(3, "reserved for future use, range of 00 to 99"), + }, p.Err() +} diff --git a/pknid_test.go b/pknid_test.go new file mode 100644 index 0000000..3dd7f77 --- /dev/null +++ b/pknid_test.go @@ -0,0 +1,42 @@ +package nmea + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +var pknidtests = []struct { + name string + raw string + err string + msg PKNID +}{ + { + name: "typical sentance", + raw: "$PKNID,00,U00001,015,00,*24", + msg: PKNID{ + SentanceVersion: "00", + UnitID: "U00001", + Status: "015", + Extension: "00", + }, + }, +} + +func TestPKNID(t *testing.T) { + for _, tt := range pknidtests { + t.Run(tt.name, func(t *testing.T) { + m, err := Parse(tt.raw) + if tt.err != "" { + assert.Error(t, err) + assert.EqualError(t, err, tt.err) + } else { + assert.NoError(t, err) + pknid := m.(PKNID) + pknid.BaseSentence = BaseSentence{} + assert.Equal(t, tt.msg, pknid) + } + }) + } +} diff --git a/pknsh.go b/pknsh.go new file mode 100644 index 0000000..c6a5a1d --- /dev/null +++ b/pknsh.go @@ -0,0 +1,37 @@ +package nmea + +const ( + // TypePKNSH type for PKLSH sentances + TypePKNSH = "KNSH" +) + +// PKNSH is a Kenwood Propritary sentance used for GPS data communications in NEXTEDGE Digital. +// +// adds UnitID and Fleet to $GPGLL sentance +// +// $PKNSH,<0>,<1>,<2>,<3>,<4>,<5>,<6>*hh +// Format: $PKNSH,xxxx.xxxx,x,xxxxx.xxxx,x,xxxxxx,x,Uxxxxx,*xx +// Example: $PKNSH,4000.0000,N,13500.0000,E,021720,A,U00001,*?? +type PKNSH struct { + BaseSentence + Latitude float64 // Latitude + Longitude float64 // Longitude + Time Time // Time Stamp + Validity string // validity - A=valid, V=invalid + UnitID string // U00001 to U65519 or U00000001 to U16776415 (U is FIXED) +} + +// newPKNSH constructor +func newPKNSH(s BaseSentence) (Sentence, error) { + p := NewParser(s) + p.AssertType(TypePKNSH) + + return PKNSH{ + BaseSentence: s, + Latitude: p.LatLong(0, 1, "latitude"), + Longitude: p.LatLong(2, 3, "longitude"), + Time: p.Time(4, "time"), + Validity: p.EnumString(5, "validity", ValidGLL, InvalidGLL), + UnitID: p.String(6, "unit ID, NXDN range U00001 to U65519, DMR range of U00000001 to U16776415"), + }, p.Err() +} diff --git a/pknsh_test.go b/pknsh_test.go new file mode 100644 index 0000000..6cbb142 --- /dev/null +++ b/pknsh_test.go @@ -0,0 +1,54 @@ +package nmea + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +var pknshtests = []struct { + name string + raw string + err string + msg PKNSH +}{ + { + name: "good sentence", + raw: "$PKNSH,3926.7952,N,12000.5947,W,022732,A,U00001*63", + msg: PKNSH{ + Latitude: MustParseLatLong("3926.7952 N"), + Longitude: MustParseLatLong("12000.5947 W"), + Time: Time{ + Valid: true, + Hour: 2, + Minute: 27, + Second: 32, + Millisecond: 0, + }, + Validity: "A", + UnitID: "U00001", + }, + }, + { + name: "bad validity", + raw: "$PKNSH,3926.7952,N,12000.5947,W,022732,D,U00001*66", + err: "nmea: PKNSH invalid validity: D", + }, +} + +func TestPKNSH(t *testing.T) { + for _, tt := range pknshtests { + t.Run(tt.name, func(t *testing.T) { + m, err := Parse(tt.raw) + if tt.err != "" { + assert.Error(t, err) + assert.EqualError(t, err, tt.err) + } else { + assert.NoError(t, err) + pknsh := m.(PKNSH) + pknsh.BaseSentence = BaseSentence{} + assert.Equal(t, tt.msg, pknsh) + } + }) + } +} diff --git a/pkwdwpl.go b/pkwdwpl.go new file mode 100755 index 0000000..c7bf236 --- /dev/null +++ b/pkwdwpl.go @@ -0,0 +1,45 @@ +package nmea + +const ( + // TypePKWDWPL type for PKLDS sentences + TypePKWDWPL = "KWDWPL" +) + +// PKWDWPL is Kenwood Waypoint Location +// https://github.com/wb2osz/direwolf/blob/master/waypoint.c +// +// Format: $PKWDWPL,hhmmss,v,ddmm.mm,ns,dddmm.mm,ew,speed,course,ddmmyy,alt,wname,ts*hh +// Example: $PKWDWPL,204714,V,4237.1400,N,07120.8300,W,,,200316,,test|5,/'*61 +type PKWDWPL struct { + BaseSentence + Time Time // Time Stamp + Validity string // validity - A-ok, V-invalid + Latitude float64 // Latitude + Longitude float64 // Longitude + Speed float64 // Speed in knots + Course float64 // True course + Date Date // Date + Altitude float64 // Magnetic variation + WaypointName string // 00 to 15 + TableSymbol string // U00001 to U65519 or U00000001 to U16776415 (U is FIXED) +} + +// newPKWDWPL constructor +func newPKWDWPL(s BaseSentence) (Sentence, error) { + p := NewParser(s) + p.AssertType(TypePKWDWPL) + m := PKWDWPL{ + BaseSentence: s, + Time: p.Time(0, "time"), + Validity: p.EnumString(1, "validity", ValidRMC, InvalidRMC), + Latitude: p.LatLong(2, 3, "latitude"), + Longitude: p.LatLong(4, 5, "longitude"), + Speed: p.Float64(6, "speed"), + Course: p.Float64(7, "course"), + Date: p.Date(8, "date"), + Altitude: p.Float64(9, "altitude"), + WaypointName: p.String(10, "waypoint name, Object name/Sendin Station"), + TableSymbol: p.String(11, "table and symbol as per APRS spec"), + } + return m, p.Err() +} diff --git a/pkwdwpl_test.go b/pkwdwpl_test.go new file mode 100755 index 0000000..bba26f6 --- /dev/null +++ b/pkwdwpl_test.go @@ -0,0 +1,48 @@ +package nmea + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +var pkwdkpltests = []struct { + name string + raw string + err string + msg PKWDWPL +}{ + { + name: "good sentence", + raw: "$PKWDWPL,150803,A,4237.14,N,07120.83,W,173.8,231.8,190316,1120,test,/'*39", + msg: PKWDWPL{ + Time: Time{true, 15, 8, 3, 0}, + Validity: "A", + Latitude: MustParseGPS("4237.14 N"), + Longitude: MustParseGPS("07120.83 W"), + Speed: 173.8, + Course: 231.8, + Date: Date{true, 19, 3, 16}, + Altitude: 1120, + WaypointName: "test", + TableSymbol: "/'", + }, + }, +} + +func TestPKWDWPL(t *testing.T) { + for _, tt := range pkwdkpltests { + t.Run(tt.name, func(t *testing.T) { + m, err := Parse(tt.raw) + if tt.err != "" { + assert.Error(t, err) + assert.EqualError(t, err, tt.err) + } else { + assert.NoError(t, err) + pkwdwpl := m.(PKWDWPL) + pkwdwpl.BaseSentence = BaseSentence{} + assert.Equal(t, tt.msg, pkwdwpl) + } + }) + } +} diff --git a/sentence.go b/sentence.go index 631d1d1..a32713f 100644 --- a/sentence.go +++ b/sentence.go @@ -431,6 +431,20 @@ func (p *SentenceParser) Parse(raw string) (Sentence, error) { return newXDR(s) case TypeXTE: return newXTE(s) + case TypePKLID: + return newPKLID(s) + case TypePKNID: + return newPKNID(s) + case TypePKLSH: + return newPKLSH(s) + case TypePKNSH: + return newPKNSH(s) + case TypePKLDS: + return newPKLDS(s) + case TypePKNDS: + return newPKNDS(s) + case TypePKWDWPL: + return newPKWDWPL(s) } } if s.Raw[0] == SentenceStartEncapsulated[0] {