How extract client address on server ??

  • andrea_cc

    andrea_cc - 2006-10-11

    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

    • TreNrod

      TreNrod - 2008-01-03

      I know that this Thread is quite old, but actuelly it was the first i found when i had the same problem... so.

      I cant remember the link where i found a short desc about it. But the version i used is...

      * Lese BD von Client aus
      int get_bdaddr(obex_t *handle, char *str) {
              int     fd;
              struct  sockaddr_rc     client_saddr;
              socklen_t               len = sizeof(struct sockaddr_rc);

              fd = OBEX_GetFD(handle);
              if( fd < 0 ){
                      return 0;

              if( getpeername(fd, (struct sockaddr *)&client_saddr, &len) ){
                      return 0;


      As you usually will know, handle is the pointer from client and str stores the BD-Client address. And dont forget to include rfcomm ;).
      I tried this in the obexpushd0.5 after and it worked.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks