//
// © 2019-2020 Qualcomm Technologies, Inc. and/or its subsidiaries. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "IoTTypes.h"
@class IoTBluetoothAttr;
@class IoTWrappedRepresentation;
@class IoTBtDeviceAttr;
@class IoTBtDeviceStatusAttr;

NS_ASSUME_NONNULL_BEGIN

@interface IoTBluetoothState : NSObject

@property (nonatomic, readonly) BOOL supported;
@property (nonatomic, readonly) IoTBluetoothAdapterState adapterState;
@property (nonatomic, readonly) IoTDiscoverable discoverable;
@property (nonatomic, readonly, nullable) NSString *connectedBTDeviceAddress;
@property (nonatomic, readonly) NSArray<IoTBtDeviceStatusAttr *> *pairedDevices;
@property (nonatomic, readonly, nullable) IoTBtDeviceAttr *discoveredDevice;
@property (nonatomic, readonly) BOOL scanning;

- (void)updateWithAttribute:(nullable IoTBluetoothAttr *)btAttr;

/**
 Update the internal state using a wrapped IoTSys notification diff.
 @param wrapper Wrapper representation of a diff from IoTSys
 @return Array of the changed keys. This may include additional keys that were not in the original representation that are changed in the
 	Bluetooth state due to an error.
 */
- (NSArray<NSString *> *)updateWithWrapper:(IoTWrappedRepresentation *)wrapper;

@end

NS_ASSUME_NONNULL_END
