public void StopReadLineVoltage() { if (_channel != null) { UBoxNative.ubox_stop_read_line_voltage(this._channel._handle); } }
public void SetHookoffThreshold(int voltage) { if (_channel != null) { UBoxNative.ubox_set_hookoff_threshold(this._channel._handle, voltage); } }
public void CallPhone(string phone) { if (_channel != null) { UBoxNative.ubox_send_dtmf(_channel._handle, phone); } }
public void StopRecordVoice() { if (_channel != null) { _channel._bRecording = false; UBoxNative.ubox_stop_record(_channel._handle); } }
public void CloseDevice() { Console.WriteLine("设备关闭..."); UBoxNative.ubox_close_logfile(); UBoxNative.ubox_close(); _channel = null; callbackPtr = IntPtr.Zero; callbackProc = null; }
public bool StartRecordVoice(string filename) { bool ret = false; if (_channel != null) { _channel._bRecording = true; ret = UBoxNative.ubox_record_file(_channel._handle, filename, ENUM_VOICE_CODER.CODER_MP3) == 0; } return(ret); }
public bool ConnectDevice() { UBoxNative.ubox_open_logfile(0); if (callbackProc == null) { callbackProc = new UBoxEventNotifyProc(uBoxEventNotifyCallback); callbackPtr = Marshal.GetFunctionPointerForDelegate(callbackProc); GC.KeepAlive(callbackPtr); } UBoxNative.ubox_close(); return(UBoxNative.ubox_open(callbackPtr, 0) == 0); }