GPIO fire notification issue (iOS swift)

Hi guys,
Ive been trying for a few days now to set a pin high (location beacon) from an app I’m building.
Im doing something wrong as i am getting an error when the block fires off. Error is: [ESTTelemetryInfo portsData]: unrecognized selector sent to instance…
Ive looked everywhere for a snippet but can’t find anything. I only want to be able to set the pin high (i don’t need to send any data). If i can set the pin high i figure i could set it low using the same methods.

let telem = ESTTelemetryInfo.init(shortIdentifier: “xxxxxxxxxxxxxxxx”)!
let setPinHigh = ESTTelemetryNotificationGPIO.init(notificationBlock: { (telInfo) in
if telInfo.shortIdentifier! != “xxxxxxxxxxxxxxxx” { return }
telInfo.portsData.setPort(.port0, value: .high)
})
setPinHigh.fireNotificationBlock(with: telem)

Any help would be greatly appreciated.
Cheers
Gary

That sounds like a potential bug in the iOS SDK. Can you report it on our iOS SDK GitHub? https://github.com/Estimote/iOS-SDK/issues

Hi, I’ll do that. Just a question: Should I assume that I was on the right track with the code block and how it was written then?

Oh, oops, I failed a reading comprehension skill.

The code you posted scans for Telemetry packets and extracts the GPIO data from it. This data is read-only though, e.g., if you have a button connected via GPIO “input” to your beacon, you can read if the button is currently pressed or not.

If you instead are using GPIO in the “output” mode, you need to connect to the beacon in order to set it to high/low.

Here’s a guide on connecting to beacons:
http://developer.estimote.com/managing-beacons/connecting-to-beacons/

Then, in your estDeviceConnectionDidSucceed callback, you can do:

self.device.settings.GPIO.portsData.setPort(.port0, value: .high)

Hi,
I thought this may be the case however I did already try this (and just tried again) but I get the error stating: portsData has no member ‘setPort’. Thanx for you help.

Yeah, so that could be the same bug actually :slight_smile: Saw your report on GitHub, thanks for that!