示例#1
0
文件: gsm.go 项目: gen2brain/gsmgo
// Terminates connection and free memory
func (g *GSM) Terminate() (err error) {
	// terminate connection
	e := C.GSM_TerminateConnection(g.sm)
	if e != ERR_NONE {
		err = errors.New(errorString(int(e)))
	}

	// free up used memory
	C.GSM_FreeStateMachine(g.sm)
	return
}
示例#2
0
文件: gammu.go 项目: ziutek/gogammu
func (sm *StateMachine) Disconnect() error {
	if e := C.GSM_TerminateConnection(sm.g); e != C.ERR_NONE {
		return Error{"TerminateConnection", e}
	}
	return nil
}