示例#1
0
文件: gammu.go 项目: ziutek/gogammu
func (sm *StateMachine) free() {
	if sm.IsConnected() {
		sm.Disconnect()
	}
	C.GSM_FreeStateMachine(sm.g)
	sm.g = nil
}
示例#2
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
}