Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
actjak
Posts: 33
Registered: ‎05-02-2012
My Device: playbook

I can not Initializes the library Bluetooth Serial Port (btspp)

I would use the Bluetooth Serial Port (SPP) communication protocol

my code is

 

 

#include "app.hpp"

#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>
#include <btapi/btspp.h>
#include <btapi/btdevice.h>
#include <errno.h> // add to recognize the retur error

using namespace bb::cascades;

App::App()
{

 QmlDocument *qml = QmlDocument::create("main.qml");
    //-- setContextProperty expose C++ object in QML as an variable
    //-- uncomment next line to introduce 'this' object to QML name space as an 'app' variable
    //qml->setContextProperty("app", this);

    AbstractPane *root = qml->createRootNode<AbstractPane>();
    Application::setScene(root);
 char addr[] = { (char) 0x00, (char) 0x07, (char) 0xCF, (char) 0x56, (char) 0xD0, (char) 0xFC};
    	//The Universally Unique Identifier (UUID) of the service to register.
    char UUID[] = { (char) 0xED, (char) 0x49, (char) 0x5A, (char) 0xFE, (char) 0x28, (char) 0xED, (char) 0x11, (char) 0xda, (char) 0x94, (char) 0xd9, (char) 0x00, (char) 0xe0, (char) 0x81, (char) 0x61, (char) 0x16, (char) 0x5f };

  int iN;

    	iN = bt_spp_init();

    	//qWarning() << "initialisation spp :";
    	qWarning() << "initialisation spp :";
    	qWarning() << iN;
    	if (iN == EOK){
    		qWarning()<< "EOK";
    	}else{
    		qWarning()<< "EBUSY";
    	}

int openSpp;
    	openSpp = bt_spp_open(addr,UUID,false);
    	qWarning()<< "la reponse de la fonction bt_spp_open";
    	qWarning()<< openSpp;

  	qWarning() << "denitialisation spp :";
    	qWarning() <<  deini;

}

 

int bt_spp_init()  return iN =13;

13 hnt corresponds with EOK 

 the initialization is not successful

Would somebody have an idea for a successful initialization ?

 

Please use plain text.
Contributor
actjak
Posts: 33
Registered: ‎05-02-2012
My Device: playbook

Re: I can not Initializes the library Bluetooth Serial Port (btspp)

the return of          int bt_spp_init();    is 13

i find  that  means Permission denied     ( its define in errno.h)

in the bar-descriptor I selact all and it is the same probleme

I want to know how obtain the permission?

 

 

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Device: BB Alpha

Re: I can not Initializes the library Bluetooth Serial Port (btspp)

Hi,

 

Unfortunately, Bluetooth is not yet fully functional in this current release, but should be coming soon;

 

Martin

 

Please use plain text.