zelander
Posts: 15
Joined: Thu Oct 13, 2005 1:05 pm

Error when opening stream in "Find & Connect" ex.

Sun Oct 23, 2005 10:31 pm

Hello

Have just downloaded the new BETA 5 drivers for bluetools and the "Find and Connect" example still can´t open the datastream. The application throws an errormessage like:
"Failed to set the security level of the connection. Try restarting the bluetooth stack."

The module I´m connection to has low security-settings without any password or pairing needed.

User avatar
johan
GpsGate
Posts: 15145
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Error when opening stream in "Find & Connect" ex.

Mon Oct 24, 2005 1:11 pm

I'll send you a debug version to work this out.

Regards,
Johan

Franson Support

zelander
Posts: 15
Joined: Thu Oct 13, 2005 1:05 pm

RE: Error when opening stream in "Find & Connect" ex.

Tue Oct 25, 2005 11:41 pm

Uninstalled Widcomm drivers and installed the Microsoft Stack. Now it seems like The Find and Connect example is working.. At least no exception.

/Björn

Andreas2
Posts: 108
Joined: Sun Feb 13, 2005 3:19 pm

RE: Error when opening stream in "Find & Connect" ex.

Wed Oct 26, 2005 12:35 am

The error you experienced is probably due to a version incompatibility. Which version of the Widcomm stack was installed? Versions prior to 1.4.2.10 is not supported.

Regards,
Andreas Nilsson
Franson Support

zelander
Posts: 15
Joined: Thu Oct 13, 2005 1:05 pm

RE: Error when opening stream in "Find & Connect" ex.

Wed Oct 26, 2005 12:59 am

Quite old dongle, so it´s possible that the driver is old also...

Just one last question:
When I find a connection I want to send one byte (to tell the remote device to initiate some data transfer).
Unfortunately I can´t send any data prior to receive from the remote device. I think that´s because the remote device sends a "Remote port negotiation packet" with "right" settings before it starts to send data? Is that so?

Since you have implemented RFCOMM it should be quite an easy task to implement this kind of packets to fully support Serial Port Profile, will you do that?
Edit: please =)

(The remote device is using a hardware module from free2move)
PIC Processor<--->UART<---->Bluetooth).

Regards / Bjorn

Andreas2
Posts: 108
Joined: Sun Feb 13, 2005 3:19 pm

RE: Error when opening stream in "Find & Connect" ex.

Wed Oct 26, 2005 3:14 am

It should be possible to send one byte. However, the data sent through the stream is buffered, so you will have to flush the buffer if only one byte is sent. Like this:

Code: Select all

myStream.WriteByte(0x03);
myStream.Flush();
This will send whatever is available in the output buffer to the remote device and clear the contents of the buffer.

If you implement packet based communication, you would generally flush the buffers after one packet is sent:

Code: Select all

Packet packet = ...;
// Serialize the packet into the stream
stream.Flush();
Regards,
Andreas Nilsson
Franson Support

zelander
Posts: 15
Joined: Thu Oct 13, 2005 1:05 pm

RE: Error when opening stream in "Find & Connect" ex.

Wed Oct 26, 2005 1:00 pm

I don´t think you really understood my question.

I do send one byte as you told, with flush and so on, but the pic processor "behind" my hardware module on "the other side" can´t read that byte.

I think this is because the default UART settings in remote hardware module are wrong, and there will be a framing / pageing error in PIC from UART serial stream.

If I send one byte from the PIC processor the hardware module will regonize the UART settings and setup UART settings correct and also send a RPN packege to remote host (computer bluetooth stack).

The PIC processor does only know about the UART and think it´s online all the time. (like an stateless http-server). The byte I´m sending from windows application reminds of an http GET command. And the PIC processor will respond to that.

Now the problem is that the PIC processor can´t read the "GET" command. (framing error).

I think Windows application (bluetools) need to specify serial port settings before transmission to setup hardware module (on other side) to transmit data over UART with correct settings. This is done with a RPN package.

Is that so, or do you have an onther solution to the problem?

/Bjorn

Return to “BlueTools”