Exemplo n.º 1
0
 public void StopReadLineVoltage()
 {
     if (_channel != null)
     {
         UBoxNative.ubox_stop_read_line_voltage(this._channel._handle);
     }
 }
Exemplo n.º 2
0
 public void SetHookoffThreshold(int voltage)
 {
     if (_channel != null)
     {
         UBoxNative.ubox_set_hookoff_threshold(this._channel._handle, voltage);
     }
 }
Exemplo n.º 3
0
 public void CallPhone(string phone)
 {
     if (_channel != null)
     {
         UBoxNative.ubox_send_dtmf(_channel._handle, phone);
     }
 }
Exemplo n.º 4
0
 public void StopRecordVoice()
 {
     if (_channel != null)
     {
         _channel._bRecording = false;
         UBoxNative.ubox_stop_record(_channel._handle);
     }
 }
Exemplo n.º 5
0
 public void CloseDevice()
 {
     Console.WriteLine("设备关闭...");
     UBoxNative.ubox_close_logfile();
     UBoxNative.ubox_close();
     _channel     = null;
     callbackPtr  = IntPtr.Zero;
     callbackProc = null;
 }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }