• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sending AVRCP Commands
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending AVRCP Commands


  • Subject: Re: Sending AVRCP Commands
  • From: Roman Pixell <email@hidden>
  • Date: Tue, 8 Sep 2009 10:12:53 +0200

dear josh,

i think that so far, there is not a single A2DP/AVRCP headset that is fully compatible with OS X or iphone for that matter. at least i didnt hear about ANY headset hat gives you full compatibility. right now, the music pauses only if you take an incoming phone call. the music is then resumed after hanging up.

/ ®

On 8 sep 2009, at 04.36, Joshua Brickner wrote:

I'm trying to learn how to write commands to a bluetooth device using the IOBluetooth framework. I've gotten as far as discovering, pairing, and connecting with the device. I'm at the point where I have an L2CAP channel open and I'm using - (IOReturn)writeSync:(void *)data length:(UInt16)length; to send data.

My problem is figuring how to send the specific command that I want. I'm using the AVRCP profile, and the device I'm working with is a media player. For starters I just want to send a play command. From reading the spec for AVRCP I'm pretty sure that this example is what I'm going for: http://imgur.com/K9uUG.png

Here is the code I have so far, but it doesn't seem to work. The data goes through and I get back a seemingly random set of data (usually something like: 0x480010) Can anyone give me some pointers? I haven't had much experience with this lower level C stuff such as hex and the like, but I'm eager to learn.

- (IBAction) play:(id)sender {
	IOReturn ret;
	int i;

	const char data[5] = {0x00, 0x48, 0x7C, 0x44, 0x00};
	unsigned int length = 5;
	unsigned char buf[5];
	memset(buf,0,5);
	memcpy(buf, data, length);

	printf ("send=:", length);
		for(i=0 ; i<length ; i++) {
			printf(" X", buf[i]);
		}
	printf("\n");

	for (i = 0; i < 10; i++){
		ret = [l2channel writeSync:buf length:length];
		if (kIOReturnSuccess == ret)
			break;
		usleep(10000);
	}

}

Cheers
-Josh
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@pixell.net


This email sent to email@hidden

med vänliga hälsningar / warmest regards,

/ ®

roman pixell
http://www.linkedin.com/in/pixell

http://emoticards.com/ [LIVE!]

emoticards AB
kåkbrinken 11a 3tr
111 27 stockholm

mailto://email@hidden
skype://romanpixell?call
http://twitter.com/d0pp13r
callto://+46709103551

_______________________________________________
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


References: 
 >Sending AVRCP Commands (From: Joshua Brickner <email@hidden>)

  • Prev by Date: Sending AVRCP Commands
  • Next by Date: Bluetooth on Snow Leopard
  • Previous by thread: Sending AVRCP Commands
  • Next by thread: Bluetooth on Snow Leopard
  • Index(es):
    • Date
    • Thread