int l2cap_call_cmd(__u16 ocf_ogf,int dd, void *p_param){
cmd_state_request new_req,*p_new_req=&new_req;
__u16 sw_opcode;
- int remd_count;
+ int remd_count,ret_val;
sw_opcode=swap_2_bytes(ocf_ogf);
p_new_req->actual_status=ESTABLISHED;
p_new_req->id=cmd_req_id++;
printf("Mistake with req array adding \n ");
return -1;
}
- if((((connection_hci *)p_param)->handle=call_hci_create_connection_cmd(dd, &(((connection_hci *)p_param)->slave.bdaddr), &sw_opcode)) < 0){
+ if((ret_val=call_hci_create_connection_cmd(dd, &(((connection_hci *)p_param)->slave.bdaddr), &sw_opcode)) < 0){
printf("Mistake with inquiry cmd \n ");
return -1;
}
+ ((connection_hci *)p_param)->handle=ret_val;
((connection_hci *)p_param)->con_state=CONNECTED;
req_fcn_remove();
return 0;
int main(void){
struct hci_dev_info master,*p_master=&master;
bt_address remote_bd_addr_array[HCI_MAX_DEV];
- memset(remote_bd_addr_array,0,(sizeof(bt_address)*HCI_MAX_DEV));
connection_hci connection,*p_connection=&connection;
+ memset(remote_bd_addr_array,0,(sizeof(bt_address)*HCI_MAX_DEV));
+ bt_address prefered;
int remd_count,i;
cmd_req_id=0;
global_index=0;
}
p_connection->master=master;
p_connection->slave.bdaddr=remote_bd_addr_array[0];
-
+ //fill_add(&prefered,0x31,0x16,0xCA,0x72,0x02,0x00);
+ //p_connection->slave.bdaddr=prefered;
if(create_master_connection(p_connection)<0){
printf("connection error");
return -1;