IQDevice.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // IQDevice.h
  3. // ConnectIQ
  4. //
  5. // Copyright (c) 2014 Garmin. All rights reserved.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import <CoreBluetooth/CoreBluetooth.h>
  9. /// @brief The current status of an IQDevice.
  10. typedef NS_ENUM(NSInteger, IQDeviceStatus){
  11. /// @brief No device with this UUID has been registered for status events
  12. /// the SDK.
  13. IQDeviceStatus_InvalidDevice,
  14. /// @brief Bluetooth is either powered off or resetting.
  15. IQDeviceStatus_BluetoothNotReady,
  16. /// @brief This device could not be found by iOS. Perhaps the user removed
  17. /// the device?
  18. IQDeviceStatus_NotFound,
  19. /// @brief The device is recognized by iOS, but it is not currently
  20. /// connected.
  21. IQDeviceStatus_NotConnected,
  22. /// @brief The device is connected and ready to communicate.
  23. IQDeviceStatus_Connected,
  24. };
  25. /// @brief Represents a ConnectIQ-compatible Garmin device.
  26. @interface IQDevice : NSObject <NSSecureCoding>
  27. /// @brief The unique identifier for this device.
  28. @property (nonatomic, readonly) NSUUID *uuid;
  29. /// @brief The model name of the device provided by Garmin Connect Mobile.
  30. @property (nonatomic, readonly) NSString *modelName;
  31. /// @brief The friendly name of the device, set by the user and provided by
  32. /// Garmin Connect Mobile.
  33. @property (nonatomic, readonly) NSString *friendlyName;
  34. /// @brief Creates a new device instance.
  35. ///
  36. /// @param uuid The UUID of the device to create.
  37. /// @param modelName The model name of the device to create.
  38. /// @param friendlyName The friendly name of the device to create.
  39. ///
  40. /// @return A new IQDevice instance with the appropriate values set.
  41. + (IQDevice *)deviceWithId:(NSUUID *)uuid modelName:(NSString *)modelName friendlyName:(NSString *)friendlyName;
  42. /// @brief Creates a new device instance by copying another device's values.
  43. ///
  44. /// @param device The device to copy values from.
  45. ///
  46. /// @return A new IQDevice instance with all values copied.
  47. - (instancetype)initWithDevice:(IQDevice *)device;
  48. @end