From owner-freebsd-mobile Tue Mar 25 12: 9: 1 2003 Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C213737B401 for ; Tue, 25 Mar 2003 12:08:57 -0800 (PST) Received: from scl8owa02.int.exodus.net (scl8out02.exodus.net [66.35.230.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2577643F75 for ; Tue, 25 Mar 2003 12:08:55 -0800 (PST) (envelope-from Maksim.Yevmenkin@cw.com) Received: from scl8owa01.int.exodus.net ([66.35.230.241]) by scl8owa02.int.exodus.net with Microsoft SMTPSVC(5.0.2195.5329); Tue, 25 Mar 2003 12:08:50 -0800 Received: from exodus.net ([165.193.27.35]) by scl8owa01.int.exodus.net over TLS secured channel with Microsoft SMTPSVC(5.0.2195.5329); Tue, 25 Mar 2003 12:08:49 -0800 Message-ID: <3E80B688.5060402@exodus.net> Date: Tue, 25 Mar 2003 12:05:28 -0800 From: Maksim Yevmenkin User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.1) Gecko/20021126 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: Pav Lucistnik Cc: mobile@FreeBSD.ORG Subject: Re: serial over bluetooth question References: <1048624885.1117.0.camel@pav.oook.cz> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 Mar 2003 20:08:49.0648 (UTC) FILETIME=[597E7F00:01C2F30A] X-Spam-Status: No, hits=-24.7 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,HTML_00_10,HTML_MESSAGE, QUOTED_EMAIL_TEXT,REFERENCES,REPLY_WITH_QUOTES, USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Pav Lucistnik wrote: > two questions: > > 1, how can i open serial connection to remote bluetooth device and how > to use such connection (terminal, gnokii, pilot-link ...) assuming you mean RFCOMM :) to open RFCOMM connection: s = socket(AF_BLUETOOTH, BLUETOOTH_PROTO_RFCOMM); local.rfcomm_len = sizeof(local); local.rfcomm_family = AF_BLUETOOTH memcpy(&local.rfcomm_bdaddr, NG_HCI_BDADDR_ANY, sizeof(bdaddr_t)); local.rfcomm_channel = 0; bind(s, (struct sockaddr *) &local, sizeof(local)); remote.rfcomm_len = sizeof(remote); remote.rfcomm_family = AF_BLUETOOTH; memcpy(&remote.rfcomm_bdaddr, , sizeof(bdaddr_t)); remote.rfcomm_channel = ; connect(s, (struct sockaddr *) &remote, sizeof(remote)); now is connected to via RFCOMM to the serial port on the other side :) just to read(2)/write(2) to send/receive data. check the sources for rfcomm_pppd(8). what it does is 1) open RFCOMM connection (socket) 2) fork()s 3) redirects RFCOMM socket to stdin/stdout 4) executes PPP in -direct mode (i.e. PPP uses stdin/stdout) if gnokii, pilot-link etc. support "-direct" mode (i.e. they can use stdin/stdout) then you simply repeat steps 1-3 above and execute gnokii, pilot-link etc. in step 4. if not then you can use nmdm(4) driver. connect master side to the RFCOMM socket and use slave side in gnokii, pilot-link etc. > 2, what is hcseriald good for? hcseriald(8) is for supervising serial (i.e. UART-based) Bluetooth devices. such Bluetooth devices (for example Xircom CBT card) are recognized as serial ports (modems) by sio(4) driver. hcseriald(8) opens /dev/cuaa### and pushes H4 line discipline thus coverting serial device into Netgraph node. thanks, max To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message