OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/bluetooth/test/bluetooth_test_mac.h" | 5 #include "device/bluetooth/test/bluetooth_test_mac.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 const char* identifier; | 153 const char* identifier; |
154 NSString* name; | 154 NSString* name; |
155 NSArray* uuids; | 155 NSArray* uuids; |
156 NSNumber* rssi; | 156 NSNumber* rssi; |
157 NSDictionary* service_data; | 157 NSDictionary* service_data; |
158 NSNumber* tx_power; | 158 NSNumber* tx_power; |
159 | 159 |
160 switch (device_ordinal) { | 160 switch (device_ordinal) { |
161 case 1: | 161 case 1: |
162 identifier = kTestPeripheralUUID1.c_str(); | 162 identifier = kTestPeripheralUUID1.c_str(); |
163 name = @(kTestDeviceName.c_str()); | 163 name = @(kTestDeviceGapName.c_str()); |
164 rssi = @(static_cast<int8_t>(TestRSSI::LOWEST)); | 164 rssi = @(static_cast<int8_t>(TestRSSI::LOWEST)); |
165 uuids = @[ | 165 uuids = @[ |
166 [CBUUID UUIDWithString:@(kTestUUIDGenericAccess.c_str())], | 166 [CBUUID UUIDWithString:@(kTestUUIDGenericAccess.c_str())], |
167 [CBUUID UUIDWithString:@(kTestUUIDGenericAttribute.c_str())] | 167 [CBUUID UUIDWithString:@(kTestUUIDGenericAttribute.c_str())] |
168 ]; | 168 ]; |
169 service_data = @{ | 169 service_data = @{ |
170 [CBUUID UUIDWithString:@(kTestUUIDHeartRate.c_str())] : | 170 [CBUUID UUIDWithString:@(kTestUUIDHeartRate.c_str())] : |
171 [NSData dataWithBytes:(unsigned char[]){1} length:1] | 171 [NSData dataWithBytes:(unsigned char[]){1} length:1] |
172 }; | 172 }; |
173 tx_power = @(static_cast<int8_t>(TestTxPower::LOWEST)); | 173 tx_power = @(static_cast<int8_t>(TestTxPower::LOWEST)); |
174 break; | 174 break; |
175 case 2: | 175 case 2: |
176 identifier = kTestPeripheralUUID1.c_str(); | 176 identifier = kTestPeripheralUUID1.c_str(); |
177 name = @(kTestDeviceName.c_str()); | 177 name = @(kTestDeviceGapName.c_str()); |
178 rssi = @(static_cast<int8_t>(TestRSSI::LOWER)); | 178 rssi = @(static_cast<int8_t>(TestRSSI::LOWER)); |
179 uuids = @[ | 179 uuids = @[ |
180 [CBUUID UUIDWithString:@(kTestUUIDImmediateAlert.c_str())], | 180 [CBUUID UUIDWithString:@(kTestUUIDImmediateAlert.c_str())], |
181 [CBUUID UUIDWithString:@(kTestUUIDLinkLoss.c_str())] | 181 [CBUUID UUIDWithString:@(kTestUUIDLinkLoss.c_str())] |
182 ]; | 182 ]; |
183 service_data = @{ | 183 service_data = @{ |
184 [CBUUID UUIDWithString:@(kTestUUIDHeartRate.c_str())] : | 184 [CBUUID UUIDWithString:@(kTestUUIDHeartRate.c_str())] : |
185 [NSData dataWithBytes:(unsigned char[]){2} length:1], | 185 [NSData dataWithBytes:(unsigned char[]){2} length:1], |
186 [CBUUID UUIDWithString:@(kTestUUIDImmediateAlert.c_str())] : | 186 [CBUUID UUIDWithString:@(kTestUUIDImmediateAlert.c_str())] : |
187 [NSData dataWithBytes:(unsigned char[]){0} length:1] | 187 [NSData dataWithBytes:(unsigned char[]){0} length:1] |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 // crypto::SHA256HashString(input_str, raw, sizeof(raw)); | 488 // crypto::SHA256HashString(input_str, raw, sizeof(raw)); |
489 // if (base::HexEncode(raw, sizeof(raw)) == target) { | 489 // if (base::HexEncode(raw, sizeof(raw)) == target) { |
490 // return input_str; | 490 // return input_str; |
491 // } | 491 // } |
492 // ++input[0]; | 492 // ++input[0]; |
493 // } | 493 // } |
494 // return ""; | 494 // return ""; |
495 // } | 495 // } |
496 | 496 |
497 } // namespace device | 497 } // namespace device |
OLD | NEW |