<div dir="ltr"><div>Sorry for another delay, <br></div><div><br></div><div>  I was looking at recent submissions for the new-architecture nutdrv_qx family of drivers to provide examples, and some of those submissions needed a bit of cleanup before posing as examples. Unfortunately our QX expert did not respond yet, so it took a longer while on my side.</div><div><br></div><div>  So now I can suggest looking at two PRs:</div><div>* <a href="https://github.com/networkupstools/nut/pull/638/">https://github.com/networkupstools/nut/pull/638/</a> adding support for "hunnox" - both a USB protocol subdriver (in nutdrv_qx.c) and device/HID mapping "hunnox_subdriver" (with sources in nutdrv_qx_hunnox.c/.h files), and</div><div>* <a href="https://github.com/networkupstools/nut/pull/1008">https://github.com/networkupstools/nut/pull/1008</a> adding just an "snr" protocol subdriver at this point.</div><div><br></div><div>They also add documentation updates for the changes they made, but this aspect was slightly addressed in your PR already (mention of the new subdriver would need to move from 
docs/man/blazer-common.txt to nutdrv_qx.txt though).</div><div><br></div><div>  To remind, my primary concerns about your original submission and from later discussion are:</div><div><br></div><div>* The changes in your PR #979 are targeted for blazer_usb driver which would at some point be deprecated and obsoleted in favor of nutdrv_qx, so this added support would be lost. While someone in the community probably can pick up and port source code lines, it would be hard to guarantee without access to hardware that the resulting driver actually works. So in fact you are best positioned (and incentivised) to initially provide the modern driver that will survive in the NUT codebase for long.<br></div><div><br></div><div>* Another point is the bold statement that "<span style="font-family:"Book Antiqua",serif;color:black" lang="EN-US">PID=0000/VID=FFFF of blazer_USB is Ablerex’s Identification code.</span>" It is not exactly a random unique number, and I suppose if the USB-IF authority had a *publicly* available registry of the ID numbers they give out - same as DNS registry, or IANA TCP/UDP port registry, or MAC address prefix registry for networking, or many other such lists in IT - these particular numbers would not be there, probably not for anyone. Since the USB-IF registry is not public, I can only assume that the other mentioned Vendor ID "1cb0" is registered properly and no other devices would conflict using it. I understand the technical point that these "0000:FFFF" are the uncustomized IDs flashed into the USB chips your devices use, but it also means that any other vendor might have those spectacularly not-unique ID numbers, with same or even unrelated chips. We already do have a practical example of such mess with "ATCL" chips that provide USB media connections for otherwise unrelated UPSes that talk completely different protocols and have different NUT drivers for same Vendor ID + Product ID + Device String tuple.</div><div><br></div><div>* Also, "<span style="font-family:"Book Antiqua",serif;color:black" lang="EN-US">the modification is only for the addition of Ablerex product features, so there is no need to consider the differences of other customers</span>" - the wording here may be unfortunate, English is not a native language for either of us, but as written this phrase looks very concerning :) You are changing an existing driver that supports several device families already, and existing users of this driver expect that the support is not broken when they upgrade NUT. So *OF COURSE* there is a need to consider differences for other customers. That said, your original (blazer_usb) submission was quite cleanly separated and should not have impacted users... unless they have some "0000:FFFF" device that worked before with some subdriver and would be detected as "ablerex_ext_command=1" and might stop working now; you did not offer any failsafe (addvar() a flag, probably) to override your detection and disable ablerex mode in the unlikely case it is misdiagnosed and breaks somebody in practice.</div><div><br></div><div>* Notably, the mapping macro in nutdrv_qx is more elaborate and allows to map not just ID numbers but also a string the device presents itself with, so detection of proper subdriver can probably be made more reliable at that point, and not with a hack to check particular IDs in `blazer_initinfo()` as you proposed in current PR.</div><div><br></div><div>Hope this helps,</div><div>Jim Klimov<br></div><div><br></div><div>

</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 12, 2021 at 11:17 AM Johnson-shen <<a href="mailto:johnson-shen@ablerex.com.tw">johnson-shen@ablerex.com.tw</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <div>Dear Sir,</div>
    <div><br>
    </div>
    <div>How’s today?<br>
    </div>
    <div><br>
    </div>
    <div>Could you kindly provide your comment
      about our opinions?<br>
    </div>
    <div><br>
    </div>
    <div>Please kindly provide more information,
      documents or example code about the driver that will separate
      Ablerex's, if you did not agree with our opinions.</div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div>Regards!</div>
    <div>Johnson</div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div><br>
    </div>
    <div>Johnson-shen 於 4/6/2021 6:22 PM 寫道:<br>
    </div>
    <blockquote type="cite">
      
      <div>Dear Sir,</div>
      <div><br>
      </div>
      <div>
        <pre style="background:rgb(248,249,250) none repeat scroll 0% 0%"><span style="font-family:"Book Antiqua",serif;color:black" lang="EN-US">Could you merge our driver for us?</span><span style="font-family:"Book Antiqua",serif" lang="EN-US"></span></pre>
        <pre style="background:rgb(248,249,250) none repeat scroll 0% 0%"><span style="font-family:"Book Antiqua",serif;color:black" lang="EN-US">Because PID=0000/VID=FFFF of blazer_USB is Ablerex’s Identification code.

And this time the modification is only for the addition of Ablerex product features, 

so there is no need to consider the differences of other customers. Could you agree?</span><span style="font-family:"Book Antiqua",serif;color:rgb(32,33,36)" lang="EN-US"></span></pre>
        </div>
      <div><br>
      </div>
      <div>Regards!</div>
      <div>Johnson</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>Jim Klimov 於 4/4/2021 7:43 PM 寫道:<br>
      </div>
      <blockquote type="cite">
        
        <div dir="auto">Hello,
          <div dir="auto"><br>
          </div>
          <div dir="auto">  I am really sorry about the delay, I hoped
            our community expert on the Qx drivers would recommend the
            best course of action, but he did not reply yet.</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">  To me it currently seems that this Pull
            request: <a href="https://github.com/networkupstools/nut/pull/638/files" target="_blank">https://github.com/networkupstools/nut/pull/638/files</a>
            represents the modernly desirable addition of a USB protocol
            subdriver (in nutdrv_qx.c/.h) and the vendor protocol
            nuances subdriver (in separate files).</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto"> Sadly, according to comment trail, that
            particular Pull request changed a bit of logic in existing
            functions (around langid_fix and enabling a hunnox patch,
            most prominently) and there were concerns if it is not
            breaking anything for other devices that work currently. It
            would be beneficial if people running nutdrv_qx today could
            build that branch and confirm into PR comments that the
            updated driver does work well or does break something after
            all.</div>
          <br>
          <div dir="auto">  So I think the new ablerex subdriver should
            carefully take a similar path. Nutdrv_qx modular code did
            grow as a refactoring and merge of earlier drivers including
            blazer, so your original code contribution should be easily
            portable into the new layout.</div>
          <div dir="auto"><br>
          </div>
          <div dir="auto">Thank you very much and really sorry it took
            longer that I'd expect,</div>
          <div dir="auto">Jim Klimov</div>
          <div dir="auto"><br>
          </div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Mon, Mar 29, 2021, 13:16
            Johnson-shen <<a href="mailto:johnson-shen@ablerex.com.tw" target="_blank">johnson-shen@ablerex.com.tw</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div>
              <div>Dear Sir,</div>
              <div><br>
              </div>
              <div>Thank you for your reply.<br>
              </div>
              <div><br>
              </div>
              <div>I can not sure what you mean.<br>
              </div>
              <div><br>
              </div>
              <div>May I confirm with you again about it?<br>
              </div>
              <div><br>
              </div>
              <div>You did not recommend that extend the new function
                from blazer_usb.c for Ablerex UPS.<br>
              </div>
              <div><br>
              </div>
              <div>You suggest that separate the Ablerex function into a
                new driver(.c or .h) independently to avoid vendor
                nuances.<br>
              </div>
              <div><br>
              </div>
              <div>Until we follow the above rule to modify, It will be
                upload and merge the driver.<br>
              </div>
              <div><br>
              </div>
              <div>Is it right?<br>
              </div>
              <div><br>
              </div>
              <div>Please kindly provide more information or explain to
                us, if I  got you wrong.<br>
              </div>
              <div><br>
              </div>
              <div>Please kindly provide the example for a new structure
                to us, I think will help to modify it for reference, if
                it is right.<br>
              </div>
              <div><br>
              </div>
              <div>Regards!</div>
              <div>Johnson</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>Jim Klimov 於 3/24/2021 6:26 PM 寫道:<br>
              </div>
              <blockquote type="cite">
                <div dir="auto">Hello,
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">Yes, in fact there were two things.</div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">One was that a week ago I posted some
                    documentation updates into your PR (e.g. for
                    acknowledgements) and asked you to confirm they sit
                    well with you, and hoped that's it.</div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">Unfortunately, I was now reminded that
                    extending the blazer_usb driver was not a good
                    approach - it was (poorly, fixing that) documented
                    as heading to obsoletion and eventual removal from
                    codebase. Various drivers for Qx protocols were
                    aggregated in drivers/nutdrv_qx*.{c,h} as a common
                    core and clean separate sources for vendor nuances.</div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">In order for us to maintain support
                    for your device in the long run, and not lose it
                    when old redundant drivers do get dropped, your code
                    contribution should be relocated to this newer
                    structure, and importantly - re-tested with your
                    hardware we do not have access to. I hope Daniele
                    (CC'ed) can clarify this better if you would need
                    assistance.</div>
                  <div dir="auto"><br>
                  </div>
                  <div dir="auto">Sorry about not noticing this earlier,</div>
                  <div dir="auto">Jim Klimov</div>
                </div>
                <br>
                <div class="gmail_quote">
                  <div dir="ltr" class="gmail_attr">On Wed, Mar 24,
                    2021, 03:58 Johnson-shen <<a href="mailto:johnson-shen@ablerex.com.tw" rel="noreferrer" target="_blank">johnson-shen@ablerex.com.tw</a>>
                    wrote:<br>
                  </div>
                  <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                    <div>
                      <div>Dear Sir,</div>
                      <br>
                      The status of the project is waiting for the other
                      managers to verify and confirm? <br>
                      <p>Please advise me if you have any support for
                        this project.</p>
                      <p><br>
                      </p>
                      <p>Regards!</p>
                      <p>Johnson</p>
                      <p><br>
                      </p>
                      <p><br>
                      </p>
                      <p><br>
                      </p>
                      <p><br>
                      </p>
                      <div>Jim Klimov 於 3/18/2021 8:07 PM 寫道:<br>
                      </div>
                      <blockquote type="cite">
                        <div dir="auto">Hello, thanks for the driver
                          update and sorry that I had to be reminded of
                          the PR by mailing list. I reviewed it last
                          week and added a few points on documentation.
                          Can you please check those, that I did not
                          mistake something, and I think it is good to
                          merge. Thanks again!
                          <div dir="auto"><br>
                          </div>
                          <div dir="auto">Jim Klimov</div>
                        </div>
                        <br>
                        <div class="gmail_quote">
                          <div dir="ltr" class="gmail_attr">On Thu, Mar
                            18, 2021, 11:33 Johnson-shen <<a href="mailto:johnson-shen@ablerex.com.tw" rel="noreferrer noreferrer noreferrer" target="_blank">johnson-shen@ablerex.com.tw</a>>
                            wrote:<br>
                          </div>
                          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                            <div>
                              <div>Dear Wolfy,</div>
                              <div><br>
                              </div>
                              Please advise me, if you need more
                              information about the new driver.<br>
                              Also please kindly update the status of
                              the new driver for us.
                              <div><br>
                              </div>
                              <div>Regards!</div>
                              <div>Johnson</div>
                              <div><br>
                              </div>
                              <div><br>
                              </div>
                              <div><br>
                              </div>
                              <div>Johnson-shen 於 3/10/2021 6:24 PM 寫道:<br>
                              </div>
                              <blockquote type="cite">
                                <div>Dear Wolfy,</div>
                                <div><br>
                                </div>
                                <div>Please refer to the below table for
                                  the whole support list of the UPS
                                  Model of the new driver.</div>
                                <div><br>
                                </div>
                                <div><img alt=""></div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                                <div>Please kindly advise me if you have
                                  any questions.</div>
                                <div><br>
                                </div>
                                <div>Regards!</div>
                                <div>Johnson</div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                                <div>Johnson-shen 於 3/10/2021 9:43 AM
                                  寫道:<br>
                                </div>
                                <blockquote type="cite">
                                  <div>Dear Wolfy,</div>
                                  <div><br>
                                  </div>
                                  Thank you for the reply to emails
                                  quickly, the DK+ is our customer model
                                  name for ODM.<br>
                                  <br>
                                   We will provide the whole support
                                  list of UPS Model of the driver to you
                                  tomorrow.<br>
                                  <p><br>
                                  </p>
                                  <p><br>
                                  </p>
                                  <p>Regards!</p>
                                  <p>Johnson</p>
                                  <p><br>
                                  </p>
                                  <div><br>
                                  </div>
                                  <div> <br>
                                  </div>
                                  <div> <br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>Manuel Wolfshant 於 3/9/2021 7:11
                                    PM 寫道:<br>
                                  </div>
                                  <blockquote type="cite">
                                    <div>On 3/9/21 8:37 AM, John wrote:<br>
                                    </div>
                                    <blockquote type="cite">
                                      <div>
                                        <p class="MsoNormal"><span lang="EN-US">Hi,</span></p>
                                        <p class="MsoNormal"><span lang="EN-US"> </span></p>
                                        <p class="MsoNormal"><span lang="EN-US">I'm engineer
                                            from Ablere Electronics Co.,
                                            Ltd. (<a href="http://www.ablerex.com.tw/" rel="noreferrer noreferrer
                                              noreferrer noreferrer" target="_blank">http://www.ablerex.com.tw/</a>).</span></p>
                                        <p class="MsoNormal"><span lang="EN-US"> </span></p>
                                        <p class="MsoNormal"><span lang="EN-US">I pull request
                                            to networkupstools/nut that
                                            Add support for Ablerex Dk+
                                            #979.</span></p>
                                        <p class="MsoNormal"><span lang="EN-US"> </span></p>
                                      </div>
                                    </blockquote>
                                    <br>
                                    <p>long time user of an MS3000RT
                                      here. where is the DK+ described?
                                      I cannot find it on your web site
                                      or via google.<br>
                                    </p>
                                    <p><br>
                                    </p>
                                    <p>wolfy<br>
                                    </p>
                                  </blockquote>
                                  <p><br>
                                  </p>
                                  <pre cols="72">-- 
盈正豫順電子股份有限公司

Ablerex Electronics Co., Ltd.

研發部 / 沈南村 

E-mail: <a href="mailto:Johnson-shen@ablerex.com.tw" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">Johnson-shen@ablerex.com.tw</a>

Tel: 886-7-397-8640 Ext: 894

Fax: 886-7-3978641

807-66高雄市三民區水源路157號

No.157, Shuiyuan Rd., Sanmin District, Kaohsiung City 807-66, Taiwan
(R.O.C.)</pre>
                                </blockquote>
                                <p><br>
                                </p>
                                <pre cols="72">-- 
盈正豫順電子股份有限公司

Ablerex Electronics Co., Ltd.

研發部 / 沈南村 

E-mail: <a href="mailto:Johnson-shen@ablerex.com.tw" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">Johnson-shen@ablerex.com.tw</a>

Tel: 886-7-397-8640 Ext: 894

Fax: 886-7-3978641

807-66高雄市三民區水源路157號

No.157, Shuiyuan Rd., Sanmin District, Kaohsiung City 807-66, Taiwan
(R.O.C.)</pre>
                              </blockquote>
                              <p><br>
                              </p>
                              <pre cols="72">-- 
盈正豫順電子股份有限公司

Ablerex Electronics Co., Ltd.

研發部 / 沈南村 

E-mail: <a href="mailto:Johnson-shen@ablerex.com.tw" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">Johnson-shen@ablerex.com.tw</a>

Tel: 886-7-397-8640 Ext: 894

Fax: 886-7-3978641

807-66高雄市三民區水源路157號

No.157, Shuiyuan Rd., Sanmin District, Kaohsiung City 807-66, Taiwan
(R.O.C.)</pre>
                            </div>
_______________________________________________<br>
                            Nut-upsdev mailing list<br>
                            <a href="mailto:Nut-upsdev@alioth-lists.debian.net" rel="noreferrer noreferrer noreferrer
                              noreferrer" target="_blank">Nut-upsdev@alioth-lists.debian.net</a><br>
                            <a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev" rel="noreferrer noreferrer noreferrer
                              noreferrer noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev</a><br>
                          </blockquote>
                        </div>
                      </blockquote>
                      <p><br>
                      </p>
                      <pre cols="72">-- 
盈正豫順電子股份有限公司

Ablerex Electronics Co., Ltd.

研發部 / 沈南村 

E-mail: <a href="mailto:Johnson-shen@ablerex.com.tw" rel="noreferrer noreferrer" target="_blank">Johnson-shen@ablerex.com.tw</a>

Tel: 886-7-397-8640 Ext: 894

Fax: 886-7-3978641

807-66高雄市三民區水源路157號

No.157, Shuiyuan Rd., Sanmin District, Kaohsiung City 807-66, Taiwan
(R.O.C.)</pre>
                    </div>
                  </blockquote>
                </div>
              </blockquote>
              <p><br>
              </p>
              <pre cols="72">-- 
盈正豫順電子股份有限公司

Ablerex Electronics Co., Ltd.

研發部 / 沈南村 

E-mail: <a href="mailto:Johnson-shen@ablerex.com.tw" rel="noreferrer" target="_blank">Johnson-shen@ablerex.com.tw</a>

Tel: 886-7-397-8640 Ext: 894

Fax: 886-7-3978641

807-66高雄市三民區水源路157號

No.157, Shuiyuan Rd., Sanmin District, Kaohsiung City 807-66, Taiwan
(R.O.C.)</pre>
            </div>
          </blockquote>
        </div>
      </blockquote>
      <p><br>
      </p>
      <pre cols="72">-- 
盈正豫順電子股份有限公司

Ablerex Electronics Co., Ltd.

研發部 / 沈南村 

E-mail: <a href="mailto:Johnson-shen@ablerex.com.tw" target="_blank">Johnson-shen@ablerex.com.tw</a>

Tel: 886-7-397-8640 Ext: 894

Fax: 886-7-3978641

807-66高雄市三民區水源路157號

No.157, Shuiyuan Rd., Sanmin District, Kaohsiung City 807-66, Taiwan
(R.O.C.)</pre>
    </blockquote>
    <p><br>
    </p>
    <pre cols="72">-- 
盈正豫順電子股份有限公司

Ablerex Electronics Co., Ltd.

研發部 / 沈南村 

E-mail: <a href="mailto:Johnson-shen@ablerex.com.tw" target="_blank">Johnson-shen@ablerex.com.tw</a>

Tel: 886-7-397-8640 Ext: 894

Fax: 886-7-3978641

807-66高雄市三民區水源路157號

No.157, Shuiyuan Rd., Sanmin District, Kaohsiung City 807-66, Taiwan
(R.O.C.)</pre>
  </div>

</blockquote></div>