-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from SuessLabs/feature/Battery
Device Battery Levels
- Loading branch information
Showing
3 changed files
with
82 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Linux.Bluetooth | ||
{ | ||
public static class BluezConstants | ||
{ | ||
public const string DbusService = "org.bluez"; | ||
|
||
public const string AdapterInterface = "org.bluez.Adapter1"; | ||
public const string BatteryInterface = "org.bluez.Battery1"; | ||
public const string DeviceInterface = "org.bluez.Device1"; | ||
public const string GattServiceInterface = "org.bluez.GattService1"; | ||
public const string GattManagerInterface = "org.bluez.GattManager1"; | ||
public const string GattCharacteristicInterface = "org.bluez.GattCharacteristic1"; | ||
public const string GattDescriptorInterface = "org.bluez.GattDescriptor1"; | ||
public const string LeAdvertisementInterface = "org.bluez.LEAdvertisement1"; | ||
public const string LeAdvertisingManagerInterface = "org.bluez.LEAdvertisingManager1"; | ||
} | ||
|
||
} |
79 changes: 34 additions & 45 deletions
79
src/Linux.Bluetooth/Constants.cs → ...inux.Bluetooth/Constants/GattConstants.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,34 @@ | ||
namespace Linux.Bluetooth | ||
{ | ||
public static class BluezConstants | ||
{ | ||
public const string DbusService = "org.bluez"; | ||
public const string AdapterInterface = "org.bluez.Adapter1"; | ||
public const string DeviceInterface = "org.bluez.Device1"; | ||
public const string GattServiceInterface = "org.bluez.GattService1"; | ||
public const string GattManagerInterface = "org.bluez.GattManager1"; | ||
public const string GattCharacteristicInterface = "org.bluez.GattCharacteristic1"; | ||
public const string GattDescriptorInterface = "org.bluez.GattDescriptor1"; | ||
public const string LeAdvertisementInterface = "org.bluez.LEAdvertisement1"; | ||
public const string LeAdvertisingManagerInterface = "org.bluez.LEAdvertisingManager1"; | ||
} | ||
|
||
// https://www.bluetooth.com/specifications/gatt/ | ||
|
||
public static class GattConstants | ||
{ | ||
//// Device Information | ||
|
||
public const string DeviceInformationServiceUUID = "0000180a-0000-1000-8000-00805f9b34fb"; | ||
public const string ModelNameCharacteristicUUID = "00002a24-0000-1000-8000-00805f9b34fb"; | ||
public const string ManufacturerNameCharacteristicUUID = "00002a29-0000-1000-8000-00805f9b34fb"; | ||
|
||
//// Current Time | ||
|
||
public const string CurrentTimeServiceUUID = "00001805-0000-1000-8000-00805f9b34fb"; | ||
public const string CurrentTimeCharacteristicUUID = "00002a2b-0000-1000-8000-00805f9b34fb"; | ||
|
||
// Battery Service | ||
// BlueZ presents this service a separate interface, Battery1. | ||
// public const string BatteryServiceUUID = "0000180f-0000-1000-8000-00805f9b34fb"; | ||
// public const string BatteryLevelCharacteristicUUID = "00002a19-0000-1000-8000-00805f9b34fb"; | ||
|
||
// Apple Notification Center Service (ANCS) | ||
// https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Introduction/Introduction.html | ||
public const string ANCServiceUUID = "7905f431-b5ce-4e99-a40f-4b1e122d00d0"; | ||
|
||
// TODO: Lowercase these. | ||
public const string ANCSNotificationSourceUUID = "9FBF120D-6301-42D9-8C58-25E699A21DBD"; | ||
public const string ANCSControlPointUUID = "69D1D8F3-45E1-49A8-9821-9BBDFDAAD9D9"; | ||
public const string ANCSDataSourceUUID = "22EAC6E9-24D6-4BB5-BE44-B36ACE7C7BFB"; | ||
} | ||
} | ||
namespace Linux.Bluetooth.Constants | ||
{ | ||
/// <summary> | ||
/// GATT Constants based on, https://www.bluetooth.com/specifications/gatt/ | ||
/// </summary> | ||
public static class GattConstants | ||
{ | ||
//// Device Information | ||
|
||
public const string DeviceInformationServiceUUID = "0000180a-0000-1000-8000-00805f9b34fb"; | ||
public const string ModelNameCharacteristicUUID = "00002a24-0000-1000-8000-00805f9b34fb"; | ||
public const string ManufacturerNameCharacteristicUUID = "00002a29-0000-1000-8000-00805f9b34fb"; | ||
|
||
//// Current Time | ||
|
||
public const string CurrentTimeServiceUUID = "00001805-0000-1000-8000-00805f9b34fb"; | ||
public const string CurrentTimeCharacteristicUUID = "00002a2b-0000-1000-8000-00805f9b34fb"; | ||
|
||
// Battery Service | ||
// BlueZ presents this service a separate interface, Battery1. | ||
// public const string BatteryServiceUUID = "0000180f-0000-1000-8000-00805f9b34fb"; | ||
// public const string BatteryLevelCharacteristicUUID = "00002a19-0000-1000-8000-00805f9b34fb"; | ||
|
||
// Apple Notification Center Service (ANCS) | ||
// https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Introduction/Introduction.html | ||
public const string ANCServiceUUID = "7905f431-b5ce-4e99-a40f-4b1e122d00d0"; | ||
|
||
// TODO: Lowercase these. | ||
public const string ANCSNotificationSourceUUID = "9FBF120D-6301-42D9-8C58-25E699A21DBD"; | ||
|
||
public const string ANCSControlPointUUID = "69D1D8F3-45E1-49A8-9821-9BBDFDAAD9D9"; | ||
public const string ANCSDataSourceUUID = "22EAC6E9-24D6-4BB5-BE44-B36ACE7C7BFB"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters