linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott James Remnant <scott@netsplit.com>
To: linux-bluetooth@vger.kernel.org
Cc: keybuk@chromium.org, Scott James Remnant <scott@netsplit.com>
Subject: [PATCHv2 2/8] Rename AUTH_TYPE_NOTIFY to AUTH_TYPE_NOTIFY_PASSKEY
Date: Mon, 23 Jan 2012 16:27:46 -0800	[thread overview]
Message-ID: <1327364872-32313-3-git-send-email-scott@netsplit.com> (raw)
In-Reply-To: <1327364872-32313-1-git-send-email-scott@netsplit.com>

This makes room for additional notification types to be added.
---
 src/device.c |    8 ++++----
 src/device.h |    2 +-
 src/event.c  |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/device.c b/src/device.c
index c19acd4..670bfc4 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2320,7 +2320,7 @@ void device_simple_pairing_complete(struct btd_device *device, uint8_t status)
 {
 	struct authentication_req *auth = device->authr;
 
-	if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent)
+	if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
 		agent_cancel(auth->agent);
 }
 
@@ -2337,7 +2337,7 @@ void device_bonding_complete(struct btd_device *device, uint8_t status)
 
 	DBG("bonding %p status 0x%02x", bonding, status);
 
-	if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent)
+	if (auth && auth->type == AUTH_TYPE_NOTIFY_PASSKEY && auth->agent)
 		agent_cancel(auth->agent);
 
 	if (status) {
@@ -2587,7 +2587,7 @@ int device_request_authentication(struct btd_device *device, auth_type_t type,
 		err = agent_request_confirmation(agent, device, passkey,
 						confirm_cb, auth, NULL);
 		break;
-	case AUTH_TYPE_NOTIFY:
+	case AUTH_TYPE_NOTIFY_PASSKEY:
 		err = agent_display_passkey(agent, device, passkey);
 		break;
 	default:
@@ -2627,7 +2627,7 @@ static void cancel_authentication(struct authentication_req *auth)
 	case AUTH_TYPE_PASSKEY:
 		((agent_passkey_cb) auth->cb)(agent, &err, 0, device);
 		break;
-	case AUTH_TYPE_NOTIFY:
+	case AUTH_TYPE_NOTIFY_PASSKEY:
 		/* User Notify doesn't require any reply */
 		break;
 	}
diff --git a/src/device.h b/src/device.h
index 13005ae..2558e4a 100644
--- a/src/device.h
+++ b/src/device.h
@@ -30,7 +30,7 @@ typedef enum {
 	AUTH_TYPE_PINCODE,
 	AUTH_TYPE_PASSKEY,
 	AUTH_TYPE_CONFIRM,
-	AUTH_TYPE_NOTIFY,
+	AUTH_TYPE_NOTIFY_PASSKEY,
 } auth_type_t;
 
 struct btd_device *device_create(DBusConnection *conn,
diff --git a/src/event.c b/src/event.c
index 0783b47..d3de936 100644
--- a/src/event.c
+++ b/src/event.c
@@ -200,8 +200,8 @@ int btd_event_user_notify(bdaddr_t *sba, bdaddr_t *dba, uint32_t passkey)
 	if (!get_adapter_and_device(sba, dba, &adapter, &device, TRUE))
 		return -ENODEV;
 
-	return device_request_authentication(device, AUTH_TYPE_NOTIFY, passkey,
-								FALSE, NULL);
+	return device_request_authentication(device, AUTH_TYPE_NOTIFY_PASSKEY,
+							passkey, FALSE, NULL);
 }
 
 void btd_event_simple_pairing_complete(bdaddr_t *local, bdaddr_t *peer,
-- 
1.7.7.3


  parent reply	other threads:[~2012-01-24  0:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24  0:27 [PATCHv2 0/8] Generate PIN for keyboards inside bluetoothd Scott James Remnant
2012-01-24  0:27 ` [PATCHv2 1/8] bt_ids: add header of device class constants Scott James Remnant
2012-01-24  0:27 ` Scott James Remnant [this message]
2012-01-24  0:27 ` [PATCHv2 3/8] Pass passkey by pointer rather than by value Scott James Remnant
2012-01-24  0:27 ` [PATCHv2 4/8] agent: add DisplayPinCode method Scott James Remnant
2012-01-24  0:27 ` [PATCHv2 5/8] Add AUTH_TYPE_NOTIFY_PASSKEY to device_request_authentication Scott James Remnant
2012-01-24  0:27 ` [PATCHv2 6/8] Generate PIN for keyboard devices Scott James Remnant
2012-01-24  0:27 ` [PATCHv2 7/8] doc: document DisplayPinCode Scott James Remnant
2012-01-24  0:27 ` [PATCHv2 8/8] simple-agent: add DisplayPinCode Scott James Remnant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327364872-32313-3-git-send-email-scott@netsplit.com \
    --to=scott@netsplit.com \
    --cc=keybuk@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).