09-05-2008 05:12 PM
When I attempt to create a BluetoothSerialPort object my app will occasionally throw some erros.
The three error messages I usually receive are..
"Radio is off" - This tends to occur when the radio is turned on, which makes no sense.
"All ports in use" - I'm assuming this occurs from not properly disconnecting a port before recreating it.
"SppOpen failed" - I have no idea what this is.
My main concern is with the 'SppOpen failed' error. My code to create the port is..
BluetoothSerialPortInfo portInfo = BluetoothSerialPort.getSerialPortInfo();
BluetoothSerialPortInfo info = portInfo[pairedDevicesList.getSelectedIndex()]
port = new BluetoothSerialPort(info, BluetoothSerialPort.BAUD_115200, BluetoothSerialPort.DATA_FORMAT_PARITY_NONE | BluetoothSerialPort.DATA_FORMAT_STOP_BITS_1 | BluetoothSerialPort.DATA_FORMAT_DATA_BITS_8, BluetoothSerialPort.FLOW_CONTROL_NONE, 1024, 1024, this);
Sometimes when I invoke this it will throw that SppOpen error, and I have no idea why this occurs. What does SppOpen failed even mean?
Thanks a lot for the help
09-08-2008 10:13 AM
What BlackBerry model and handheld software version are you testing with? You can see this under Options, About. Are you able to reproduce this using handheld software version 4.5.0.x? Are you seeing this with any Bluetooth device or just a specific one?
The following link contains an example on how to properly close connections.
How To - Close connections
Article Number: DB-00530
09-08-2008 02:22 PM
The SppOpen failed error occurs quite frequently on OS 4.2. I have also seen it on OS 4.1. As for OS 4.5 I don't recall it being an issue.
I actually just noticed on OS 4.2 the SppOpen failed error has a number added to it such as 'SppOpen failed: 19'. Not sure what the number means, but it changes everytime the error pops up.
Thank you for the response and the link.
09-09-2008 10:13 AM
09-09-2008 01:53 PM
I've tried about 5 or 6 different Bluetooth GPS devices and they all have the same issue. On an OS 4.1 Blackberry device, I am able to reproduce it by connecting to a Bluetooth GPS device, when I turn off the GPS device after connecting, it will throw the SppOpen error.
It may be a problem with my code, because when I detect a disconnect, I will attempt to reconnect to the device. This allows it to automatically reconnect when its turned back on, or comes within range again. So it seems the error will pop up when i attempt to reconnect to a device that has been turned off. Not sure if that warrants an error or not, it just seems a little strange since it acts a little different on OS 4.2.
OS 4.2 seems to throw the error when i initially try to connect to the device. Even when the GPS device is turned on. If I keep trying it will connect.
For now I'm just catching the error and trying to reconnect. It doesn't seem like a huge issue now, I'd just be nice to know exactly what is causing it.
08-09-2013 05:30 AM
I know this is a very old post but I happen to have come across some information on the numeric codes that can accompany "SppOpen Fail: n" errors.
On the off chance this helps others:
In use 5
No resources 12
Not found 13
Device not found 14
Connection failed 15
No connection 17
Invalid parm 18
In progress 19
Invalid type 21
HCI init err 22
Not supported 23
SDP continue state 24
Not enormously clear I know but maybe it will offer some clues.