This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import ( | |
"math/big" | |
"reflect" | |
"strconv" | |
"testing" | |
) | |
//How to calculate the band mask greater than 64 for AT+QCFG="band" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET= GreatCGOProgram | |
OPENWRT_SDK=/home/user/openwrt | |
STAGING_DIR=$(OPENWRT_SDK)/staging_dir | |
CC=$(BUILD_DIR)/$(OPENWRT_SDK)/staging_dir/$(toolchain_dir)/bin/$(ARCH)-openwrt-linux-gcc | |
# example: | |
# toolchain-aarch64_cortex-a53+crypto_gcc-8.4.0_musl | |
# aarch64-openwrt-linux-gcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package protobuf_nats | |
import ( | |
"errors" | |
"github.com/nats-io/nats.go" | |
"google.golang.org/protobuf/encoding/protojson" | |
"google.golang.org/protobuf/proto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viper.SetDefault("push.frequency", 100) | |
d.timer = time.NewTicker(viper.GetDuration("push.frequency") * time.Millisecond) | |
//Make interface for netInterface we need to watch. | |
for bn := range bCache { | |
if d.InterfaceCache[bn] == nil { | |
inter, err := net.InterfaceByName(bn) | |
if err != nil { | |
return | |
} | |
d.InterfaceCache[bn] = inter |