When use Watch with Tizen 5.5, SAFileTransfer on smartphone return ERROR_PEER_AGENT_NO_RESPONSE

I have my Companion applications that are working fine with Tizen 4.0.
Now the users of my application are reporting me a bug when they install my application on Watch 3 (Tizen 5.5).
The bug seems related to SAFileTransfer error.
The reason of the fail is :

SAFileTransfer.ERROR_PEER_AGENT_NO_RESPONSE

So the Companion app on smartPhone is able to get agents peers correctly.

#FindPeerAgents Status : [peeragent found] and peerAgents [[Lcom.samsung.android.sdk.accessory.SAPeerAgent;@192459]

and this is the Peer object:
#PeerAgent: PeerAgent - id:47375 containerId:33725 FriendlyName:WhatsMedia Profile Version:1.0 PeerAccessory - Id:54541 Name:GEAR_SERIES Address:08:BF:A0:5D:FA:C5 TransportType:2 ProductId:SM-R840 VendorId:SAMSUNG APDU:2097152 SSDU:65524 Accessory ID:SAMSUNG_ACCESSARY__08:BF:A0:5D:FA:C5 MXDU:65517 Encryption padding:100 MexSupport:0 SocketSupport:1 and mPeerAgentStatus 0

but when I try to invoke the

SAFileTransfer.send(mPeerAgent, mSelectedFileName);

on the callback onTransferCompleted() I receive an error : SAFileTransfer.ERROR_PEER_AGENT_NO_RESPONSE

I’m using accessory-v2.6.1.jar in my Android application and following the accessoryservices.xml in both the app:

  1. accessoryservices.xml on SmartPhone application:
 <application name = "WhatsMedia">
     <serviceProfile
         id="/service/whatsmedia"
         name="WhatsMedia"
         role="consumer"
         serviceImpl="com.whatsmedia.android.sender.FileTransferSender"
         version="1.0"
         serviceLimit="ANY"
         serviceTimeout="10">
         <supportedTransports>
             <transport type="TRANSPORT_BT"/>
             <transport type="TRANSPORT_WIFI"/>
         </supportedTransports>

         <serviceChannel
             id="107"
             dataRate="low"
             priority="low"
             reliability= "enable"/>   
 </serviceProfile>
 </application>
    <paths xmlns:android="http://schemas.android.com/apk/res/android">
     <files-path name="my_images" path="." />
     <cache-path name="my_cache" path="." />
     <external-path name="ext" path="." />
 </paths>
  1. accessoryservices.xml on Tizen application:
<?xml version="1.0" encoding="UTF-8"?>

resources>
application name=“WhatsMedia”>
serviceProfile
autoLaunchAppId=“IqjHbNhtlB.WhatsMedia”
id=“/service/whatsmedia”
name=“WhatsMedia”
role=“provider”
version=“1.0”>
supportedTransports>
transport type=“TRANSPORT_BT”/>
transport type=“TRANSPORT_WIFI”/>
/supportedTransports>
serviceChannel
id=“107”
dataRate=“low”
priority=“low”
reliability=“enable”>
/serviceChannel>
/serviceProfile>
/application>
/resources>

On the Watch side unfortunately I don’t see any error since my users are reporting me this bug.
I tried to create a beta version to show some logs and it seems never arrived a SAAgent.acceptServiceConnectionRequest so is never created a “SAP socket to accept an incoming connection for
a specific peer”, but I cannot be sure about this since I didn’t debug my application on Tizen 5.5 device.

Of course, on the Device Manager in Tizen Studio, the Emulator w-5.5-circle-x86 not support webapis because is not installed the SAP framework ! And in the Samsung test LAB remote we have only devices with Tizen 4.0 !
I’m wondering in which way tizen developers should test their application on Tizen 5.5 !!! Should I buy all the real devices to test it ? Actually tizen 5.5 is installed only to Watch 3.
This situation is really frustrating me.
I hope someone could help me or give me some hints.
Best

Hello,

Would you please add below privilege and try again?

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

Thanks,
Iqbal

1 Like

Are your sure the issue is connected with Tizen 5.5 on GW3? Since Android 9 (Pie) you have to put some changes in manifest.xml and service class inherited after SAP Service. Personally I didn’t noticed any issues with Tizen 5.5.x on GW3. I tested with Android 7, 9 and 10.

Make sure you use last SAP libraries and read carefully PDF document about last changes.

Tizen 5.5.1 is already distributed on Galaxy Active 2 too.

Hi Iqbal, your suggestion fixes my problem. I have to use
<tizen:privilege name=“http://developer.samsung.com/tizen/privilege/accessoryprotocol”/>
instead of
<tizen:privilege name=“http://developer.samsung.com/privilege/accessoryprotocol”/>
Thanks very much for your help !

1 Like

The problem here is simple:
even if you use the example presents in the newest AccessorySDK_v2.6.4 WebAPI FileTransfer at this path

AccessorySDK_v2.6.4\Samples\Samples(Web).zip\Basic(App)\Consumer(Android)_Provider(Tizen)\Provider\FileTransfer

the config.xml uses this privilege
<tizen:privilege name=“http://developer.samsung.com/privilege/accessoryprotocol”/>

but if you follow the guide

then is suggested to use
http://developer.samsung.com/tizen/privilege/accessoryprotocol privilege

So I recommend to Samsung to update the documentation and the example of the AccessorySDK to the newest Tizen version. Besides, in the Remote Test Labs is not present any Samsung Watch at latest Tizen 5.5 so is not possible to test the application on real device in advanced. Thanks to @Iqbal for his help.

1 Like

Samsung doesn’t care about updating documentation / links pointing to 404 on forums :slight_smile: - Although I have to admit that in this case they have updated the privilege in the file in question. :clap: