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

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, IoTClientDiscoveryInterval) {
    IoTClientDiscoveryIntervalStopped = 0,
    IoTClientDiscoveryIntervalFrequent = 1,
    IoTClientDiscoveryIntervalRegular = 2,
};

@protocol IoTClientDiscoveryStateDelegate

- (void)clientDiscoverStateRequestScan;
- (void)clientDiscoverStateDidStop;
- (void)clientDiscoverStateDidStart;

@end

@interface IoTClientDiscoveryState : NSObject

@property (nonatomic,readonly) IoTClientDiscoveryInterval currentInterval;
@property (nonatomic,readonly,weak) id<IoTClientDiscoveryStateDelegate> delegate;

// Must be called on main thread...
- (instancetype)initWithDelegate:(id<IoTClientDiscoveryStateDelegate>)delegate;

- (void)start;
- (void)stop;
- (void)scanToRefindService;
- (void)didDiscoverService;
- (void)didRemoveService:(NSInteger)remaining;

@end

NS_ASSUME_NONNULL_END
