Hi,

I'm attempting to retrieve the bdaddr of a device which is sending a
file with OBEX to the obexpushd daemon. I use OBEX_GetFD() and
getpeername(). Here is the function i'm using:

 int get_bdaddr(obex_t *handle, char *str) {
        int                     fd;
        struct  sockaddr_rc     sa;
        socklen_t               len = sizeof(sa);

     if( getpeername(handle,(struct sockaddr *)&sa,&len) < 0 )
                 return 0;
        ba2str(&sa.rc_bdaddr,str);
        printf("\n\tADDRESS: %s\n", str);
        printf("\tchannel: %d\n", sa.rc_channel);
         printf("\tfamily: %d\n", sa.rc_family);
        return 1;
}


and here is how I call the function from the code:

        if (intf & (1 << INTF_BLUETOOTH)) {
             fd = OBEX_GetFD(BT_HANDLE);
            printf("about to get_bdaddr...\n");
            get=get_bdaddr(fd,str);
            printf("\n\tADDRESS2: %s\n", str);
        }



The channel and family values appear to be correct (channel is 9) but
the problem is that the address value is: 00:00:00:00:00

Does anybody know how I can get the actual bdaddr of the sending device?

regards,

Stephen.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to