009
05.12.2002, 20:47 Uhr
void*
Generic Pointer (Operator)
|
Hallo!
Hier nun den sehnlich erwartete Code:
C++: |
#define QUEUE_SIZE 10
// ...
int Server(char *bluetoothAddress) { int error=0, localSocket, remoteSocket, sizeRemote; struct sockaddr_l2 localSockAddrBt, remoteSockAddrBt;
localSocket=socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); localSockAddrBt.l2_family=AF_BLUETOOTH; bacpy(&(localSockAddrBt.l2_bdaddr), strtoba(bluetoothAddress)); localSocketAddrBt.l2_psm=htobs(10); // <= Brauche das hier!
// just to check... printf("Bluetooth address is: %s\n", batostr((remoteSockAddrBt.l2_bdaddr)));
if(-1!=localSocket) { if(-1!=bind(localSocket, (struct sockaddr *)&localSockAddrBt, sizeof(localSockAddrBt))) { if(-1!=listen(localSocket, QUEUE_SIZE)) // ...
|
-- Gruß void* Dieser Post wurde am 05.12.2002 um 22:46 Uhr von void* editiert. |