Hi everybody,

I have:
Nokia E51 and a Bluetooth printer Star SM-T300

The printer can be found on windows using default bluetooth serach, this printer has a password, (defaul:1234) accepted easyly on windows.

I try to connect using RFCOMM Simple Client:
OutputStream os = null;
StreamConnection con = null;
try {
* Open the connection to the server
con = (StreamConnection) Connector.open("btspp://00150EE0A89D:1;authenticate=false;encrypt=false;master=false");
* Sends data to remote device
os = con.openOutputStream();
* Close all resources
} catch (IOException e2) {
System.out.println("Failed to print data");
System.out.println("IOException: " + e2.getMessage());
return false;
And Nothing happens.

I try to use Obex with authenticator:
ClientSession clientSession = (ClientSession) Connector.open("btgoep://00150ee0a89d:1",Connector.READ_WRITE);

HeaderSet hsConnect = clientSession.createHeaderSet();

hsConnect.createAuthenticationChallenge(null, true, true);
clientSession.setAuthenticator(new OBEXAuthenticator()); //this class is a simple implementation of Authenticator
HeaderSet hsConnectReply = clientSession.connect(hsConnect);

if (hsConnectReply.getResponseCode() != ResponseCodes.OBEX_HTTP_OK) {
AppMidlet.getInstance().appendForm("Failed to connect"+hsConnectReply);

=====Class OBEXAuthenticator =========
public class OBEXAuthenticator implements Authenticator {

String userName;
String senha;

public OBEXAuthenticator (String userName,String senha) {
this.userName = userName;
this.senha = senha;
public OBEXAuthenticator () {
this.userName = "1234";
this.senha = "1234";

public PasswordAuthentication onAuthenticationChallenge(String description, boolean isUserIdRequired, boolean isFullAccess) {
// AppMidlet.getInstance().appendForm("Teste");
return new PasswordAuthentication(userName.getBytes(), senha.getBytes());

public byte[] onAuthenticationResponse(byte[] userName) {
return senha.getBytes();


And with obex authencaticator the code stop on line:
HeaderSet hsConnectReply = clientSession.connect(hsConnect);

My printer support only password, not user, but my code supports user and pass.
What´s worng with my obex code?
RFCOMM supports authencation?

I use bluecove on windows to try to search supported services.
My code show an service on my printer, only BT Serial and show the same url used on my RFCOMM example.
My code doesn´t show any OBEX service.

What I can do?