|
|
@ -32,11 +32,23 @@ func main() {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
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()))
|
|
|
|
//fmt.Println(hex.EncodeToString(parsedMsg.Bytes()))
|
|
|
|
regInfoBytes, _ := json.Marshal(terminalClient.RegistrationInfo)
|
|
|
|
regInfoBytes, _ := json.Marshal(terminalClient.RegistrationInfo)
|
|
|
|
fmt.Println(string(regInfoBytes))
|
|
|
|
fmt.Println(string(regInfoBytes))
|
|
|
|
|
|
|
|
|
|
|
|
terminalClient.AttachGroups([]common.GroupConfig{
|
|
|
|
err = terminalClient.AttachGroups([]common.GroupConfig{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Group: common.NewAddressFromSSINumber(101),
|
|
|
|
Group: common.NewAddressFromSSINumber(101),
|
|
|
|
ScanMode: common.Scanned,
|
|
|
|
ScanMode: common.Scanned,
|
|
|
@ -50,6 +62,9 @@ func main() {
|
|
|
|
ScanMode: common.Scanned,
|
|
|
|
ScanMode: common.Scanned,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
panic(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for {
|
|
|
|
for {
|
|
|
|
select {
|
|
|
|
select {
|
|
|
@ -65,19 +80,6 @@ func main() {
|
|
|
|
//terminalClient.SendTM()
|
|
|
|
//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
|
|
|
|
//if parsedMsg.Kind == tmkind.IpApiNo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|