Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTDriver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTDriver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTDriver.cpp b/noncore/settings/networksettings2/opietooth2/OTDriver.cpp index a7ee662..cfd0491 100644 --- a/noncore/settings/networksettings2/opietooth2/OTDriver.cpp +++ b/noncore/settings/networksettings2/opietooth2/OTDriver.cpp | |||
@@ -692,53 +692,53 @@ QString OTDriver::getPeerName( const OTDeviceAddress & PAddr ) { | |||
692 | } | 692 | } |
693 | 693 | ||
694 | return QString( name ); | 694 | return QString( name ); |
695 | } | 695 | } |
696 | 696 | ||
697 | long OTDriver::getLinkQuality( const OTDeviceAddress & Addr ) { | 697 | long OTDriver::getLinkQuality( const OTDeviceAddress & Addr ) { |
698 | struct hci_conn_info_req *cr; | 698 | struct hci_conn_info_req *cr; |
699 | struct hci_request rq; | 699 | struct hci_request rq; |
700 | read_rssi_rp rp; | 700 | read_rssi_rp rp; |
701 | uint16_t handle; | 701 | uint16_t handle; |
702 | 702 | ||
703 | if( ! open() ) { | 703 | if( ! open() ) { |
704 | return 0; | 704 | return 0; |
705 | } | 705 | } |
706 | 706 | ||
707 | cr = (struct hci_conn_info_req *)malloc( | 707 | cr = (struct hci_conn_info_req *)malloc( |
708 | sizeof(*cr) + sizeof(struct hci_conn_info)); | 708 | sizeof(*cr) + sizeof(struct hci_conn_info)); |
709 | if (!cr) | 709 | if (!cr) |
710 | return 0; | 710 | return 0; |
711 | 711 | ||
712 | bacpy( &(cr->bdaddr), &(Addr.getBDAddr()) ); | 712 | bacpy( &(cr->bdaddr), &(Addr.getBDAddr()) ); |
713 | cr->type = ACL_LINK; | 713 | cr->type = ACL_LINK; |
714 | 714 | ||
715 | if (ioctl( fd(), HCIGETCONNINFO, (unsigned long) cr) < 0) { | 715 | if (ioctl( fd(), HCIGETCONNINFO, (unsigned long) cr) < 0) { |
716 | odebug << "Get connection info failed" << oendl; | 716 | odebug << "Get NetworkSetup info failed" << oendl; |
717 | free(cr); | 717 | free(cr); |
718 | return 0; | 718 | return 0; |
719 | } | 719 | } |
720 | 720 | ||
721 | handle = htobs(cr->conn_info->handle); | 721 | handle = htobs(cr->conn_info->handle); |
722 | 722 | ||
723 | free(cr); | 723 | free(cr); |
724 | 724 | ||
725 | memset(&rq, 0, sizeof(rq)); | 725 | memset(&rq, 0, sizeof(rq)); |
726 | rq.ogf = OGF_STATUS_PARAM; | 726 | rq.ogf = OGF_STATUS_PARAM; |
727 | rq.ocf = OCF_READ_RSSI; | 727 | rq.ocf = OCF_READ_RSSI; |
728 | rq.cparam = &handle; | 728 | rq.cparam = &handle; |
729 | rq.clen = 2; | 729 | rq.clen = 2; |
730 | rq.rparam = &rp; | 730 | rq.rparam = &rp; |
731 | rq.rlen = GET_LINK_QUALITY_RP_SIZE; | 731 | rq.rlen = GET_LINK_QUALITY_RP_SIZE; |
732 | 732 | ||
733 | if (hci_send_req( fd(), &rq, 100) < 0) { | 733 | if (hci_send_req( fd(), &rq, 100) < 0) { |
734 | odebug << "Get connection info failed" << oendl; | 734 | odebug << "Get NetworkSetup info failed" << oendl; |
735 | return 0; | 735 | return 0; |
736 | } | 736 | } |
737 | 737 | ||
738 | if( rp.status ) { | 738 | if( rp.status ) { |
739 | odebug << QString().sprintf("HCI get_link_quality cmd failed (0x%2.2X)", rp.status) << oendl; | 739 | odebug << QString().sprintf("HCI get_link_quality cmd failed (0x%2.2X)", rp.status) << oendl; |
740 | return 0; | 740 | return 0; |
741 | } | 741 | } |
742 | 742 | ||
743 | return rp.rssi+50; | 743 | return rp.rssi+50; |
744 | } | 744 | } |