| View previous topic :: View next topic |
| Author |
Message |
Cliff
Joined: 29 Nov 2006 Posts: 3
Digg It |
Posted: Fri Dec 01, 2006 4:59 pm Post subject: |
|
|
Not yet.
Working on that part. |
|
| Back to top |
|
 |
djork
Joined: 01 Dec 2006 Posts: 7
Digg It |
Posted: Fri Dec 01, 2006 7:49 pm Post subject: |
|
|
| Hey, I've been pursuing the same thing all day. I don't know Bluetooth, so this is brand new to me... but after abandoning a RFCOMM channel for the L2CAP channel code you posted I am having a little more success. One problem: my interrupt channel never connects. |
|
| Back to top |
|
 |
momo_the_monster
Joined: 01 Dec 2006 Posts: 1
Digg It |
Posted: Fri Dec 01, 2006 8:27 pm Post subject: |
|
|
| Took a couple of tries on my MacBookPro (1 crash, 4 failed attempts) but I got it to pair! Woot! |
|
| Back to top |
|
 |
djork
Joined: 01 Dec 2006 Posts: 7
Digg It |
Posted: Fri Dec 01, 2006 8:56 pm Post subject: |
|
|
| New progress. I am getting info coming across some channel, but it only appears to be a counter. It increments (like 0x18, 0x20, 0x28, 0x30) with each button press, no matter what it is. It's printing out as channel 214, but that can't be right. Maybe it's a problem with my paltry knowledge of C data types and printf...? |
|
| Back to top |
|
 |
djork
Joined: 01 Dec 2006 Posts: 7
Digg It |
Posted: Sat Dec 02, 2006 2:25 am Post subject: |
|
|
Mmmmkay, when sending the data to light up a player LED with writeSync:length: do I want to send the whole shebang (0x0a1110) or just 0x10 over L2CAP channel 0x11?
Nevermind, I'm way off. HID is a different protocol from L2CAP. Maybe I need to try RFCOMM? Serial? |
|
| Back to top |
|
 |
geoff
Joined: 01 Dec 2006 Posts: 1
Digg It |
Posted: Sat Dec 02, 2006 7:31 am Post subject: |
|
|
djork:
I had a similar issue with incrimenting values but realized it was a mis-placed parenthesis.
Basically to get the button code (which you can find here) you'd want something like:
| Code: | | int button = ((unsigned int)(*(unsigned char*)(dataPointer+2)) * 0x100 + (unsigned int)(*(unsigned char*)(dataPointer+3))); |
Though that's admittedly quite ugly. Also of note is that combinations of buttons can come in any form. For instance A+B = 0x0C (cute huh?).
Still playing with this little guy. Haven't tried sending anything yet, though i'm itching to try once my brain turns back on tomorrow morning.[/url] |
|
| Back to top |
|
 |
lucas
Joined: 25 Nov 2006 Posts: 4
Digg It |
Posted: Sat Dec 02, 2006 11:04 am Post subject: |
|
|
Or you can do:
| Code: | | unsigned short button = *(unsigned short *)(dataPointer + 2); |
I've found that deleting the remote from the device pairing history seems to help the problem of the interrupt channel not opening correctly. |
|
| Back to top |
|
 |
|