WiringPi / WiringPi-Node

Node.js bindings to wiringPi
334 stars 94 forks source link

How to release a wiringPiI2CSetup() file descriptor #43

Closed nkolban closed 7 years ago

nkolban commented 8 years ago

If I call wiringPiI2CSetup() I am returned an open file descriptor. What is the correct way to dispose of this if I no longer need the resource?

nekuz0r commented 7 years ago

Good catch sir ! There is indeed a missing close function, the native wiring pi library does not provide any close function because it expects you to call close since it's open with open. Will add a dispose function for I2C and any other resources opening a file descriptor

NoHomey commented 7 years ago

@nekuz0r I've created #50 with which I'm adding individual closing functions for SPI and I2C interfaces. Could you review it?