Hello,
i ve a very simple question. I got a simple obex server code that runs
fine.I ve taken the obexserver sample souce code as a tamplate. Question is:
how/where can i get, on my server, the bt address of the client ??
thanks a lot
Andrea
Hi Andrea,
On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> including obex_main.h conflicts with the necessary inclusion in my code of
> <openobex/obex.h>...
> Moreover obex_main.h require all other header file of openobex libs to
> compile...
>
> is there any way to get out of all this ?
>
>
> grazie
> andrea
I'm afraid not an easy one. When I look into the source code (1.3) in
obex_const.h there is an obex_interface_t structure which for usb gives
you all information about the connection. However, for the case of a
Bluetooth transport it is "to be added" ..........
There is another function defined in obex.h which may give you what you
want (just found this) :
int OBEX_GetFD(obex_t *self);
You may try using the return value of this function as the fd for
getpeername(). Don't have any documentation for it.
Ciao,
Peter
>
>
>
>
>
>
>
> On 10/11/06, Peter Wippich <[email protected]> wrote:
> >
> >
> > Hi,
> >
> >
> > On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> >
> > > ok,
> > > i get that stratcure as "handle" with this call:
> > >
> > > obex_t *handle = NULL;
> > > handle = OBEX_Init(OBEX_TRANS_BLUETOOTH, obex_event, 0);
> > > ....
> > > btobex_accept(handle);
> > >
> > > OK, but if i add this code:
> > >
> > > getpeername(handle->fd, &addr, &addr_len);
> > >
> > > my compiler gives me this error:
> > >
> > > > > > request for member 'fd' in something not a structure or union
> > >
> > >
> > > Do you wonder why ?
> > > thanks a lot
> > No ;-)
> >
> > You have to do something like this:
> >
> > #include "(path to file)/obex_main.h"
> >
> > .....
> >
> > getpeername( (struct obex *)handle->fd, ....)
> >
> > Ciao,
> >
> > Peter
> >
> >
> > >
> > >
> > >
> > >
> > >
> > > On 10/11/06, Peter Wippich <[email protected]> wrote:
> > > >
> > > >
> > > > Hi Andrea,
> > > >
> > > > On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> > > >
> > > > > what do you mean with "obex structure" ? which structure are you
> > > > referring ?
> > > > >
> > > > > andrea
> > > >
> > > > The structure defined in lib/obex_main.h It is not exported directly
> > by
> > > > the api, as far as I can see. The OBEX_Init() shall return a pointer
> > to
> > > > such a structure (defined as a void * for the API). It is not realy
> > good
> > > > style to access internal structure of the library, but I can see no
> > > > "official" way to get the bd_addr of a remote client (but may be I
> > missed
> > > > something).
> > > >
> > > > Ciao,
> > > >
> > > > Peter
> > > >
> > > >
> > > >
> > > > | Peter Wippich Voice: +49 30
> > 46776411 |
> > > > | G&W Instruments GmbH fax: +49 30
> > 46776419 |
> > > > | Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected]
> > |
> > > > | D-13355 Berlin /
> > Germany |
> > > >
> > > >
> > > >
> > -------------------------------------------------------------------------
> > > > 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
> > > >
> > >
> > >
> >
> >
> > | Peter Wippich Voice: +49 30 46776411 |
> > | G&W Instruments GmbH fax: +49 30 46776419 |
> > | Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
> > | D-13355 Berlin / Germany |
> >
> >
> > -------------------------------------------------------------------------
> > 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
> >
>
>
| Peter Wippich Voice: +49 30 46776411 |
| G&W Instruments GmbH fax: +49 30 46776419 |
| Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
| D-13355 Berlin / Germany |
-------------------------------------------------------------------------
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
including obex_main.h conflicts with the necessary inclusion in my code of
<openobex/obex.h>...
Moreover obex_main.h require all other header file of openobex libs to
compile...
is there any way to get out of all this ?
grazie
andrea
On 10/11/06, Peter Wippich <[email protected]> wrote:
>
>
> Hi,
>
>
> On Wed, 11 Oct 2006, Andrea Carlevato wrote:
>
> > ok,
> > i get that stratcure as "handle" with this call:
> >
> > obex_t *handle = NULL;
> > handle = OBEX_Init(OBEX_TRANS_BLUETOOTH, obex_event, 0);
> > ....
> > btobex_accept(handle);
> >
> > OK, but if i add this code:
> >
> > getpeername(handle->fd, &addr, &addr_len);
> >
> > my compiler gives me this error:
> >
> > > > > request for member 'fd' in something not a structure or union
> >
> >
> > Do you wonder why ?
> > thanks a lot
> No ;-)
>
> You have to do something like this:
>
> #include "(path to file)/obex_main.h"
>
> .....
>
> getpeername( (struct obex *)handle->fd, ....)
>
> Ciao,
>
> Peter
>
>
> >
> >
> >
> >
> >
> > On 10/11/06, Peter Wippich <[email protected]> wrote:
> > >
> > >
> > > Hi Andrea,
> > >
> > > On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> > >
> > > > what do you mean with "obex structure" ? which structure are you
> > > referring ?
> > > >
> > > > andrea
> > >
> > > The structure defined in lib/obex_main.h It is not exported directly
> by
> > > the api, as far as I can see. The OBEX_Init() shall return a pointer
> to
> > > such a structure (defined as a void * for the API). It is not realy
> good
> > > style to access internal structure of the library, but I can see no
> > > "official" way to get the bd_addr of a remote client (but may be I
> missed
> > > something).
> > >
> > > Ciao,
> > >
> > > Peter
> > >
> > >
> > >
> > > | Peter Wippich Voice: +49 30
> 46776411 |
> > > | G&W Instruments GmbH fax: +49 30
> 46776419 |
> > > | Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected]
> |
> > > | D-13355 Berlin /
> Germany |
> > >
> > >
> > >
> -------------------------------------------------------------------------
> > > 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
> > >
> >
> >
>
>
> | Peter Wippich Voice: +49 30 46776411 |
> | G&W Instruments GmbH fax: +49 30 46776419 |
> | Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
> | D-13355 Berlin / Germany |
>
>
> -------------------------------------------------------------------------
> 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
>
Hi,
On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> ok,
> i get that stratcure as "handle" with this call:
>
> obex_t *handle = NULL;
> handle = OBEX_Init(OBEX_TRANS_BLUETOOTH, obex_event, 0);
> ....
> btobex_accept(handle);
>
> OK, but if i add this code:
>
> getpeername(handle->fd, &addr, &addr_len);
>
> my compiler gives me this error:
>
> > > > request for member 'fd' in something not a structure or union
>
>
> Do you wonder why ?
> thanks a lot
No ;-)
You have to do something like this:
#include "(path to file)/obex_main.h"
.....
getpeername( (struct obex *)handle->fd, ....)
Ciao,
Peter
>
>
>
>
>
> On 10/11/06, Peter Wippich <[email protected]> wrote:
> >
> >
> > Hi Andrea,
> >
> > On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> >
> > > what do you mean with "obex structure" ? which structure are you
> > referring ?
> > >
> > > andrea
> >
> > The structure defined in lib/obex_main.h It is not exported directly by
> > the api, as far as I can see. The OBEX_Init() shall return a pointer to
> > such a structure (defined as a void * for the API). It is not realy good
> > style to access internal structure of the library, but I can see no
> > "official" way to get the bd_addr of a remote client (but may be I missed
> > something).
> >
> > Ciao,
> >
> > Peter
> >
> >
> >
> > | Peter Wippich Voice: +49 30 46776411 |
> > | G&W Instruments GmbH fax: +49 30 46776419 |
> > | Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
> > | D-13355 Berlin / Germany |
> >
> >
> > -------------------------------------------------------------------------
> > 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
> >
>
>
| Peter Wippich Voice: +49 30 46776411 |
| G&W Instruments GmbH fax: +49 30 46776419 |
| Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
| D-13355 Berlin / Germany |
-------------------------------------------------------------------------
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
ok,
i get that stratcure as "handle" with this call:
obex_t *handle = NULL;
handle = OBEX_Init(OBEX_TRANS_BLUETOOTH, obex_event, 0);
....
btobex_accept(handle);
OK, but if i add this code:
getpeername(handle->fd, &addr, &addr_len);
my compiler gives me this error:
>>> request for member 'fd' in something not a structure or union
Do you wonder why ?
thanks a lot
On 10/11/06, Peter Wippich <[email protected]> wrote:
>
>
> Hi Andrea,
>
> On Wed, 11 Oct 2006, Andrea Carlevato wrote:
>
> > what do you mean with "obex structure" ? which structure are you
> referring ?
> >
> > andrea
>
> The structure defined in lib/obex_main.h It is not exported directly by
> the api, as far as I can see. The OBEX_Init() shall return a pointer to
> such a structure (defined as a void * for the API). It is not realy good
> style to access internal structure of the library, but I can see no
> "official" way to get the bd_addr of a remote client (but may be I missed
> something).
>
> Ciao,
>
> Peter
>
>
>
> | Peter Wippich Voice: +49 30 46776411 |
> | G&W Instruments GmbH fax: +49 30 46776419 |
> | Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
> | D-13355 Berlin / Germany |
>
>
> -------------------------------------------------------------------------
> 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
>
Hi Andrea,
On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> what do you mean with "obex structure" ? which structure are you referring ?
>
> andrea
The structure defined in lib/obex_main.h It is not exported directly by
the api, as far as I can see. The OBEX_Init() shall return a pointer to
such a structure (defined as a void * for the API). It is not realy good
style to access internal structure of the library, but I can see no
"official" way to get the bd_addr of a remote client (but may be I missed
something).
Ciao,
Peter
| Peter Wippich Voice: +49 30 46776411 |
| G&W Instruments GmbH fax: +49 30 46776419 |
| Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
| D-13355 Berlin / Germany |
-------------------------------------------------------------------------
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
what do you mean with "obex structure" ? which structure are you referring ?
andrea
On 10/11/06, Peter Wippich <[email protected]> wrote:
>
>
> Hello Andrea,
>
> On Wed, 11 Oct 2006, Andrea Carlevato wrote:
>
> > Sorry Peter but using openobex libs i ve no socket there, only an
> > handle...How can i use getpeername() if i ve no socket to pass it ???
> >
> >
> > andrea
> >
> I've not used Oben Obex so far. But when I look at the source code of
> btobex_listen / btobex_accept / btobex_connect_request use sockets for
> bluetooth communication. And the file descriptor inside the obex structure
> is a socket file descriptor. Also you have an obex_transport structure
> which should already contain the source / destination addresses (not sure
> if this is realy the bluetooth address for BT transport, just had a short
> look).
>
> Ciao,
>
> Peter
>
>
> | Peter Wippich Voice: +49 30 46776411 |
> | G&W Instruments GmbH fax: +49 30 46776419 |
> | Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
> | D-13355 Berlin / Germany |
>
>
> -------------------------------------------------------------------------
> 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
>
Hello Andrea,
On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> Sorry Peter but using openobex libs i ve no socket there, only an
> handle...How can i use getpeername() if i ve no socket to pass it ???
>
>
> andrea
>
I've not used Oben Obex so far. But when I look at the source code of
btobex_listen / btobex_accept / btobex_connect_request use sockets for
bluetooth communication. And the file descriptor inside the obex structure
is a socket file descriptor. Also you have an obex_transport structure
which should already contain the source / destination addresses (not sure
if this is realy the bluetooth address for BT transport, just had a short
look).
Ciao,
Peter
| Peter Wippich Voice: +49 30 46776411 |
| G&W Instruments GmbH fax: +49 30 46776419 |
| Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
| D-13355 Berlin / Germany |
-------------------------------------------------------------------------
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
Sorry Peter but using openobex libs i ve no socket there, only an
handle...How can i use getpeername() if i ve no socket to pass it ???
andrea
On 10/11/06, Peter Wippich <[email protected]> wrote:
>
>
> Hi Andrea,
>
> usualy you use getpeername() to her the remote address of a socket.
>
> Ciao,
>
> Peter
>
> On Wed, 11 Oct 2006, Andrea Carlevato wrote:
>
> > Hello,
> > i ve a very simple question. I got a simple obex server code that runs
> > fine.I ve taken the obexserver sample souce code as a tamplate. Question
> is:
> > how/where can i get, on my server, the bt address of the client ??
> >
> > thanks a lot
> >
> > Andrea
> >
> >
>
>
> | Peter Wippich Voice: +49 30 46776411 |
> | G&W Instruments GmbH fax: +49 30 46776419 |
> | Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
> | D-13355 Berlin / Germany |
>
>
> -------------------------------------------------------------------------
> 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
>
Hi Andrea,
usualy you use getpeername() to her the remote address of a socket.
Ciao,
Peter
On Wed, 11 Oct 2006, Andrea Carlevato wrote:
> Hello,
> i ve a very simple question. I got a simple obex server code that runs
> fine.I ve taken the obexserver sample souce code as a tamplate. Question is:
> how/where can i get, on my server, the bt address of the client ??
>
> thanks a lot
>
> Andrea
>
>
| Peter Wippich Voice: +49 30 46776411 |
| G&W Instruments GmbH fax: +49 30 46776419 |
| Gustav-Meyer-Allee 25, Geb. 12 Email: [email protected] |
| D-13355 Berlin / Germany |
-------------------------------------------------------------------------
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