pax_global_header00006660000000000000000000000064122207050300014501gustar00rootroot0000000000000052 comment=9646fda44bff165fa4b738ce7a8cf1bb5802a69d m4api-0.3~0.9646fd/000077500000000000000000000000001222070503000135545ustar00rootroot00000000000000m4api-0.3~0.9646fd/CMakeLists.txt000066400000000000000000000030651222070503000163200ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.8) project(m4api C) set(m4api_VERSION_MAJOR 0) set(m4api_VERSION_MINOR 3) set(m4api_VERSION 0.3) option(enable_maintainer "Enables the maintainer CFLAGS (-Wall -Werror)" OFF) if(enable_maintainer) add_definitions(-Wall -Werror) endif(enable_maintainer) include(FindPkgConfig) pkg_check_modules(lusb REQUIRED libusb) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/m4api.pc.in ${CMAKE_BINARY_DIR}/m4api.pc @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/m4api.h.in ${CMAKE_CURRENT_SOURCE_DIR}/m4api.h @ONLY) include_directories(${lusb_INCLUDE_DIRS}) link_directories(${lusb_LIBRARY_DIRS}) set(library_sources m4api.c) set(library_headers m4api.h) add_executable(m4ctl m4ctl.c) add_library(m4api SHARED ${library_sources}) add_library(m4api-static STATIC ${library_sources}) add_dependencies(m4ctl m4api) set_target_properties(m4api-static PROPERTIES OUTPUT_NAME m4api CLEAN_DIRECT_OUTPUT 1) set_target_properties(m4api PROPERTIES CLEAN_DIRECT_OUTPUT 1 SOVERSION ${m4api_VERSION}) set_property(TARGET m4api PROPERTY PUBLIC_HEADER ${library_headers}) set_property(TARGET m4ctl PROPERTY COMPILE_FLAGS ${lusb_CFLAGS_OTHER}) set_property(TARGET m4ctl PROPERTY LINK_FLAGS ${lusb_LDFLAGS_OTHER}) target_link_libraries(m4ctl m4api) target_link_libraries(m4api ${lusb_LDFLAGS}) target_link_libraries(m4api-static ${lusb_LDFLAGS}) install(TARGETS m4ctl m4api m4api-static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib PUBLIC_HEADER DESTINATION include/m4api) install(FILES ${CMAKE_BINARY_DIR}/m4api.pc DESTINATION lib/pkgconfig) m4api-0.3~0.9646fd/example.c000066400000000000000000000025011222070503000153510ustar00rootroot00000000000000#include #include "m4api.h" int main (int argc, char **argv) { float fval; int ival; /* m4api will handle conversion to 8- or 16-bit integer */ struct m4Diagnostics diag; struct usb_dev_handle *dev; char user_buf[64]; printf("This example will set your VIN_MIN_ON to 10 V, and it will\n" "increase IGN_DBC by 10 ms. OK? Type 'yes' or 'no': "); if (NULL == fgets(user_buf, sizeof(user_buf), stdin) || user_buf[0] != 'y') { printf("Exiting.\n"); return -1; } dev = m4Init(); if (!dev) { perror("m4Init"); return -1; } /* Read in diagnostics */ if (m4GetDiag(dev, &diag)) return -1; printf("VIN = %0.2f\n", diag.vin); printf("V33 = %0.2f\n", diag.v33); /* Get and update a voltage level */ if (m4GetFloat(dev, M4_VIN_MIN_ON, &fval)) return -1; printf("VIN_MIN_ON was %0.2f", fval); fval = 10.0; if (m4SetFloat(dev, M4_VIN_MIN_ON, fval)) return -1; if (m4GetFloat(dev, M4_VIN_MIN_ON, &fval)) return -1; printf(", now %0.2f\n", fval); /* Update an integer */ if (m4GetInteger(dev, M4_IGN_DBC, &ival)) return -1; printf("IGN_DBC was %d", ival); ival += 10; if (m4SetInteger(dev, M4_IGN_DBC, ival)) return -1; if (m4GetInteger(dev, M4_IGN_DBC, &ival)) return -1; printf (", now %d\n", ival); return 0; } m4api-0.3~0.9646fd/license.txt000066400000000000000000000635021222070503000157450ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! m4api-0.3~0.9646fd/m4api.c000066400000000000000000000310211222070503000147270ustar00rootroot00000000000000/* * m4api, a tool for M4-ATX DC-DC power supplies * (c) 2009-2010 Ken Tossell * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License, version 2.1, * as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this software; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "m4api.h" static size_t m4TypeLengths[13] = { 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1 }; static float m4TypeConversions_v1[13] = { 0.1123, 0.076625, 0.0375, 0.0188136, 1.0, 1.0, 1.0, 1.0, 10.0, 10.0, 1.0, 1.0, 1.0 }; static float m4TypeConversions_v2[13] = { 0.1552, 0.1165, 0.0389, 0.0195, 1.0, 1.0, 1.0, 1.0, 10.0, 10.0, 1.0, 1.0, 1.0 }; static int m4TypeForms[13] = { M4_FLOAT, M4_FLOAT, M4_FLOAT, M4_FLOAT, M4_INTEG, M4_INTEG, M4_INTEG, M4_INTEG, M4_INTEG, M4_INTEG, M4_TIMER, M4_INTEG, M4_INTEG }; char* m4TypeDescs[14] = { "V", "V", "V", "V", "deg. C", "sec", "ms", "ms", "ms", "ms", "", "tries", "" }; struct m4DiagField m4DiagFields[6] = { {M4_VLT_12_11, 2, "VIN", "Input voltage"}, {M4_VLT_12_11, 3, "IGN", "Ignition voltage"}, {M4_VLT_33_01, 4, "33V", "Voltage on 3.3V rail"}, {M4_VLT_5_03, 5, "5V", "Voltage on 5V rail"}, {M4_VLT_12_07, 6, "12V", "Voltage on 12V rail"}, {M4_DEG, 12, "TEMP", "Temperature"}, }; size_t m4NumDiagFields = sizeof(m4DiagFields) / sizeof(m4DiagFields[0]); struct m4ConfigField m4ConfigFields[47] = { {M4_VLT_12_11, 0x00, "IGN_HIGH", "Ignition HIGH limit"}, {M4_VLT_12_11, 0x01, "IGN_LOW", "Ignition LOW limit"}, {M4_MSC_10_1, 0x02, "IGN_DBC", "Ignition debounce"}, {M4_SEC, 0x03, "PSU_DELAY", "Delay before PSU startup"}, {M4_VLT_12_11, 0x04, "VIN_MIN_START", "Min. VIN voltage at PSU startup"}, {M4_VLT_12_11, 0x05, "VIN_MIN_ON", "Min. VIN voltage while all rails are on"}, {M4_VLT_12_11, 0x06, "VIN_MIN_5V", "Min. VIN voltage while 5VSB is on"}, {M4_VLT_12_11, 0x07, "VIN_MAX", "Max. allowed VIN voltage"}, {M4_VLT_12_07, 0x08, "12V_MAX", "Max. limit for 12V"}, {M4_VLT_12_07, 0x09, "12V_MIN", "Min. limit for 12V"}, {M4_VLT_5_03, 0x0a, "5V_MAX", "Max. limit for 5V"}, {M4_VLT_5_03, 0x0b, "5V_MIN", "Min. limit for 5V"}, {M4_VLT_33_01, 0x0c, "33V_MAX", "Max. limit for 3.3V"}, {M4_VLT_33_01, 0x0d, "33V_MIN", "Min. limit for 3.3V"}, {M4_MSC_1_1, 0x0e, "12V_TIME", "12V rail startup time"}, {M4_MSC_1_1, 0x0f, "33V_TIME", "3.3V rail startup time"}, {M4_MSC_10_2, 0x10, "PWRSW", "PWRSW 'push-down' time"}, {M4_TRY, 0x12, "PSU_ON_TIME", "Try to turn ON the PSU for N time"}, {M4_SEC, 0x13, "ON_DELAY", "Delay between ON tries"}, {M4_TRY, 0x14, "PSU_OFF_TIME", "Try to turn OFF the PSU for N time"}, {M4_SEC, 0x15, "OFF_DELAY", "Delay between OFF tries"}, {M4_SEC, 0x16, "EMG_TIME_5VSB", "Emergency shutdown timer for 5VSB"}, {M4_SEC, 0x17, "EMG_TIMER", "Emergency shutdown timer"}, {M4_MSC_10_1, 0x18, "PS_ON_0", "PS ON 0 threshold"}, {M4_MSC_10_1, 0x19, "PS_ON_1", "PS ON 1 threshold"}, {M4_MSC_10_2, 0x1a, "THUMP", "Thump timeout"}, {M4_DEG, 0x1c, "TEMP_MAX", "Max. temperature"}, {M4_DEG, 0x1d, "TEMP_MIN", "Min. temperature"}, {M4_BYT, 0x1e, "EMG_OFF_MODE", "Emergency OFF mode selector"}, {M4_MSC_10_1, 0x1f, "5V_SBY_DLY", "5V standby PSW-on delay"}, {M4_TIM, 0x20, "OFF_DELAY_0", "Off-delay MODE 0"}, {M4_TIM, 0x22, "OFF_HARD_0", "Hard-off MODE 0"}, {M4_TIM, 0x24, "OFF_DELAY_1", "Off-delay MODE 1"}, {M4_TIM, 0x26, "OFF_HARD_1", "Hard-off MODE 1"}, {M4_TIM, 0x28, "OFF_DELAY_2", "Off-delay MODE 2"}, {M4_TIM, 0x2a, "OFF_HARD_2", "Hard-off MODE 2"}, {M4_TIM, 0x2c, "OFF_DELAY_3", "Off-delay MODE 3"}, {M4_TIM, 0x2e, "OFF_HARD_3", "Hard-off MODE 3"}, {M4_TIM, 0x30, "OFF_DELAY_4", "Off-delay MODE 4"}, {M4_TIM, 0x32, "OFF_HARD_4", "Hard-off MODE 4"}, {M4_TIM, 0x34, "OFF_DELAY_5", "Off-delay MODE 5"}, {M4_TIM, 0x36, "OFF_HARD_5", "Hard-off MODE 5"}, {M4_TIM, 0x38, "OFF_DELAY_6", "Off-delay MODE 6"}, {M4_TIM, 0x3a, "OFF_HARD_6", "Hard-off MODE 6"}, {M4_TIM, 0x3c, "OFF_DELAY_7", "Off-delay MODE 7"}, {M4_TIM, 0x3e, "OFF_HARD_7", "Hard-off MODE 7"}, /* big gap with no (known) fields */ {M4_BYT, 0xff, "RESET", "Reset to factory defaults"}, }; #define VENDOR 0x04d8 #define PRODUCT 0xd001 #define READ_ENDPOINT 0x81 #define WRITE_ENDPOINT 0x01 #define TIMEOUT 3000 typedef struct m4Handle { struct usb_dev_handle *usb_devh; int version; } m4Handle; static float* _m4GetConversionsTable(m4Handle *dev) { if (dev->version >= 0x20) return m4TypeConversions_v2; else return m4TypeConversions_v1; } m4Handle *m4Init() { struct usb_bus *bus; struct usb_device *dev; usb_dev_handle *usb_devh = NULL; m4Handle *m4_handle = NULL; char diag_buf[24]; usb_init(); if (usb_find_busses() < 0) { return NULL; } if (usb_find_devices() < 0) { return NULL; } bus = usb_get_busses(); while (bus && !usb_devh) { dev = bus->devices; while (dev && !usb_devh) { if (dev->descriptor.idVendor == VENDOR && dev->descriptor.idProduct == PRODUCT) { usb_devh = usb_open(dev); if (usb_devh) { #ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP /* Linux usually claims HID devices for its usbhid driver. */ usb_detach_kernel_driver_np(usb_devh, 0); #endif if (usb_set_configuration(usb_devh, 1) < 0 || usb_claim_interface(usb_devh, 0) < 0 || usb_set_altinterface(usb_devh, 0) < 0) { usb_close(usb_devh); usb_devh = NULL; continue; } } } dev = dev->next; } bus = bus->next; } if (!usb_devh) goto fail; m4_handle = (m4Handle*) malloc(sizeof(m4Handle)); if (!m4_handle) goto fail; memset(m4_handle, 0, sizeof(m4Handle)); m4_handle->usb_devh = usb_devh; if (m4FetchDiag(m4_handle, diag_buf) < 0) goto fail; m4_handle->version = diag_buf[23]; return m4_handle; fail: if (m4_handle) free(m4_handle); if (usb_devh) usb_close(usb_devh); return NULL; } void m4Close(m4Handle *dev) { if (dev->usb_devh) usb_close(dev->usb_devh); free(dev); } int m4Read(m4Handle *dev, unsigned char *buf, unsigned int len, int timeout) { return usb_interrupt_read(dev->usb_devh, READ_ENDPOINT, (char*) buf, len, timeout); } int m4Write(m4Handle *dev, unsigned char *buf, unsigned int len, int timeout) { return usb_interrupt_write(dev->usb_devh, WRITE_ENDPOINT, (char*) buf, len, timeout); } int m4FetchDiag(m4Handle *dev, char *buf) { unsigned char pollCmd[] = {0x81, 0x00}; if (m4Write(dev, pollCmd, 2, TIMEOUT) != 2) return -1; if (m4Read(dev, buf, 24, TIMEOUT) != 24) return -1; if (buf[0] != 0x21) return -1; return 0; } int m4GetDiag(m4Handle *dev, struct m4Diagnostics *diag) { char buf[24]; int field_id; if (m4FetchDiag(dev, buf) < 0) return -1; diag->vin = m4GetVal(dev, M4_VLT_12_11, buf + 2); diag->vign = m4GetVal(dev, M4_VLT_12_11, buf + 3); diag->v33 = m4GetVal(dev, M4_VLT_33_01, buf + 4); diag->v5 = m4GetVal(dev, M4_VLT_5_03, buf + 5); diag->v12 = m4GetVal(dev, M4_VLT_12_07, buf + 6); diag->temp = m4GetVal(dev, M4_DEG, buf + 12); return 0; } float m4GetVal(m4Handle *dev, enum m4Type type, char *posn) { float val; short tmp_sh; int tmp_i; float *conversions; switch (m4TypeLengths[type]) { case 1: tmp_i = posn[0]; if (type != M4_DEG) tmp_i &= 0xff; break; case 2: if (type == M4_DEG) { tmp_sh = (posn[0] << 8) | (posn[1]); tmp_i = (float) tmp_sh; } else { tmp_i = ((unsigned char) posn[0] << 8) | ((unsigned char) posn[1]); } break; default: printf("ERROR: typeLen(%d) == %lu!\n", type, m4TypeLengths[type]); exit(-1); } // printf("%x ", tmp_i); conversions = _m4GetConversionsTable(dev); val = tmp_i * conversions[type]; return val; } void m4PrintVal(m4Handle *dev, enum m4Type type, float val) { int tmp_i, sec, min, hr; switch (m4TypeForms[type]) { case M4_INTEG: if (type == M4_DEG) printf("%+d", (int) val); else printf("%d", (int) val); break; case M4_FLOAT: printf("%0.2f", val); break; case M4_TIMER: tmp_i = (int) val; if (tmp_i == 0xffff) { printf("never"); } else { sec = tmp_i % 60; min = (tmp_i % 3600) / 60; hr = tmp_i / 3600; printf("%02d:%02d:%02d", hr, min, sec); } break; default: printf("ERROR: typeForm(%d) == %d!\n", type, m4TypeForms[type]); break; } } int m4GetConfig(m4Handle *dev, struct m4ConfigField *field, char *buf) { unsigned char cmd[24] = {0xa4, 0xa1}; cmd[2] = field->index; cmd[3] = m4TypeLengths[field->type]; if (m4Write(dev, cmd, 24, TIMEOUT) != 24) return -1; if (m4Read(dev, buf, 24, TIMEOUT) != 24) return -1; if (buf[0] != 0x31) return -1; return 0; } int m4ParseValue(m4Handle *dev, enum m4Type type, char const *strval, char *buf) { int intval; float fval; int hr, min, sec; float *conversions = _m4GetConversionsTable(dev); switch(m4TypeForms[type]) { case M4_INTEG: intval = atoi(strval) / (int) conversions[type]; break; case M4_FLOAT: fval = atof(strval); intval = fval / conversions[type]; break; case M4_TIMER: if (!strcasecmp("never", strval)) intval = 0xffff; else { if (sscanf(strval, "%d:%d:%d", &hr, &min, &sec) != 3) return -1; else intval = 3600 * hr + 60 * min + sec; } } if (m4TypeLengths[type] == 2) { buf[0] = intval >> 8; buf[1] = intval; } else { buf[0] = intval; buf[1] = 0; } return 0; } int m4GetFloat(m4Handle *dev, enum m4FieldID fid, float *out) { char buf[24]; struct m4ConfigField *field; field = &m4ConfigFields[fid]; if (m4GetConfig(dev, field, buf)) return -1; *out = m4GetVal(dev, field->type, &buf[4]); return 0; } int m4SetFloat(m4Handle *dev, enum m4FieldID fid, float val) { char binary[2]; int ival; struct m4ConfigField *field; float *conversions; field = &m4ConfigFields[fid]; conversions = _m4GetConversionsTable(dev); ival = val / conversions[field->type]; if (m4TypeLengths[field->type] == 2) { binary[0] = ival >> 8; binary[1] = ival; } else { binary[0] = ival; binary[1] = 0; } return m4SetBinary(dev, field, binary); } int m4GetInteger(m4Handle *dev, enum m4FieldID fid, int *out) { char buf[24]; struct m4ConfigField *field; field = &m4ConfigFields[fid]; if (m4GetConfig(dev, field, buf)) return -1; *out = (int) m4GetVal(dev, field->type, &buf[4]); return 0; } int m4SetInteger(m4Handle *dev, enum m4FieldID fid, int val) { char binary[2]; struct m4ConfigField *field; float *conversions = _m4GetConversionsTable(dev); field = &m4ConfigFields[fid]; val /= conversions[field->type]; if (m4TypeLengths[field->type] == 2) { binary[0] = val >> 8; binary[1] = val; } else { binary[0] = val; binary[1] = 0; } return m4SetBinary(dev, field, binary); } int m4SetConfig(m4Handle *dev, struct m4ConfigField *field, char const *strval) { char binary[] = {0, 0}; if (m4ParseValue(dev, field->type, strval, binary) < 0) return -1; return m4SetBinary(dev, field, binary); } int m4SetBinary(m4Handle *dev, struct m4ConfigField *field, char const *val) { char buf[24]; unsigned char cmd[24] = {0xa4, 0xa0}; cmd[2] = field->index; cmd[3] = m4TypeLengths[field->type]; cmd[4] = val[0]; cmd[5] = val[1]; if (m4Write(dev, cmd, 24, TIMEOUT) != 24) return -1; if (m4Read(dev, buf, 24, TIMEOUT) != 24) return -1; if (buf[0] != 0x31 || buf[2] != cmd[2] || buf[4] != cmd[4] || buf[5] != cmd[5]) return -1; return 0; } void m4PrintDiag(m4Handle *dev, char *buf) { int field_id; size_t config_offset = 0; float value; for (field_id = 0; field_id < m4NumDiagFields; ++field_id) { printf("%s:\t", m4DiagFields[field_id].name); value = m4GetVal(dev, m4DiagFields[field_id].type, buf + m4DiagFields[field_id].index); m4PrintVal(dev, m4DiagFields[field_id].type, value); puts(""); } } int m4ConfigField(m4Handle *dev, char const *name) { int field_id; for (field_id = 0; field_id < M4_NUM_CONFIG_FIELDS; ++field_id) { if (!strcasecmp(m4ConfigFields[field_id].name, name)) return field_id; } return -1; } m4api-0.3~0.9646fd/m4api.ebuild000066400000000000000000000010071222070503000157520ustar00rootroot00000000000000# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=3 DESCRIPTION="M4-ATX power supply utility" HOMEPAGE="http://ram.umd.edu/wiki/Public/Software/m4api" SRC_URI="http://ram.umd.edu/git/bits/m4api.git/snapshot/refs/tags/${P}.tar.gz" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="" DEPEND="=dev-libs/libusb-0.1*" RDEPEND="${DEPEND}" S="${WORKDIR}"/m4api-${P} src_compile() { emake || die 'emake' } src_install() { dobin m4ctl } m4api-0.3~0.9646fd/m4api.h.in000066400000000000000000000102451222070503000153460ustar00rootroot00000000000000/* * m4api, a tool for M4-ATX DC-DC power supplies * (c) 2009-2010 Ken Tossell * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License, version 2.1, * as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this software; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef M4API_H #define M4API_H #ifdef __cplusplus extern "C" { #endif // __cplusplus const int M4API_VERSION_MAJOR = @m4api_VERSION_MAJOR@; const int M4API_VERSION_MINOR = @m4api_VERSION_MINOR@; const float M4API_VERSION = @m4api_VERSION@; enum m4Type { M4_VLT_12_11, M4_VLT_12_07, M4_VLT_5_03, M4_VLT_33_01, M4_DEG, M4_SEC, M4_MSC_1_1, // 1 byte M4_MSC_1_2, // 2 bytes M4_MSC_10_1, // 1 byte M4_MSC_10_2, // 2 bytes M4_TIM, // 2 bytes M4_TRY, M4_BYT }; enum m4FieldID { M4_IGN_HIGH, M4_IGN_LOW, M4_IGN_DBC, M4_PSU_DELAY, M4_VIN_MIN_START, M4_VIN_MIN_ON, M4_VIN_MIN_5V, M4_VIN_MAX, M4_12V_MAX, M4_12V_MIN, M4_5V_MAX, M4_5V_MIN, M4_33V_MAX, M4_33V_MIN, M4_12V_TIME, M4_33V_TIME, M4_PWRSW, M4_PSU_ON_TIME, M4_ON_DELAY, M4_PSU_OFF_TIME, M4_OFF_DELAY, M4_EMG_TIME_5VSB, M4_EMG_TIMER, M4_PS_ON_0, M4_PS_ON_1, M4_THUMP, M4_TEMP_MAX, M4_TEMP_MIN, M4_EMG_OFF_MODE, M4_5V_SBY_DLY, M4_OFF_DELAY_0, M4_OFF_HARD_0, M4_OFF_DELAY_1, M4_OFF_HARD_1, M4_OFF_DELAY_2, M4_OFF_HARD_2, M4_OFF_DELAY_3, M4_OFF_HARD_3, M4_OFF_DELAY_4, M4_OFF_HARD_4, M4_OFF_DELAY_5, M4_OFF_HARD_5, M4_OFF_DELAY_6, M4_OFF_HARD_6, M4_OFF_DELAY_7, M4_OFF_HARD_7, M4_RESET, M4_NUM_CONFIG_FIELDS }; enum m4Repr { M4_INTEG, M4_FLOAT, M4_TIMER }; struct m4DiagField { enum m4Type type; unsigned int index; char *name; char *desc; }; struct m4ConfigField { enum m4Type type; unsigned int index; char *name; char *desc; }; struct m4Diagnostics { float vin; float vign; float v33; float v5; float v12; float temp; }; struct m4Handle; extern struct m4DiagField m4DiagFields[]; extern struct m4ConfigField m4ConfigFields[]; extern char* m4TypeDescs[]; /* Find and open the PSU */ struct m4Handle *m4Init(); /* Close the device handle */ void m4Close(struct m4Handle *dev); /* User-friendly-ish routines for setting/getting config values */ int m4GetFloat(struct m4Handle *dev, enum m4FieldID fid, float *out); int m4SetFloat(struct m4Handle *dev, enum m4FieldID fid, float val); int m4GetInteger(struct m4Handle *dev, enum m4FieldID fid, int *out); int m4SetInteger(struct m4Handle *dev, enum m4FieldID fid, int val); /* Get the diagnostic string in its raw form (<0 = error) */ int m4FetchDiag(struct m4Handle *dev, char *buf); /* Get the diagnostic values in processed form (<0 = error) */ int m4GetDiag(struct m4Handle *dev, struct m4Diagnostics *diag); /* Get a floating-point representation of the value stored at specified memory location */ float m4GetVal(struct m4Handle *dev, enum m4Type type, char *posn); /* Print the formatted value of the element of type `type' and value `val' */ void m4PrintVal(struct m4Handle *dev, enum m4Type type, float val); /* Load the field's value from the PSU into buf */ int m4GetConfig(struct m4Handle *dev, struct m4ConfigField *field, char *buf); /* Parse a value (123, 1.23 or 00:00:10) into buffer, encoding it */ int m4ParseValue(struct m4Handle *dev, enum m4Type type, char const *strval, char *buf); /* Write the human-readable value to the field on the PSU */ int m4SetConfig(struct m4Handle *dev, struct m4ConfigField *field, char const *strval); /* Print the status variables in the (raw) buffer */ void m4PrintDiag(struct m4Handle *dev, char *buf); /* Find the m4ConfigField of the given name */ int m4ConfigField(struct m4Handle *dev, char const *name); #ifdef __cplusplus } #endif // __cplusplus #endif m4api-0.3~0.9646fd/m4api.pc.in000066400000000000000000000005231222070503000155170ustar00rootroot00000000000000libdir=@CMAKE_INSTALL_PREFIX@/lib includedir=@CMAKE_INSTALL_PREFIX@/include/m4api Name: m4api Description: Library for controlling the M4-ATX power supply Requires: libusb Version: @m4api_VERSION@ URL: http://ram.umd.edu/wiki/Public/Software/m4api Libs: -L${libdir} -lm4api Libs.private: -L${libdir} -lusb -lm4api Cflags: -I${includedir} m4api-0.3~0.9646fd/m4ctl.c000066400000000000000000000061061222070503000147460ustar00rootroot00000000000000/* * m4api, a tool for M4-ATX DC-DC power supplies * (c) 2009-2010 Ken Tossell * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License, version 2.1, * as published by the Free Software Foundation. * * This software is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this software; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "m4api.h" int main (int argc, char **argv) { int field_id; float val; struct m4Handle *dev; dev = m4Init(); if (!dev) { perror("m4Init"); return -1; } /* by default, print diagnostics */ if (argc == 1 || (argc >= 2 && !strcmp(argv[1], "-diag"))) { char diagBuf[24]; char repeat = argc >= 3; if (repeat) { for (;;) { if (m4FetchDiag(dev, diagBuf) < 0) { puts("ERROR: cannot fetch diagnostics"); return -1; } printf("-- %d\n", time(NULL)); m4PrintDiag(dev, diagBuf); sleep(1); } } else { if (m4FetchDiag(dev, diagBuf) < 0) { puts("ERROR: cannot fetch diagnostics"); return -1; } m4PrintDiag(dev, diagBuf); } } else if (argc >= 2 && !strcmp(argv[1], "-config")) { /* with no further args after -config, print them all */ char configBuf[24]; if (argc == 2) { for (field_id = 0; field_id < M4_NUM_CONFIG_FIELDS; ++field_id) { struct m4ConfigField *field = &m4ConfigFields[field_id]; printf("%s:\t", field->name); m4GetConfig(dev, field, configBuf); m4PrintVal(dev, field->type, m4GetVal(dev, field->type, &configBuf[4])); if (*m4TypeDescs[field->type] != 0) printf(" %s\n", m4TypeDescs[field->type]); else puts(""); } } else { /* we got a field name; first verify it */ int field_id = m4ConfigField(dev, argv[2]); if (field_id < 0) { fprintf(stderr, "%s: Invalid configuration field\n", argv[2]); return -1; } struct m4ConfigField *field = &m4ConfigFields[field_id]; if (argc >= 4) { return m4SetConfig(dev, field, argv[3]); } else { m4GetConfig(dev, field, configBuf); m4PrintVal(dev, field->type, m4GetVal(dev, field->type, &configBuf[4])); if (&m4TypeDescs[field->type] != 0) printf(" %s\n", m4TypeDescs[field->type]); else puts(""); } } } else { printf("m4ctl version %d.%d\n", M4API_VERSION_MAJOR, M4API_VERSION_MINOR); printf("USAGE: %s -diag [loop] # Print diagnostic values\n" \ " %s -config # Print all config values\n" \ " %s -config FIELD # Print one field\n" \ " %s -config FIELD VALUE # Set one value\n", argv[0], argv[0], argv[0], argv[0] ); return -1; } m4Close(dev); return 0; } m4api-0.3~0.9646fd/readme.txt000066400000000000000000000013651222070503000155570ustar00rootroot00000000000000m4api is a tool for monitoring and configuring Mini-Box M4-ATX power supplies. Built using libusb 0.1, m4api can be used on Linux, Mac, BSD and Windows systems. For information about libusb, see http://www.libusb.org/. Up-to-date source code is available at: http://ram.umd.edu/wiki/Public/Software/m4api or http://ram.umd.edu/git/ For Git access: $ git clone git://ram.umd.edu/bits/m4api.git INSTALLATION ============ $ mkdir -p build $ cd build $ cmake .. $ make $ sudo make install USAGE ===== $ ./m4ctl -diag [loop] # Print diagnostic values $ ./m4ctl -config # Print all config values $ ./m4ctl -config FIELD # Print one field $ ./m4ctl -config FIELD VALUE # Set one value -- Ken Tossell ktossell@umd.edu