diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-04-02 22:12:39 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-04-03 12:59:15 +0300 |
commit | dd4d0d6b653627d86319dcdf1c1efb5a46fa628c (patch) | |
tree | bfff6d6974970b17cb9f1dbc95103e4f59f64ff1 /proximity/reporter.c | |
parent | 09a29322d3887e42416689af28d09ca9ef3b2fdc (diff) |
proximity: reporter: move definitions to .h and add util function
This allows us to re-use these definitions in GATT sub-profiles.
Diffstat (limited to 'proximity/reporter.c')
-rw-r--r-- | proximity/reporter.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/proximity/reporter.c b/proximity/reporter.c index c5a3bb8a6..2474feae6 100644 --- a/proximity/reporter.c +++ b/proximity/reporter.c @@ -40,20 +40,22 @@ #include "attrib-server.h" #include "reporter.h" -#define IMMEDIATE_ALERT_SVC_UUID 0x1802 -#define LINK_LOSS_SVC_UUID 0x1803 -#define TX_POWER_SVC_UUID 0x1804 -#define ALERT_LEVEL_CHR_UUID 0x2A06 -#define POWER_LEVEL_CHR_UUID 0x2A07 - -enum { - NO_ALERT = 0x00, - MILD_ALERT = 0x01, - HIGH_ALERT = 0x02, -}; - static DBusConnection *connection; +const char *get_alert_level_string(uint8_t level) +{ + switch (level) { + case NO_ALERT: + return "none"; + case MILD_ALERT: + return "mild"; + case HIGH_ALERT: + return "high"; + } + + return "unknown"; +} + static void register_link_loss(struct btd_adapter *adapter) { uint16_t start_handle, h; |