public class SAPeerAgent extends Object implements Parcelable
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.
For more information about using Accessory, please refer to the Accessory Programming Guide.
Modifier and Type | Method and Description |
---|---|
SAPeerAccessory |
getAccessory()
Returns the instance of
SAPeerAccessory hosting this Accessory Peer Agent. |
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.
|
String |
getPeerId()
Returns the Accessory Peer Agent ID.
|
String |
getProfileVersion()
Returns the version of the Accessory Service Profile that the Accessory Peer Agent supports.
|
boolean |
isFeatureEnabled(int type)
Returns
true if the Accessory feature on the remote Accessory Peer Agent
is enabled. |
public SAPeerAccessory getAccessory()
SAPeerAccessory
hosting this Accessory Peer Agent.SAPeerAccessory
.public String getPeerId()
public String getAppName()
public String getProfileVersion()
public int getMaxAllowedDataSize()
SASocket.send(int, byte[])
,
SASocket.secureSend(int, byte[])
public int getMaxAllowedMessageSize()
SAMessage.send(SAPeerAgent, byte[])
,
SAMessage.secureSend(SAPeerAgent, byte[])
public boolean isFeatureEnabled(int type)
true
if the Accessory feature on the remote Accessory Peer Agent
is enabled.type
- The feature ID(must be (SA.DEVICE_ACCESSORY
, SA.SERVICE_MESSAGE
)).true
if the Accessory feature is available on the remote Accessory Peer Agent,
else false
IllegalArgumentException
- Thrown if the feature ID passed is not valid.Copyright © Samsung Electronics, Co., Ltd. All rights reserved.