|
|
|
@ -32,11 +32,23 @@ func main() {
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
err = terminalClient.SubscribeEvents([]tmkind.TetraFlexTerminalMessageKinds{
|
|
|
|
|
tmkind.IpApiCallUpdateNotification,
|
|
|
|
|
tmkind.IpApiSdsTlReportNotification,
|
|
|
|
|
tmkind.IpApiSdsTlShortReportNotification,
|
|
|
|
|
tmkind.IpApiSdsDataType4Notification,
|
|
|
|
|
tmkind.IpApiSdsStatusNotification,
|
|
|
|
|
tmkind.IpApiSdsTlTransferNotification,
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
//fmt.Println(hex.EncodeToString(parsedMsg.Bytes()))
|
|
|
|
|
regInfoBytes, _ := json.Marshal(terminalClient.RegistrationInfo)
|
|
|
|
|
fmt.Println(string(regInfoBytes))
|
|
|
|
|
|
|
|
|
|
terminalClient.AttachGroups([]common.GroupConfig{
|
|
|
|
|
err = terminalClient.AttachGroups([]common.GroupConfig{
|
|
|
|
|
{
|
|
|
|
|
Group: common.NewAddressFromSSINumber(101),
|
|
|
|
|
ScanMode: common.Scanned,
|
|
|
|
@ -50,6 +62,9 @@ func main() {
|
|
|
|
|
ScanMode: common.Scanned,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for {
|
|
|
|
|
select {
|
|
|
|
@ -65,19 +80,6 @@ func main() {
|
|
|
|
|
//terminalClient.SendTM()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if parsedMsg.Kind == tmkind.IpApiRegistrationConfirm {
|
|
|
|
|
|
|
|
|
|
regInfo, err := parsedMsg.AsRegistrationInfo()
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
fmt.Println(hex.EncodeToString(parsedMsg.Bytes()))
|
|
|
|
|
regInfoBytes, _ := json.Marshal(regInfo)
|
|
|
|
|
fmt.Println(string(regInfoBytes))
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if parsedMsg.Kind == tmkind.IpApiNo
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|