Skip to contentSkip to conversation

DUN Gateway

Bluez-devel Mayank BATRA 2 participants 4 messages Nov 4, 2006 – Nov 7, 2006 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi Marcel,

There is an option --dialup -u (Pretend to be a dialup/telephone) in the dund daemon. But I see that this option only registers a DIALUP_NET_SVCLASS_ID SDP record. It does nothing else apart from that. My requirement is that I want to make dund work as a DUN Gateway. Thus, it should read AT commands sent from the DUN Terminal and send back responses to it. Is there some way through which I can make dund do so?

Best Regards,

Mayank

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw

Hi,

I don't know if you can make dund work like this, however, the patch I =

just proposed can be used in a similar way :
See thread called "[Bluez-devel] rfcomm patch to startup an executable =

at connection"
If a modem is installed on a serial port, then a simple gateway =

application can be used between /dev/rfcomm0 and the modem.

1) Create SDP record:
sdptool add --channel 20 DUN

2) setup your serial port
stty -F /dev/ttyS0 115200 ...

3) Start the rfcomm utility in watch mode:
rfcomm --raw watch 0 20 gateway_app {} /dev/ttyS0
Note: the {} will be replaced by /dev/rfcomm0.

4) Setup your DUN data terminal and connect. Upon connection, rfcomm launches a gateway_app process.

It's up to you to write the gateway ;) Something like this should be enough:

int f1 =3D open(argv[1]);
int f2 =3D open(argv[2]);
while(!error)
{
int fd =3D poll(f1, f2)
if(fd=3D=3D1)

    read(f1); write(f2);
else if(fd=3D=3D2)
    read(f2); write(f1);

else error;
}
close(f1);
close(f2);

Maybe a shell command already exists

Hope this helps!
Fr=E9d=E9ric

Mayank BATRA a =E9crit :

Quoted 3 lines

Hi Marcel,

There is an option --dialup -u (Pretend to be a dialup/telephone) in the =

dund daemon. But I see that this option only registers a DIALUP_NET_SVCLASS= _ID SDP record. It does nothing else apart from that. My requirement is tha= t I want to make dund work as a DUN Gateway. Thus, it should read AT comman= ds sent from the DUN Terminal and send back responses to it.

Quoted 10 lines

Is there some way through which I can make dund do so?

Best Regards,

Mayank

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job ea=

sier

Quoted 2 lines

Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=

=3D121642

Quoted 5 lines

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
=

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easi= er
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1=
21642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Hi Fr=E9d=E9ric,

Quoted 10 lines

I don't know if you can make dund work like this, however, =

the patch I =

just proposed can be used in a similar way :
See thread called "[Bluez-devel] rfcomm patch to startup an =

executable =

at connection"

Yes, I think this is what I need. I'll try this out.

Quoted 1 line

Hope this helps!

Thanks a lot!!

Best Regards,

Mayank

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easi= er
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1=
21642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw
In reply to Frédéric DALLEAU

Hi Fr=E9d=E9ric,

I tried this out and it actually works. Thanks for your great patch! It is really helpful!

Best Regards,

Mayank

Quoted 71 lines · Fr=E9d=E9ric DALLEAU wrote:

Hi,
=

I don't know if you can make dund work like this, however, =

the patch I =

just proposed can be used in a similar way :
See thread called "[Bluez-devel] rfcomm patch to startup an =

executable =

at connection"
If a modem is installed on a serial port, then a simple gateway =

application can be used between /dev/rfcomm0 and the modem. =

1) Create SDP record:
sdptool add --channel 20 DUN
=

2) setup your serial port
stty -F /dev/ttyS0 115200 ...
=

3) Start the rfcomm utility in watch mode:
rfcomm --raw watch 0 20 gateway_app {} /dev/ttyS0
Note: the {} will be replaced by /dev/rfcomm0.
=

4) Setup your DUN data terminal and connect. Upon connection, rfcomm launches a gateway_app process. =

It's up to you to write the gateway ;) Something like this =

should be enough:
=

int f1 =3D open(argv[1]);
int f2 =3D open(argv[2]);
while(!error)
{
int fd =3D poll(f1, f2)
if(fd=3D=3D1)

    read(f1); write(f2);
else if(fd=3D=3D2)
    read(f2); write(f1);

else error;
}
close(f1);
close(f2);
=

Maybe a shell command already exists
=

Hope this helps!
Fr=E9d=E9ric
=

=

Mayank BATRA a =E9crit :

Quoted 3 lines

Hi Marcel,

There is an option --dialup -u (Pretend to be a =

dialup/telephone) in the dund daemon. But I see that this =

Quoted 12 lines

option only registers a DIALUP_NET_SVCLASS_ID SDP record. It =

does nothing else apart from that. My requirement is that I =

want to make dund work as a DUN Gateway. Thus, it should read =

AT commands sent from the DUN Terminal and send back responses to it.

Quoted 5 lines

Is there some way through which I can make dund do so?

Best Regards,

Mayank

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easi= er
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1=
21642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel