示例#1
0
        //---------------------------------------------------
        // BtStack.SetGeneralSecurityOptions
        //---------------------------------------------------
        public eBTRC SetGeneralSecurityOptions(GenSecOptions Opts)
        {
            eBTRC rc = BT_SetGeneralSecurityOptions(Opts.LocalDeviceName,
                                                    Opts.FTPRootDir,
                                                    Opts.IsDiscoverable ? 1 : 0,
                                                    Opts.IsConnectable  ? 1 : 0);

            return(rc);
        }
示例#2
0
        //---------------------------------------------------
        // BtStack.SetSvcSecurityOptions
        //---------------------------------------------------
        public eBTRC SetSvcSecurityOptions(eBTSVC eSvc, SvcSecOptions Opts)
        {
            eBTRC rc = BT_SetSvcSecurityOptions(eSvc,
                                                Opts.IsEnabled                  ? 1 : 0,
                                                Opts.IsAuthRequired             ? 1 : 0,
                                                Opts.IsPINRequired              ? 1 : 0,
                                                Opts.IsEncryptRequired  ? 1 : 0);

            return(rc);
        }
示例#3
0
        //----------------------------------------------------------
        // SendFileComplete handler
        //----------------------------------------------------------
        public void OnSendFileComplete(eBTRC rc)
        {
            eBTRC i = rc;

            AddResult(String.Format("  >SendFile: {0}",
                                    rc == eBTRC.BT_FTP_OPEN_FAILED ? "open failed" :
                                    rc == eBTRC.BT_FTP_SEND_ERROR ? "send error" :
                                    rc == eBTRC.BT_FTP_CLOSE_FAILED ? "close failed" :
                                    rc == eBTRC.BT_OK ? "completed" :
                                    "unknown error"));

            SendComplete = true;
        }
示例#4
0
        private void ShowFcnResult(string fcn, eBTRC rc)
        {
            string s;

            s = String.Format("{0}-->{1}",
                              fcn,
                              rc == eBTRC.BT_OK ? "BT_OK" :
                              rc == eBTRC.BT_FAIL ? "BT_FAIL" :
                              rc == eBTRC.BT_DEVICE_NOTAVAIL ? "BT_DEVICE_NOTAVAIL" :
                              rc == eBTRC.BT_SVC_NOT_SUPPORTED ? "BT_SVC_NOT_SUPPORTED" :
                              rc == eBTRC.BT_SVC_NOT_UNIQUE ? "BT_SVC_NOT_UNIQUE" :
                              "unknown rc");
            AddResult(s);
            if (fcn.Equals("SendFile") && rc != eBTRC.BT_OK)
            {
                SendComplete = true;
            }
        }
示例#5
0
 public static string PANConnectResultToString(eBTRC result)
 {
     string errorMessage;
     switch (result)
     {
         case eBTRC.BT_FAIL:
             errorMessage = "Connection attempt has failed";
             break;
         case eBTRC.BT_SVC_NOT_SUPPORTED:
             errorMessage = "The device does not support the PAN service";
             break;
         case eBTRC.BT_DEVICE_NOTAVAIL:
             errorMessage = "The device is not responding to Bluetooth communications";
             break;
         case eBTRC.BT_UNSUPPORTED:
             errorMessage = "This is the return code if the method is called from the standard BTaccess library.";
             break;
         default:
             errorMessage = "Unknown result returned.";
             break;
     }
     return errorMessage;
 }
示例#6
0
 //----------------------------------------------------------
 // BusinessCardComplete Handler
 //----------------------------------------------------------
 public void OnBcComplete(eBTRC rc)
 {
     AddResult(String.Format("  >BusCard operation {0}",
                             rc == eBTRC.BT_OK ? "succeeded" : "failed"));
 }
示例#7
0
文件: Form1.cs 项目: fido2478/engcon
 private void ShowFcnResult(string fcn, eBTRC rc)
 {
     string s;
     s = String.Format("{0}-->{1}",
         fcn,
         rc == eBTRC.BT_OK ? "BT_OK" :
         rc == eBTRC.BT_FAIL ? "BT_FAIL" :
         rc == eBTRC.BT_DEVICE_NOTAVAIL ? "BT_DEVICE_NOTAVAIL" :
         rc == eBTRC.BT_SVC_NOT_SUPPORTED ? "BT_SVC_NOT_SUPPORTED" :
         rc == eBTRC.BT_SVC_NOT_UNIQUE ? "BT_SVC_NOT_UNIQUE" :
                                          "unknown rc");
     AddResult(s);
     if (fcn.Equals("SendFile") && rc != eBTRC.BT_OK)
         SendComplete = true;
 }
示例#8
0
文件: Form1.cs 项目: fido2478/engcon
        //----------------------------------------------------------
        // SendFileComplete handler
        //----------------------------------------------------------
        public void OnSendFileComplete(eBTRC rc)
        {
            eBTRC i = rc;

            AddResult(String.Format("  >SendFile: {0}",
                rc == eBTRC.BT_FTP_OPEN_FAILED ? "open failed" :
                rc == eBTRC.BT_FTP_SEND_ERROR ? "send error" :
                rc == eBTRC.BT_FTP_CLOSE_FAILED ? "close failed" :
                rc == eBTRC.BT_OK ? "completed" :
                                                "unknown error"));

            SendComplete = true;
        }
示例#9
0
文件: Form1.cs 项目: fido2478/engcon
 //----------------------------------------------------------
 // BusinessCardComplete Handler
 //----------------------------------------------------------
 public void OnBcComplete(eBTRC rc)
 {
     AddResult(String.Format("  >BusCard operation {0}",
         rc == eBTRC.BT_OK ? "succeeded" : "failed"));
 }
示例#10
0
 //BTHelper()
 //{
 //    //KnownDevices.Add("FA:73:5E:37:12:00"); // "00:12:37:5E:73:FA"
 //    //KnownDevices.Add("72:FF:8C:37:12:00"); // "00:12:37:8C:FF:72" PDA36
 //    //KnownDevices.Add("41:2F:8D:37:12:00"); // "00:12:37:8D:2F:41"
 //    //KnownDevices.Add("C6:01:8D:37:12:00"); // "00:12:37:8D:01:C6"
 //    //KnownDevices.Add("8D:2F:41:37:12:00"); // "00:12:37:41:2F:8D"
 //    //KnownDevices.Add("C6:01:8D:37:00:08"); // PDA38
 //}
 public static string StringFcnResult(eBTRC rc)
 {
     string s;
     s = String.Format("{0}",
         rc == eBTRC.BT_OK ? "BT_OK" :
         rc == eBTRC.BT_FAIL ? "BT_FAIL" :
         rc == eBTRC.BT_DEVICE_NOTAVAIL ? "BT_DEVICE_NOTAVAIL" :
         rc == eBTRC.BT_SVC_NOT_SUPPORTED ? "BT_SVC_NOT_SUPPORTED" :
         rc == eBTRC.BT_SVC_NOT_UNIQUE ? "BT_SVC_NOT_UNIQUE" :
                                          "unknown rc");
     return s;
 }