com.samsung.android.sdk.accessory
Class SAPeerAgent
- java.lang.Object
-
- com.samsung.android.sdk.accessory.SAPeerAgent
-
- All Implemented Interfaces:
- android.os.Parcelable
public class SAPeerAgent extends java.lang.Object implements android.os.Parcelable
SAPeerAgent represents a remote Accessory Peer Agent.This class encapsulates the information about a remote Accessory Peer Agent and the Accessory Device that the Accessory Peer Agent runs on.
The application can check such information to decide whether to request a Service Connection with the Accessory Peer Agent, and whether to accept incoming Service Connection requests from the Accessory Peer Agent.
Developer Guides
For more information about using Accessory, please refer to the Accessory Programming Guide.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description SAPeerAccessory
getAccessory()
Returns the instance ofSAPeerAccessory
hosting this Accessory Peer Agent.java.lang.String
getAppName()
Returns the name of the application to which the Accessory Peer Agent belongs.int
getMaxAllowedDataSize()
Returns the maximum allowed data size on sending application data.int
getMaxAllowedMessageSize()
Returns the maximum allowed message size on sending application message.java.lang.String
getPeerId()
Returns the Accessory Peer Agent ID.java.lang.String
getProfileVersion()
Returns the version of the Accessory Service Profile that the Accessory Peer Agent supports.boolean
isFeatureEnabled(int type)
Returnstrue
if the Accessory feature on the remote Accessory Peer Agent is enabled.
-
-
-
Method Detail
-
getAccessory
public SAPeerAccessory getAccessory()
Returns the instance ofSAPeerAccessory
hosting this Accessory Peer Agent.- Returns:
- The instance of
SAPeerAccessory
. - Since:
- 2.0.19
-
getPeerId
public java.lang.String getPeerId()
Returns the Accessory Peer Agent ID.- Returns:
- The Accessory Peer Agent ID.
- Since:
- 2.0.19
-
getAppName
public java.lang.String getAppName()
Returns the name of the application to which the Accessory Peer Agent belongs.- Returns:
- The name of the application to which the Accessory Peer Agent belongs.
- Since:
- 2.0.19
-
getProfileVersion
public java.lang.String getProfileVersion()
Returns the version of the Accessory Service Profile that the Accessory Peer Agent supports.- Returns:
- The version of the Accessory Service Profile
- Since:
- 2.0.19
-
getMaxAllowedDataSize
public int getMaxAllowedDataSize()
Returns the maximum allowed data size on sending application data.- Returns:
- The maximum allowed data size
- Since:
- 2.0.19
- See Also:
SASocket.send(int, byte[])
,SASocket.secureSend(int, byte[])
-
getMaxAllowedMessageSize
public int getMaxAllowedMessageSize()
Returns the maximum allowed message size on sending application message.- Returns:
- The maximum allowed message size
- Since:
- 2.5.0
- See Also:
SAMessage.send(SAPeerAgent, byte[])
,SAMessage.secureSend(SAPeerAgent, byte[])
-
isFeatureEnabled
public boolean isFeatureEnabled(int type)
Returnstrue
if the Accessory feature on the remote Accessory Peer Agent is enabled.- Parameters:
type
- The feature ID(must be (SA.DEVICE_ACCESSORY
,SA.SERVICE_MESSAGE
)).- Returns:
true
if the Accessory feature is available on the remote Accessory Peer Agent, elsefalse
- Throws:
java.lang.IllegalArgumentException
- Thrown if the feature ID passed is not valid.- Since:
- 2.5.0
-
-