Re: RFCOMMChannel delegate OK, but getting no events\data (+)
Re: RFCOMMChannel delegate OK, but getting no events\data (+)
- Subject: Re: RFCOMMChannel delegate OK, but getting no events\data (+)
- From: Joseph Kelly <email@hidden>
- Date: Mon, 10 Apr 2006 17:20:43 -0700
Sergey,
which delegate methods are failing? -rfcommChannelData:data:length?
As long as you are doing -writeSync: you probably should not be
receiving -rfcommChannelWriteComplete calls.
joe
On Apr 10, 2006, at 4:58 PM, Serge Vasiljev wrote:
hi All,
I'm very new one in Mac world and Objective-C is ... a bit unusual
for a while.
I'm trying to write a simple application to send a SMS\dial a
number on my mobile via BT conncetor in my iMac.
all logic looks like this:
.....
BTConnector *con = [[BTConnector alloc] init];
[con connect];
[con sendMessage: @"ATD01636158713\r"];
sleep(10);
[con disconnect];
....
***************************************************
connect with BT device:
....
// lookup device via address
IOBluetoothNSStringToDeviceAddress(@"00-0A-D9-EC-0D-28",
&btAddress);
btDevice = [IOBluetoothDevice withAddress: &btAddress];
// find service
// here I'm looking for
// kBluetoothSDPUUID16ServiceClassDialupNetworking
IOBluetoothSDPServiceRecord *dialupServiceRecord;
BluetoothRFCOMMChannelID rfcommChannelID;
dialupServiceRecord = [btDevice getServiceRecordForUUID:
[IOBluetoothSDPUUID uuid16:
kBluetoothSDPUUID16ServiceClassDialupNetworking]];
[dialupServiceRecord getRFCOMMChannelID:&rfcommChannelID];
// open channel
result = [btDevice openRFCOMMChannelSync:&btChannel
withChannelID:rfcommChannelID delegate: self];
if(kIOReturnSuccess != result)
printf("FAILED channel\n");
else
printf("OK channel\n");
// deligate
result = [btChannel setDelegate:self];
if(kIOReturnSuccess != result)
printf("FAILED deligate\n");
else
printf("OK deligate\n");
[btChannel retain];
.....
***************************************************
send message to BT device:
.... (do MTU check)
[btChannel writeSync:buffer length:numBytesToSend]
my sytems:
iMac (Intel)
Mac OS X 10.4.6
Any help very appretiate - I'm quite confused :(.
// Sergey
_______________________________________________
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
_______________________________________________
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