나는 phisiological 매개 변수를 얻을 수있는 센서를 구입했습니다; 내 컴퓨터에 블루투스 프로토콜로 연결되어 있으므로 직렬 포트 (예 : COM10)가 연결될 때 연결됩니다. 가 지금은 실시간으로 데이터를 읽을 수있는 간단한 루틴을 쓰고 있어요 : 이것은 나를 위해 작동직렬 포트 연결 문제
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SewLib;
using System.IO.Ports;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
SewDevice myDevice;
SerialPort comPort;
public Form1()
{
InitializeComponent();
comPort = new SerialPort("COM10");
myDevice = new SewDevice(ref comPort);
myDevice.OnSamplesReceived += new ReceivedSamplesHandler(ReceiveData);
}
private void btstart_Click(object sender, EventArgs e)
{
eErrorClassOpcodes reply = myDevice.StartStreaming();
if (reply == eErrorClassOpcodes.Ok)
{
// ok device is connected and streaming is started
}
}
,하지만 지금은 COM 포트의 선택에 대한 비 정적 절차를 가질 것 : 내 생각이다 주기 내 모든 PC에서 감지하고 블루투스 어댑터가있는 포트만 선택하십시오.
아이디어가 있습니까?
감사
안드레아