software you can take with you

Read data from bluetooth device

Last post 12-08-2011 8:23 PM by farahbenji. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-07-2011 3:56 AM

    Read data from bluetooth device

    Hi, I would like to read data from a bluetooth device on VS 2008, however, I'm not sure on how to use the in the hand tools. I paired my bluetooth device with my laptop, and com9 is created under the standard serial over bluetooth link under my device manager. Please kindly assist me on how do i get started connecting to the ports so as to collect the data on the bluetooth device. Thanks.
    Filed under: ,
  • 12-08-2011 4:46 AM In reply to

    Re: Read data from bluetooth device

    Have a read of http://32feet.codeplex.com/documentation  That discusses what kind of connection you want to make and how to make it.  See if that helps.
  • 12-08-2011 9:25 AM In reply to

    Re: Read data from bluetooth device

    Thanks Alan for the reply. I've succesfully connected the device on the comm port. However the data being displayed is in a strange format. I'm not sure how to convert the text into something readable. Please kindly advised. My code is as follows: private delegate void setTextDeleg(string text); public delegate void myDelegate(); SerialPort serialPort = new SerialPort(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { string[ portname = SerialPort.GetPortNames(); foreach (string name in portname) comboBox1.Items.Add(name); } private void button1_Click(object sender, EventArgs e) { if (this.comboBox1.SelectedIndex == -1) { MessageBox.Show("Please select comm port first!"); } else if (serialPort.IsOpen) serialPort.Close(); try { { serialPort.PortName = comboBox1.Text; serialPort.BaudRate = 9600; serialPort.Parity = Parity.None; serialPort.DataBits = 8; serialPort.StopBits = StopBits.One; serialPort.Encoding = System.Text.Encoding.ASCII ; } serialPort.Open(); label1.Text = comboBox1.Text + " is opened"; serialPort.DataReceived += new SerialDataReceivedEventHandler(datareceived); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } void datareceived(object sender, SerialDataReceivedEventArgs e) { myDelegate d = new myDelegate(update); textBox1.Invoke(d, new object[ { }); } public void update() { textBox1.AppendText(serialPort.ReadExisting()); textBox1.ScrollToCaret(); } } The message that is being displayed on the textbox is as followed: I've tried to change the System.Text.Encoding.ASII into Default but failed. Please kindly assist. Thanks much!
    Filed under: ,
  • 12-08-2011 2:33 PM In reply to

    Re: Read data from bluetooth device

    Looks like the documenation is at: http://www.nonin.com/OEMSolutions/WristOx2-Model-3150-OEM  "3150 Specifications - old"

  • 12-08-2011 8:23 PM In reply to

    Re: Read data from bluetooth device

    Hi Alan, Thanks for the reply. I've read the documentation, but I'm still unsure which byte to look at to retrieve the pulse rate and sp0 data so that I could convert the byte to float i guess? Please advised.
Page 1 of 1 (5 items)
Copyright © 2001-2013 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy. OrcsWeb's Windows Cloud Server Hosting