aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2012-06-06 15:19:20 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-07-02 13:47:15 +0300
commit98ddb6aac237be3749e44f0f4399f19f8d9ba0a9 (patch)
tree4c276a5bbfb708a09c2b3b9e38444ec3da1b014f
parentb939e8fab19d140afe684c587b95ddb4a6b588f5 (diff)
downloadbluez-98ddb6aac237be3749e44f0f4399f19f8d9ba0a9.tar.gz
bluez-98ddb6aac237be3749e44f0f4399f19f8d9ba0a9.tar.xz
bluez-98ddb6aac237be3749e44f0f4399f19f8d9ba0a9.zip
SAP: Make sap_error_rsp function static
This error message is used to reply to SAP protocol errors and it should not be used by drivers as they don't have access to server internal state machine. Messages passed to drivers are valid and properly formatted so drivers shall use result code in response messages to indicate error (section 4.11 of SAP specification).
-rw-r--r--sap/sap.h1
-rw-r--r--sap/server.c27
2 files changed, 13 insertions, 15 deletions
diff --git a/sap/sap.h b/sap/sap.h
index 5a98bad0..16c333a9 100644
--- a/sap/sap.h
+++ b/sap/sap.h
@@ -173,7 +173,6 @@ int sap_power_sim_on_rsp(void *sap_device, uint8_t result);
int sap_reset_sim_rsp(void *sap_device, uint8_t result);
int sap_transfer_card_reader_status_rsp(void *sap_device, uint8_t result,
uint8_t status);
-int sap_error_rsp(void *sap_device);
int sap_transport_protocol_rsp(void *sap_device, uint8_t result);
/* Event indication. Implemented by server.c*/
diff --git a/sap/server.c b/sap/server.c
index a96c3fa8..648fa58c 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -286,6 +286,19 @@ static int disconnect_ind(struct sap_connection *conn, uint8_t disc_type)
return send_message(conn, buf, size);
}
+static int sap_error_rsp(struct sap_connection *conn)
+{
+ struct sap_message msg;
+
+ memset(&msg, 0, sizeof(msg));
+ msg.id = SAP_ERROR_RESP;
+
+ error("SAP error (state %d pr 0x%02x).", conn->state,
+ conn->processing_req);
+
+ return send_message(conn, &msg, sizeof(msg));
+}
+
static void connect_req(struct sap_connection *conn,
struct sap_parameter *param)
{
@@ -928,20 +941,6 @@ int sap_transport_protocol_rsp(void *sap_device, uint8_t result)
return send_message(sap_device, buf, size);
}
-int sap_error_rsp(void *sap_device)
-{
- struct sap_message msg;
- struct sap_connection *conn = sap_device;
-
- memset(&msg, 0, sizeof(msg));
- msg.id = SAP_ERROR_RESP;
-
- error("SAP error (state %d pr 0x%02x).", conn->state,
- conn->processing_req);
-
- return send_message(conn, &msg, sizeof(msg));
-}
-
int sap_status_ind(void *sap_device, uint8_t status_change)
{
struct sap_connection *conn = sap_device;