|
Posted by Tim Wallace on September 1, 2005, 8:50 am
Please log in for more thread options Next obvious question...is the Bluetooth radio on?
Tim
> Hi!
>
> Yes, I do. In fact, the step that fails is the first step. This is
> rougly what happens:
>
> SOCKET bth_socket = ::socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);
> SOCKADDR_BTH name = { 0 };
> int nameLen = sizeof(name);
>
> name.addressFamily = AF_BTH;
> name.port = BT_PORT_ANY;
>
> if(::bind(bth_socket, (const sockaddr*)&name, nameLen) == SOCKET_ERROR)
> {
> // I don't want to get here :(
> }
>
> // connect
> // listen
> // WSASetService
> // etc...
>
> Any idea why I can't bind the socket? It says that the address is not
> valid on the local machine, which seams absurd since I set the port to
> auto-select. If I use a fixed port, it will always claim that the
> address is already in use. The only idea I have, is that the AF_BTH
> address family is not valid, i.e. it is not possible to host custom
> services. Ideas?
>
> Regards,
> Nille
>
> Tim Wallace wrote:
>> Are you following the steps for Registering a BT service as outlined in
>> MS
>> documentation?
>>
>> Tim
>>
>> > Hi!
>> >
>> > Is it possible to "advertise" bluetooth services on a smartphone (Qtek
>> > S100 running Windows Mobile 2003, Second Edition v4.21.1088)? I'm
>> > trying to programmatically advertise a custom service through the
>> > Winsock interface, but it refuses to allow me to bind the socket (it
>> > claims that the address is not valid on the local computer). It works
>> > on XP, of course.
>> >
>> >
>> > Ideas?
>> >
>> >
>> > Thanks in advance,
>> > Andreas Nilsson
>> >
>> >
>> >
>
|