From: Dave Mielke <dave@mielke.cc>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] PIN helper
Date: Wed, 8 Mar 2006 16:40:32 -0500 [thread overview]
Message-ID: <20060308214031.GZ4516@beta.private.mielke.cc> (raw)
In-Reply-To: <20060308221925.17d20407.fotopiper@o2.pl>
[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]
[quoted lines by Radek on 2006/03/08 at 22:19 +0100]
>from whot I had read in the net there had been some controversies about
>the pinhelpers. The d-bus one need d-bus, and the python one need some
>extra libs as well as X..
May I use this opportunity to "readvertise" a script I tried to bring to your
collective attention some months ago. It's attached to this post as "bluepin".
It works in text mode, supports a file containing address/pin mappings, and
uses the dialog utility to bring up a text-mode prompt on a spare virtual
terminal for devices not listed in the file. Please give it some consideration.
I'll be glad to enhance it as necessary regarding whatever features it's
missing or could use in addition to what it already does. See the comments at
the top of the script for more detail.
--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: dave@mielke.cc | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/
[-- Attachment #2: bluepin --]
[-- Type: text/plain, Size: 1956 bytes --]
#!/bin/sh
# This script has been written by Dave Mielke <dave@mielke.cc>. It's a light
# weight, text mode, Bluetooth PIN helper script. Its dependencies are:
# * /bin/sh The standard system command shell.
# * open A command which opens a free virtual terminal.
# * dialog A command which presents a text-mode dialog.
#
# The file /etc/bluetooth/pins is searched for a line corresponding to the
# Bluetooth address of the device. Each line of this file should contain the
# address of a device and its PIN, in that order, separated by space. If the
# address is found then the corresponding PIN is automatically supplied. If
# it's not found then the user is prompted via a text-mode dialog in a free
# virtual terminal. The console automatically returns to the original virtual
# terminal as soon as the PIN is entered.
pinsFile="/etc/bluetooth/pins"
pinLimit=16
[ "${#}" -gt 0 ] && {
direction="${1}"
shift
[ "${#}" -gt 0 ] && {
address="${1}"
shift
if [ "${#}" -gt 0 ]
then
name="${1}"
shift
else
name=""
fi
[ -f "${pinsFile}" -a -r "${pinsFile}" ] && exec <"${pinsFile}" && {
while read a p x
do
[ "${a}" = "${address}" ] && {
echo "PIN:${p}"
exit 0
}
done
}
if [ "${direction}" = "out" ]
then
adjective="outgoing"
preposition="to"
else
adjective="incoming"
preposition="from"
fi
title="Bluetooth PIN Prompt"
time="`date '+%Y-%m-%d@%H:%M:%S'`"
prompt="Enter PIN for ${adjective} Bluetooth connection ${preposition} ${name}[${address}]"
pin="`open 3>&1 -s -w -- dialog --output-fd 3 --clear --title "${title}" --cr-wrap --max-input "${pinLimit}" --inputbox "${time}\n\n${prompt}" 0 0 ""`"
[ -n "${pin}" ] && {
echo "PIN:${pin}"
exit 0
}
}
}
echo ERR
exit 0
next prev parent reply other threads:[~2006-03-08 21:40 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-08 21:19 [Bluez-devel] PIN helper Radek
2006-03-08 21:40 ` Dave Mielke [this message]
2006-03-08 22:01 ` Radek Rurarz
2006-03-08 22:16 ` Dave Mielke
2006-03-09 5:44 ` Radek Rurarz
2006-03-09 5:55 ` Dave Mielke
2006-03-09 6:06 ` Radek Rurarz
2006-03-09 6:12 ` Dave Mielke
2006-03-09 18:29 ` Radek Rurarz
2006-03-09 19:34 ` Dave Mielke
2006-03-09 21:55 ` Radek Rurarz
2006-03-09 22:04 ` Radek Rurarz
2006-03-10 1:33 ` Dave Mielke
2006-03-10 7:28 ` Radek Rurarz
2006-03-10 13:35 ` Dave Mielke
2006-03-10 18:10 ` Radek Rurarz
2006-03-10 17:25 ` Dave Mielke
2006-03-10 18:13 ` Radek Rurarz
2006-03-10 18:39 ` Dave Mielke
2006-03-10 19:22 ` Radek Rurarz
2006-03-10 20:55 ` Dave Mielke
2006-03-10 22:24 ` Radek Rurarz
2006-03-10 23:04 ` Dave Mielke
2006-03-13 4:08 ` KrAnTi KaMbHaMpAtI
2006-03-10 20:56 ` Dave Mielke
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=20060308214031.GZ4516@beta.private.mielke.cc \
--to=dave@mielke.cc \
--cc=bluez-devel@lists.sourceforge.net \
/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).