RFCOMMChannel delegate OK, but getting no events\data (+)
RFCOMMChannel delegate OK, but getting no events\data (+)
- Subject: RFCOMMChannel delegate OK, but getting no events\data (+)
- From: "Serge Vasiljev" <email@hidden>
- Date: Tue, 11 Apr 2006 01:58:55 +0200
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