ahoy all. First off, im making a generic I2C device manager, allowing you to connect any i2c device with any open i2CController service and allow you to read from/write to the I2cDevice without having to use the controller services directly. My purpose for this project was not my own, rather Ray wanted an easier way to read/write to i2cDevices regardless of the controller service they use. Yes, im aware that i2c is just a few basic operations, but clearly i dont need to write those operations from scratch given the "msg" system built into mrl and used by the controller services. This service just allows the user to have one service with easy methods for all necessary i2c operations without having to reference each controller service for each i2c method call. Again, im making this for ray, i know what he wants it to have, but what i2c devices/hardware he uses I am unaware of and don't need to know since this service generalizes the controllers as an I2CController (the built in interface that all i2c controllers implement), and my generic I2cDevice class.
I have a couple questions about I2CControl interface methods and the attach/detach logic. Looking at the pcf8574 service as my guide for an I2CControl class (which is my I2cDevice class), im assuming that the only methods that are required for an I2CControl are the methods found in the I2CControl interface? Assuming that is so, I also see that the pcf service has a "public void attach(String service)" that appears to allow you to only attach the controller and not set the device bus or device address. While that certainly can be useful, what confuses me is the way in which that method accomplishes its task. It calls the " public void attach(Attachable service) " method which checks that the controller service you provided is actually an i2CController. Why have this extra method when you can just check that within the same "public void attach(String service)" method? My only guess is that, for some reason, you can add the controller to the pcf as an "attachable". I ask this because im uncertain whether this method as well as "attachables" are used behind the scenes by mrl. If so, then i guess i should add support for attachables in my generic I2cDevice class im making.