Languages

Menu
Sites
Language
Migrate Accessory Protocol Tizen Wearable Web 2.3 to 2.3.1

Hi,

I'm trying to migrate an wearable app from 2.3 to 2.3.1 which have installed Samsung Accessory Protocol SDK but I'm having different errors, the first one was about permissions, I had this permission:

<tizen:privilege name="http://developer.samsung.com/privilege/accessoryprotocol"/>

And when I tried to install my app in my smart watch I got an error saying that I should use this one:

<tizen:privilege name="http://developer.samsung.com/tizen/privilege/accessoryprotocol"/>

I made this change but when I tryied to run the app I got next error: Unknown Error Internal Error running the code to start accessory protocol in this line: webapis.sa.requestSAAgent(requestOnSuccess, requestOnError);

I've tried also start from scratch an app using the manual which Samsung offer to create a web companion app

http://developer.samsung.com/gear/develop/getting-started/web-companion/setup-sdk

Here how to config your web companion app:

http://developer.samsung.com/gear/develop/getting-started/web-companion/use-sap

Here how to run Accessory protocol:

http://developer.samsung.com/gear/develop/getting-started/web-companion/interact-device

So far this is my code:

function requestOnSuccess (agents) {
        alert("requestOnSuccess");
    var i = 0;
    for (i; i < agents.length; i += 1) {
        if (agents[i].role === "PROVIDER") {
            SAAgent = agents[i];
            break;
        }
    }   /* Set listener for upcoming connection from Consumer */
    SAAgent.setServiceConnectionListener(connectionListener);

}

function requestOnError (e) {   alert("requestOnError"); }

/* Requests the SAAgent specified in the Accessory Service Profile */
if(CHANNELID ==""){
    alert("requestSAAgent");
    webapis.sa.requestSAAgent(requestOnSuccess, requestOnError);
}
}
catch(e){
    alert(e);

}

And this is my config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="*********" version="1.0.0" viewmodes="maximized">
    <tizen:application id="*********" package="******" required_version="2.3.1"/>
    <content src="index.html"/>
    <feature name="http://developer.samsung.com/tizen/feature/network.accessory_protocol"/>
    <feature name="http://tizen.org/feature/screen.size.normal"/>
    <feature name="http://tizen.org/feature/network.bluetooth.le"/>
    <feature name="http://tizen.org/feature/sensor.heart_rate_monitor"/>
    <icon src="icon.png"/>
    <tizen:metadata key="AccessoryServicesLocation" value="res/xml/accessoryservices.xml"/>
    <name>EcoLog</name>
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
    <tizen:privilege name="http://tizen.org/privilege/healthinfo"/>
    <tizen:privilege name="http://tizen.org/privilege/bluetooth.admin"/>
    <tizen:privilege name="http://tizen.org/privilege/bluetooth.gap"/>
    <tizen:privilege name="http://tizen.org/privilege/power"/>
    <tizen:privilege name="http://tizen.org/privilege/application.info"/>
    <tizen:privilege name="http://tizen.org/privilege/package.info"/>
    <tizen:privilege name="http://developer.samsung.com/tizen/privilege/accessoryprotocol"/>
    <tizen:profile name="wearable"/>
    <tizen:setting background-support="enable" encryption="disable" hwkey-event="enable"/>
    <tizen:setting hwkey-event="enable"/>
</widget>

Everything was working well until I migrate from 2.3 to 2.3.1

Does anyone know what It's going on? Any help would be really appreciated.

Cheers,

Miguel

Responses

3 Replies
Marco Buettner

Did u try to reinstall extension on 2.3.1?

http://developer.samsung.com/technical-doc/view.do?v=T000000248

(why u change from 2.3 to 2.3.1?)

Miguel Benitez

Because It's part of the requirements :(

I've found out the problem, I don't know what happened but turning off and on again the bluetooth in my smart watch (Samsung gear2) solve the problem

Thank you for your time!

Miguel Benitez

Because It's part of the requirements :(

I've found out the problem, I don't know what happened but turning off and on again the bluetooth in my smart watch (Samsung gear2) solve the problem

Thank you for your time!