Re: Still confuse about rfcomm send and receive.....
Re: Still confuse about rfcomm send and receive.....
- Subject: Re: Still confuse about rfcomm send and receive.....
- From: Marco Pontil <email@hidden>
- Date: Mon, 24 May 2004 09:26:57 -0700
Nathanael,
what they told you is correct, you need to add to the object that
calls "selectedDevice openRFCOMMChannelSync" a method called
"rfcommChannelData":
(void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel
data:(void *)dataPointer length:(size_t)dataLength;
because you passed "self" as delegate in openRFCOMMChannelSync the
rfcomm channel will automatically call your implementation of
rfcommChannel
Data:data:length: everytime it gets new data.
... Marco
On May 24, 2004, at 7:46 AM, Nathanael P wrote:
Hi everyone..
I am a student of a college in Indonesia, and I am
currently doing a final task. I am a newbie in mac
programming. For my final task, I want to build a
bluetooth communication between my se t610 and my mac.
I have built a rfcomm sync connection, but I do not
how to receive the response from what I have sent. I
have asked to bluetooth developer mailing list, they
told me to set the callback from setdelegate: and use
this function:
(void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel
data:(void *)dataPointer length:(size_t)dataLength;
But I do not know how to use it both. Currently, this
is what i have done:
IOBluetoothDeviceSelectorController *deviceSelector;
NSArray *deviceArray;
deviceSelector = [IOBluetoothDeviceSelectorController
deviceSelector];
[deviceSelector runModal];
deviceArray = [deviceSelector getResults];
selectedDevice = [deviceArray objectAtIndex:0];
[selectedDevice openRFCOMMChannelSync:&mRFCOMMChannel
withChannelID:10 delegate:self];
[mRFCOMMChannel retain];
char *s1 = "at+cmgf=1\r";
[mRFCOMMChannel writeSync:s1 length:strlen(s1)];
char *s2 = "at+cmgl=\"all\"\r";
[mRFCOMMChannel writeSync:s2 length:strlen(s2)];
These code is learned from the example that comes
along with project builder. I'd be so grateful if
anyone could explain me.
Thanks a lot,
Nathanael
__________________________________
Do you Yahoo!?
Yahoo! Domains Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer
_______________________________________________
bluetooth-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/bluetooth-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
bluetooth-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/bluetooth-dev
Do not post admin requests to the list. They will be ignored.