+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include<sys/socket.h>
-#include<asm/types.h>
-#include "hcidriver.h"
-
-#define BTPROTO_HCI 1
-
-
-
-int main(void){
- int sock,sock2;
- sockaddr_hci address,address2;
-
- if((sock=socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI))<0){
- printf("first socket: %d wasn't created\n",sock);
-
- }
-
- if((sock2=socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI))<0){
- printf("second socket: %d wasn't created\n",sock2);
- }
-
- memset(&address,0,sizeof(address));
- address.hci_family=AF_BLUETOOTH;
- address.dev_id=0;
-
- memset(&address2,0,sizeof(address2));
- address2.hci_family=AF_BLUETOOTH;
- address2.dev_id=1;
-
- if(bind(sock,(struct sockaddr *) &address, sizeof(address))<0){
- printf("Socket: %d wasn't binded\n",sock);
- close(sock);
- return -1;
- }
- printf("Socket: %d was binded\n",sock);
-
- if(bind(sock2,(struct sockaddr *) &address2, sizeof(address2))<0){
- printf("Socket: %d wasn't binded\n",sock2);
- close(sock2);
- return -1;
- }
- printf("Socket: %d was binded\n",sock2);
-
-
- printf("Value of sock is now %d \n",sock);
- printf("Value of sock2 is now %d \n",sock2);
- close(sock);
- printf("Socket: %d was closed\n",sock);
- return 0;
-}
-