Révision 340558f2 TestXamConnections/TestXamConnections.Android/Services/BluetoothService.cs
TestXamConnections/TestXamConnections.Android/Services/BluetoothService.cs | ||
---|---|---|
10 | 10 |
{ |
11 | 11 |
private readonly BluetoothAdapter bluetoothAdapter; |
12 | 12 |
|
13 |
public ObservableCollection<DeviceInfo> FoundDevices = new ObservableCollection<DeviceInfo>();
|
|
13 |
public ObservableCollection<InfoAppareil> FoundDevices = new ObservableCollection<InfoAppareil>();
|
|
14 | 14 |
public BluetoothService() |
15 | 15 |
{ |
16 |
FoundDevices = new ObservableCollection<DeviceInfo>();
|
|
16 |
FoundDevices = new ObservableCollection<InfoAppareil>();
|
|
17 | 17 |
bluetoothAdapter = BluetoothAdapter.DefaultAdapter; |
18 | 18 |
} |
19 | 19 |
|
20 |
public ICollection<DeviceInfo> GetBondedDevices()
|
|
20 |
public ICollection<InfoAppareil> GetBondedDevices()
|
|
21 | 21 |
{ |
22 |
ICollection<DeviceInfo> ret = new ObservableCollection<DeviceInfo>();
|
|
22 |
ICollection<InfoAppareil> ret = new ObservableCollection<InfoAppareil>();
|
|
23 | 23 |
foreach (BluetoothDevice bondedDevice in bluetoothAdapter.BondedDevices) |
24 | 24 |
{ |
25 |
DeviceInfo toAddItem = new DeviceInfo
|
|
25 |
InfoAppareil toAddItem = new InfoAppareil
|
|
26 | 26 |
{ |
27 |
MACAddress = bondedDevice.Address,
|
|
28 |
Name = bondedDevice.Name
|
|
27 |
AdresseMAC = bondedDevice.Address,
|
|
28 |
Nom = bondedDevice.Name
|
|
29 | 29 |
}; |
30 | 30 |
ret.Add(toAddItem); |
31 | 31 |
} |
Formats disponibles : Unified diff