Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTDriverList.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTDriverList.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTDriverList.cpp b/noncore/settings/networksettings2/opietooth2/OTDriverList.cpp index f703834..e5af742 100644 --- a/noncore/settings/networksettings2/opietooth2/OTDriverList.cpp +++ b/noncore/settings/networksettings2/opietooth2/OTDriverList.cpp | |||
@@ -32,55 +32,55 @@ void OTDriverList::update() { | |||
32 | 32 | ||
33 | struct hci_dev_list_req *dl; | 33 | struct hci_dev_list_req *dl; |
34 | struct hci_dev_req *dr; | 34 | struct hci_dev_req *dr; |
35 | struct hci_dev_info di; | 35 | struct hci_dev_info di; |
36 | int cur; | 36 | int cur; |
37 | 37 | ||
38 | dl = 0; | 38 | dl = 0; |
39 | cur = 0; | 39 | cur = 0; |
40 | do { | 40 | do { |
41 | cur += 5; | 41 | cur += 5; |
42 | 42 | ||
43 | dl = (struct hci_dev_list_req*) | 43 | dl = (struct hci_dev_list_req*) |
44 | ::realloc( dl, sizeof( struct hci_dev_list_req ) + | 44 | ::realloc( dl, sizeof( struct hci_dev_list_req ) + |
45 | ( cur * sizeof(struct hci_dev_req) ) | 45 | ( cur * sizeof(struct hci_dev_req) ) |
46 | ); | 46 | ); |
47 | 47 | ||
48 | if( dl == 0 ) { | 48 | if( dl == 0 ) { |
49 | // memory problem | 49 | // memory problem |
50 | exit(1); | 50 | exit(1); |
51 | } | 51 | } |
52 | 52 | ||
53 | dl->dev_num = cur; | 53 | dl->dev_num = cur; |
54 | 54 | ||
55 | if( ioctl( OT->getSocket(), HCIGETDEVLIST, (void*)dl) ) { | 55 | if( ioctl( OT->getSocket(), HCIGETDEVLIST, (void*)dl) ) { |
56 | owarn << "WARNING : cannot read device list. " | 56 | odebug << "WARNING : cannot read device list. " |
57 | << errno | 57 | << errno |
58 | << strerror( errno ) << oendl; | 58 | << strerror( errno ) << oendl; |
59 | return; | 59 | return; |
60 | } | 60 | } |
61 | 61 | ||
62 | // if num == cur perhaps we did not get all devices yet | 62 | // if num == cur perhaps we did not get all devices yet |
63 | } while( dl->dev_num == cur ); | 63 | } while( dl->dev_num == cur ); |
64 | 64 | ||
65 | if( dl->dev_num != count() ) { | 65 | if( dl->dev_num != count() ) { |
66 | // new or missing devices | 66 | // new or missing devices |
67 | clear(); | 67 | clear(); |
68 | 68 | ||
69 | dr = dl->dev_req; | 69 | dr = dl->dev_req; |
70 | resize( dl->dev_num ); | 70 | resize( dl->dev_num ); |
71 | 71 | ||
72 | for( cur=0; cur < dl->dev_num; cur ++) { | 72 | for( cur=0; cur < dl->dev_num; cur ++) { |
73 | memset( &di, 0, sizeof( di ) ); | 73 | memset( &di, 0, sizeof( di ) ); |
74 | di.dev_id = (dr+cur)->dev_id; | 74 | di.dev_id = (dr+cur)->dev_id; |
75 | 75 | ||
76 | // get device info | 76 | // get device info |
77 | if( ioctl( OT->getSocket(), HCIGETDEVINFO, (void*)&di) != 0 ) | 77 | if( ioctl( OT->getSocket(), HCIGETDEVINFO, (void*)&di) != 0 ) |
78 | continue; // uh ? | 78 | continue; // uh ? |
79 | insert( cur, new OTDriver( OT, &di ) ); | 79 | insert( cur, new OTDriver( OT, &di ) ); |
80 | } | 80 | } |
81 | 81 | ||
82 | owarn << "Found " << count() << " devices" << oendl; | 82 | odebug << "Found " << count() << " devices" << oendl; |
83 | 83 | ||
84 | ::free( dl ); | 84 | ::free( dl ); |
85 | } | 85 | } |
86 | } | 86 | } |