From owner-freebsd-bluetooth@FreeBSD.ORG Fri Apr 20 13:34:18 2007 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DBAE16A403 for ; Fri, 20 Apr 2007 13:34:18 +0000 (UTC) (envelope-from jackt123@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.233]) by mx1.freebsd.org (Postfix) with ESMTP id 2EA9B13C487 for ; Fri, 20 Apr 2007 13:34:18 +0000 (UTC) (envelope-from jackt123@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so932362wxc for ; Fri, 20 Apr 2007 06:34:17 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=mHoqrV5BHRfPD1Nb+Y3pdrROZDV2gKfHCwuk4XYcaaoU4fneFcj4hU5aaeUkRAv0Cz4MYUousuqoIYQ0sz9twWZ0aJQ7zpf1aDsGM0xgI8i4OcKeGEjuIoOCioW9Mu7epI71I3UD5TsxntVn7YiR+IYZxhkobr1mU49frLL4njs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=AtlKTMbO9+nklquYSy9yenHI0cCiaGEl4powX5Zcsp3JyRGJaLrLj21bHsLEyY4sBXQbJNafAGRr71lfwc6QwE+AnjgJfRO9lUoG/d0LwPG+g60Z4GqmC+I41aQ1Afw34SlmFtL2d4k99XH8+iiavwnJHvPWZ/7yTFXfqRHHlF8= Received: by 10.70.87.11 with SMTP id k11mr5468562wxb.1177074389254; Fri, 20 Apr 2007 06:06:29 -0700 (PDT) Received: by 10.70.12.5 with HTTP; Fri, 20 Apr 2007 06:06:29 -0700 (PDT) Message-ID: Date: Fri, 20 Apr 2007 13:06:29 +0000 From: "Jack T" To: freebsd-bluetooth@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: ng_btsocket_rfcomm_receive_msc: Got MSC on dlci=18 in invalid state=5 X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Apr 2007 13:34:18 -0000 Hi all: As part of my class project, I chose to write a simple application using the Bluetooth Stack on FreeBSD. My first task is to generate and receive OBEX messages. Here is my code, and it does work (I get the correct reply codes from my Bluetooth cellphone), but each time after my program ends, the FreeBSD console emits the following 2 messages: ng_btsocket_rfcomm_receive_msc: Got MSC on dlci=18 in invalid state=5 ng_btsocket_rfcomm_receive_dm: Got DM for non-existing dlci=18 Could someone point me in the right direction on where I'm doing wrong? Thank you! -- Here is the code for sending OBEX Connect -- // Populate my bluetooth socket struct sockaddr_rfcomm me; bzero(&me, sizeof(me)); me.rfcomm_family = AF_BLUETOOTH; me.rfcomm_channel = 0; // Populate peer bluetooth socket struct sockaddr_rfcomm peer; bzero(&peer, sizeof(peer)); peer.rfcomm_family = AF_BLUETOOTH; peer.rfcomm_channel = 9; bt_aton(peerAddress, &(peer.rfcomm_bdaddr)); // connect int f = socket(AF_BLUETOOTH, SOCK_STREAM, BLUETOOTH_PROTO_RFCOMM); if (bind(f, (void*)(&me), sizeof(me))!=0) { error... } if (connect(f, (void*)(&peer), sizeof(peer))!=0) { error... } // Send "CONNECT MSG" {Length=7; Version=0x10; Flags=0; MaxPacket=255} unsigned char x[128] = { 0x80, 0, 7, 0x10, 0, 0, 0xff }; if (write(f,x,7)!=7) { error... } // Read the reply if (read(f,x,7)!=7) { error... } printf("peer version = %d\n", (int)(x[3])); printf("peer flag = 0x%02X\n", (int) (x[4])); printf("max packet size = %d\n", (int)m); fflush(stdout);