Accessing GPIO and temperature using IOS SDK with Objective C

Hi

I am trying to access temperature data from one of the Location Beacon. I am new to Objective C.

I have followed following steps. Created a Proximity Content for single Beacon Project from estimote cloud.
trying to edit viewController.m and include following code

ESTDeviceManager *manager = [[ESTDeviceManager alloc] init];

ESTTelemetryNotificationTemperature *temperatureNotification = [[ESTTelemetryNotificationTemperature alloc] initWithNotificationBlock:^(ESTTelemetryInfoTemperature *temperature) {
NSLog(@“Current temperature: %@ C”, temperature.temperatureInCelsius);
}];
[manager registerForTelemetryNotification:temperatureNotification];

I have Estimote Telemetry enabled and able to view temperature data in the estimote app.

can you please tell me what I am missing in getting temperature details on my personal app.

Hello,

There may be this kind of issue if you do not keep reference to ESTDeviceManager. Convert it to property of the class. Let me know if that helped.

Marcin

Thank you Marcin. It helped little bit.
But Still unab,e to connect to the estimote device and retrieve temperature from Location Beacon. I am pasting my code here. can you please let me know what I am doing wrong. this is from viewController.m

//
// Please report any problems with this app template to contact@estimote.com
//

#import "ViewController.h"

#import "BeaconDetails.h"
#import "BeaconDetailsCloudFactory.h"
#import "CachingContentFactory.h"
#import "ProximityContentManager.h"
#import "Estimote/EstimoteSDK.framework/Headers/ESTDeviceManager.h"
#import "Estimote/EstimoteSDK.framework/Headers/ESTTelemetryNotificationTemperature.h"
#import "Estimote/EstimoteSDK.framework/Headers/ESTTelemetryInfoTemperature.h"
#import "Estimote/EstimoteSDK.framework/Headers/ESTDeviceFilterLocationBeacon.h"


@interface ViewController () <ProximityContentManagerDelegate,ESTDeviceManagerDelegate>

@property (weak, nonatomic) IBOutlet UILabel *label;
@property (weak, nonatomic) IBOutlet UIImageView *image;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;

@property (nonatomic) ProximityContentManager *proximityContentManager;
@property (nonatomic) ESTDeviceManager *manager;

@property (nonatomic) ESTSettingEstimoteTLMEnable *en;

@end

@implementation ViewController {
   // ESTDeviceManager *manager;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self.activityIndicator startAnimating];

    self.proximityContentManager = [[ProximityContentManager alloc]
        initWithBeaconIDs:@[
            [[BeaconID alloc] initWithUUIDString:@"B9407F30-F5F8-466E-AFF9-25556B57FE6D" major:42953 minor:49468]
        ]
        beaconContentFactory:[[CachingContentFactory alloc] initWithBeaconContentFactory:[BeaconDetailsCloudFactory new]]];
    self.proximityContentManager.delegate = self;

    [self.proximityContentManager startContentUpdates];
    
    self.en = [[ESTSettingEstimoteTLMEnable alloc]initWithValue:TRUE];
    
    self.manager  = [[ESTDeviceManager alloc] init];
    
    ESTDeviceFilterLocationBeacon *be = [[ESTDeviceFilterLocationBeacon alloc] initWithIdentifier:@"de396be57fbbdd39539a41fad4e1ce2c"];
    [self.manager startDeviceDiscoveryWithFilter: be];
  //  self.manager.delegate = self;
    
    
    
    ESTTelemetryNotificationTemperature *temperatureNotification = [[ESTTelemetryNotificationTemperature alloc]
                                                                    initWithNotificationBlock:^(ESTTelemetryInfoTemperature *temperature) {
                                                                        NSLog(@"Current temperature: %@ C", temperature.temperatureInCelsius);
                                                                    }];
    
    [self.manager registerForTelemetryNotification:temperatureNotification];
    
    NSLog(@"scanning: %@ C", be.description);
 
    
     NSLog(@"elf.en.getValue....%@",self.manager.description);
   
    
    
}

- (void)proximityContentManager:(ProximityContentManager *)proximityContentManager didUpdateContent:(id)content {
    [self.activityIndicator stopAnimating];
    [self.activityIndicator removeFromSuperview];

    BeaconDetails *beaconDetails = content;
    if (beaconDetails) {
        

        
      //  ESTTelemetryNotificationGPIO *gpioNotify = [[ESTTelemetryNotificationGPIO alloc] initWithNotificationBlock:^(ESTTelemetryInfoGPIO *gpio) {
      //      NSLog(@"GPIO Notify: %@", gpio.portsData);
      //  }];
      //   [manager registerForTelemetryNotification:gpioNotify];
        
        self.view.backgroundColor = beaconDetails.backgroundColor;
        self.label.text = [NSString stringWithFormat:@"You're in %@'s range!", beaconDetails.beaconName];
       
        self.image.hidden = NO;
    } else {
        self.view.backgroundColor = BeaconDetails.neutralColor;
        self.label.text = @"No beacons in range.";
        self.image.hidden = YES;
    }
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}

-(void)deviceManager:(ESTDeviceManager *)manager didDiscoverDevices:(NSArray<ESTDevice *> *)devices{
    NSLog(@"Device desc %@",devices );
     NSLog(@"manager desc %@",manager);
 

    
}
-(void)deviceManagerDidFailDiscovery:(ESTDeviceManager *)manager1{
    NSLog(@"manager %@",manager1);
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end