Return-Path: Message-ID: From: "Gloria Saripah Patara" To: bluez-users@lists.sourceforge.net In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_94079_29669233.1148453356353" References: Subject: [Bluez-users] Found errors Sender: bluez-users-admin@lists.sourceforge.net Errors-To: bluez-users-admin@lists.sourceforge.net Reply-To: bluez-users@lists.sourceforge.net List-Unsubscribe: , List-Id: BlueZ users List-Post: List-Help: List-Subscribe: , List-Archive: Date: Wed, 24 May 2006 13:49:16 +0700 ------=_Part_94079_29669233.1148453356353 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, Friends. I want ask you, about error messages. Did you find this kind of message? -------- Can't establish OBEX connection : Host is down ----------- I use perror to print the message. And function that raises the message is BtOBEX_TransportConnect(...., ...., ....., ....) inside this message i attached my code. --------------------- Thanks in advance ------=_Part_94079_29669233.1148453356353 Content-Type: application/octet-stream; name=main.c Content-Transfer-Encoding: 7bit X-Attachment-Id: f_enlb4jwo Content-Disposition: attachment; filename="main.c" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "goep.h" #include "ftp.h" void send_file(int od, char *fileName) { struct stat st; unsigned char *data; int fd; fd = open(argv[0], O_RDONLY); if (fd < 0) { printf("Can't open file %s\n", fileName); return; } if (fstat(fd, &st) < 0) { printf("Can't get size of file %s\n", fileName); close(fd); return; } data = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); if (!data) { printf("Can't mmap file %s\n", fileName); close(fd); return; } if (obex_put(od, NULL, basename(fileName), data, st.st_size) == 0) { printf("%lu bytes sent\n", st.st_size); } munmap(data, st.st_size); close(fd); } bdaddr_t get_client(){ inquiry_info *ii = NULL; int max_rsp; max_rsp = 255; ii = (inquiry_info*)malloc(max_rsp * sizeof(inquiry_info)); free(ii); return (ii->bdaddr); } int main(){ bdaddr_t src, dest; int mode, od; char *fileName = "bt.sol"; bacpy(&src, BDADDR_ANY); if ((od = obex_open(&src, &get_client(), channel)) < 0) { perror("Can't establish OBEX connection"); exit(1); } mode = OBEX_FILE_TRANSFER; obex_connect(od, mode); printf("Connected\n"); //transferring file send_file(); obex_disconnect(od); printf("Disconnected.\n"); obex_close(od); return 0; } ------=_Part_94079_29669233.1148453356353-- ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ Bluez-users mailing list Bluez-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bluez-users