I am an university student currently doing a final project and I am a newbie in xcode programming. I am going to write a program with xcode that could sends at command using bluetooth and recieve response (like hyper terminal in windows). The input and the output are both 2 NSTextField (1 for input, 1 for output). For my first try, I learned from the example that bundled with mac os 10.3. Would you please explain me how to implement that code? Where should I put the code? This is the code I have written so far: IOBluetoothRFCOMMChannel *mRFCOMMChannel; IOBluetoothDevice *selectedDevice; 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]; [mRFCOMMChannel writeSync:"at+cmgf=1/n" length:16]; Do I make mistakes? Thanks for your help. --- Marco Pontil <mpontil@apple.com> wrote:
Since you correctly registered yourself as delegate
of the channel you
should implement:
-
(void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel
data:(void *)dataPointer length:(size_t)dataLength;
to receive data. There are more delegate methods you
may need, the full
list of delegate methods for an RFCOMM channel are
toward the end of
IOBluetoothRFCOMMChannel.h
... Marco
On Apr 12, 2004, at 10:46 PM, Nathanael P wrote:
I want to enter at commands to mobile phone using
bluetooth. I wrote the program on xcode. I have
opened
a rfcomm channel synchronously:
[selectedDevice
openRFCOMMChannelSync:&mRFCOMMChannel
withChannelID:10 delegate:self];
[mRFCOMMChannel retain];
I have a problem:
I've tried to enter the at commands using
writeSync,
but there's no response. I have no idea how to
read
the incoming data from the mobile phone. How to
write
the at commands and read the incoming data?
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
_______________________________________________
bluetooth-dev mailing list |
bluetooth-dev@lists.apple.com
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 |
bluetooth-dev@lists.apple.com
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/bluetooth-dev
Do not post admin requests to the list. They will be
ignored.
__________________________________ Do you Yahoo!? Yahoo! Tax Center - File online by April 15th http://taxes.yahoo.com/filing.html _______________________________________________ bluetooth-dev mailing list | bluetooth-dev@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/bluetooth-dev Do not post admin requests to the list. They will be ignored.