rfcomm question 1
Hi Marcel!
I'm doing a project using bluetooth. But I have something to ask.
Now, I make the connection between Linux PC and Sony Ericsson T610 by typing "rfcomm connect 0 <adress>", and it was success. Then, I wish to make the connection in this way: let T610 be the client and PC be the server. When T610 searched the PC, I wish to connect them by selecting the PC in the mobile. But when I entered the PIN, the mobile always showed "PIN not match". Why is that? And how can I do so that the connection can be created by mobile phone? Thank you very much.
Michael
---------------------------------
新年願望第一位 : 找到友緣人
Marcel Holtmann
maintainerHi Michael,
Quoted 8 lines
I'm doing a project using bluetooth. But I have something to ask. Now, I make the connection between Linux PC and Sony Ericsson T610 by typing "rfcomm connect 0 <adress>", and it was success. Then, I wish to make the connection in this way: let T610 be the client and PC be the server. When T610 searched the PC, I wish to connect them by selecting the PC in the mobile. But when I entered the PIN, the mobile always showed "PIN not match". Why is that? And how can I do so that the connection can be created by mobile phone?
do you have hcid running? What does "hcidump -x" as root shows when you connect from the mobile phone?
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Hi Marcel!
Of course, hcid is running. Then when I typed
"hcidump -x", and then choose the computer in mobile phone, after I entered the PIN, the following occurs:
[root@cm218-253-8-120 root]# hcidump -x HCIDump - HCI packet analyzer ver 1.16
device: hci0 snap_len: 1028 filter: 0xffffffff
Quoted 1 line
HCI Event: Connect Request (
0x04) plen 10
A8 D8 DD D9 0A 00 04 02 52 01
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
A8 D8 DD D9 0A 00 01
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
00 01 09 04
Quoted 1 line
HCI Event: PIN Code Request (
0x16) plen 6
A8 D8 DD D9 0A 00
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
A8 D8 DD D9 0A 00 05 42 6C 75 65 5A 00 00 00 00 00
00 00 00
00 00 00
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 10
01 0D 04 00 A8 D8 DD D9 0A 00
Quoted 1 line
HCI Event: Connect Complete (
0x03) plen 11
05 29 00 A8 D8 DD D9 0A 00 01 00
But the mobile shows "PIN not match". So how can I do? Michael
--- Marcel Holtmann <[email protected]> 內容:
Quoted 18 lines
Hi Michael,
Quoted 1 line
I'm doing a project using bluetooth. But I have
something to ask.
Quoted 1 line
Now, I make the connection between Linux PC and
Sony Ericsson T610 by
Quoted 1 line
typing "rfcomm connect 0 <adress>", and it was
success. Then, I wish
Quoted 1 line
to make the connection in this way: let T610 be
the client and PC be
Quoted 1 line
the server. When T610 searched the PC, I wish to
connect them by
Quoted 1 line
selecting the PC in the mobile. But when I entered
the PIN, the mobile
Quoted 1 line
always showed "PIN not match". Why is that? And
how can I do so that
Quoted 1 line
the connection can be created by mobile phone?
Quoted 12 lines
do you have hcid running? What does "hcidump -x" as root shows when you
connect from the mobile phone?Regards
Marcel
-------------------------------------------------------
Quoted 12 lines
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at
http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 1 line
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerHi Michael,
Quoted 20 lines
Of course, hcid is running. Then when I typed
"hcidump -x", and then choose the computer in mobile phone, after I entered the PIN, the following occurs:
[root@cm218-253-8-120 root]# hcidump -x HCIDump - HCI packet analyzer ver 1.16
device: hci0snap_len: 1028 filter:0xffffffffQuoted 1 line
HCI Event: Connect Request (
0x04) plen 10A8 D8 DD D9 0A 00 04 02 52 01
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
A8 D8 DD D9 0A 00 01Quoted 1 line
HCI Event: Command Status (
0x0f) plen 400 01 09 04
Quoted 1 line
HCI Event: PIN Code Request (
0x16) plen 6A8 D8 DD D9 0A 00
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
A8 D8 DD D9 0A 00 05 42 6C 75 65 5A 00 00 00 00 00
00 00 00
00 00 00
Quoted 5 lines
Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 1001 0D 04 00 A8 D8 DD D9 0A 00
Quoted 1 line
HCI Event: Connect Complete (
0x03) plen 1105 29 00 A8 D8 DD D9 0A 00 01 00
But the mobile shows "PIN not match". So how can I do?
run "hcidump -X" and you might see your PIN. I guess it is "BlueZ" and why are you using security mode 3?
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Hi Marcel,
Here is the content of /etc/bluetooth/hcid.conf
#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.7 2004/12/13 14:16:03 holtmann Exp $
#
# HCId options
options {
# Automatically initialize new devices
autoinit yes;
# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming
connections
# user - Always ask user for a PIN
#
security auto;
# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired
devices
# once - Pair once and deny successive
attempts
pairing multi;
# PIN helper
pin_helper /usr/bin/bluepin;
# D-Bus PIN helper
#dbus_pin_helper;
}# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
#name "BlueZ (%d)";
name "cm218-253-8-120.hkcable.com.hk:%d"
# Local device class
class 0x3e0100;
# Default packet type
#pkt_type DH1,DM1,HV1;
# Inquiry and Page scan
iscan enable; pscan enable;
# Default link mode
# none - no specific policy
# accept - always accept incoming
connections
# master - become master on incoming
connections,
# deny role switch on outgoing
connections
lm accept;
# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;
# Authentication and Encryption (Security Mode
3)
#auth enable;
#encrypt enable;
}How can I modify the Security Mode?
Also, how can I change the PIN of my Linux PC?
Thank you very much.
Michael
--- Marcel Holtmann <[email protected]> 內容:
Quoted 34 lines
Hi Michael,
Quoted 2 lines
Of course, hcid is running. Then when I typed
"hcidump -x", and then choose the computer inmobile
Quoted 1 line
phone, after I entered the PIN, the following
occurs:
Quoted 6 lines
[root@cm218-253-8-120 root]# hcidump -x
HCIDump - HCI packet analyzer ver 1.16
device: hci0snap_len: 1028 filter:0xffffffffQuoted 1 line
HCI Event: Connect Request (
0x04) plen 10A8 D8 DD D9 0A 00 04 02 52 01
< HCI Command: Accept Connection Request(0x01|0x0009)
Quoted 7 lines
plen 7
A8 D8 DD D9 0A 00 01Quoted 1 line
HCI Event: Command Status (
0x0f) plen 400 01 09 04
Quoted 1 line
HCI Event: PIN Code Request (
0x16) plen 6A8 D8 DD D9 0A 00
< HCI Command: PIN Code Request Reply(0x01|0x000d)
Quoted 2 lines
plen 23
A8 D8 DD D9 0A 00 05 42 6C 75 65 5A 00 00 00 0000
Quoted 7 lines
00 00 00
00 00 00Quoted 1 line
HCI Event: Command Complete (
0x0e) plen 1001 0D 04 00 A8 D8 DD D9 0A 00
Quoted 1 line
HCI Event: Connect Complete (
0x03) plen 1105 29 00 A8 D8 DD D9 0A 00 01 00
But the mobile shows "PIN not match". So how can Ido?
Quoted 12 lines
run "hcidump -X" and you might see your PIN. I guess it is "BlueZ" and
why are you using security mode 3?Regards
Marcel
-------------------------------------------------------
Quoted 12 lines
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at
http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 1 line
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerHi Michael,
Quoted 70 lines
Here is the content of
/etc/bluetooth/hcid.conf
#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.7 2004/12/13 14:16:03 holtmann Exp $
## HCId options
options {
# Automatically initialize new devices
autoinit yes;# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming
connections
# user - Always ask user for a PIN
#
security auto;# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with already paired
devices
# once - Pair once and deny successive
attemptspairing multi; # PIN helper pin_helper /usr/bin/bluepin; # D-Bus PIN helper #dbus_pin_helper; }# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
#name "BlueZ (%d)";
name "cm218-253-8-120.hkcable.com.hk:%d"
# Local device class
class0x3e0100;# Default packet type
#pkt_type DH1,DM1,HV1;# Inquiry and Page scan
iscan enable; pscan enable;# Default link mode
# none - no specific policy
# accept - always accept incoming
connections
# master - become master on incoming
connections,
# deny role switch on outgoing
connections
lm accept;# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;
Quoted 6 lines
# Authentication and Encryption (Security Mode
3)#auth enable; #encrypt enable; }How can I modify the Security Mode?
this setting is fine. It is in security mode 1/2, but your hcidump was a little bit strange, because it looked like security mode 3 and normally mobile phones are not in that mode.
Quoted 1 line
Also, how can I change the PIN of my Linux PC?
For incoming connection the PIN is in /etc/bluetooth/pin and you need to restart hcid after you changed it.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Hi Marcel,
The version of my hcidump is 1.16. Is it related?
And how can I correct it as you said the setting is fine but the hcidump is strange?
Thanks!
Michael
--- Marcel Holtmann <[email protected]> 內容:
Quoted 91 lines
Hi Michael,
Quoted 1 line
Here is the content of
/etc/bluetooth/hcid.confQuoted 4 lines
#
# HCI daemon configuration file.
#
# $Id: hcid.conf,v 1.7 2004/12/13 14:16:03holtmann
Quoted 16 lines
Exp $
## HCId options
options {
# Automatically initialize new devices
autoinit yes;# Security Manager mode
# none - Security manager disabled
# auto - Use local PIN for incoming
connections
# user - Always ask user for a PIN
#
security auto;Quoted 3 lines
# Pairing mode
# none - Pairing disabled
# multi - Allow pairing with alreadypaired
Quoted 46 lines
devices
# once - Pair once and deny successive
attemptspairing multi; # PIN helper pin_helper /usr/bin/bluepin; # D-Bus PIN helper #dbus_pin_helper; }# Default settings for HCI devices
device {
# Local device name
# %d - device id
# %h - host name
#name "BlueZ (%d)";
name "cm218-253-8-120.hkcable.com.hk:%d"
# Local device class
class0x3e0100;# Default packet type
#pkt_type DH1,DM1,HV1;# Inquiry and Page scan
iscan enable; pscan enable;# Default link mode
# none - no specific policy
# accept - always accept incoming
connections
# master - become master on incoming
connections,
# deny role switch on outgoing
connections
lm accept;# Default link policy
# none - no specific policy
# rswitch - allow role switch
# hold - allow hold mode
# sniff - allow sniff mode
# park - allow park mode
lp rswitch,hold,sniff,park;Quoted 1 line
# Authentication and Encryption (Security
Mode
Quoted 5 lines
3)
#auth enable; #encrypt enable; }How can I modify the Security Mode?
this setting is fine. It is in security mode 1/2, but your hcidump was a
little bit strange, because it looked like security mode 3 and normally
mobile phones are not in that mode.Quoted 1 line
Also, how can I change the PIN of my Linux PC?
Quoted 12 lines
For incoming connection the PIN is in
/etc/bluetooth/pinand you need to
restart hcid after you changed it.Regards
Marcel
-------------------------------------------------------
Quoted 12 lines
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at
http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 1 line
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerHi Michael,
Quoted 3 lines
The version of my hcidump is 1.16. Is it related?
And how can I correct it as you said the setting is fine but the hcidump is strange?
don't worry so much about it. Check with hciconfig that auth and encrypt are not set and that you put your PIN in /etc/bluetooth/pin and then restart hcid. Make sure that only one copy of hcid is running.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
[Bluez-users] rfcomm question 3
Hi all users!
I thank Marcel here for help on initializing
connection from mobile to PC. Now, before I can do that, I initialize the rfcomm connection from PC to mobile, and then run my project program. The syntax is as follows:
snprintf (tmp, sizeof (tmp), "t68_remote_v2 (%s)", modemname);
tmp[sizeof (tmp) - 1] = 0;
openlogfile (tmp, logfile, LOG_DAEMON, loglevel); set_alarmhandler (alarmhandler, alarmlevel, modemname);
openmodem ();
setmodemparams ();
But now, when I initialize the connection from mobile to PC, once I run the program, "/dev/rfcomm0: No such device" is shown. So, I wish to know how can I modify the program by changing some syntax from that I post here? Or is there any program that I can include in my main program? Thank you very much.
Michael
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerRe: [Bluez-users] rfcomm question 3
Hi Michael,
Quoted 11 lines
I thank Marcel here for help on initializing
connection from mobile to PC. Now, before I can do that, I initialize the rfcomm connection from PC to mobile, and then run my project program. The syntax is as follows:
snprintf (tmp, sizeof (tmp), "t68_remote_v2(%s)", modemname);
tmp[sizeof (tmp) - 1] = 0;
openlogfile (tmp, logfile,LOG_DAEMON, loglevel);set_alarmhandler(alarmhandler, alarmlevel, modemname);
Quoted 8 lines
openmodem ();
setmodemparams ();
But now, when I initialize the connection from mobile to PC, once I run the program, "/dev/rfcomm0: No such device" is shown. So, I wish to know how can I modify the program by changing some syntax from that I post here? Or is there any program that I can include in my main program? Thank you very much.
if you wanna connect from a mobile phone to a machine running BlueZ you need to write an application that listens on a RFCOMM channel. This is about socket programming and you convert this socket later in to a TTY with a /dev/rfcommX device node, but actually unless you have some legacy application like pppd this should not be needed. What you need is to do direct socket programming. It is as easy as using a TTY and I posted detailed information about how to change a TTY based program into a socket based program years ago. Check the mailing list archive.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Marcel!
I've looked at your power point about Bluetooth programming for Linux in Wireless Technologies Congress 2003, but I found that the programs in slides 19, 21 and 22 are seemed not to be closely related to change a TTY based program to a socket based program. (P.S. In order to let you know what I'm saying, I attach the power point here.) Please explain to me, but I just need to know if slides 19 and 21 are related to the topic I wish to know. Thank you very much.
Michael
Marcel Holtmann <[email protected]> wrote:
Hi Michael,
Quoted 11 lines
I thank Marcel here for help on initializing connection from mobile to PC. Now, before I can do that, I initialize the rfcomm connection from PC to mobile, and then run my project program. The syntax is as follows:
snprintf (tmp, sizeof (tmp), "t68_remote_v2(%s)", modemname);
tmp[sizeof (tmp) - 1] = 0;
openlogfile (tmp, logfile,LOG_DAEMON, loglevel);set_alarmhandler(alarmhandler, alarmlevel, modemname);
Quoted 8 lines
openmodem ();
setmodemparams ();
But now, when I initialize the connection from mobile to PC, once I run the program, "/dev/rfcomm0: No such device" is shown. So, I wish to know how can I modify the program by changing some syntax from that I post here? Or is there any program that I can include in my main program? Thank you very much.
if you wanna connect from a mobile phone to a machine running BlueZ you need to write an application that listens on a RFCOMM channel. This is about socket programming and you convert this socket later in to a TTY with a /dev/rfcommX device node, but actually unless you have some legacy application like pppd this should not be needed. What you need is to do direct socket programming. It is as easy as using a TTY and I posted detailed information about how to change a TTY based program into a socket based program years ago. Check the mailing list archive.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
---------------------------------
新年願望第一位 : 找到友緣人
Re: [Bluez-users] rfcomm question 3
In reply to Marcel HoltmannHi Marcel,
I've found one powerpoint you made about Bluetooth programming on Linux in Wireless Technologies Congress 2003. But I don't know for those three programs you put, which one is describing about the PC listening the mobile in RFCOMM channel. Let me put here.
For Handling of Bluetooth device addresses
#include <bluetooth/bluetooth.h>
void main(int argc, char *argv[])
{bdaddr_t bdaddr;
char *str, addr[18];str2ba("00:a5:b4:c3:d2:e1", &bdaddr);ba2str(&bdaddr, addr);
str = batostr(&bdaddr);printf("%s %s\n", addr, str);
free(str);bacpy(&bdaddr, BDADDR_ANY);
}
For definition of the socket data types
static int rfcomm_connect(bdaddr_t *src, bdaddr_t *dst, uint8_t channel) {
struct sockaddr_rc addr;
int sk;
if ((sk = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) return -1;
addr.rc_family = AF_BLUETOOTH;bacpy(&addr.rc_bdaddr, src);
addr.rc_channel = 0;
if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) { close(sk);
return -1;
}
addr.rc_family = AF_BLUETOOTH;bacpy(&addr.rc_bdaddr, dst);
addr.rc_channel = channel;
if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) { close(sk);
return -1;
}
So I wish to know which one is about socket based programming? Thanks a lot! Michael
Marcel Holtmann <[email protected]> wrote:
Hi Michael,
Quoted 11 lines
I thank Marcel here for help on initializing connection from mobile to PC. Now, before I can do that, I initialize the rfcomm connection from PC to mobile, and then run my project program. The syntax is as follows:
snprintf (tmp, sizeof (tmp), "t68_remote_v2(%s)", modemname);
tmp[sizeof (tmp) - 1] = 0;
openlogfile (tmp, logfile,LOG_DAEMON, loglevel);set_alarmhandler(alarmhandler, alarmlevel, modemname);
Quoted 8 lines
openmodem ();
setmodemparams ();
But now, when I initialize the connection from mobile to PC, once I run the program, "/dev/rfcomm0: No such device" is shown. So, I wish to know how can I modify the program by changing some syntax from that I post here? Or is there any program that I can include in my main program? Thank you very much.
if you wanna connect from a mobile phone to a machine running BlueZ you need to write an application that listens on a RFCOMM channel. This is about socket programming and you convert this socket later in to a TTY with a /dev/rfcommX device node, but actually unless you have some legacy application like pppd this should not be needed. What you need is to do direct socket programming. It is as easy as using a TTY and I posted detailed information about how to change a TTY based program into a socket based program years ago. Check the mailing list archive.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
---------------------------------
新年願望第一位 : 找到友緣人
Marcel Holtmann
maintainerRe: [Bluez-users] rfcomm question 3
Hi Michael,
Quoted 33 lines
I've found one powerpoint you made about Bluetooth programming on
Linux in Wireless Technologies Congress 2003. But I don't know for those three programs you put, which one is describing about the PC listening the mobile in RFCOMM channel. Let me put here. For Handling of Bluetooth device addresses
#include <bluetooth/bluetooth.h>
voidmain(int argc, char *argv[])
{bdaddr_tbdaddr;
char *str, addr[18];str2ba("00:a5:b4:c3:d2:e1", &bdaddr);ba2str(&bdaddr, addr);
str =batostr(&bdaddr);printf("%s %s\n", addr, str);
free(str);bacpy(&bdaddr, BDADDR_ANY);
}For definition of the socket data types
static intrfcomm_connect(bdaddr_t *src, bdaddr_t *dst, uint8_t channel)
{
structsockaddr_rcaddr;
int sk;
if ((sk =socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) return -1;
addr.rc_family =AF_BLUETOOTH;bacpy(&addr.rc_bdaddr, src);
addr.rc_channel = 0;
if (bind(sk, (struct sockaddr *) &addr, sizeof(addr))< 0) { close(sk);
return -1;
}
Quoted 8 lines
addr.rc_family =
AF_BLUETOOTH;bacpy(&addr.rc_bdaddr, dst);
addr.rc_channel = channel;
if (connect(sk, (struct sockaddr *) &addr, sizeof(addr))< 0) { close(sk);
return -1;
}
So I wish to know which one is about socket based programming?
the second is about socket programming, because it has the command socket() in it ;)
The rctest.c program is a prefect example on how to create a listening RFCOMM server and parts of the rfcomm program may also help. If you don't how to do socket programming, then buy a book about it or read some of the howtos on the net about TCP/IP socket progamming. Actually using the sockets in Bluetooth is a lot more easier.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Ka Kin CheungHi Michael,
Quoted 1 line
So I wish to know which one is about socket based programming?
The one using socket :D
By saying so, you can already remove the first one. It is only for handling Bluetooth address, as the comment says.
The second function is about connection, not listening.
I haven't found the 3rd function you mention about, or maybe I just misread your email ... reading source code without indentation is not that simple.
Basically RFCOMM socket programming is just very standard socket programm= ing.
in very short, to start listening,
socket
bind (specifying RFCOMM port)
setsockopt (for MTU ... I guess)
listen
accept
..
Alain
* Ka Kin Cheung [Wed, 2 Feb 2005 at 10:49 +0800]
<quote>
Quoted 2 lines
Hi Marcel,
I've found one powerpoint you made about Bluetooth programming on L=
inux in Wireless Technologies Congress 2003. But I don't know for those t= hree programs you put, which one is describing about the PC listening the=
mobile in RFCOMM channel. Let me put here.
Quoted 8 lines
For Handling of Bluetooth device addresses
#include <bluetooth/bluetooth.h>
voidmain(int argc, char *argv[])
{bdaddr_tbdaddr;
char *str, addr[18];str2ba("00:a5:b4:c3:d2:e1", &bdaddr);ba2str(&bdaddr, addr);
Quoted 8 lines
str =3D
batostr(&bdaddr);printf("%s %s\n", addr, str);
free(str);bacpy(&bdaddr, BDADDR_ANY);
}
=20
For definition of the socket data types
static int rfcomm_connect(bdaddr_t *src,bdaddr_t*dst,uint8_tchannel=
)
Quoted 12 lines
{
structsockaddr_rcaddr;
int sk;
if ((sk =3Dsocket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0) return -1;
addr.rc_family =3DAF_BLUETOOTH;bacpy(&addr.rc_bdaddr, src);
addr.rc_channel =3D 0;
if (bind(sk, (struct sockaddr *) &addr, sizeof(addr))< 0) { close(sk);
return -1;
}
Quoted 8 lines
addr.rc_family =3D
AF_BLUETOOTH;bacpy(&addr.rc_bdaddr, dst);
addr.rc_channel =3D channel;
if (connect(sk, (struct sockaddr *) &addr, sizeof(addr))< 0) { close(sk);
return -1;
}
So I wish to know which one is about socket based programming? Thanks a=
lot!
Quoted 24 lines
Michael
=20
Marcel Holtmann <[email protected]> wrote:
Hi Michael,
=20Quoted 11 lines
I thank Marcel here for help on initializing connection from mobile to PC. Now, before I can do that, I initialize the rfcomm connection from PC to mobile, and then run my project program. The syntax is as follows:
snprintf (tmp, sizeof (tmp), "t68_remote_v2(%s)", modemname);
tmp[sizeof (tmp) - 1] =3D 0;
openlogfile (tmp, logfile,LOG_DAEMON, loglevel);set_alarmhandler(alarmhandler, alarmlevel, modemname);Quoted 8 lines
openmodem ();
setmodemparams ();
But now, when I initialize the connection from mobile to PC, once I run the program, "/dev/rfcomm0: No such device" is shown. So, I wish to know how can I modify the program by changing some syntax from that I post here? Or is there any program that I can include in my main program? Thank you very much.
Quoted 6 lines
=20
if you wanna connect from a mobile phone to a machine running BlueZ you need to write an application that listens on a RFCOMM channel. This is about socket programming and you convert this socket later in to a TTY with a/dev/rfcommXdevice node, but actually unless you have some legacy application like pppd this should not be needed. What you need i=
s
Quoted 2 lines
to do direct socket programming. It is as easy as using a TTY and I posted detailed information about how to change a TTY based program int=
o
Quoted 15 lines
a socket based program years ago. Check the mailing list archive. =20
Regards
=20
Marcel
=20
=20
=20
=20
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Quoted 8 lines
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
=20
=20
=20
---------------------------------
=E6=96=B0=E5=B9=B4=E9=A1=98=E6=9C=9B=E7=AC=AC=E4=B8=80=E4=BD=8D : =E6=89=
=BE=E5=88=B0=E5=8F=8B=E7=B7=A3=E4=BA=BA=20
</quote>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Marcel HoltmannHi Marcel!
Acutally, this project is just related to
bluetooth. I've seen your reply, and then got through rctest.c. I found that the part of receiving mobile exists. Then I wish to know need I include the rctest.c file in my main program with which header files include in it? Or need I put the part in my program? And about the part you said that is the socket program, I wish to know is it ok if I just put it in my main program with which header files include in it? And as I need to accept all mobile, not the one that the address has been set in the program, to connect with PC and then access the program, how can I do to make sure that my wish is possible? Thank you very much.P.S. Alian, the third program is just about HCI, and it seems not to be related to my project. Thanks for pointing out about this.
Michael
--- Marcel Holtmann <[email protected]> 內容:
Quoted 67 lines
Hi Michael,
Quoted 1 line
I've found one powerpoint you made about
Bluetooth programming on
Quoted 1 line
Linux in Wireless Technologies Congress 2003. But
I don't know for
Quoted 1 line
those three programs you put, which one is
describing about the PC
Quoted 1 line
listening the mobile in RFCOMM channel. Let me put
here.
Quoted 14 lines
For Handling of Bluetooth device addresses
#include <bluetooth/bluetooth.h>
voidmain(int argc, char *argv[])
{bdaddr_tbdaddr;
char *str, addr[18];str2ba("00:a5:b4:c3:d2:e1", &bdaddr);ba2str(&bdaddr, addr);
str =batostr(&bdaddr);printf("%s %s\n", addr, str);
free(str);bacpy(&bdaddr, BDADDR_ANY);
}Quoted 2 lines
For definition of the socket data types
static int rfcomm_connect(bdaddr_t *src,bdaddr_t*dst,
uint8_tQuoted 5 lines
channel)
{
structsockaddr_rcaddr;
int sk;
if ((sk = socket(PF_BLUETOOTH,SOCK_STREAM,
BTPROTO_RFCOMM)) < 0)Quoted 5 lines
return -1;
addr.rc_family =AF_BLUETOOTH;bacpy(&addr.rc_bdaddr, src);
addr.rc_channel = 0;
if (bind(sk, (struct sockaddr *) &addr,sizeof(addr)) < 0) {
Quoted 7 lines
close(sk);
return -1;
}
addr.rc_family =AF_BLUETOOTH;bacpy(&addr.rc_bdaddr, dst);
addr.rc_channel = channel;
if (connect(sk, (struct sockaddr *) &addr,sizeof(addr)) < 0) {
Quoted 4 lines
close(sk);
return -1;
}
So I wish to know which one is about socket basedprogramming?
the second is about socket programming, because it has the command
socket()in it ;)The
rctest.cprogram is a prefect example on how to create a listening
RFCOMM server and parts of the rfcomm program may also help. If you
don't how to do socket programming, then buy a book about it or read
some of the howtos on the net about TCP/IP socket progamming. Actually
using the sockets in Bluetooth is a lot more easier.
Quoted 8 lines
Regards
Marcel
-------------------------------------------------------
Quoted 12 lines
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at
http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 1 line
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerRe: [Bluez-users] rfcomm question 3
Hi Michael,
Quoted 6 lines
Acutally, this project is just related to
bluetooth. I've seen your reply, and then got throughrctest.c. I found that the part of receiving mobile exists. Then I wish to know need I include therctest.cfile in my main program with which header files include in it? Or need I put the part in my
Quoted 8 lines
program? And about the part you said that is the socket program, I wish to know is it ok if I just put it in my main program with which header files include in it? And as I need to accept all mobile, not the one that the address has been set in the program, to connect with PC and then access the program, how can I do to make sure that my wish is possible? Thank you very much.
you need to include the listen part, because this one gives you a socket descriptor for the incoming connection in the end. From this descriptor you can read() and write(). If you wanna accept only specific devices then use getpeername() to get its address after they connected to you. You can then decide what to do. If you don't like that device simple close the connection.
The rctest.c is an example of how to do it. Don't include things that you don't understand. For using RFCOMM it is enough to include the bluetooth.h and rfcomm.h header files.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Marcel!
I'm sorry for that I made an unclear question before so that I'm confusing of how to do. Let me ask again here.
1.After seeing your reply, I'm deciding to change the rfcomm connection approach as from mobile terminal to computer in two ways:
a)Just include "rctest.c" by creating "rctest.h" in bluez-utils-2.14/test directory, and put the function prototypes related to listening on a RFCOMM channel and include the header files bluetooth.h and rfcomm.h in my main program b)put the functions related to listening on a RFCOMM channel in my main program, and include the header files bluetooth.h and rfcomm.h in the beginning.
So, which approach is more appropriate? And for each approach, what variables need I to declare in the beginning of my main program?
2.My wish is to let the program to accept all mobiles that wish to connect to PC. Then how can I write the syntax so that if one mobile wish to connect to PC, the PC can accept it? And how can I do to count and check the number of mobile terminals connecting with PC? 3.What online reference is good for me to get familiar with the matter that I asked in the previous two questions?
Hope that my question and your answer can make me more clearer about what I've to do. Thank you very much for your kindness.
Marcel Holtmann <[email protected]> wrote:
Hi Michael,
Quoted 6 lines
Acutally, this project is just related to bluetooth. I've seen your reply, and then got through
rctest.c. I found that the part of receiving mobile exists. Then I wish to know need I include therctest.cfile in my main program with which header files include in it? Or need I put the part in my
Quoted 8 lines
program? And about the part you said that is the socket program, I wish to know is it ok if I just put it in my main program with which header files include in it? And as I need to accept all mobile, not the one that the address has been set in the program, to connect with PC and then access the program, how can I do to make sure that my wish is possible? Thank you very much.
you need to include the listen part, because this one gives you a socket descriptor for the incoming connection in the end. From this descriptor you can read() and write(). If you wanna accept only specific devices then use getpeername() to get its address after they connected to you. You can then decide what to do. If you don't like that device simple close the connection.
The rctest.c is an example of how to do it. Don't include things that you don't understand. For using RFCOMM it is enough to include the bluetooth.h and rfcomm.h header files.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
---------------------------------
新年願望第一位 : 找到友緣人
Re: [Bluez-users] rfcomm question 3
Hi Michael,
Quoted 1 line
a)Just include "
rctest.c" by creating "rctest.h" in bluez-utils-2.14/test directory, and put the function prototypes related to listening on a RFCOMM channel and include the header filesbluetooth.handrfcomm.hin my main program
Are you kidding ?
Quoted 1 line
b)put the functions related to listening on a RFCOMM channel in my main program, and include the header files
bluetooth.handrfcomm.hin the beginning.
Seems much better than the first idea. basically only do_listen and recv_mode should be important in your case.
Quoted 1 line
So, which approach is more appropriate?
The second one.
Quoted 1 line
And for each approach, what variables need I to declare in the beginning of my main program?
Are you kidding ? (once more) .. this is not a bluetooth/socket API question anymore but just C programming you are asking about. Are we here for that ?
Quoted 1 line
2.My wish is to let the program to accept all mobiles that wish to connect to PC. Then how can I write the syntax so that if one mobile wish to connect to PC, the PC can accept it?
Take a look at the function do_listen ... the bind call.
loc_addr.rc_family = AF_BLUETOOTH;
loc_addr.rc_bdaddr = BDADDR_ANY;
loc_addr.rc_channel = channel;
if( bind(s, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0 ) {should let you get connection from any device ....
Quoted 2 lines
And how can I do to count and check the number of mobile terminals connecting with PC?
3.What online reference is good for me to get familiar with the matter that I asked in the previous two questions?
Some googleing with keyword like "socket programming" should be a good start.
Regards,
Alain
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi all users!
I first give a thank to Alain Volmat that points
out my fault and confusion about rctest.c. Then I put the parts do_listen and recv_mode in my main porgram. But when I compile, strange things occur.....
As my program is MySQL C API, I have to compile
with "gcc -c -I/usr/include/mysql XX.c", and it is no problem. But when I type "gcc -o XX XX.o -L/usr/lib/mysql -lmysqlclient", following occurs:bic_midterm.o(.text+0x1c0a): In function `do_listen':
: undefined reference to `ba2str'
collect2: ld returned 1 exit status
I checked with rctest.c, but there is not a function for ba2str. On the other hand, tv2fl can be accepted as there is a function in rctest.c. Here are the include files in my main program.
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <string.h>
#include <termios.h>
#include <syslog.h>
#include <errno.h>
#include <ctype.h>
#include <signal.h>
#include <modeminit.h>
include <modeminit.c>
#include <logging.c>
#include <logging.h>
#include <extras.h>
#include <extras.c>
#include <locking.c>
#include <locking.h>
#include <alarm.h>
#include <alarm.c>
#include <sys/file.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/rfcomm.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>
#include <mysql/mysql.h>
Let's see if there is any function that is missing. If there is no function missing, where can I find the ba2str function? I believe that if ba2str function can be found declared, the program can be run. Thank you very much for your kindness.
Michael
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Michael,
ba2str is a function provided by bluez-libs. Linking your program against the bluez-lib might solve your problem.
add -lbluetooth to your command line.
Alain
* Ka Kin Cheung [Thu, 3 Feb 2005 at 18:50 +0800]
<quote>
Quoted 60 lines
Hi all users!
I first give a thank to Alain Volmat that points
out my fault and confusion aboutrctest.c. Then I put the partsdo_listenandrecv_modein my main porgram. But when I compile, strange things occur.....
As my program is MySQL C API, I have to compile
with "gcc -c -I/usr/include/mysqlXX.c", and it is no problem. But when I type "gcc -o XX XX.o -L/usr/lib/mysql -lmysqlclient", following occurs:bic_midterm.o(.text+0x1c0a): In function `do_listen':
: undefined reference to `ba2str'
collect2: ld returned 1 exit status
I checked withrctest.c, but there is not a function for ba2str. On the other hand, tv2fl can be accepted as there is a function inrctest.c. Here are the include files in my main program.=20
#ifdefHAVE_CONFIG_H
#include <config.h>#endif =20 =20#include <
stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <string.h>
#include <termios.h>
#include <syslog.h>
#include <errno.h>
#include <ctype.h>#include <signal.h> =20 =20#include <
modeminit.h>
include <modeminit.c>
#include <logging.c>
#include <logging.h>
#include <extras.h>
#include <extras.c>
#include <locking.c>
#include <locking.h>
#include <alarm.h>
#include <alarm.c>
=20#include <sys/file.h> =20 =20#include <
bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/rfcomm.h>
#include <bluetooth/sdp.h>#include <bluetooth/sdp_lib.h> =20 =20
Quoted 10 lines
#include <
mysql/mysql.h>
Let's see if there is any function that is missing. If
there is no function missing, where can I find the
ba2str function? I believe that if ba2str function can
be found declared, the program can be run. Thank you
very much for your kindness.
Michael
=20
_______________________________________________________________________
=E6=96=B0=E5=B9=B4=E9=A1=98=E6=9C=9B=E7=AC=AC=E4=B8=80=E4=BD=8D : =E6=89=
=BE=E5=88=B0=E5=8F=8B=E7=B7=A3=E4=BA=BA
Quoted 5 lines
http://personals.yahoo.com.hk
=20
=20
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Quoted 8 lines
Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
=20
</quote>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi all,
I've added -lbluetooth in the command, and it successes. But when I run the program, the program terminates and doesn't wait for any mobile terminal involving into the program. What is the problem about my program? And need I really link the header files in bluez-libs/include? If so, should I include like this "bluez-libs-2.14/include/xx.h"? But the /usr/include contains the files. So I wish to know why if it is so. Here is the syntax of my program.
int main (int argc, char **argv)
{
...
int no_connection;
...
printf("\E[H\E[J");
printf ("Bluetooth infrared converter\n\n");
printf ("Doing initializations !\n");
no_connection=0;
do_listen(recv_mode);
...
while (1)
{
no_connection++;
printf("Now %d mobile terminal(s) is(are) using this program\n");
sprintf (command, "at+cscs=i\"8859-1\"\r");
ret_code = put_command (command, answer, sizeof (answer), 5, 0);
sprintf (command, "AT*EAM=\"Bt-IrConverter\"\r");
ret_code = put_command (command, answer, sizeof (answer), 5, 0);
submenu_selected = 0;
while (!submenu_selected)
{
....
Thanks very much.
Michael
Alain Volmat <[email protected]> wrote:
Hi Michael,
ba2str is a function provided by bluez-libs. Linking your program against the bluez-lib might solve your problem.
add -lbluetooth to your command line.
Alain
* Ka Kin Cheung [Thu, 3 Feb 2005 at 18:50 +0800]
Quoted 73 lines
Hi all users!
I first give a thank to Alain Volmat that points out my fault and confusion aboutrctest.c. Then I put the partsdo_listenandrecv_modein my main porgram. But when I compile, strange things occur..... As my program is MySQL C API, I have to compile with "gcc -c -I/usr/include/mysqlXX.c", and it is no problem. But when I type "gcc -o XX XX.o -L/usr/lib/mysql -lmysqlclient", following occurs:bic_midterm.o(.text+0x1c0a): In function `do_listen':
: undefined reference to `ba2str'
collect2: ld returned 1 exit status
I checked withrctest.c, but there is not a function for ba2str. On the other hand, tv2fl can be accepted as there is a function inrctest.c. Here are the include files in my main program.
#ifdefHAVE_CONFIG_H
#include
#endif#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include#include
include
#include
#include
#include
#include
#include
#include
#include
#include#include
#include
#include
#include
#include
#include
#include#include
Let's see if there is any function that is missing. If there is no function missing, where can I find the ba2str function? I believe that if ba2str function can be found declared, the program can be run. Thank you very much for your kindness.
Michael_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
Quoted 10 lines
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
---------------------------------
新年願望第一位 : 找到友緣人
Marcel Holtmann
maintainerRe: [Bluez-users] rfcomm question 3
Hi Michael,
Quoted 4 lines
I've added -lbluetooth in the command, and it successes. But when
I run the program, the program terminates and doesn't wait for any mobile terminal involving into the program. What is the problem about my program?
if you copied only the code without actually understanding what it does, then you also copied the output of the error messages to the syslog and an exit(1) if something fails. Check for error messages in your log files on the system.
Quoted 4 lines
And need I really link the header files in bluez-libs/include? If so,
should I include like this "bluez-libs-2.14/include/xx.h"? But the/usr/includecontains the files. So I wish to know why if it is so.
I think you should buy yourself a C programming book first, because this mailing list is not for teaching how to do C or socket programming or how to use the gcc. And btw you link object code or libraries, but you include header files.
And as a side note. Don't send code with such a stupid indentation. We use a tab with the size of 8 spaces. You should also stop sending HTML encoded emails. This is a mailing list and the prefered format is a 7-bit ASCII encoding.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Marcel,
I'm sorry for doing such stupid thing. Now I put all parts of rctest.c in my main program
to test, and then I found the error message " Can't set RFCOMM link mode: Protocol not available (92)", and this happens in do_listen part. My T610 has included my PC in the menu of "My device". So, what have I do so that the RFCOMM link can be set? Thanks. Michael
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerRe: [Bluez-users] rfcomm question 3
Hi,
Quoted 6 lines
Now I put all parts of
rctest.cin my main program
to test, and then I found the error message " Can't set RFCOMM link mode: Protocol not available (92)", and this happens indo_listenpart. My T610 has included my PC in the menu of "My device". So, what have I do so that the RFCOMM link can be set?
you have two possibilities. First you can install a Linux kernel where RFCOMM link mode is supported. This is a 2.6.10-mh3 or a 2.6.11-rc3. Second you don't use any link mode features. Means that no master, auth, encrypt or secure variable should be set to 1.
I really would feel better if you try to understand what the code in rctest.c means and actually does, instead of only copy it and then try to use it.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Ka Kin CheungHello Ka Kin Cheung
It looks like you haven't that much c or socket programming knowledge. So if you try to learn c, socket programming, compiling, bluetooth programming and all relatet topics in one step, that's pretty hard.
What about Java? JSR 82?
It's fully documentated and you find a lot of samples if you ask google...
Take a look at this:
http://sourceforge.net/projects/avetanabt/
(It is available for windows as well.)
And a good general programming rule (specially for c/c++):
Do not use gcc if you haven't already understand what your code's supposed to do.
regards
Marco
Quoted 147 lines · Ka Kin Cheung
Hi all,
I've added -lbluetooth in the command, and it successes. But when I
run the program, the program terminates and doesn't wait for any mobile terminal involving into the program. What is the problem about my program? And need I really link the header files in bluez-libs/include? If so, should I include like this "bluez-libs-2.14/include/xx.h"? But the/usr/includecontains the files. So I wish to know why if it is so.
Here is the syntax of my program.
int main (int argc, char **argv)
{
...
intno_connection;
...
printf("\E[H\E[J");
printf ("Bluetooth infrared converter\n\n");
printf ("Doing initializations !\n");
no_connection=0;
do_listen(recv_mode);
...
while (1)
{
no_connection++;
printf("Now %d mobile terminal(s) is(are) using this program\n"); sprintf (command, "at+cscs=i\"8859-1\"\r");
ret_code=put_command(command, answer, sizeof (answer), 5, 0); sprintf (command, "AT*EAM=\"Bt-IrConverter\"\r");
ret_code=put_command(command, answer, sizeof (answer), 5, 0);submenu_selected= 0;
while (!submenu_selected)
{
....
Thanks very much.
Michael*/Alain Volmat <[email protected]>/* wrote:
Hi Michael,
ba2str is a function provided by bluez-libs. Linking your program against the bluez-lib might solve your problem.
add -lbluetooth to your command line.
Alain
* Ka Kin Cheung [Thu, 3 Feb 2005 at 18:50 +0800]
> Hi all users!
> I first give a thank to Alain Volmat that points
> out my fault and confusion aboutrctest.c. Then I put
> the partsdo_listenandrecv_modein my main porgram.
> But when I compile, strange things occur.....
> As my program is MySQL C API, I have to compile
> with "gcc -c -I/usr/include/mysqlXX.c", and it is no
> problem. But when I type "gcc -o XX XX.o
> -L/usr/lib/mysql -lmysqlclient", following occurs:
>bic_midterm.o(.text+0x1c0a): In function `do_listen':
> : undefined reference to `ba2str'
> collect2: ld returned 1 exit status
> I checked withrctest.c, but there is not a function
> for ba2str. On the other hand, tv2fl can be accepted
> as there is a function inrctest.c. Here are the
> include files in my main program.
> #ifdefHAVE_CONFIG_H
> #include
> #endif
>
>
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
>
>
> #include
> include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
>
> #include
>
>
> #include
> #include
> #include
> #include
> #include
> #include
>
>
> #include
> Let's see if there is any function that is missing. If
> there is no function missing, where can I find the
> ba2str function? I believe that if ba2str function can
> be found declared, the program can be run. Thank you
> very much for your kindness.
> Michael
>
>
_______________________________________________________________________
> 新年願望第一位 : 找到友緣人
> http://personals.yahoo.com.hk
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive
Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF,
etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 2 lines
------------------------------------------------------------------------
新年願望第一位 : 找到友緣人 <http://hk.personals.yahoo.com>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi all users!
Sorry, but I have to say that I have knowledge about C, but I don't have so much knowledge about socket programming. And I would like to point out that what I find hard is just to let my main program to listen to what bluetooth mobile device wishes to connect to PC, and then let the program run even though no bluetooth device is connecting with the PC i.e. let PC to be server. Anyway, thank you very much for all of your advices. Sorry for any misunderstanding. By the way, C is the main programming language of my project, so it is not possible for me to use one language more. But I thank Marco for advice.
And I wish to ask question here. I've heard that rfcom_bind can do something similar those things do in rctest.c, but until now, I can't find any detail about rfcomm_bind, even in this mail-list or in web. So, if anyone knows, please kindly inform me here and I'll use it once I understand what it does. Sorry for impolite reply but I am eager to learn more about this. Thank you very much!
Michael
Hello Ka Kin Cheung
It looks like you haven't that much c or socket programming knowledge. So if you try to learn c, socket programming, compiling, bluetooth programming and all relatet topics in one step, that's pretty hard.
What about Java? JSR 82?
It's fully documentated and you find a lot of samples if you ask google...
Take a look at this:
http://sourceforge.net/projects/avetanabt/
(It is available for windows as well.)
And a good general programming rule (specially for c/c++):
Do not use gcc if you haven't already understand what your code's supposed to do.
regards
Marco
Quoted 147 lines · Ka Kin Cheung
Hi all,
I've added -lbluetooth in the command, and it successes. But when I run the program, the program terminates and doesn't wait for any mobile terminal involving into the program. What is the problem about my program? And need I really link the header files in bluez-libs/include? If so, should I include like this "bluez-libs-2.14/include/xx.h"? But the/usr/includecontains the files. So I wish to know why if it is so. Here is the syntax of my program.
int main (int argc, char **argv)
{
...
intno_connection;
...printf("\E[H\E[J");
printf ("Bluetooth infrared converter\n\n");
printf ("Doing initializations !\n");
no_connection=0;do_listen(recv_mode);
...
while (1)
{
no_connection++;printf("Now %d mobile terminal(s) is(are) using this program\n"); sprintf (command, "at+cscs=i\"8859-1\"\r");ret_code=put_command(command, answer, sizeof (answer), 5, 0); sprintf (command, "AT*EAM=\"Bt-IrConverter\"\r");ret_code=put_command(command, answer, sizeof (answer), 5, 0);submenu_selected= 0;
while (!submenu_selected)
{
....
Thanks very much.
Michael*/Alain Volmat /* wrote:
Hi Michael,
ba2str is a function provided by bluez-libs. Linking your program against the bluez-lib might solve your problem.
add -lbluetooth to your command line.
Alain
* Ka Kin Cheung [Thu, 3 Feb 2005 at 18:50 +0800]
Quoted 60 lines
Hi all users!
I first give a thank to Alain Volmat that points out my fault and confusion aboutrctest.c. Then I put the partsdo_listenandrecv_modein my main porgram. But when I compile, strange things occur..... As my program is MySQL C API, I have to compile with "gcc -c -I/usr/include/mysqlXX.c", and it is no problem. But when I type "gcc -o XX XX.o -L/usr/lib/mysql -lmysqlclient", following occurs:bic_midterm.o(.text+0x1c0a): In function `do_listen':
: undefined reference to `ba2str'
collect2: ld returned 1 exit status
I checked withrctest.c, but there is not a function for ba2str. On the other hand, tv2fl can be accepted as there is a function inrctest.c. Here are the include files in my main program.
#ifdefHAVE_CONFIG_H
#include
#endif#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include#include
include
#include
#include
#include
#include
#include
#include
#include
#include#include
#include
#include
#include
#include
#include
#includeQuoted 9 lines
#include
Let's see if there is any function that is missing. If there is no function missing, where can I find the ba2str function? I believe that if ba2str function can be found declared, the program can be run. Thank you very much for your kindness.
Michael_______________________________________________________________________
Quoted 6 lines
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- InteractiveReporting
Quoted 2 lines
Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF,
etc.
Quoted 6 lines
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 2 lines
------------------------------------------------------------------------
新年願望第一位 : 找到友緣人
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
---------------------------------
新年願望第一位 : 找到友緣人
Re: [Bluez-users] rfcomm question 3
Hello Michael
Maybe this helps:
---- start code snippet ----
// handle the includes yourself
#define CHANNEL 4
#define QUEUE 10
int main()
{
int sock, client;
socklen_t alen;
struct sockaddr_rc addr;
addr.rc_family = AF_BLUETOOTH;
bacpy(&addr.rc_bdaddr, BDADDR_ANY);
addr.rc_channel = htobs(CHANNEL);
alen = sizeof(addr);
// request a socket from the operating system
if((sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0)
{
printf("socket(...) failed");
exit(1);
}
// bind the socket to the system
if(bind(sock, (struct sockaddr *)&addr, alen) < 0)
{
printf("bind(...) failed\n");
exit(2);
}
// set the socket into listen mode. handle 10 (QUEUE) connections.
if(listen(sock, QUEUE) < 0)
{
printf("listen(...) failed\n");
exit(3);
}
// wait for the next connection or serve the next in the queue
while(client = accept(sock, (struct sockaddr *)&addr, &alen))
{
char remoteAddr[18];
ba2str(&addr.rc_bdaddr, remoteAddr);
printf("connection from %s:\n", remoteAddr);
// send a "hello from server" to client
char out[] = "hello from server";
send(client, out, strlen(out), 0);
printf("> %s\n", out);
// read the answer
char buffer[101]; // buffer size 100, 1 for '\0'
int noReadChars = recv(client, buffer, sizeof(buffer)-1, 0);
buffer[noReadChars] = '\0'; // here the received answer ends
printf("< %s\n", buffer);
// now close the connection
close(client);
}
close(sock);
return 0;
}---- code snippet end ----
If you start this sample the machine listens on rfcomm channel 4 for incoming connections. you can now connect with a mobile phone.
If you now search for "c socket programming" on google, you'll be able to fully understand this code snippet and be able to change it to do what you want.
regards
Marco
Quoted 218 lines · Ka Kin Cheung
Hi all users!
Sorry, but I have to say that I have knowledge about C, but I don't
have so much knowledge about socket programming. And I would like to point out that what I find hard is just to let my main program to listen to what bluetooth mobile device wishes to connect to PC, and then let the program run even though no bluetooth device is connecting with the PC i.e. let PC to be server. Anyway, thank you very much for all of your advices. Sorry for any misunderstanding.
By the way, C is the main programming language of my project, so it
is not possible for me to use one language more. But I thank Marco for advice.
And I wish to ask question here. I've heard thatrfcom_bindcan do
something similar those things do inrctest.c, but until now, I can't find any detail aboutrfcomm_bind, even in this mail-list or in web. So, if anyone knows, please kindly inform me here and I'll use it once I understand what it does. Sorry for impolite reply but I am eager to learn more about this. Thank you very much!
Michael
*//*Hello Ka Kin Cheung
It looks like you haven't that much c or socket programming knowledge. So
if you try to learn c, socket programming, compiling, bluetooth programming
and all relatet topics in one step, that's pretty hard.What about Java? JSR 82?
It's fully documentated and you find a lot of samples if you ask google...Take a look at this:
http://sourceforge.net/projects/avetanabt/
(It is available for windows as well.)And a good general programming rule (specially for c/c++):
Do not use gcc if you haven't already understand what your code's supposed
to do.regards
MarcoKa Kin Cheung wrote:
> Hi all,
> I've added -lbluetooth in the command, and it successes. But when I > run the program, the program terminates and doesn't wait for any
mobile
> terminal involving into the program. What is the problem about my > program? And need I really link the header files in
bluez-libs/include?
> If so, should I include like this "bluez-libs-2.14/include/xx.h"?
But
> the/usr/includecontains the files. So I wish to know why if it
is so.
> Here is the syntax of my program.
> int main (int argc, char **argv)
> {
> ...
> intno_connection;
> ...
>printf("\E[H\E[J");
> printf ("Bluetooth infrared converter\n\n");
> printf ("Doing initializations !\n");
> no_connection=0;
>do_listen(recv_mode);
> ...
> while (1)
> {
> no_connection++;
>printf("Now %d mobile terminal(s) is(are) using this program\n"); > sprintf (command, "at+cscs=i\"8859-1\"\r");
>ret_code=put_command(command, answer, sizeof (answer), 5, 0); > sprintf (command, "AT*EAM=\"Bt-IrConverter\"\r");
>ret_code=put_command(command, answer, sizeof (answer), 5, 0); >submenu_selected= 0;
> while (!submenu_selected)
> {
> ....
> Thanks very much.
> Michael
>
> */Alain Volmat /* wrote:
>
> Hi Michael,
>
> ba2str is a function provided by bluez-libs. Linking your > program against the bluez-lib might solve your problem.
>
> add -lbluetooth to your command line.
>
> Alain
>
> * Ka Kin Cheung [Thu, 3 Feb 2005 at 18:50 +0800]
>
> > Hi all users!
> > I first give a thank to Alain Volmat that points
> > out my fault and confusion aboutrctest.c. Then I put
> > the partsdo_listenandrecv_modein my main porgram.
> > But when I compile, strange things occur.....
> > As my program is MySQL C API, I have to compile
> > with "gcc -c -I/usr/include/mysqlXX.c", and it is no
> > problem. But when I type "gcc -o XX XX.o
& gt; > -L/usr/lib/mysql -lmysqlclient", following occurs:
> >bic_midterm.o(.text+0x1c0a): In function `do_listen':
> > : undefined reference to `ba2str'
> > collect2: ld returned 1 exit status
> > I checked withrctest.c, but there is not a function
> > for ba2str. On the other hand, tv2fl can be accepted
> > as there is a function inrctest.c. Here are the
> > include files in my main program.
> > #ifdefHAVE_CONFIG_H
> > #include
> > #endif
> >
> >
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> >
> >
> > #include
> > include
> > #include
> > ; #include
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> >
> > #include
> >
> >
> > #include
> > #include
> > #include
> > #include
> > #include
> > #include
> >
> >
> > #include
> > Let's see if there is any function that is missing. If > > there is no function missing, where can I find the
> > ba2str function? I believe that if ba2str function can > > be found declared, the program can be run. Thank you
> > very much for your kindness.
> > Michael
> >
> >
>
_______________________________________________________________________
> > 新年願望第一位 : 找到友緣人
> > http://personals.yahoo.com.hk
> >
> >
> > ------------------------------------------------------- > > This SF.Net email is sponsored by: IntelliVIEW -- Interactive > Reporting
> > Tool for open source databases. Create drag-&-drop reports.
Save time
> > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, > etc.
> > Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> > _______________________________________________
> > Bluez-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/bluez-users
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive
Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF,
etc.
> Download a FREE c opy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
>
>
------------------------------------------------------------------------
> 新年願望第一位 : 找到友緣人-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 2 lines
------------------------------------------------------------------------
新年願望第一位 : 找到友緣人 <http://hk.personals.yahoo.com>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerRe: [Bluez-users] rfcomm question 3
Hi Marco,
Quoted 9 lines
Maybe this helps:
---- start code snippet ----
// handle the includes yourself#define CHANNEL 4
#define QUEUE 10int
main()
Quoted 8 lines
{
int sock, client;
socklen_t alen;
struct sockaddr_rc addr;
addr.rc_family = AF_BLUETOOTH;
bacpy(&addr.rc_bdaddr, BDADDR_ANY);
addr.rc_channel = htobs(CHANNEL);thanks for the example, but the htobs(CHANNEL) is wrong. rc_channel is only uint8_t and when you do byteswap on a big endian machine this will end up in channel 0.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hello Marcel
Thanks a lot. I hoped someone more c experienced will take a quick look at my code. It's the result of a example I found (the mistake comes from there) and a socket programming howto I read.
I now changed it to
addr.rc_channel = 4;
Actually I do not need to #define it for the whole file.
regards
Marco
Quoted 33 lines · Marcel Holtmann
Hi Marco,
Quoted 9 lines
Maybe this helps:
---- start code snippet ----
// handle the includes yourself#define CHANNEL 4
#define QUEUE 10int
main()Quoted 8 lines
{ int sock, client; socklen_t alen; struct sockaddr_rc addr; addr.rc_family = AF_BLUETOOTH; bacpy(&addr.rc_bdaddr, BDADDR_ANY); addr.rc_channel = htobs(CHANNEL);thanks for the example, but the htobs(CHANNEL) is wrong.
rc_channelis onlyuint8_tand when you do byteswap on a big endian machine this will end up in channel 0.Regards
Marcel
Quoted 11 lines
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerRe: [Bluez-users] rfcomm question 3
Hi Marco,
Quoted 8 lines
Thanks a lot. I hoped someone more c experienced will take a quick look at my code. It's the result of a example I found (the mistake comes from there) and a socket programming howto I read.
I now changed it to
addr.rc_channel = 4;Actually I do not need to #define it for the whole file.
the code is fine so far. However the best example is still in rctest.c besides that it uses fork() and this is sometimes hard to understand by beginners. I cleaned the rctest.c stuff lately and removed some cruft things.
In your code I would only criticize the coding style and the naming of the variables.
Coding style:
- Use /* */ for comments
- if(bind...) ==> if (bind...) {
- (struct sockaddr *)&addr ==> (struct sockaddr *) &addr
Variable names:
- sock ==> sk
- client ==> nsk (stands for new socket)
- noReadChars ==> len or num (this is not C++ or Java)
When you do accept() you should do the "alen = sizeof(addr);" again, because the value of alen could be overwritten. And a memset() of the addr variable before filling it with values is a good idea. It can happens that the size between the kernel and the userspace differs and so you make sure that it is filled with zeros.
And don't declare new variables inside the code. Do it at the top of a function or a the top of a block. Old compilers like GCC 2.95 don't like this and remember this is not Java.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hello Marcel
thanks a lot for your comments and hints on my code.
unfortunately we only had 1 module about c/c++ programming in the university and I'm programming java for over 3 years. Luckily, in comunication-technology, we've a subtopic about c socket-programming in two weeks, this will be very helpfull.
Actually my project is in c++. Because of that I started already with the c++ usage of comments and variable declarations. For c I usually use the --ansii flag to ensure gcc backward compatibility.
I'll definitely check out the rctest.c example
Regarding your price/hour: Do you know how many money you would earn if you got paid for your email support in this list? Amazing! :-)
It's always a pleasure if someone answers emails in mailinglists that fast and precise as you do (The last one i've "met" spending so much time for a mailinglist was Mattia Barbon in the wxPerl list.).
regards
Marco
Quoted 46 lines · Marcel Holtmann
Hi Marco,
Quoted 6 lines
Thanks a lot. I hoped someone more c experienced will take a quick look at my code. It's the result of a example I found (the mistake comes from there) and a socket programming howto I read.
I now changed it to
addr.rc_channel = 4;Actually I do not need to #define it for the whole file.
the code is fine so far. However the best example is still in
rctest.cbesides that it usesfork()and this is sometimes hard to understand by beginners. I cleaned therctest.cstuff lately and removed some cruft things.In your code I would only criticize the coding style and the naming of the variables.
Coding style:
- Use /* */ for comments
- if(bind...) ==> if (bind...) {
- (struct sockaddr *)&addr ==> (struct sockaddr *) &addrVariable names:
- sock ==> sk
- client ==> nsk (stands for new socket)
- noReadChars ==> len or num (this is not C++ or Java)When you do
accept()you should do the "alen = sizeof(addr);" again, because the value of alen could be overwritten. And amemset()of the addr variable before filling it with values is a good idea. It can happens that the size between the kernel and the userspace differs and so you make sure that it is filled with zeros.And don't declare new variables inside the code. Do it at the top of a function or a the top of a block. Old compilers like GCC 2.95 don't like this and remember this is not Java.
Regards
Marcel
Quoted 11 lines
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Marcel Holtmann
maintainerRe: [Bluez-users] rfcomm question 3
Hi Marco,
Quoted 1 line
thanks a lot for your comments and hints on my code.
you are welcome.
Quoted 8 lines
unfortunately we only had 1 module about c/c++ programming in the university and I'm programming java for over 3 years. Luckily, in comunication-technology, we've a subtopic about c socket-programming in two weeks, this will be very helpfull.
Actually my project is in c++. Because of that I started already with the c++ usage of comments and variable declarations. For c I usually use the --ansii flag to ensure gcc backward compatibility.
Actually all my suggestions are based on my work inside the Linux kernel. If you are at that point you see code a little bit different, because you must deal with different things. People underestimate the coding style and I think it is one of the important things to keep this clean and to help and allow newbies to understand the code. And this is another important thing, because if you don't understand the code you end up copying stuff from one project to another. This does not increase code quality and I have seen enough projects where something works, but nobody knows why.
Quoted 1 line
I'll definitely check out the
rctest.cexample
The test programs still need some cleanups, because there are too many global variables in that code.
Quoted 2 lines
Regarding your price/hour: Do you know how many money you would earn if you got paid for your email support in this list? Amazing! :-)
I don't know, but actually that is not so important. A project will only make progress if the mailing list is activly maintained. If people don't care about the problems of others, the project is already dead.
However feel free to make a donation if you like ;)
http://www.bluez.org/sponsors.html
Quoted 3 lines
It's always a pleasure if someone answers emails in mailinglists that fast and precise as you do (The last one i've "met" spending so much time for a mailinglist was Mattia Barbon in the wxPerl list.).
Thanks
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi all!
I'm still doing my project. Now I face a problem
that the T610 still cannot connect to PC. Then my tutor said that I have to write a sdp program to let the phone to connect to PC. I wish to know that is there any guideline or even the source code for sdp programming? It is urgent as my tutor said he used two months to do it before.
Thank you very much for your kindness.
Michael
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Michael,
Quoted 2 lines
I wish to know that is there any guideline or even the source code for sdp programming?
looking at the source of sdptool might help.
Sincerely,
Alain
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Ka Kin CheungDear Cheung
Please take a look on bluez-util/tools/sdptool.c. It should help a lot.
best regard
Mike,Lee
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Ka Kin CheungQuoted 5 lines · Ka Kin Cheung
Hi all!
I'm still doing my project. Now I face a problem
that the T610 still cannot connect to PC. Then my tutor said that I have to write a sdp program to let the phone to connect to PC.
this has nothing to do with it. i think you tutor is wrong... if your pc is listening on a rfcomm channel, then you can connect with a url like btspp://0123456789AB:4
the first part is the protocol, the second the mac address, the last one the channel number.
have you tried/understood my last post to you:
http://sourceforge.net/mailarchive/message.php?msg_id=10756581
you need a sdp-entry only if the mobile phone wants to do a service search (paging) what's not needed. a inquiry could get you the mac address and you then can connect to the listening port in your program.
if it still doesn't work, please send a description of what you exactly do and what the exact results are. please use hcidump as well...
regards
Marco
Quoted 13 lines
I wish to know that is
there any guideline or even the source code for sdp programming? It is urgent as my tutor said he used two months to do it before.
Thank you very much for your kindness.
Michael_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
Quoted 11 lines
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Ka Kin CheungPlease check out the post from Jay Summet as well:
http://sourceforge.net/mailarchive/forum.php?thread_id=6573020&forum_id=1883
it might help...
regards
Marco
Quoted 17 lines · Ka Kin Cheung
Hi all!
I'm still doing my project. Now I face a problem
that the T610 still cannot connect to PC. Then my tutor said that I have to write a sdp program to let the phone to connect to PC. I wish to know that is there any guideline or even the source code for sdp programming? It is urgent as my tutor said he used two months to do it before.
Thank you very much for your kindness.
Michael_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
Quoted 11 lines
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Marco TrudelHi Marco!
I've put some functions you posted before into my main program. As I wish to write the program to act as server, I wrote like this:
int main (int argc, char **argv)
{
//variable declaration...
addr.rc_family = AF_BLUETOOTH;
bacpy(&addr.rc_bdaddr, BDADDR_ANY);
addr.rc_channel = 4;
alen = sizeof(addr);
//mysql initialization....
while (1)
{
// request a socket from the operating system
if((sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0)
{
printf("socket(...) failed");
exit(1);
}
// bind the socket to the system
if(bind(sock, (struct sockaddr *)&addr, alen) < 0)
{
printf("bind(...) failed\n");
exit(2);
}
// set the socket into listen mode. handle 10 (QUEUE) connections.
if(listen(sock, 10) < 0)
{
printf("listen(...) failed\n");
exit(3);
}
while(client = accept(sock, (struct sockaddr *)&addr, &alen))
{
char remoteAddr[18];
ba2str(&addr.rc_bdaddr, remoteAddr);
printf("connection from %s:\n", remoteAddr);
// send a "hello from server" to client
char out[] = "hello from server";
send(client, out, strlen(out), 0);
printf("> %s\n", out);
// read the answer
char buffer[101]; // buffer size 100, 1 for '\0'
int noReadChars = recv(client, buffer, sizeof(buffer)-1, 0);
buffer[noReadChars] = '\0'; // here the received answer ends
printf("< %s\n", buffer);
while (1)
{
.......After I ran it, the sock, bind and listen functions were all passed. But after that, I couldn't see any result about it. Then I wish to fiind out how to connect SE T610 to bluez in my PC, but I couldn't find the method. And the strange thing is that the phone could search my PC and then added it on the "My device" list, I was wondering why couldn't the phone initialize the connection to PC. I'm very surprising that Jay Summet said that T610 cannot connect to bluez in Linux PC. So I wish Jay also to explain why, and does it mean that there is no method that T610 can really initialize the connection to PC? By the way, after I looked at the specification of the bluetooth system, I could not find any way to write sdp program. So, can you and other mail users suggest a method for me to do? I really thank you very much for your kindness.
Michael
Marco Trudel <[email protected]> wrote:
Quoted 5 lines · Ka Kin Cheung
Hi all!
I'm still doing my project. Now I face a problem that the T610 still cannot connect to PC. Then my tutor said that I have to write a sdp program to let the phone to connect to PC.
this has nothing to do with it. i think you tutor is wrong... if your pc is listening on a rfcomm channel, then you can connect with a url like btspp://0123456789AB:4
the first part is the protocol, the second the mac address, the last one the channel number.
have you tried/understood my last post to you:
http://sourceforge.net/mailarchive/message.php?msg_id=10756581
you need a sdp-entry only if the mobile phone wants to do a service search (paging) what's not needed. a inquiry could get you the mac address and you then can connect to the listening port in your program.
if it still doesn't work, please send a description of what you exactly do and what the exact results are. please use hcidump as well...
regards
Marco
Quoted 13 lines
I wish to know that is
there any guideline or even the source code for sdp programming? It is urgent as my tutor said he used two months to do it before.
Thank you very much for your kindness. Michael_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
Quoted 11 lines
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
---------------------------------
新年願望第一位 : 找到友緣人
Re: [Bluez-users] rfcomm question 3
Quoted 49 lines · Ka Kin Cheung
Hi Marco!
I've put some functions you posted before into my main program. As I
wish to write the program to act as server, I wrote like this:
int main (int argc, char **argv)
{
//variable declaration...
addr.rc_family =AF_BLUETOOTH;
bacpy(&addr.rc_bdaddr, BDADDR_ANY);
addr.rc_channel = 4;
alen = sizeof(addr);
//mysql initialization....
while (1)
{
// request a socket from the operating system
if((sock = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)) < 0){ printf("socket(...) failed"); exit(1); } // bind the socket to the system if(bind(sock, (struct sockaddr *)&addr, alen) < 0) { printf("bind(...) failed\n"); exit(2); } // set the socket into listen mode. handle 10 (QUEUE) connections. if(listen(sock, 10) < 0) { printf("listen(...) failed\n"); exit(3); } while(client = accept(sock, (struct sockaddr *)&addr, &alen)) { char remoteAddr[18]; ba2str(&addr.rc_bdaddr, remoteAddr); printf("connection from %s:\n", remoteAddr); // send a "hello from server" to client char out[] = "hello from server"; send(client, out, strlen(out), 0); printf("> %s\n", out); // read the answer char buffer[101]; // buffer size 100, 1 for '\0' int noReadChars = recv(client, buffer, sizeof(buffer)-1, 0); buffer[noReadChars] = '\0'; // here the received answer ends printf("< %s\n", buffer); while (1) { .......
Quoted 2 lines
After I ran it, the sock, bind and listen functions were all passed. But after that, I couldn't see any result about it.
question: what do you expect? my pc usually starts a britney spears mp3 and makes a couple of somersaults...
no, serious: what do you expect??? nothing will happen after that because the pc waits for a client connection.
please - really - read a couple of tutorials about socket programming and try to understand what the codes does that you write.
as already was said: this list is not here to explain you how socket programming works...
Quoted 3 lines
Then I wish to fiind out
how to connect SE T610 to bluez in my PC, but I couldn't find the method.
you've to write a client program for that runs on the mobile phone. if i remember right, the T610 hasn't support for jsr82. I don't know if you're able to do c programming on it and have access to the bluetooth system. i use a nokia 6230, there you have mdip2.0 and jsr83. so it's no problem at all...
regards
Marco
Quoted 82 lines
And the strange thing is that the phone could search my PC and then added it on the "My device" list, I was wondering why couldn't the phone initialize the connection to PC. I'm very surprising that Jay Summet said that T610 cannot connect to bluez in Linux PC. So I wish Jay also to explain why, and does it mean that there is no method that T610 can really initialize the connection to PC?
By the way, after I looked at the specification of the bluetooth system, I could not find any way to write sdp program. So, can you and other mail users suggest a method for me to do? I really thank you very much for your kindness.
Michael*/Marco Trudel <[email protected]>/* wrote:
Ka Kin Cheung wrote:
> Hi all!
> I'm still doing my project. Now I face a problem > that the T610 still cannot connect to PC. Then my > tutor said that I have to write a sdp program to let > the phone to connect to PC.this has nothing to do with it. i think you tutor is wrong... if your pc is listening on a rfcomm channel, then you can connect with a url like btspp://0123456789AB:4
the first part is the protocol, the second the mac address, the last one the channel number.
have you tried/understood my last post to you:
http://sourceforge.net/mailarchive/message.php?msg_id=10756581you need a sdp-entry only if the mobile phone wants to do a service search
(paging) what's not needed. a inquiry could get you the mac address and you
then can connect to the listening port in your program.if it still doesn' t work, please send a description of what you exactly do
and what the exact results are. please use hcidump as well...regards
Marco> I wish to know that is
> there any guideline or even the source code for sdp
> programming? It is urgent as my tutor said he used two
> months to do it before.
> Thank you very much for your kindness.
> Michael
>
>
>
_______________________________________________________________________
> 新年願望第一位 : 找到友緣人
> http://personals.yahoo.com.hk
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real
users.
> Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
>-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 2 lines
------------------------------------------------------------------------
新年願望第一位 : 找到友緣人 <http://hk.personals.yahoo.com>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Marco!
Quoted 4 lines
question: what do you expect? my pc usually starts a britney spears mp3 >and makes a couple of somersaults...
no, serious: what do you expect??? nothing will happen after that because the pc waits for a client connection.
My expect is to see if my phone can connect to mobile phone, address can be seen by putting the address on the screen. (Of course, it will be done by myself). But unfortunately, nothing to see because I can't find an option on T610 that can connect to PC even though I put the PC into "My device" list.
I've borrowed books for socket programming, don't worry about this. But I don't understand why sdp programming is not needed, instead of the word said by my tutor.
Quoted 5 lines
you've to write a client program for that runs on the mobile phone. if i remember right, the T610 hasn't support for jsr82. I don't know if you're able to do c programming on it and have access to the bluetooth >system. i use a nokia 6230, there you have mdip2.0 and jsr83. so it's no problem at all...
Thx for suggestion.
Michael
---------------------------------
新年願望第一位 : 找到友緣人
Re: [Bluez-users] rfcomm question 3
Quoted 8 lines · Ka Kin Cheung
Hi Marco!
Quoted 1 line
question: what do you expect? my pc usually starts a britney spears
mp3 >and
Quoted 3 lines
makes a couple of somersaults...
no, serious: what do you expect??? nothing will happen after that because the pc waits for a client connection.My expect is to see if my phone can connect to mobile phone,
I assume you mean if your phone can connect to the pc. How do you wanna see this? What behavior do you excactly expect?
Quoted 3 lines
address can
be seen by putting the address on the screen. (Of course, it will be done by myself).
I don't know what you mean with this...
I assume you mean to printf() the address after a client connected...
Quoted 3 lines
But unfortunately, nothing to see because I can't find
an option on T610 that can connect to PC even though I put the PC into "My device" list.
As I said, you need to programm this yourself (and install it on your mobile phone)...
Quoted 1 line
I've borrowed books for socket programming, don't worry about this.
good. then read it before you continue.
programm a little server and a little client that just exchange a little message. If you've understood that, you should understand what you try to do with bluez (because your pc is the server, your mobile phone the client).
Quoted 3 lines
But
I don't understand why sdp programming is not needed, instead of the word said by my tutor.
Can you please explain what you're doing?
I don't know who your tutor is, what he made or what he makes... So, how should I know what he needed the sdp for?
Actually you should explain us what he needed the sdp for. You're supposed to understand what you're doing and what you need (do you?)...
Quoted 8 lines
Quoted 5 lines
you've to write a client program for that runs on the mobile phone. if i remember right, the T610 hasn't support for jsr82. I don't know if you're able to do c programming on it and have access to the bluetooth system.
i use a nokia 6230, there you have mdip2.0 and jsr83. so it's noproblem at
Quoted 1 line
all...
Thx for suggestion.
that wasn't a suggestion. you have to do this!
regards
Marco
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Marco!
I think it is a need to explain the whole things
here so that you can understand.
My purpose of my project is to use bluetooth mobile
devices (now are T610 and iPAQ 3970, where iPAQ is running on Windows CE 3.0) to act as remote control on IR devices (now is doing for AV devices such as TV, CD, VCD, DVD and VCR). The OS used is Linux, and the main programming language is C. At first, I connected PC to T610, and it successed and the remote control on AV devices using T610 was also successful. But my supervisor said that the approach should be that the PC act as server, so that the connection from bluetooth mobile device to PC is needed. Then I tried hard to find out how the T610 can connect to PC. Now T610 can search my PC and then add in the "My device" list. But when I looked at the "Service list", the "Local service cannot found" statement was shown. Then, my tutor said that sdp (service discovery protocol) is needed for T610. So, my work is now mainly on how to do for sdp so that the T610 can connect to PC. If this is successful, then the next thing that I have to do is to connect the iPAQ running on Windows CE to the PC to access my main program that runs on Linux.
Regarding to your questions and comments in the
prevoius mail:
1.>> My expect is to see if my phone can connect to mobile phone,
Quoted 1 line
I assume you mean if your phone can connect to the
pc.
Quoted 1 line
How do you wanna see this? What behavior do you
excactly expect?
Your assumption is correct, and then after I can see
the address of T610, what I wish to see is the menu can be sent throught AT command to the phone and then try to do the remote control using T610.
2.>> But unfortunately, nothing to see because I can't
find an option >>on T610 that can connect to PC even
though I put the PC into "My >>device" list.
Quoted 1 line
As I said, you need to programm this yourself (and
install it on your
Quoted 1 line
mobile phone)...
The main point is, as the menu for my program can
be sent to T610 using AT command and the C main program on the Linux PC can get my choice from T610 and then do the corresponding things, I wish to know why an extra program is needed to write and then install on my phone? And is there any contradiction with sdp?
3. >how should I know what he needed the sdp for? Actually you should >explain us what he needed the sdp for.
The situation is when I connect from PC to T610,
the "accessories" i.e. the menu that I wish to use is sent through AT command to the phone, and then I can use. When I check the "service list", I see "object push" in the list. But then when I change the connection approach that from T610 to PC, no service can be found in the "Service list". Then my tutor said the sdp is needed for T610 so that the service on the PC can be found and then the connection from T610 to PC can be done.
By the way, my tutor is Hong Kong people, and you
may not know him.
4.>>>you've to write a client program for that runs on the mobile >>>phone. if i remember right, the T610 hasn't support for jsr82. I >>>don't know if you're able to do c programming on it and have access >>>to the bluetooth system. i use a nokia 6230, there you have mdip2.0 and jsr83. so it's no problem at all...
Quoted 2 lines
Quoted 1 line
Thx for suggestion.
that wasn't a suggestion. you have to do this!
But the problem is, my project can only use T610 and iPAq at this instant, and the language used for this project is C. So, is there any other alternative that can do the thing same as that you said before?
Here are the things that I concern now:
1. How to do for sdp so that the mobile devices can connect to PC (and the main point is, this can be done when I run my main program)
2. As my iPAq is running on Windows CE and the program used on it will be written in Visual eMbedded C++, but AT command is used for T610, so how can I solve this "contradiction" and that the choice from my iPAQ can be known by my main program?
I do hope that you can understand what I face now.
Thank you very much.
Michael
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Marco TrudelHi Marco!
Sorry for that. there is one thing missing. When I ran "hcidump -t -X" and then I let my phone
to update the "local service", the output is like this:
[root@csg457-kinlok-cyc722 root]# hcidump -t -X HCIDump - HCI packet analyzer ver 1.16
device: hci0 snap_len: 1028 filter: 0xffffffff 1108694591.032437 > HCI Event: Connect Request (0x04) plen 10
0000: a8 d8 dd d9 0a 00 04 02 52 01
........R.
1108694591.032900 < HCI Command: Accept Connection Request (0x01|0x0009) plen 7
0000: a8 d8 dd d9 0a 00 01
.......
1108694591.042439 > HCI Event: Command Status (0x0f) plen 4
0000: 00 01 09 04
....
1108694591.057439 > HCI Event: Connect Complete (0x03) plen 11
0000: 00 29 00 a8 d8 dd d9 0a 00 01 00
.).........
1108694591.058447 < HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
0000: 29 00 0f 00
)...
1108694591.059437 > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
0000: a8 d8 dd d9 0a 00 01
.......
1108694591.066448 > HCI Event: Command Complete (0x0e) plen 6
0000: 01 0d 08 00 29 00
....).
1108694591.067441 < HCI Command: Change Connection Packet Type (0x01|0x000f) ple
n 4
0000: 29 00 18 cc
)...
1108694591.075434 > HCI Event: Command Status (0x0f) plen 4
0000: 00 01 0f 04
....
1108694591.076430 > HCI Event: Connection Packet Type Changed (0x1d) plen 5
0000: 00 29 00 18 00
.)...
1108694591.103432 > ACL data: handle 0x0029 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 1 scid 0x0040
1108694591.104425 < ACL data: handle 0x0029 flags 0x02
dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040result 0 status 0
1108694591.111432 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.114443 > ACL data: handle 0x0029 flags 0x02 dlen 16
L2CAP(s): Config req: dcid 0x0040 flags 0x0000
clen 4
MTU 251
1108694591.119481 < ACL data: handle 0x0029 flags 0x02
dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x0000
result 0 clen 0
1108694591.119502 < ACL data: handle 0x0029 flags 0x02
dlen 12
L2CAP(s): Config req: dcid 0x0040 flags 0x0000clen 0
1108694591.125426 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.127424 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.130429 > ACL data: handle 0x0029 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x0000
result 0 clen 0
1108694591.135434 > ACL data: handle 0x0029 flags 0x02 dlen 17
1108694591.137449 > ACL data: handle 0x0029 flags 0x01 dlen 17
L2CAP(d): cid 0x0040 len 30 [psm 1]
SDP SSA Req: tid 0x0 len 0x19
pat uuid-16 0x1108 (Headset)
max 65535
aid(s) 0x0001 (SrvClassIDList) 0x0004
(ProtocolDescList) 0x0009 (BTPro
fileDescList) 0x0100 (SrvName) 0x0302 (unknown)
cont 00
1108694591.138414 < ACL data: handle 0x0029 flags 0x02
dlen 14
L2CAP(d): cid 0x0040 len 10 [psm 1]
SDP SSA Rsp: tid 0x0 len 0x5
count 2
cont 001108694591.144450 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.153430 > ACL data: handle 0x0029 flags 0x02 dlen 17
1108694591.155429 > ACL data: handle 0x0029 flags 0x01 dlen 17
L2CAP(d): cid 0x0040 len 30 [psm 1]
SDP SSA Req: tid 0x0 len 0x19
pat uuid-16 0x111e (Handsfree)
max 65535
aid(s) 0x0001 (SrvClassIDList) 0x0004
(ProtocolDescList) 0x0009 (BTPro
fileDescList) 0x0100 (SrvName) 0x0311 (unknown)
cont 00
1108694591.156030 < ACL data: handle 0x0029 flags 0x02
dlen 14
L2CAP(d): cid 0x0040 len 10 [psm 1]
SDP SSA Rsp: tid 0x0 len 0x5
count 2
cont 001108694591.164449 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.173426 > ACL data: handle 0x0029 flags 0x02 dlen 17
1108694591.176423 > ACL data: handle 0x0029 flags 0x01 dlen 14
L2CAP(d): cid 0x0040 len 27 [psm 1]
SDP SSA Req: tid 0x0 len 0x16
pat uuid-16 0x1107 (IRMCSyncCmd)
max 65535
aid(s) 0x0001 (SrvClassIDList) 0x0004
(ProtocolDescList) 0x0009 (BTPro
fileDescList) 0x0100 (SrvName)
cont 00
1108694591.176892 < ACL data: handle 0x0029 flags 0x02
dlen 14
L2CAP(d): cid 0x0040 len 10 [psm 1]
SDP SSA Rsp: tid 0x0 len 0x5
count 2
cont 001108694591.184438 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.193441 > ACL data: handle 0x0029 flags 0x02 dlen 17
1108694591.195438 > ACL data: handle 0x0029 flags 0x01 dlen 17
L2CAP(d): cid 0x0040 len 30 [psm 1]
SDP SSA Req: tid 0x0 len 0x19
pat uuid-16 0x1105 (OBEXObjPush)
max 65535
aid(s) 0x0001 (SrvClassIDList) 0x0004
(ProtocolDescList) 0x0009 (BTPro
fileDescList) 0x0100 (SrvName) 0x0303
(SuppFormatsList)
cont 00
1108694591.196315 < ACL data: handle 0x0029 flags 0x02
dlen 14
L2CAP(d): cid 0x0040 len 10 [psm 1]
SDP SSA Rsp: tid 0x0 len 0x5
count 2
cont 001108694591.203415 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.212423 > ACL data: handle 0x0029 flags 0x02 dlen 17
1108694591.214446 > ACL data: handle 0x0029 flags 0x01 dlen 14
L2CAP(d): cid 0x0040 len 27 [psm 1]
SDP SSA Req: tid 0x0 len 0x16
pat uuid-16 0x1106 (OBEXObjTrnsf)
max 65535
aid(s) 0x0001 (SrvClassIDList) 0x0004
(ProtocolDescList) 0x0009 (BTPro
fileDescList) 0x0100 (SrvName)
cont 00
1108694591.215070 < ACL data: handle 0x0029 flags 0x02
dlen 14
L2CAP(d): cid 0x0040 len 10 [psm 1]
SDP SSA Rsp: tid 0x0 len 0x5
count 2
cont 001108694591.222411 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.231413 > ACL data: handle 0x0029 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
1108694591.231500 < ACL data: handle 0x0029 flags 0x02
dlen 12
L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x00401108694591.239408 > HCI Event: Number of Completed Packets (0x13) plen 5
0000: 01 29 00 01 00
.)...
1108694591.329386 > HCI Event: Disconn Complete (0x05) plen 4
0000: 00 29 00 13
.)..
What does it mean? And is there any error? If so,
how can I do?
Thanks a lot!
Michael
_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
[Bluez-users] multiple instances of OPUSH server
Halu!
How do I enable support for multiple instances of an Obex server. Im using OPD. What Im trying to do is setup two OPD servers on my computer. Two bluetooth dongles will be used. One of the dongles listen to rfcomm channel 10 and the other to channel 3. I want one instance of OPD to listen to rfcomm channel 10 on /dev/rfcomm0 and the other one to channel 3 on /dev/rfcomm1.
If I run one instance of opd on channel 10, it works fine but when I try to run the 2nd opd on channel 3 i get the error message:
opd[4561]: Failed to register BtOBEX server on RFCOMM channel 10. (-1 / 98) It seems that everytime I run opd, its default rfcomm device is /dev/rfcomm0.
Note: error 98 stands for " Address already in use "
How do I make OPD run on a specified rfcomm device (say on /dev/rfcomm1)? I tried looking at the code of OPD but I cant seem to find how to change the default rfcomm device. I also tried binding my bluetooth dongles to specified rfcomm devices and channels but it still doesnt work.
Any help/insight is greatly appreciated.
Many thanks. :)
-jan
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
In reply to Ka Kin CheungHello Michael
Do I understand this right:
You have to control infrared devices like a television with your mobile phone. The connection between your mobile phone and your pc is over bluetooth and your pc then sends the infrared signals to the television, is this correct?
You were able to connect from your pc to the mobile phone. Did you use bluetooth? Which service do you connected to (from your mobile phone), what's it's name?
Then you sent the menu for the remote control from your pc to your mobile phone using at commands and got the choices you made on the mobile phone bacck to your pc. Your pc then sent the answer to the television using infrared?
Hope I understood this more or less correctly...
regards
Marco
Quoted 103 lines · Ka Kin Cheung
Hi Marco!
I think it is a need to explain the whole things
here so that you can understand.
My purpose of my project is to use bluetooth mobile
devices (now are T610 and iPAQ 3970, where iPAQ is running on Windows CE 3.0) to act as remote control on IR devices (now is doing for AV devices such as TV, CD, VCD, DVD and VCR). The OS used is Linux, and the main programming language is C. At first, I connected PC to T610, and it successed and the remote control on AV devices using T610 was also successful. But my supervisor said that the approach should be that the PC act as server, so that the connection from bluetooth mobile device to PC is needed. Then I tried hard to find out how the T610 can connect to PC. Now T610 can search my PC and then add in the "My device" list. But when I looked at the "Service list", the "Local service cannot found" statement was shown. Then, my tutor said that sdp (service discovery protocol) is needed for T610. So, my work is now mainly on how to do for sdp so that the T610 can connect to PC. If this is successful, then the next thing that I have to do is to connect the iPAQ running on Windows CE to the PC to access my main program that runs on Linux.
Regarding to your questions and comments in the
prevoius mail:
1.>> My expect is to see if my phone can connect to mobile phone,Quoted 1 line
I assume you mean if your phone can connect to the
pc.
Quoted 1 line
How do you wanna see this? What behavior do you
excactly expect?
Your assumption is correct, and then after I can see
the address of T610, what I wish to see is the menu can be sent throught AT command to the phone and then try to do the remote control using T610.
2.>> But unfortunately, nothing to see because I can't
find an option >>on T610 that can connect to PC even
though I put the PC into "My >>device" list.Quoted 1 line
As I said, you need to programm this yourself (and
install it on your
Quoted 1 line
mobile phone)...
The main point is, as the menu for my program can
be sent to T610 using AT command and the C main program on the Linux PC can get my choice from T610 and then do the corresponding things, I wish to know why an extra program is needed to write and then install on my phone? And is there any contradiction with sdp?
3. >how should I know what he needed the sdp for? Actually you should >explain us what he needed the sdp for.
The situation is when I connect from PC to T610,
the "accessories" i.e. the menu that I wish to use is sent through AT command to the phone, and then I can use. When I check the "service list", I see "object push" in the list. But then when I change the connection approach that from T610 to PC, no service can be found in the "Service list". Then my tutor said the sdp is needed for T610 so that the service on the PC can be found and then the connection from T610 to PC can be done.
By the way, my tutor is Hong Kong people, and you
may not know him.
4.>>>you've to write a client program for that runs on the mobile >>>phone. if i remember right, the T610 hasn't support for jsr82. I >>>don't know if you're able to do c programming on it and have access >>>to the bluetooth system. i use a nokia 6230, there you have mdip2.0 and jsr83. so it's no problem at all...Quoted 3 lines
Quoted 1 line
Thx for suggestion.
that wasn't a suggestion. you have to do this!
But the problem is, my project can only use T610 and iPAq at this instant, and the language used for this project is C. So, is there any other alternative that can do the thing same as that you said before?
Here are the things that I concern now:
1. How to do for sdp so that the mobile devices can connect to PC (and the main point is, this can be done when I run my main program)
2. As my iPAq is running on Windows CE and the program used on it will be written in Visual eMbedded C++, but AT command is used for T610, so how can I solve this "contradiction" and that the choice from my iPAQ can be known by my main program?
I do hope that you can understand what I face now.
Thank you very much.
Michael_______________________________________________________________________
新年願望第一位 : 找到友緣人
http://personals.yahoo.com.hk
Quoted 11 lines
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Marco!
Thanks for you reply as I afraid that you may not reply my mail due to my ridicious act before.
Regarding to your questions:
1.>The connection between your mobile phone and your pc is over bluetooth >and your pc then sends the infrared signals to the television, is this correct? Yes, correct.
2.>You were able to connect from your pc to the mobile phone. Did you use
Quoted 1 line
bluetooth?
Yes, of course, and the connection layer is rfcomm. I typed "rfcomm connect 0 <address>" to connect to T610, and it was success. Now what I do is to change the approach, but still it is not successful. 3.>Which service do you connected to (from your mobile phone), what's it's >name?
The service that the PC provided for T610 is Object push
4.>Then you sent the menu for the remote control from your pc to your mobile
Quoted 1 line
phone using at commands and got the choices you made on the mobile >phone bacck to your pc. Your pc then sent the answer to the television >using infrared?
Exactly!
Quoted 1 line
Hope I understood this more or less correctly...
I'm glad that you understand much about my project. So I hope that you can point out something about how I do for sdp so that I can eventually let the T610 to connect to PC while my main program is running. Thanks so much.
Michael
---------------------------------
Yahoo! 工具列 - 內置防止彈出視窗工能!
Re: [Bluez-users] rfcomm question 3
Hello Michael
finally I understand what you're trying to do. that explains a lot! I would have been confused too if somone told me about socket programming while doing what you do.
I suggest to add a description of what you do when posting to a mailinglist the next time. That might save a lot of time :-)
Quoted 2 lines
Yes, of course, and the connection layer is rfcomm. I typed "rfcomm connect 0 <address>" to connect to T610, and it was success.
what service is on rfcomm channel 0 on the mobile phone? obex?
Ok. So now you try
1. to connect with your mobile phone to the pc
2. send the menu from the pc to the mobile phone
3. do what already worked before...
As far as I know - please correct me if someone knows better - a mobile phone doesn't provide a feature to connect to remote devices (at least mine doesn't). It wouldn't make sense, because the mobile phone has no idea what to do after it connected, does it?
I wonder how your tutor made this. If he tells you, could you send this to the list? I'm really interested...
Actually I think you now have to write/download a program for your mobile phone that connects to an obex (if you're working with obex) service (on your pc) - or ask your tutor how he did it...
Then you can send the menu from to pc to the mobile phone and everything should be fine.
And here now comes the sdp thing that your tutor mentioned. Your mobile phone will do a service scan on your pc (paging), then it should find a obex service that it knows it's able to connect to.
Can I have your program that sent the menu from the pc to the mobile phone? I never worked with something like this but I'm be very interested how this looks/works. I don't mind that I've to connect from the pc to the mobile phone...
Please inform me of any success/failures (after you described what you do, i'm really interested in it - you might already have noticed it).
regards
Marco
Quoted 30 lines · Ka Kin Cheung
Hi Marco!
Thanks for you reply as I afraid that you may not reply my mail due
to my ridicious act before.
Regarding to your questions:
1.>The connection between your mobile phone and your pc is over bluetooth >and your pc then sends the infrared signals to the television, is this correct?
Yes, correct.
2.>You were able to connect from your pc to the mobile phone. Did you useQuoted 1 line
bluetooth?
Yes, of course, and the connection layer is rfcomm. I typed "rfcomm connect 0 <address>" to connect to T610, and it was success. Now what I do is to change the approach, but still it is not successful. 3.>Which service do you connected to (from your mobile phone), what's it's >name?
The service that the PC provided for T610 is Object push
4.>Then you sent the menu for the remote control from your pc to your mobileQuoted 3 lines
phone using at commands and got the choices you made on the mobile phone bacck to your pc. Your pc then sent the answer to the television using infrared?
Exactly!
Quoted 1 line
Hope I understood this more or less correctly...
I'm glad that you understand much about my project. So I hope that you can point out something about how I do for sdp so that I can eventually let the T610 to connect to PC while my main program is running. Thanks so much.
Michael
Quoted 2 lines
------------------------------------------------------------------------
Yahoo! 工具列 - 內置防止彈出視窗工能 <http://hk.toolbar.yahoo.com>!
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Re: [Bluez-users] rfcomm question 3
Hi Marco!
I'm surprising that you are quite interested about
my project as you didn't do about the thing what I've done, I think.
Regarding to your questions:
1.> what service is on rfcomm channel 0 on the mobile phone? obex?
Sorry, I'm not sure what you are asking. But about
OBEX, after I did for "sdptool browse <address>" for my T610, following occurs
Service Name: Dial-up Networking
Service RecHandle: 0x10000
Service Class ID List:
"Dialup Networking" (0x1103)
"Generic Networking" (0x1201)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100
Service Name: Voice gateway
Service RecHandle: 0x10002
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 3
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100
Service Name: Serial Port 1
Service RecHandle: 0x10003
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
Service Name: Serial Port 2
Service RecHandle: 0x10004
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 5
Service Name: OBEX Object Push
Service RecHandle: 0x10005
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 10
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100Service Name: IrMC Synchronization
Service RecHandle: 0x10006
Service Class ID List:
"IrMCSync" (0x1104)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 11
"OBEX" (0x0008)
Profile Descriptor List:
"IrMCSync" (0x1104)
Version: 0x0100Service Name: HF Voice gateway
Service RecHandle: 0x10007
Service Class ID List:
"" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 6
Profile Descriptor List:
"" (0x111e)
Version: 0x0100
Service Name: OBEX Basic Imaging
Service RecHandle: 0x1000b
Service Class ID List:
"" (0x111b)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 15
"OBEX" (0x0008)
Profile Descriptor List:
"" (0x111a)
Version: 0x0100Service Name: OBEX File Transfer
Service RecHandle: 0x1000f
Service Class ID List:
"OBEX File Transfer" (0x1106)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 7
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX File Transfer" (0x1106)
Version: 0x0100
If regarding the above output, the service I wish
to use should be OBEX OIbject Push, and it is in channel 10. Am I right?
2.>It wouldn't make sense, because the mobile phone has no idea what
Quoted 1 line
to do after it connected, does it?
So what I have to do is, after the mobile phone connect to PC, the menu could be sent to the mobile phone's "accessories" menu and then run. As you are interested in what I've done for connecting PC to T610 and then do my work, I attached a file here. It is one of my project's program where the phone is connected from PC. You can see how it works with T610 (if you have T610. Or if not, any Sony Ericsson T series phone may be ok.) But there are notes here:
1.There are lines that are MySQL API. So, I'll send also the SQL files and then you have to create AVDevice database.
2.The IR part is using IRTrans transceiver (maybe you have heard about it). But you can ignore any error message caused by IRTrans as it doesn't affect the operation about bluetooth.
Thank you very much for your kindness and
interest.
Michael
--- Marco Trudel <[email protected]> 內容:
Quoted 103 lines
Hello Michael
finally I understand what you're trying to do. that explains a lot!
I would have been confused too if somone told me about socket programming
while doing what you do.
I suggest to add a description of what you do when posting to a mailinglist
the next time. That might save a lot of time :-)Quoted 1 line
Yes, of course, and the connection layer is
rfcomm. I typed "rfcomm
Quoted 1 line
connect 0 <address>" to connect to T610, and it
was success.
what service is on rfcomm channel 0 on the mobile
phone? obex?Ok. So now you try
1. to connect with your mobile phone to the pc
2. send the menu from the pc to the mobile phone
3. do what already worked before...As far as I know - please correct me if someone knows better - a mobile
phone doesn't provide a feature to connect to remote devices (at least mine
doesn't). It wouldn't make sense, because the mobile phone has no idea what
to do after it connected, does it?
I wonder how your tutor made this. If he tells you, could you send this to
the list? I'm really interested...Actually I think you now have to write/download a program for your mobile
phone that connects to an obex (if you're working with obex) service (on
your pc) - or ask your tutor how he did it... Then you can send the menu from to pc to the mobile phone and everything
should be fine.
And here now comes the sdp thing that your tutor mentioned. Your mobile
phone will do a service scan on your pc (paging), then it should find a
obex service that it knows it's able to connect to.Can I have your program that sent the menu from the pc to the mobile phone?
I never worked with something like this but I'm be very interested how this
looks/works. I don't mind that I've to connect from the pc to the mobile
phone...Please inform me of any success/failures (after you described what you do,
i'm really interested in it - you might already have noticed it).regards
MarcoQuoted 2 lines · Ka Kin Cheung
Hi Marco!
Thanks for you reply as I afraid that you maynot reply my mail due
Quoted 3 lines
to my ridicious act before.
Regarding to your questions:
1.>The connection between your mobile phone andyour pc is over
Quoted 1 line
bluetooth >and your pc then sends the infrared
signals to the
Quoted 3 lines
television, is this correct?
Yes, correct.
2.>You were able to connect from your pc to themobile phone. Did you use
Quoted 2 lines
Quoted 1 line
bluetooth?
Yes, of course, and the connection layer is
rfcomm. I typed "rfcomm
Quoted 1 line
connect 0 <address>" to connect to T610, and it
was success. Now what I
Quoted 1 line
do is to change the approach, but still it is not
successful.
Quoted 1 line
3.>Which service do you connected to (from your
mobile phone), what's
Quoted 2 lines
it's >name?
The service that the PC provided for T610 isObject push
Quoted 1 line
4.>Then you sent the menu for the remote control
from your pc to your mobile
Quoted 1 line
Quoted 1 line
phone using at commands and got the choices you
made on the mobile
Quoted 1 line
Quoted 1 line
phone bacck to your pc. Your pc then sent the
answer to the television
Quoted 3 lines
Quoted 1 line
using infrared?
Exactly!
Quoted 13 lines
Quoted 2 lines
Quoted 1 line
Hope I understood this more or less correctly...
I'm glad that you understand much about my
project. So I hope that you
Quoted 1 line
can point out something about how I do for sdp so
that I can eventually
Quoted 1 line
let the T610 to connect to PC while my main
program is running.
Quoted 5 lines
Thanks so much.
Michael
------------------------------------------------------------------------
Quoted 5 lines
Quoted 1 line
Yahoo! 工具列 - 內置防止彈出視窗工能
-------------------------------------------------------
Quoted 6 lines
SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 4 lines
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
Quoted 1 line
_______________________________________________________________________
Yahoo! 工具列 - 內置防止彈出視窗工能!
http://toolbar.yahoo.com.hk