Problems with rfcomm event listener
Problems with rfcomm event listener
- Subject: Problems with rfcomm event listener
- From: Erik Juto <email@hidden>
- Date: Sat, 13 May 2006 15:38:25 +0200
Hi!
We're building a robot in school and I'm writing a Carbon application
in C++ to get and display data from the robot. I've successfully
established a connection and I get data from the robot. We use the
bluetooth rfcomm as a 8 bit serial cable.
I want to do something like this, pseudo code:
rfcommeventlistener() {
on new Data event:
data = event->u.data.dataPtr
if ( data == 0xFA )
display ( " detection on sensor x")
else if ( data == 0xFB )
display ( "detection on sensor y" )
}
What I CAN do is, pseudo code again:
rfcommeventlistener() {
on new Data event:
data = event->u.data.dataPtr
display ( data )
}
Everything works except the comparation between data and a constant.
The data block pointed on by event->u.data.dataPtr seems to be
somewhat random in size and not 8 bits as i expect (wrong?).
What should I do to get the comparation work?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden