From d570e6cee8ce8651bff4471d8c4cfff61072cd89 Mon Sep 17 00:00:00 2001 From: zhiqiang feng Date: Mon, 1 Feb 2021 16:07:00 +0800 Subject: [PATCH] change default device --- telegram.yaml | 4 ++-- utils/pulsar.go | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/telegram.yaml b/telegram.yaml index caafe9a..20643ee 100644 --- a/telegram.yaml +++ b/telegram.yaml @@ -1,5 +1,5 @@ serial: - device: ttyS1 + device: /tmp/ttyS1 baudrate: 9600 #bytesize: 8 # 1, 2, 15 @@ -22,4 +22,4 @@ pulsar: telegram: tcp: false - pulsar: true \ No newline at end of file + pulsar: true diff --git a/utils/pulsar.go b/utils/pulsar.go index 83f4bf1..96ec52c 100644 --- a/utils/pulsar.go +++ b/utils/pulsar.go @@ -56,5 +56,7 @@ func PulsarSend(data string) error { func ClosePulsar() { producer.Close() - client.Close() + if client != nil { + client.Close() + } }