<div dir="ltr">Hello,<div><br></div><div>I am developing a new NUT driver for brazilian UPS brand "Ragtech" by reverse engeneering. I have never been involved in NUT driver development, so I wish to ask some basic questions. Any help will be much appreciated!</div><div><br></div><div>1. Is there a mandatory C code style? I mean, any strong recommendation? If there are none, I prefer to keep mine.</div><div><br></div><div>2. What are the purposes of "instant commands" test.battery.start and calibration.start? I know an UPS command that will put the load on battery until it reaches a low level and then put the UPS online back. After that, an UPS variable regarding the detected battery capacity will get updated. To which one of those "instant commands" should I associate this UPS command? Also, it seems that in this case the status flag CAL must be reported, is this right?</div><div><br></div><div>4. When doing the command above, the load is on battery *and* also there is line power present. In this case, does it make sense to report both OL and OB status flags? Or are OL and OB mutually exclusive?</div><div><br></div><div></div><div>3. The UPS connects to computer by USB and appears as a serial port /dev/ttyACM?. My driver completely supports hotplugging, so I can plug or unplug the usb cable before or after the driver has started. In any case, the driver connects, disconnects or reconnects to the UPS. The way I did this is by doing connection to the serial port and detection of UPS model all in upsdrv_initinfo(), with upsdrv_initups() doing almost nothing.  Is this alright?</div><div><br></div><div>4. I wish to be able to pass to the driver some custom options besides the "port = " that appears in <span style="color:rgb(0,0,0);font-family:monospace">ups.conf (for example, only manage a device that reports a specific serial number). What is the standard way to do this?</span></div><span style="font-family:monospace"><br></span><div><span style="font-family:monospace">I probably will have more questions, please forgive me if I don't ask them all in a single e-mail. I plan to submit my code as soon as these naive questions get resolved.</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">Thank you very much,</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">João Luis.</span></div></div>