|
| Re: Hardcoding a device's address |
 |
Sun, 25 Jun 2006 23:05:12 -070 |
Hi,
Try doing a discovery of a device with a known BdAddr and dumping out the
octets of the BdAddr. My guess is that the octets are not ordered in the
way you might expect; they might be reversed or byte-swapped. I think
there was a posting to this forum a while back that explained this.
Regards,
Peter
|
| Post Reply
|
| RE: Hardcoding a device's address |
 |
Mon, 26 Jun 2006 09:13:49 +120 |
I'll be doing the same thing today or tomorrow, so I'll watch this
thread closely.
I'll be sure to post if I find a working solution.
-----Original Message-----
From: bounce-507244-89538@news.palmos.com
[mailto:bounce-507244-89538@news.palmos.com] On Behalf Of Jevin Maltais
Sent: Sunday, 25 June 2006 6:06 a.m.
To: Bluetooth Forum
Subject: Hardcoding a device's address
Hey everyone,
I would like to hardcode the address of the device I am connecting to as
it won't change and so I can skip the discovery stage. I'm using a
modified version of Peter's BTSerialSample program.
This program works fine (hope the formatting is okay):
static BtLibDeviceAddressType gBdAddr; // BSSa: device address
err = PrvBtOpenLibAndRegisterCallback();
if(err)
return;
/*-------------------------------------------------------*/
/* Discover the Bluetooth remote device */
/*-------------------------------------------------------*/
err = BtLibDiscoverSingleDevice(
gBtLibRefNum, // Reference number for
Bluetooth library
NULL, // NULL =>
default text is "Select a device:"
NULL, // No filter
0, // 0
filters
&gBdAddr, // Address of
the selected device
true, // Display name,
not address
false); // don't ignore
the parameters
PrvBtUnregisterCallbackAndCloseLib();
config.function = 0;
// Must be zero
config.drvrDataP = (MemPtr)&btParams;
config.drvrDataSize = sizeof(BtVdOpenParams);
btParams.role = btVdClient;
// We are the client side
btParams.u.client.method = btVdUseUuidList; // Use
SDP
// Set up the remote address (can be null if not initialized)
btParams.u.client.remoteDevAddr.address[0] = gBdAddr.address[0];
btParams.u.client.remoteDevAddr.address[1] = gBdAddr.address[1];
btParams.u.client.remoteDevAddr.address[2] = gBdAddr.address[2];
btParams.u.client.remoteDevAddr.address[3] = gBdAddr.address[3];
btParams.u.client.remoteDevAddr.address[4] = gBdAddr.address[4];
btParams.u.client.remoteDevAddr.address[5] = gBdAddr.address[5];
sppUuid.size = btLibUuidSize16;
sppUuid.UUID[0] = 0x11;
sppUuid.UUID[1] = 0x01;
btParams.u.client.u.uuidList.tab = &sppUuid; // the
list of service uuids
btParams.u.client.u.uuidList.len = 1; // the
number of uuids
in the list
err = SrmExtOpen(
sysFileCVirtRfComm,
&config,
sizeof(config),
&gBtPortId
);
but if I try to change it to:
btParams.u.client.remoteDevAddr.address[0] = 0x00;
btParams.u.client.remoteDevAddr.address[1] = 0xA0; ...
I get the error: serErrConfigurationFailed - The port needs time to
configure, and the configuration has failed. I'll take any hints I can
get.
--
Jevin Maltais [jevin@techie.com]
http://jevy.org
--
For information on using the PalmSource Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/support/forums/
###################################################################
WARNING: This email may contain information which is confidential
and may be privileged. If you are not the intended recipient,
you must not read, use, copy or distribute this email or its
attachments (if any). If you have received this email in error,
please notify us immediately by return email, facsimile or
telephone (you may call us collect) and
delete this email - Thank you
###################################################################
|
| Post Reply
|
|
|
|
|
|
|
|
|
|