Documentation ¶
Index ¶
- Constants
- Variables
- func BytesString(b []byte) string
- func CheckAT(gs *GaoSerial) error
- func CheckATZ(gs *GaoSerial) error
- func ConvInt64(jsonItf interface{}) int64
- func ConvString(jsonItf interface{}) string
- func DeepCopy(dst, src interface{}) error
- func DoFlateCompress(src []byte) ([]byte, error)
- func DoFlateUnCompress(compressSrc []byte) ([]byte, error)
- func GetCSQ(gs *GaoSerial) (string, error)
- func GetCurrentDir() string
- func GetIMEI(gs *GaoSerial) (string, error)
- func GetNetWork(gs *GaoSerial) (string, error)
- func PathExists(path string) (bool, error)
- func SetEchoClose(gs *GaoSerial) error
- func StrToMap(s string) (map[string]string, error)
- func StringBytes(s string) (b []byte)
- type ErrPortBlock
- type GaoSerial
- func (gs *GaoSerial) Close() error
- func (gs *GaoSerial) Open(com string, bandrate int) error
- func (gs *GaoSerial) Read(timeout time.Duration) ([]byte, error)
- func (gs *GaoSerial) SetReadTimeout(timeout time.Duration) error
- func (gs *GaoSerial) Write(b []byte) (int, error)
- func (gs *GaoSerial) WriteAndRead(b []byte, wrInterval, readTimeout time.Duration) ([]byte, error)
- func (gs *GaoSerial) WriteAndReadLines(b []byte, wrInterval, readTimeout time.Duration) ([][]byte, error)
Constants ¶
View Source
const InvalidString = "<invalid convert>"
Variables ¶
View Source
var ( //AT check a equipment whether has at response AT = "AT\r" //ATZ init equipment configure ATZ = "ATZ\r" ECHOCLOSE = "ATE0\r" ECHOOPEN = "ATE1\r" //IME is international mobile equipment identity IME = "AT+CGSN\r" //CSQ is signal intensity of equipment CSQ = "AT+CSQ\r" //NETWORK is mobile equipment network situation NETWORK = "AT+CREG?\r" )
Functions ¶
func BytesString ¶
func ConvString ¶
func ConvString(jsonItf interface{}) string
func DoFlateCompress ¶
func DoFlateUnCompress ¶
func GetCurrentDir ¶
func GetCurrentDir() string
func GetNetWork ¶
GetNetWork return equipment network register situation
func PathExists ¶
func StringBytes ¶
Types ¶
type ErrPortBlock ¶
type ErrPortBlock struct {
// contains filtered or unexported fields
}
func (ErrPortBlock) Error ¶
func (e ErrPortBlock) Error() string
type GaoSerial ¶
func NewGaoSerial ¶
func (*GaoSerial) WriteAndRead ¶
WriteAndRead write data and receive response wrInterval is time interval between write and read readTimeout is time read data
Click to show internal directories.
Click to hide internal directories.