Date: Fri, 20 Apr 2007 13:06:29 +0000 From: "Jack T" <jackt123@gmail.com> To: freebsd-bluetooth@freebsd.org Subject: ng_btsocket_rfcomm_receive_msc: Got MSC on dlci=18 in invalid state=5 Message-ID: <a1ef274e0704200606i3381c864tc4057bee2989afa4@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a1ef274e0704200606i3381c864tc4057bee2989afa4>