diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 94a9ed024..000000000
--- a/LICENSE
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, 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
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If 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 convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU 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
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state 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 program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/README.md b/README.md
deleted file mode 100644
index 4c9c3c72d..000000000
--- a/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# moOde audio player
-
-Moode Audio Player is a derivative of the wonderful WebUI audio player client for MPD originally designed and coded by Andrea Coiutti and Simone De Gregori, and subsequently enhanced by early efforts from the RaspyFi/Volumio projects.
-
-Tim Curtis © 2014
-
-Release Notes https://github.com/moode-player/moode/blob/master/www/relnotes.txt
-Player Setup https://github.com/moode-player/moode/blob/master/www/setup.txt
-Moode OS Builder https://github.com/moode-player/mosbuild
-
-## Other Resources
-[moodeaudio.org](http://moodeaudio.org)\
-[moOde Twitter feed](http://twitter.com/MoodeAudio)\
-[Contributors](https://github.com/moode-player/moode/blob/master/www/CONTRIBS.html)
diff --git a/etc/avahi/services/moode.service b/etc/avahi/services/moode.service
new file mode 100755
index 000000000..7f614bbc2
--- /dev/null
+++ b/etc/avahi/services/moode.service
@@ -0,0 +1,10 @@
+
+
+
+
+ moOde audio player: %h
+
+ _http._tcp
+ 80
+
+
diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf
index 8bd4cb14e..ac86c992f 100755
--- a/etc/nginx/nginx.conf
+++ b/etc/nginx/nginx.conf
@@ -30,7 +30,7 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
- client_max_body_size 8M;
+ client_max_body_size 8M;
##
# SSL Settings
diff --git a/etc/php/7.0/cli/php.ini b/etc/php/7.0/cli/php.ini
index 425fd7071..c73a5c95d 100755
--- a/etc/php/7.0/cli/php.ini
+++ b/etc/php/7.0/cli/php.ini
@@ -810,7 +810,8 @@ file_uploads = On
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
-upload_max_filesize = 2M
+;upload_max_filesize = 2M
+upload_max_filesize = 8M
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
diff --git a/home/xinitrc.default b/home/xinitrc.default
index b353dfac3..6f6950266 100755
--- a/home/xinitrc.default
+++ b/home/xinitrc.default
@@ -17,6 +17,7 @@
# along with this program. If not, see .
#
# 2018-01-26 TC moOde 4.0
+# 2018-04-02 TC moOde 4.1 remove --disable-overlay-scrollbar because it has no effect either disable or enable
#
# Turn off display power management
@@ -26,6 +27,6 @@ xset s 600
# launch chrome browser
SCREENSIZE="$(fbset -s | awk '$1 == "geometry" { print $2","$3 }')"
-chromium-browser --kiosk --touch-events --disable-touch-drag-drop --disable-overlay-scrollbar \
+chromium-browser --kiosk --touch-events --disable-touch-drag-drop \
--enable-touchview --enable-pinch --window-size=$SCREENSIZE --window-position=0,0 \
--disable-session-crashed-bubble --disable-infobars --no-first-run --app=http://localhost/
diff --git a/lib/systemd/system/bluetooth.service b/lib/systemd/system/bluetooth.service
index 448626433..a08f2792c 100644
--- a/lib/systemd/system/bluetooth.service
+++ b/lib/systemd/system/bluetooth.service
@@ -1,5 +1,9 @@
#
# 2018-01-26 TC moOde 4.0
+# 2018-04-02 TC moOde 4.1
+# - change ExecStart to use the symlink in /usr/sbin
+# - allows 5.43 and 5.49 bluez to work with this file
+# - note: --noplugin=sap may not be needed with 5.49
#
[Unit]
@@ -10,7 +14,7 @@ ConditionPathIsDirectory=/sys/class/bluetooth
[Service]
Type=dbus
BusName=org.bluez
-ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap
+ExecStart=/usr/sbin/bluetoothd --noplugin=sap
NotifyAccess=main
#WatchdogSec=10
#Restart=on-failure
diff --git a/lib/systemd/system/localui.service b/lib/systemd/system/localui.service
index d8e29088e..2eb126537 100755
--- a/lib/systemd/system/localui.service
+++ b/lib/systemd/system/localui.service
@@ -1,20 +1,3 @@
-#!/bin/bash
-#
-# moOde audio player (C) 2014 Tim Curtis
-# http://moodeaudio.org
-#
-# This Program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# This Program 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
#
# 2018-01-26 TC moOde 4.0
#
diff --git a/mpd/playlists/Default Playlist.m3u b/mpd/playlists/Default Playlist.m3u
index 6964cbc15..6ad59231b 100755
--- a/mpd/playlists/Default Playlist.m3u
+++ b/mpd/playlists/Default Playlist.m3u
@@ -21,7 +21,6 @@ http://ice1.somafm.com/covers-128-mp3
http://ice1.somafm.com/deepspaceone-128-aac
http://ice1.somafm.com/defcon-128-aac
http://ice1.somafm.com/digitalis-128-aac
-http://ice1.somafm.com/doomed-128-aac
http://ice1.somafm.com/dronezone-128-aac
http://ice1.somafm.com/dubstep-128-aac
http://ice1.somafm.com/fluid-128-aac
diff --git a/network/dhcpcd.conf.default b/network/dhcpcd.conf.default
index 0416637eb..ee634c8c4 100755
--- a/network/dhcpcd.conf.default
+++ b/network/dhcpcd.conf.default
@@ -16,3 +16,4 @@ slaac private
#AP mode
#interface wlan0
#static ip_address=172.24.1.1/24
+#nohook wpa_supplicant
diff --git a/network/wpa_supplicant.conf.default b/network/wpa_supplicant.conf.default
index 268c9c472..f3bf1f0db 100755
--- a/network/wpa_supplicant.conf.default
+++ b/network/wpa_supplicant.conf.default
@@ -3,6 +3,6 @@
# the player Network configuration page.
#########################################
-country=GB
+country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
diff --git a/other/bluetooth/bluez-5.49.tar.xz b/other/bluetooth/bluez-5.49.tar.xz
new file mode 100755
index 000000000..5f2907cac
Binary files /dev/null and b/other/bluetooth/bluez-5.49.tar.xz differ
diff --git a/other/build/build_recipe_v2.3.txt b/other/build/build_recipe_v2.4.txt
similarity index 92%
rename from other/build/build_recipe_v2.3.txt
rename to other/build/build_recipe_v2.4.txt
index c8bb50e25..efd6426a4 100644
--- a/other/build/build_recipe_v2.3.txt
+++ b/other/build/build_recipe_v2.4.txt
@@ -1,8 +1,8 @@
################################################################
#
-# Build Recipe v2.3, 2018-01-26
+# Build Recipe v2.4, 2018-04-02
#
-# moOde 4.0
+# moOde 4.1
#
# These instructions are written for Linux Enthusiasts
# and System Integrators and provide a recipe for making
@@ -15,6 +15,17 @@
#
# Changes:
#
+# v2.4: Set permissions for localui.service in STEP 8
+# Specify Linux kernel by Git hash in STEP 11
+# Add echo "y" to rpi-update in STEP 11, reqd for prompt in 4.14.y branch
+# Add apt-get clean to STEP 11
+# Bump to MPD 0.20.18 in STEP 6
+# Bump to upmpdcli-code-1.2.16 in COMPONENT 6 for Tidal fixes
+# Bump to Bluetooth 5.49 in STEP 4
+# Use local libupnppsamples-code sources in COMPONENT 6
+# Remove djmount in COMPONENT 1 and /mnt/UPNP in STEP 7
+# Set time zone to America/Detroit in STEP 2
+# Add second apt-get update in STEP 3 for robustness
# v2.3: Add sudo for cp pre-compiled MPD binary in STEP 6
# Bump to shairport-sync 3.1.7
# Reset dir permissions for var local in STEP 8
@@ -173,7 +184,9 @@ net.ifnames=0
1. Insert the SD Card into a Raspberry Pi and POWER UP.
-2. Change the current password (raspberry) to moodeaudio and the host name to moode.
+2. sudo timedatectl set-timezone "America/Detroit"
+
+3. Change the current password (raspberry) to moodeaudio and the host name to moode.
ssh pi@raspberrypi (pwd=raspberry)
@@ -181,7 +194,7 @@ echo "pi:moodeaudio" | sudo chpasswd
sudo sed -i "s/raspberrypi/moode/" /etc/hostname
sudo sed -i "s/raspberrypi/moode/" /etc/hosts
-3. Download moOde application sources and configs.
+4. Download moOde application sources and configs.
//
// NOTE: We are downloading the Sources in this particular step in order to obtain the resizefs.sh file.
@@ -193,7 +206,7 @@ cd ~
wget http://moodeaudio.org/downloads/prod/rel-stretch-r40.zip
sudo unzip ./rel-stretch-r40.zip
-4. Expand the root partition to 3GB.
+5. Expand the root partition to 3GB.
sudo cp ./rel-stretch/www/command/resizefs.sh ./
sudo chmod 0755 ./resizefs.sh
@@ -231,6 +244,8 @@ sudo apt-get -y upgrade
# SR2
sudo reboot
+sudo apt-get update
+
sudo apt-get -y install rpi-update php-fpm nginx sqlite3 php-sqlite3 memcached php-memcache mpc \
bs2b-ladspa libbs2b0 libasound2-plugin-equal telnet automake sysstat squashfs-tools tcpdump shellinabox \
samba smbclient udisks-glue ntfs-3g exfat-fuse git inotify-tools libav-tools avahi-utils
@@ -253,10 +268,27 @@ sudo systemctl disable dnsmasq
2. Install Bluetooth
-sudo apt-get -y install bluez bluez-firmware pi-bluetooth \
-dh-autoreconf expect libortp-dev libbluetooth-dev libasound2-dev \
+sudo apt-get -y install bluez-firmware pi-bluetooth \
+dh-autoreconf expect libdbus-1-dev libortp-dev libbluetooth-dev libasound2-dev \
libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc-dev
+# Compile bluez
+sudo cp ./rel-stretch/other/bluetooth/bluez-5.49.tar.xz ./
+sudo tar xvf bluez-5.49.tar.xz
+cd bluez-5.49
+./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-library
+sudo make
+sudo make install
+cd ~
+sudo rm -rf ./bluez-5.49
+sudo rm ./bluez-5.49.tar.xz
+
+# Delete symlink and bin for old bluetoothd
+sudo rm /usr/sbin/bluetoothd
+sudo rm -rf /usr/lib/bluetooth
+# Create symlink for new bluetoothd
+sudo ln -s /usr/libexec/bluetooth/bluetoothd /usr/sbin/bluetoothd
+
NOTE: Ignore warnings from autoreconf and configure
cd /tmp
@@ -353,15 +385,15 @@ libboost-dev \
libicu-dev \
libglib2.0-dev
-3. Download MPD 0.20.12 sources and prep for compile.
+3. Download MPD 0.20.18 sources and prep for compile.
# Optionally install pre-compiled binary and skip to STEP 7
-sudo cp ./rel-stretch/other/mpd/mpd-0.20.12 /usr/local/bin/mpd
+sudo cp ./rel-stretch/other/mpd/mpd-0.20.18 /usr/local/bin/mpd
sudo reboot
-sudo wget http://www.musicpd.org/download/mpd/0.20/mpd-0.20.12.tar.xz
-sudo tar xf mpd-0.20.12.tar.xz
-cd mpd-0.20.12
+sudo wget http://www.musicpd.org/download/mpd/0.20/mpd-0.20.18.tar.xz
+sudo tar xf mpd-0.20.18.tar.xz
+cd mpd-0.20.18
sudo sh autogen.sh
4. Configure compile options.
@@ -384,7 +416,7 @@ sudo make
sudo make install
sudo strip --strip-unneeded /usr/local/bin/mpd
cd ~
-sudo rm -rf ./mpd-0.20.12*
+sudo rm -rf ./mpd-0.20.18*
sudo apt-get clean
sudo apt-get autoremove
@@ -421,7 +453,6 @@ sudo mkdir /var/lib/mpd/music/RADIO
# Mount points
sudo mkdir /mnt/NAS
sudo mkdir /mnt/SDCARD
-sudo mkdir /mnt/UPNP
# Symlinks
sudo ln -s /mnt/NAS /var/lib/mpd/music/NAS
sudo ln -s /mnt/SDCARD /var/lib/mpd/music/SDCARD
@@ -497,6 +528,8 @@ sudo chmod 0755 /usr/local/bin/a2dp-autoconnect
sudo chmod 0644 /lib/systemd/system/rotenc.service
# Udev
sudo chmod 0644 /etc/udev/rules.d/*
+# Localui
+sudo chmod 0644 /lib/systemd/system/localui.service
4. Services are started by moOde Worker so lets disable them here.
@@ -566,14 +599,18 @@ sudo reboot
////////////////////////////////////////////////////////////////
//
-// STEP 11 - Optionally install latest Linux Kernel
+// STEP 11 - Optionally install updated Linux Kernel
//
////////////////////////////////////////////////////////////////
-sudo PRUNE_MODULES=1 rpi-update
+// STEP 11 - Optionally install updated Linux Kernel
+
+# kernel ver 4.14.32
+echo "y" | sudo PRUNE_MODULES=1 rpi-update 171c962793f7a39a6798ce374d9d63ab0cbecf8c
sudo rm -rf /lib/modules.bak
sudo rm -rf /boot.bak
+sudo apt-get clean
# SR7
sudo reboot
@@ -664,7 +701,6 @@ host name and other names at first boot. See the file /var/www/setup.txt for mor
sudo apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install minidlna
sudo systemctl disable minidlna
-sudo apt-get -y install djmount
////////////////////////////////////////////////////////////////
//
@@ -774,15 +810,16 @@ sudo rm libupnpp-0.16.0.tar.gz
4. Upmpdcli
-sudo cp ./rel-stretch/other/upmpdcli/upmpdcli-1.2.15.tar.gz ./
-sudo tar xfz ./upmpdcli-1.2.15.tar.gz
-cd upmpdcli-1.2.15
+sudo cp ./rel-stretch/other/upmpdcli/upmpdcli-code-1.2.16.tar.gz ./
+sudo tar xfz ./upmpdcli-code-1.2.16.tar.gz
+cd upmpdcli-code
+./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc
sudo make
sudo make install
cd ~
-sudo rm -rf ./upmpdcli-1.2.15
-sudo rm upmpdcli-1.2.15.tar.gz
+sudo rm -rf ./upmpdcli-code-1.2.16
+sudo rm upmpdcli-code-1.2.16.tar.gz
sudo useradd upmpdcli
sudo cp ./rel-stretch/lib/systemd/system/upmpdcli.service /lib/systemd/system
@@ -795,7 +832,7 @@ sudo systemctl disable upmpdcli
NOTE: This also installs a bunch of other utils
-sudo git clone https://@opensourceprojects.eu/git/p/libupnppsamples/code libupnppsamples-code
+sudo cp -r ./rel-stretch/other/libupnppsamples-code/ ./
cd libupnppsamples-code
sudo ./autogen.sh
sudo ./configure
diff --git a/other/libupnppsamples-code/Makefile.am b/other/libupnppsamples-code/Makefile.am
new file mode 100755
index 000000000..3f7aa8afc
--- /dev/null
+++ b/other/libupnppsamples-code/Makefile.am
@@ -0,0 +1,26 @@
+
+AM_CXXFLAGS = -std=c++11
+
+LDADD = -lupnpp -lpthread -lrt
+
+bin_PROGRAMS = typedservice ohsender ohradio upexplorer multirdr \
+ upsend uplistdir dumpXML \
+ rdcvolume myrdcvolume hellodevice helloctl
+
+typedservice_SOURCES = src/typedservice.cpp
+upexplorer_SOURCES = src/upexplo.cpp
+multirdr_SOURCES = src/multirdr.cpp
+ohradio_SOURCES = src/ohradio.cpp
+ohsender_SOURCES = src/ohsender.cpp
+uplistdir_SOURCES = src/uplistdir.cpp
+rdcvolume_SOURCES = src/rdcvolume.cpp
+myrdcvolume_SOURCES = src/myrdcvolume.cpp
+dumpXML_SOURCES = src/dumpXML.cpp
+hellodevice_SOURCES = hello_src/hellodevice.cpp
+helloctl_SOURCES = hello_src/helloctl.cpp
+
+upsend_SOURCES = upsend_src/upsend.cpp \
+ upsend_src/streamer.cpp \
+ upsend_src/wav.cpp
+upsend_LDADD = -lupnpp -lmicrohttpd -lpthread -lrt
+upsend_CPPFLAGS = -I/usr/include/libupnpp -I$(top_srcdir)/src -DHAVE_STD_FUTURE=1
diff --git a/other/libupnppsamples-code/README.asc b/other/libupnppsamples-code/README.asc
new file mode 100755
index 000000000..adf1022d5
--- /dev/null
+++ b/other/libupnppsamples-code/README.asc
@@ -0,0 +1,64 @@
+= libupnpp sample programs
+
+This repository has a bunch of small(ish) sample programs to help with
+starting-up a libupnpp-based project. Some of them may be useful in their
+own right but beware:
+
+NOTE: none of the samples take a lot of care about managing memory because
+they're of the 'run once and die' kind. Be careful about cleanup if you
+integrate bits of code in a longer-running program.
+
+The different samples are hopefully commented enough to be understandable
+and useful.
+
+== samples
+
+=== src/uplistdir.cpp
+
+Just list all devices and services on the local network, using the simple
+libupnpp discovery 'traverse' method, which has to wait for the full
+discovery window.
+
+=== src/rdcvolume.cpp
+
+Control the volume on an UPnP AV renderer, using the keyboard. This is a
+simple demonstration of using a predefined libupnpp control class to control a
+standard device. It uses discovery callbacks to connect to the device as
+soon as it responds to search.
+
+=== src/myrdcvolume.cpp
+
+This is functionally the same as rdcvolume, but it defines its own service
+control interface class. This is to show how you can do stuff without the
+predefined control classes, and use libupnpp to control an arbitrary UPnP
+device.
+
+=== hello_src/hellodevice.cpp, hello_src/helloctl.cpp
+
+This shows how to implement a "Hello World" device/service and the
+corresponding control interface. Nothing in there that is not more
+interestingly implemented in upmpdcli, but it is as simple as possible,
+so certainly easier to understand.
+
+=== upsend_src
+
+A program to send an audio file to an UPnP AV renderer, without using a
+Media Server. Can also send a 44100/16/2 stream read on stdin as a wav
+file. The file description part (DIDL) is not too smart, but most
+renderers don't seem to care. It uses libmicrohttpd to serve the audio file
+to the renderer. Possibly could be improved and find a use.
+
+=== src/multirdr.cpp
+
+Shows that we can get events from multiple UPnP AV renderers.
+
+=== src/upexplo.cpp
+
+Has a whole bunch of more or less useful code snippets, accessing UPnP AV
+Media Server and Renderer services.
+
+=== src/ohradio.cpp, src/ohsender.cpp
+
+Code to interface the OpenHome Radio and Sender services. Not sure that
+this is good for anything...
+
diff --git a/other/libupnppsamples-code/autogen.sh b/other/libupnppsamples-code/autogen.sh
new file mode 100755
index 000000000..65c2aad71
--- /dev/null
+++ b/other/libupnppsamples-code/autogen.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+aclocal
+automake --add-missing --copy
+autoconf
diff --git a/other/libupnppsamples-code/configure.ac b/other/libupnppsamples-code/configure.ac
new file mode 100755
index 000000000..3b96e965e
--- /dev/null
+++ b/other/libupnppsamples-code/configure.ac
@@ -0,0 +1,11 @@
+AC_PREREQ([2.53])
+AC_INIT([upexplorer], [0.10.0], [jfd@lesbonscomptes.com],
+ [upexplorer], [http://www.lesbonscomptes.com/upmpdcli])
+AC_CONFIG_SRCDIR([src/upexplo.cpp])
+AC_CONFIG_HEADERS([src/localconfig.h])
+AM_INIT_AUTOMAKE([1.10 no-define subdir-objects foreign])
+
+AC_PROG_CXX
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/other/libupnppsamples-code/hello_src/helloctl.cpp b/other/libupnppsamples-code/hello_src/helloctl.cpp
new file mode 100755
index 000000000..5ab5c8081
--- /dev/null
+++ b/other/libupnppsamples-code/hello_src/helloctl.cpp
@@ -0,0 +1,148 @@
+// This libupnpp sample is the control side for the hellodevice sample
+// device implementation
+
+#include
+#include
+#include
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/soaphelp.hxx"
+#include "libupnpp/control/discovery.hxx"
+#include "libupnpp/control/device.hxx"
+#include "libupnpp/control/service.hxx"
+
+using namespace std;
+using namespace std::placeholders;
+
+// Locally defined control class for the Rendering Control
+// service. We're just copying code from the libupnpp actually, this is
+// just to show that it can be done outside the library.
+class HelloCTL : public UPnPClient::Service {
+public:
+
+ /* Construct by copying data from device and service objects.*/
+ HelloCTL(const UPnPClient::UPnPDeviceDesc& device,
+ const UPnPClient::UPnPServiceDesc& service)
+ : UPnPClient::Service(device, service) {
+ // No event handling. Look at, e.g. rdcvolume.cpp for an example
+ }
+
+ virtual ~HelloCTL() {}
+
+ virtual bool serviceTypeMatch(const std::string& tp) {
+ return isHelloService(tp);
+ }
+
+ /* Test that a service type matches ours. This can be used
+ with the directory traversal routine */
+ static bool isHelloService(const std::string& st) {
+ // Note that we do not care about the version
+ return st.find("urn:upnpp-schemas:service:HelloService") == 0;
+ }
+
+ int hello();
+};
+
+int HelloCTL::hello()
+{
+ // Outgoing parameters. The object is constructed with the service
+ // type (comes from the description we were built on), and the
+ // action name. This is sufficient for some actions (ie stop())
+ UPnPP::SoapOutgoing args(getServiceType(), "Hello");
+
+ // This call does not need further outgoing arguments (see
+ // rdcvolume for an example of these.
+
+ // We have to declare a return parameter, even if we don't care
+ // about the contents.
+ UPnPP::SoapIncoming data;
+
+ int ret = runAction(args, data);
+ if (ret != UPNP_E_SUCCESS) {
+ return ret;
+ }
+ string value;
+ if (!data.get("MyValue", &value)) {
+ cerr << "HelloCTL:getVolume: missing MyValue in response\n";
+ return UPNP_E_BAD_RESPONSE;
+ }
+
+ cout << "Hello : " << value << endl;
+ return 0;
+}
+
+// Device discovery part. We do it the easy way here: use a blocking
+// call which will wait for the initial window to complete. We could
+// traverse the device directory in search, for example of a device of
+// a specific kind instead of using a device name like we do here (there is
+// an example of UPnPDeviceDirectory::traverse() usage in uplistdir.cpp).
+//
+// See rdcvolume.cpp for a version using callbacks to get the device asap
+shared_ptr getService(const string& name)
+{
+ // Initialize and get a discovery directory handle.
+ auto *superdir = UPnPClient::UPnPDeviceDirectory::getTheDir(1);
+ if (nullptr == superdir) {
+ cerr << "Discovery init failed\n";
+ return shared_ptr();
+ }
+
+ UPnPClient::UPnPDeviceDesc devicedesc;
+ // We look-up the device by either friendlyname or udn as the 2
+ // namespaces are unlikely to overlap, no need to complicate things
+ if (!superdir->getDevByUDN(name, devicedesc) &&
+ !superdir->getDevByFName(name, devicedesc)) {
+ cerr << "Can't connect to " << name << endl;
+ return shared_ptr();
+ }
+
+ // Walk the device description service list, looking for ours
+ for (const auto& ent : devicedesc.services) {
+ // cout << ent.dump() << endl;
+ if (HelloCTL::isHelloService(ent.serviceType)) {
+ return make_shared(devicedesc, ent);
+ }
+ }
+ cerr << name << " has no hello service\n";
+ return shared_ptr();
+}
+
+int main(int argc, char **argv)
+{
+ // Initialize libupnpp logging
+ Logger::getTheLog("")->setLogLevel(Logger::LLERR);
+
+ argv++;argc--;
+ if (argc != 1) {
+ cerr << "Usage: rdcvolume rendererNameOrUid\n";
+ return 1;
+ }
+ string devname(*argv++);
+ argc--;
+
+
+ // Explicitely initialize libupnpp so that we can display a
+ // possible error
+ UPnPP::LibUPnP *mylib = UPnPP::LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+
+ shared_ptr hlo = getService(devname);
+ if (!hlo) {
+ cerr << "Device " << devname <<
+ " has no Hello service" << endl;
+ return 1;
+ }
+ hlo->hello();
+ return 0;
+}
+
diff --git a/other/libupnppsamples-code/hello_src/hellodevice.cpp b/other/libupnppsamples-code/hello_src/hellodevice.cpp
new file mode 100755
index 000000000..356494c91
--- /dev/null
+++ b/other/libupnppsamples-code/hello_src/hellodevice.cpp
@@ -0,0 +1,164 @@
+// A barebones example of device implementation.
+//
+// The skeleton code for the Service part could have been
+// automatically generated by the scripts/sdeftoc.py (libupnpp source
+// tree), from the xml description, but we did it by hand instead.
+//
+// This is a minimal example. Refer to, e.g. the upmpdcli code for a
+// more complete exercise of the library.
+#include
+
+#include
+#include
+#include
+
+using namespace std;
+using namespace std::placeholders;
+using namespace UPnPProvider;
+using namespace UPnPP;
+
+// Beware: these must match the values for serviceType and serviceId in the
+// device description document
+const string sTpHello("urn:upnpp-schemas:service:HelloService:1");
+const string sIdHello("urn:upnpp-org:serviceId:HelloService");
+
+// Device description document. This has some identifying data and a
+// list of services.
+// Beware: the UDN value must match the uuid parameter for the device
+// constructor, and the SCDPURL paths must match the vdircontent paths
+// (see below)
+const string devicedesc(R"raw(
+
+ 10
+
+ urn:upnpp-schemas:device:HelloDevice:1
+ HelloDeviceName
+ HelloDevices
+ SimpleHelloDevice
+ 1.0
+ uuid:you-should-find-something-better
+
+
+ urn:upnpp-schemas:service:HelloService:1
+ urn:upnpp-org:serviceId:HelloService
+ /hello/Hello.xml
+ /ctl/Hello
+ /evt/Hello
+
+
+
+
+
+
+)raw");
+
+// Service description document. The variables and actions. Action
+// names must match the name parameter to the addActionMapping calls
+const string helloservicedesc(R"raw(
+
+ 11
+
+
+ Hello
+
+
+ MyValue
+ out
+ Hello
+
+
+
+
+
+
+ Hello
+ string
+
+
+
+)raw");
+
+// The files which will be served by the HTTP server. Refer to the
+// comments in device.hxx for more details.
+unordered_map myfiles {
+ {"/hello/description.xml", {devicedesc, "text/xml"}},
+ {"/hello/Hello.xml", {helloservicedesc, "text/xml"}},
+ };
+
+// The service class defines the methods which will be called for each
+// UPnP action (and the event handling, which is not shown here).
+class HelloService : public UPnPProvider::UpnpService {
+public:
+
+ // The constructor initializes the base class (which links to the
+ // device and lib), and sets our action callbacks.
+ HelloService(UpnpDevice *dev)
+ : UpnpService(sTpHello, sIdHello, dev), m_dev(dev) {
+
+ m_dev->addActionMapping(this, "Hello",
+ bind(&HelloService::hello, this, _1, _2));
+
+ }
+
+ // Event retrieval routine. This gets polled (the service can
+ // trigger an immediate poll). We're not really doing this, look
+ // at how upmpdcli openhome services do it
+ virtual bool getEventData(bool all, std::vector& names,
+ std::vector& values) {
+ return true;
+ }
+
+private:
+
+ // An action method. This takes no argument, just returns a value.
+ // Look at upmpdcli code to see how to handle incoming parameters.
+ int hello(const SoapIncoming& sc, SoapOutgoing& data) {
+
+ data.addarg("MyValue", "World");
+ return UPNP_E_SUCCESS;
+ }
+
+ UpnpDevice *m_dev;
+};
+
+// The device initializes the parent class and creates its services
+class HelloDevice : public UpnpDevice {
+public:
+ HelloDevice(const string& deviceid,
+ const std::unordered_map& files)
+ : UpnpDevice(deviceid, files) {
+ m_services.push_back(new HelloService(this));
+ }
+
+ ~HelloDevice() {
+ for (auto& ent : m_services) {
+ delete ent;
+ }
+ }
+ vector m_services;
+};
+
+
+int main(int argc, char *argv[])
+{
+ // Initialize libupnpp logging
+ Logger::getTheLog("")->setLogLevel(Logger::LLERR);
+
+ //cout << "DEVICE: " << devicedesc << endl;
+ //cout << "SERVICE: " << helloservicedesc << endl;
+
+ // uuid must match the one in the description document
+ HelloDevice dev("uuid:you-should-find-something-better", myfiles);
+
+ string host;
+ unsigned short port;
+ dev.ipv4(&host, &port);
+
+ // fname should match what we set in the desc above ! A real
+ // program would do it differently...
+ string fname("HelloDeviceName");
+
+ cout << fname << " running on host " << host << " port " << port << endl;
+
+ dev.eventloop();
+}
diff --git a/other/libupnppsamples-code/src/dumpXML.cpp b/other/libupnppsamples-code/src/dumpXML.cpp
new file mode 100755
index 000000000..f71246f7c
--- /dev/null
+++ b/other/libupnppsamples-code/src/dumpXML.cpp
@@ -0,0 +1,130 @@
+// This libupnpp sample program downloads all the XML description data
+// from a given devices and writes it to a target directory.
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/log.hxx"
+#include "libupnpp/control/description.hxx"
+#include "libupnpp/control/discovery.hxx"
+
+using namespace std;
+using namespace UPnPClient;
+using namespace UPnPP;
+
+static void neutchars(const string& str, string& out, const string& chars)
+{
+ string::size_type startPos, pos;
+ out.clear();
+ for (pos = 0;;) {
+ // Skip initial chars, break if this eats all.
+ if ((startPos = str.find_first_not_of(chars, pos)) == string::npos) {
+ break;
+ }
+ // Find next delimiter or end of string (end of token)
+ pos = str.find_first_of(chars, startPos);
+ // Add token to the output. Note: token cant be empty here
+ if (pos == string::npos) {
+ out += str.substr(startPos);
+ } else {
+ out += str.substr(startPos, pos - startPos) + "_";
+ }
+ }
+}
+
+static bool make_file(const string& nm, const string& content)
+{
+ int fd = open(nm.c_str(), O_CREAT|O_WRONLY|O_TRUNC, 0600);
+ if (fd < 0) {
+ cerr << "Could not create/open " << nm << endl;
+ perror("open");
+ return false;
+ }
+ if (write(fd, content.c_str(), content.size()) != content.size()) {
+ close(fd);
+ cerr << "Could not write to " << nm << endl;
+ perror("write");
+ return false;
+ }
+ close(fd);
+ return true;
+}
+
+int main(int argc, char *argv[])
+{
+ argv++;argc--;
+ if (argc != 2) {
+ cerr << "Usage: dumpXML \n";
+ cerr << " will be created if it does not exist\n";
+ return 1;
+ }
+ string devname(*argv++);
+ argc--;
+ string dirname(*argv++);
+ argc--;
+
+ // Initialize libupnpp logging
+ Logger::getTheLog("")->setLogLevel(Logger::LLDEB);
+
+ // Get a handle to the main lib object. You don't really need to
+ // do this actually. We just do it to check that the lib
+ // initialized ok, but there are other possible uses, see the doc
+ // in the include file.
+ LibUPnP *mylib = LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+
+ // Get a handle to the device directory. You can call this
+ // multiple times, only the first call does something, any further
+ // call will just return the pointer to the singleton.
+ UPnPDeviceDirectory *superdir = UPnPDeviceDirectory::getTheDir();
+ if (superdir == 0) {
+ cerr << "Cant access device directory\n";
+ return 1;
+ }
+
+ if (access(dirname.c_str(), X_OK|W_OK)) {
+ if (mkdir(dirname.c_str(), 0755)) {
+ cerr << "Could not create " << dirname << endl;
+ perror("mkdir");
+ return 1;
+ }
+ }
+
+ string deviceXML;
+ unordered_map srvsXML;
+ if (!superdir->getDescriptionDocuments(devname, deviceXML, srvsXML)) {
+ cerr << "Could not retrieve description documents\n";
+ return 1;
+ }
+
+ string path, fn, fn1;
+ fn = devname + "-description.xml";
+ neutchars(fn, fn1, "/ \n\r\t");
+ path = dirname + "/" + fn1;
+ if (!make_file(path, deviceXML)) {
+ return 1;
+ }
+ for (auto entry : srvsXML) {
+ fn = entry.first + ".xml";
+ neutchars(fn, fn1, "/ \n\r\t");
+ path = dirname + "/" + fn1;
+ if (!make_file(path, entry.second)) {
+ return 1;
+ }
+ }
+ return 0;
+}
diff --git a/other/libupnppsamples-code/src/localconfig.h.in b/other/libupnppsamples-code/src/localconfig.h.in
new file mode 100755
index 000000000..32c6c07af
--- /dev/null
+++ b/other/libupnppsamples-code/src/localconfig.h.in
@@ -0,0 +1,61 @@
+/* src/config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* File Offset size */
+#undef _FILE_OFFSET_BITS
+
+/* Large files support */
+#undef _LARGE_FILE_SOURCE
+
+/* Define to `long int' if does not define. */
+#undef off_t
+
+/* Define to `unsigned int' if does not define. */
+#undef size_t
diff --git a/other/libupnppsamples-code/src/multirdr.cpp b/other/libupnppsamples-code/src/multirdr.cpp
new file mode 100755
index 000000000..70bef39e8
--- /dev/null
+++ b/other/libupnppsamples-code/src/multirdr.cpp
@@ -0,0 +1,130 @@
+// Just monitor multiple renderers.
+
+#include
+#include
+
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/control/discovery.hxx"
+#include "libupnpp/control/mediarenderer.hxx"
+
+using namespace std;
+using namespace UPnPClient;
+using namespace UPnPP;
+
+template class MyReporter : public VarEventReporter {
+public:
+ MyReporter(const string& nm, T srvh)
+ : m_srv(srvh), m_nm(nm)
+ {
+ m_srv->installReporter(this);
+ }
+ virtual ~MyReporter() {
+ m_srv->installReporter(0);
+ }
+
+ // TransportState, Repeat, Shuffle, Id, TracksMax
+ virtual void changed(const char *nm, int value)
+ {
+ cerr << m_nm << ": Changed: " << nm << " (int): " << value << endl;
+ }
+
+ // Stuff
+ virtual void changed(const char *nm, const char *value)
+ {
+ cerr << m_nm << ": Changed: " << nm << " (char*): " << value << endl;
+ }
+
+ // IdArray
+ virtual void changed(const char *nm, std::vector ids)
+ {
+ cerr << m_nm << ": Changed: " << nm << " (vector)" << endl;
+ }
+
+private:
+ T m_srv;
+ string m_nm;
+};
+
+UPnPClient::UPnPDeviceDirectory *superdir;
+
+UPnPClient::MRDH getRenderer(const string& friendlyName)
+{
+ UPnPClient::UPnPDeviceDesc ddesc;
+ if (superdir->getDevByFName(friendlyName, ddesc)) {
+ return UPnPClient::MRDH(new UPnPClient::MediaRenderer(ddesc));
+ }
+ cerr << "getDevByFname failed" << endl;
+ return UPnPClient::MRDH();
+}
+
+int main(int argc, char **argv)
+{
+ argc--; argv++;
+ if (argc == 0) {
+ cerr << "Usage: multirdr [ ...]\n";
+ return 1;
+ }
+
+ LibUPnP *mylib = LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+ superdir = UPnPClient::UPnPDeviceDirectory::getTheDir();
+ if (superdir == 0) {
+ cerr << "multirdr: can't get superdir" << endl;
+ return 1;
+ }
+
+ while (argc) {
+
+ string friendlyName(*argv++);
+ argc--;
+
+ UPnPClient::MRDH rdr = getRenderer(friendlyName);
+ if (!rdr) {
+ cerr << "Renderer " << friendlyName << " not found" << endl;
+ return 1;
+ }
+
+ // Create a RenderingControl event monitor.
+ UPnPClient::RDCH rdc = rdr->rdc();
+ if (!rdc) {
+ cerr << "Device " << friendlyName <<
+ " has no RenderingControl service" << endl;
+ return 1;
+ }
+ new MyReporter(friendlyName, rdc);
+
+ // AVTransport?
+ UPnPClient::AVTH avt = rdr->avt();
+ if (avt) {
+ new MyReporter(friendlyName, avt);
+ }
+
+ // Maybe this is an openhome device ? monitor the playlist
+ UPnPClient::OHPRH ohpr = rdr->ohpr();
+ UPnPClient::OHPLH ohpl;
+ if (!ohpr) {
+ cerr << "Device " << friendlyName <<
+ " has no OpenHome support" << endl;
+ } else {
+ ohpl = rdr->ohpl();
+ if (ohpl) {
+ new MyReporter(friendlyName, ohpl);
+ }
+ }
+ }
+
+ // Just stay around and let the reporter print events
+ sleep(1000);
+ return 0;
+}
diff --git a/other/libupnppsamples-code/src/myrdcvolume.cpp b/other/libupnppsamples-code/src/myrdcvolume.cpp
new file mode 100755
index 000000000..fc213b021
--- /dev/null
+++ b/other/libupnppsamples-code/src/myrdcvolume.cpp
@@ -0,0 +1,270 @@
+// This libupnpp sample does about the same thing as rdcvolume, but it defines
+// its own control classes instead of the ones predefined by libupnpp.
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/soaphelp.hxx"
+#include "libupnpp/control/discovery.hxx"
+#include "libupnpp/control/device.hxx"
+#include "libupnpp/control/service.hxx"
+
+using namespace std;
+using namespace std::placeholders;
+
+//using namespace UPnPClient;
+//using namespace UPnPP;
+
+// Locally defined control class for the Rendering Control
+// service. We're just copying code from the libupnpp actually, this is
+// just to show that it can be done outside the library.
+class MyRDC : public UPnPClient::Service {
+public:
+
+ /* Construct by copying data from device and service objects.*/
+ MyRDC(const UPnPClient::UPnPDeviceDesc& device,
+ const UPnPClient::UPnPServiceDesc& service)
+ : UPnPClient::Service(device, service) {
+ serviceInit(device, service);
+ }
+ MyRDC() {}
+ virtual ~MyRDC() {}
+
+ bool serviceInit(const UPnPClient::UPnPDeviceDesc& device,
+ const UPnPClient::UPnPServiceDesc& service) {
+ // We want to have a look at our service description file
+ // (xml) to retrieve the min/max/step values for the
+ // volume. Not all services need to do this.
+ UPnPClient::UPnPServiceDesc::Parsed sdesc;
+ if (service.fetchAndParseDesc(device.URLBase, sdesc)) {
+ auto it = sdesc.stateTable.find("Volume");
+ if (it != sdesc.stateTable.end() && it->second.hasValueRange) {
+ m_volmin = it->second.minimum;
+ m_volmax = it->second.maximum;
+ m_volstep = it->second.step;
+ } else {
+ // ??
+ m_volmin = 0;
+ m_volmax = 100;
+ m_volstep = 1;
+ }
+ }
+ return true;
+ }
+
+ virtual bool serviceTypeMatch(const std::string& tp) {
+ return isRDCService(tp);
+ }
+
+ /* Test that a service type matches ours. This can be used
+ with the directory traversal routine */
+ static bool isRDCService(const std::string& st) {
+ // Note that we do not care about the version
+ return st.find("urn:schemas-upnp-org:service:RenderingControl") == 0;
+ }
+
+ int setVolume(int volume, const std::string& channel = "Master");
+ int getVolume(const std::string& channel = "Master");
+
+ /* Volume settings params */
+ int m_volmin;
+ int m_volmax;
+ int m_volstep;
+
+private:
+
+ void evtCallback(const unordered_map& props) {
+ // The callback gets a map of changed properties as
+ // parameter. In turn, the classes defined by libupnpp
+ // (e.g. RenderingControl) call a client event reporter in an
+ // uniform way, and after massaging the data a bit, but you
+ // can do whatever you like here. UPnP AV is special
+ // because it coalesces the values inside a LastChange XML
+ // string. Many services just report them individually.
+ cerr << "evtCallback: props size " << props.size() << endl;
+ for (const auto& ent : props) {
+ cout << ent.first << " -> " << ent.second << endl;
+ }
+ }
+
+ // Register our member function callback. It's just an
+ // std::function, other approaches may be possible.
+ void registerCallback() {
+ UPnPClient::Service::registerCallback(
+ std::bind(&MyRDC::evtCallback, this, _1));
+ }
+};
+
+// The libupnpp equivalent checks and converts the range, and also
+// that a volume change is actually required, and does appropriate
+// rounding. We're just showing how to send a parameter here. The arg
+// names are defined by the service description XML file, so it would
+// be possible to construct the call after the XML data (a la
+// upnp-inspector), there is nothing in libupnpp to prevent it.
+int MyRDC::setVolume(int ivol, const string& channel)
+{
+ // Outgoing parameters. The object is constructed with the service
+ // type (comes from the description we were built on), and the
+ // action name. This is sufficient for some actions (ie stop())
+ UPnPP::SoapOutgoing args(getServiceType(), "SetVolume");
+
+ // This call needs further outgoing arguments, which goes in there
+ // through an operator() overload
+ args("InstanceID", "0")("Channel", channel)
+ ("DesiredVolume", UPnPP::SoapHelp::i2s(ivol));
+
+ // We have to declare a return parameter, even if we don't care
+ // about the contents.
+ UPnPP::SoapIncoming data;
+
+ return runAction(args, data);
+}
+
+// Same as setVolume really, except that we look at the return data.
+int MyRDC::getVolume(const string& channel)
+{
+ UPnPP::SoapOutgoing args(getServiceType(), "GetVolume");
+ args("InstanceID", "0")("Channel", channel);
+ UPnPP::SoapIncoming data;
+ int ret = runAction(args, data);
+ if (ret != UPNP_E_SUCCESS) {
+ return ret;
+ }
+ int volume;
+ if (!data.get("CurrentVolume", &volume)) {
+ cerr << "MyRDC:getVolume: missing CurrentVolume in response\n";
+ return UPNP_E_BAD_RESPONSE;
+ }
+
+ return volume;
+}
+
+
+// Device discovery part. We do it the easy way here: use a blocking
+// call which will wait for the initial window to complete. We could
+// traverse the device directory in search, for example of a device of
+// a specific kind instead of using a device name like we do here (there is
+// an example of UPnPDeviceDirectory::traverse() usage in uplistdir.cpp).
+//
+// See rdcvolume.cpp for a version using callbacks to get the device asap
+shared_ptr getService(const string& name)
+{
+ // Initialize and get a discovery directory handle.
+ auto *superdir = UPnPClient::UPnPDeviceDirectory::getTheDir(2);
+ if (nullptr == superdir) {
+ cerr << "Discovery init failed\n";
+ return shared_ptr();
+ }
+
+ UPnPClient::UPnPDeviceDesc devicedesc;
+ // We look-up the device by either friendlyname or udn as the 2
+ // namespaces are unlikely to overlap, no need to complicate things
+ if (!superdir->getDevByUDN(name, devicedesc) &&
+ !superdir->getDevByFName(name, devicedesc)) {
+ cerr << "Can't connect to " << name << endl;
+ return shared_ptr();
+ }
+
+ // UPnPClient::Device does nothing really interesting actually. It
+ // just holds the device description. Derived device
+ // implementations, for example for a MediaRenderer, add a bit of
+ // value by creating objects for the well-known services. Here we
+ // just dispense with the device creation, and directly create a
+ // service object.
+
+ // Walk the device description service list, looking for ours
+ for (const auto& ent : devicedesc.services) {
+ if (MyRDC::isRDCService(ent.serviceType)) {
+ cout << ent.dump() << endl;
+ return make_shared(devicedesc, ent);
+ }
+ }
+ cerr << name << " has no rendering control service\n";
+ return shared_ptr();
+}
+
+// nothing to see here: character reading, one at a time.
+int mygetch()
+{
+ struct termios oldt, newt;
+ int ch;
+ tcgetattr(STDIN_FILENO, &oldt);
+ newt = oldt;
+ newt.c_lflag &= ~(ICANON | ECHO);
+ tcsetattr(STDIN_FILENO, TCSANOW, &newt);
+ ch = getchar();
+ tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
+ return ch;
+}
+
+int main(int argc, char **argv)
+{
+ argv++;argc--;
+ if (argc != 1) {
+ cerr << "Usage: rdcvolume rendererNameOrUid\n";
+ return 1;
+ }
+ string devname(*argv++);
+ argc--;
+
+ // Initialize libupnpp logging
+ Logger::getTheLog("")->setLogLevel(Logger::LLERR);
+
+ // Explicitely initialize libupnpp so that we can display a
+ // possible error
+ UPnPP::LibUPnP *mylib = UPnPP::LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+
+
+ shared_ptr rdc = getService(devname);
+ if (!rdc) {
+ cerr << "Device " << devname <<
+ " has no RenderingControl service" << endl;
+ return 1;
+ }
+
+ cout << "q = quit, 'u' = up, 'd' = down\n";
+ for (;;) {
+ int vol = rdc->getVolume();
+ cout << "Volume now " << vol << endl;
+ int key = mygetch();
+
+ if (key == 'q') {
+ cout << "QUIT\n";
+ break;
+ } else if (key == 'u') {
+ vol += 5;
+ if (vol > 100) {
+ vol = 100;
+ }
+ } else if (key == 'd') {
+ vol -= 5;
+ if (vol < 0) {
+ vol = 0;
+ }
+ } else {
+ cout << "Bad key: " << (char)key << endl;
+ continue;
+ }
+ if (rdc->setVolume(vol)) {
+ cerr << "setVolume(" << vol << ") failed\n";
+ }
+ }
+
+ return 0;
+}
+
diff --git a/other/libupnppsamples-code/src/ohradio.cpp b/other/libupnppsamples-code/src/ohradio.cpp
new file mode 100755
index 000000000..561931abb
--- /dev/null
+++ b/other/libupnppsamples-code/src/ohradio.cpp
@@ -0,0 +1,347 @@
+/* Copyright (C) 2013 J.F.Dockes
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/////////////// libupnpp OhRadio trial driver
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/log.hxx"
+#include "libupnpp/upnpputils.hxx"
+#include "libupnpp/control/cdirectory.hxx"
+#include "libupnpp/control/discovery.hxx"
+#include "libupnpp/control/mediarenderer.hxx"
+#include "libupnpp/control/ohradio.hxx"
+#include "libupnpp/control/ohinfo.hxx"
+
+using namespace std;
+using namespace UPnPClient;
+using namespace UPnPP;
+
+UPnPDeviceDirectory *superdir;
+
+int channelid;
+
+class MReporter : public UPnPClient::VarEventReporter {
+public:
+ void changed(const char *nm, int value) {
+ if (!strcmp(nm, "TransportState")) {
+ string tpstate;
+ switch(value) {
+ case OHPlaylist::TPS_Unknown: tpstate = "Unknown"; break;
+ case OHPlaylist::TPS_Buffering: tpstate = "Buffering"; break;
+ case OHPlaylist::TPS_Paused: tpstate = "Paused"; break;
+ case OHPlaylist::TPS_Playing: tpstate = "Playing"; break;
+ case OHPlaylist::TPS_Stopped: tpstate = "Stopped"; break;
+ }
+ cout << "Changed: " << nm << " : " << tpstate << endl;
+ } else if (!strcmp(nm, "Id")) {
+ cout << "Changed: " << nm << " : " << value << endl;
+ channelid = value;
+ } else {
+ cout << "Changed: " << nm << " : " << value << endl;
+ }
+ }
+ void changed(const char *nm, const char *value) {
+ cout << "Changed: " << nm << " : " << value << endl;
+ }
+
+ void changed(const char *nm, UPnPDirObject meta) {
+ cout << "Changed: " << nm << " : " << meta.dump() << endl;
+ }
+
+ void changed(const char * nm, std::vector ids) {
+ cout << "Changed: " << nm << " : ";
+ for (unsigned int i = 0; i < ids.size(); i++) {
+ cout << SoapHelp::i2s(ids[i]) << " ";
+ }
+ cout << endl;
+ }
+};
+
+MRDH getRenderer(const string& friendlyName)
+{
+ if (superdir == 0) {
+ superdir = UPnPDeviceDirectory::getTheDir();
+ }
+
+ UPnPDeviceDesc ddesc;
+ if (superdir->getDevByFName(friendlyName, ddesc)) {
+ return MRDH(new MediaRenderer(ddesc));
+ }
+ cerr << "getDevByFname failed" << endl;
+ return MRDH();
+}
+
+void rdMonitor(OHRDH hdl, OHIFH hdlif)
+{
+ MReporter reporter;
+ hdl->installReporter(&reporter);
+ hdlif->installReporter(&reporter);
+ while (true) {
+ static int prevchan;
+ sleep(2);
+ string uri;
+ UPnPDirObject dirent;
+ if (0&& prevchan != channelid) {
+ cerr << "New ChannelId: " << channelid << endl;
+ prevchan = channelid;
+#if 0
+ if (hdl->channel(&uri, &dirent) == 0) {
+ cout << "Channel: uri " << uri << "\nMetadata " <<
+ dirent.dump() << endl;
+ }
+#endif
+ int ret;
+ if ((ret = hdlif->metatext(&dirent)) == 0) {
+ cout << "Metatext: " << dirent.dump() << endl;
+ } else {
+ cerr << "Metatext: failed: " << ret << endl;
+ }
+
+ }
+ }
+}
+
+void rdIdArray(OHRDH hdl)
+{
+ vector ids;
+ int token = 0;
+ int ret;
+ if ((ret = hdl->idArray(&ids, &token)) != 0) {
+ cerr << "idArray failed: " << ret << endl;
+ return;
+ }
+
+ cout << "token: " << token << ". " << ids.size() << " ids: ";
+ for (unsigned int i = 0; i < ids.size(); i++) {
+ cout << SoapHelp::i2s(ids[i]) << " ";
+ }
+ cout << endl;
+}
+
+string rdReadList(OHRDH hdl, int id = -1)
+{
+ vector ids;
+ int token = 0;
+ int ret;
+ if ((ret = hdl->idArray(&ids, &token)) != 0) {
+ cerr << "idArray failed: " << ret << endl;
+ return string();
+ }
+ vector ents;
+ if ((ret = hdl->readList(ids, &ents)) != 0) {
+ cerr << "readList failed: " << ret << endl;
+ return string();
+ }
+
+ for (unsigned int i = 0; i < ents.size(); i++) {
+ if (id == -1) {
+ cout << "Id: " << SoapHelp::i2s(ents[i].id) <<
+ " url " << ents[i].url <<
+ "\nmetadata: " << ents[i].dirent.dump() << "\n";
+ } else {
+ if (ents[i].id == id) {
+ return ents[i].url;
+ }
+ }
+ }
+ cout << endl;
+ return string();
+}
+
+// Could not get this to work. Gets UPNP_E_BAD_RESPONSE on sendAction??
+void rdRead(OHRDH hdl, int id)
+{
+ UPnPDirObject dirent;
+ int ret;
+ if ((ret = hdl->read(id, &dirent)) != 0) {
+ cerr << "read failed: " << ret << endl;
+ return;
+ }
+ cout << "read: metadata: " << dirent.dump() << endl;
+}
+
+void rdSetId(OHRDH hdl, int id)
+{
+ int ret;
+ string url = rdReadList(hdl, id);
+ if (url.empty()) {
+ cerr << "Id " << id << " not found\n";
+ return;
+ }
+ if ((ret = hdl->setId(id, url)) != 0) {
+ cerr << "setId failed: " << ret << endl;
+ return;
+ }
+ cout << "setId ok\n";
+}
+
+static char *thisprog;
+static char usage [] =
+" -a : run idArray\n"
+" -M : monitor OHRadio\n"
+" -p : pause radio\n"
+" -P : play radio\n"
+" -r id: run read\n"
+" -R : run ReadList\n"
+" -s id: run setId\n"
+" -S : stop\n"
+" \n"
+;
+
+static void
+Usage(void)
+{
+ fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
+ exit(1);
+}
+static int op_flags;
+#define OPT_M 0x1
+#define OPT_a 0x2
+#define OPT_r 0x4
+#define OPT_R 0x8
+#define OPT_s 0x10
+#define OPT_P 0x20
+#define OPT_p 0x40
+#define OPT_S 0x80
+
+static struct option long_options[] = {
+ {0, 0, 0, 0}
+};
+
+int main(int argc, char *argv[])
+{
+ string fname;
+ string arg;
+
+ thisprog = argv[0];
+
+ int ret;
+ int option_index = 0;
+ while ((ret = getopt_long(argc, argv, "aMPpRrSs",
+ long_options, &option_index)) != -1) {
+ switch (ret) {
+ case 'a': if (op_flags) Usage(); op_flags |= OPT_a; break;
+ case 'M': if (op_flags) Usage(); op_flags |= OPT_M; break;
+ case 'P': if (op_flags) Usage(); op_flags |= OPT_P; break;
+ case 'p': if (op_flags) Usage(); op_flags |= OPT_p; break;
+ case 'R': if (op_flags) Usage(); op_flags |= OPT_R; break;
+ case 'r': if (op_flags) Usage(); op_flags |= OPT_r; break;
+ case 's': if (op_flags) Usage(); op_flags |= OPT_s; break;
+ case 'S': if (op_flags) Usage(); op_flags |= OPT_S; break;
+ default:
+ Usage();
+ }
+ }
+
+ if (op_flags & (OPT_M|OPT_a|OPT_R|OPT_p|OPT_P|OPT_S)) {
+ if (optind != argc - 1)
+ Usage();
+ fname = argv[optind++];
+ }
+ if (op_flags & (OPT_r|OPT_s)) {
+ if (optind != argc - 2)
+ Usage();
+ fname = argv[optind++];
+ arg = argv[optind++];
+ }
+
+ if (Logger::getTheLog("/tmp/ohradio.log") == 0) {
+ cerr << "Can't initialize log" << endl;
+ return 1;
+ }
+ Logger::getTheLog("")->setLogLevel(Logger::LLDEB1);
+
+ LibUPnP *mylib = LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+ mylib->setLogFileName("/tmp/libupnp.log", LibUPnP::LogLevelDebug);
+
+ MRDH rdr = getRenderer(fname);
+ if (!rdr) {
+ cerr << "Can't connect torenderer\n";
+ return 1;
+ }
+ OHRDH hdl = rdr->ohrd();
+ if (!hdl) {
+ cerr << "Device has no OHRadio service" << endl;
+ return 1;
+ }
+ OHIFH hdlif = rdr->ohif();
+ if (!hdlif) {
+ cerr << "Device has no OHInfo service" << endl;
+ return 1;
+ }
+
+ if ((op_flags & OPT_M)) {
+ rdMonitor(hdl, hdlif);
+ } else if ((op_flags & OPT_a)) {
+ rdIdArray(hdl);
+ } else if ((op_flags & OPT_R)) {
+ rdReadList(hdl);
+ } else if ((op_flags & OPT_p)) {
+ int ret = hdl->pause();
+ if (ret) {
+ cerr << "Pause: " << SoapHelp::i2s(ret);
+ return 1;
+ } else {
+ cout << "Pause Ok\n";
+ }
+ } else if ((op_flags & OPT_P)) {
+ int ret = hdl->play();
+ if (ret) {
+ cerr << "Play: " << SoapHelp::i2s(ret);
+ return 1;
+ } else {
+ cout << "Play Ok\n";
+ }
+ } else if ((op_flags & OPT_S)) {
+ int ret = hdl->stop();
+ if (ret) {
+ cerr << "Stop: " << SoapHelp::i2s(ret);
+ return 1;
+ } else {
+ cout << "Stop Ok\n";
+ }
+ } else if ((op_flags & OPT_r)) {
+ rdRead(hdl, atoi(arg.c_str()));
+ } else if ((op_flags & OPT_s)) {
+ rdSetId(hdl, atoi(arg.c_str()));
+ } else {
+ Usage();
+ }
+
+ return 0;
+}
diff --git a/other/libupnppsamples-code/src/ohsender.cpp b/other/libupnppsamples-code/src/ohsender.cpp
new file mode 100755
index 000000000..cf59cfed3
--- /dev/null
+++ b/other/libupnppsamples-code/src/ohsender.cpp
@@ -0,0 +1,170 @@
+/* Copyright (C) 2013 J.F.Dockes
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+// Code to exercise the libupnpp OhSender class
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/log.hxx"
+#include "libupnpp/upnpputils.hxx"
+#include "libupnpp/control/cdirectory.hxx"
+#include "libupnpp/control/discovery.hxx"
+#include "libupnpp/control/mediarenderer.hxx"
+#include "libupnpp/control/ohsender.hxx"
+#include "libupnpp/control/linnsongcast.hxx"
+
+using namespace std;
+using namespace UPnPClient;
+using namespace UPnPP;
+
+class MReporter : public UPnPClient::VarEventReporter {
+public:
+ void changed(const char *nm, int value) {
+ cout << "Changed: " << nm << " : " << value << endl;
+ }
+ void changed(const char *nm, const char *value) {
+ cout << "Changed: " << nm << " : " << value << endl;
+ }
+
+ void changed(const char *nm, UPnPDirObject meta) {
+ cout << "Changed: " << nm << " : " << meta.dump() << endl;
+ }
+};
+
+void rdMonitor(OHSNH hdl)
+{
+ MReporter reporter;
+ hdl->installReporter(&reporter);
+
+ while (true) {
+ sleep(2);
+ string uri;
+ string meta;
+ int ret;
+ if ((ret = hdl->metadata(uri, meta)) == 0) {
+ cout << "Uri: " << uri << " metadata " << meta << endl;
+ } else {
+ cerr << "Metadata: failed: " << ret << endl;
+ }
+ }
+}
+
+void metadata(OHSNH hdl)
+{
+ string uri, meta;
+ int ret;
+ if ((ret = hdl->metadata(uri, meta)) != 0) {
+ cerr << "metadata failed: " << ret << endl;
+ return;
+ }
+ cout << "read: uri: [" << uri << "] meta: " << meta << endl;
+}
+
+static char *thisprog;
+static char usage [] =
+" -M : monitor OHSender\n"
+" -m : run metadata\n"
+" \n"
+;
+
+static void
+Usage(void)
+{
+ fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
+ exit(1);
+}
+static int op_flags;
+#define OPT_M 0x1
+#define OPT_m 0x2
+
+static struct option long_options[] = {
+ {0, 0, 0, 0}
+};
+
+int main(int argc, char *argv[])
+{
+ string fname;
+ string arg;
+
+ thisprog = argv[0];
+
+ int ret;
+ int option_index = 0;
+ while ((ret = getopt_long(argc, argv, "Mm",
+ long_options, &option_index)) != -1) {
+ switch (ret) {
+ case 'M': if (op_flags) Usage(); op_flags |= OPT_M; break;
+ case 'm': if (op_flags) Usage(); op_flags |= OPT_m; break;
+ default:
+ Usage();
+ }
+ }
+ if (!op_flags)
+ Usage();
+
+ if (op_flags & (OPT_M|OPT_m)) {
+ if (optind != argc - 1)
+ Usage();
+ fname = argv[optind++];
+ }
+
+ if (Logger::getTheLog("/tmp/ohsender.log") == 0) {
+ cerr << "Can't initialize log" << endl;
+ return 1;
+ }
+ Logger::getTheLog("")->setLogLevel(Logger::LLDEB1);
+
+ LibUPnP *mylib = LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+ mylib->setLogFileName("/tmp/libupnp.log", LibUPnP::LogLevelDebug);
+
+ string reason;
+ OHSNH hdl = Songcast::getSender(fname, reason);
+ if (!hdl) {
+ cerr << "Device has no OpenHome Sender service" << endl;
+ return 1;
+ }
+
+ if ((op_flags & OPT_M)) {
+ rdMonitor(hdl);
+ } else if ((op_flags & OPT_m)) {
+ metadata(hdl);
+ } else {
+ Usage();
+ }
+
+ return 0;
+}
diff --git a/other/libupnppsamples-code/src/rdcvolume.cpp b/other/libupnppsamples-code/src/rdcvolume.cpp
new file mode 100755
index 000000000..6d71e8cfd
--- /dev/null
+++ b/other/libupnppsamples-code/src/rdcvolume.cpp
@@ -0,0 +1,226 @@
+// This libupnpp sample control program connects to a media renderer,
+// designated by its friendly name or uuid, and lets you adjust the
+// volume from the keyboard. It uses the MediaRenderer and
+// RenderingControl device and service classes from libupnpp.
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/control/discovery.hxx"
+#include "libupnpp/control/mediarenderer.hxx"
+
+using namespace std;
+using namespace UPnPClient;
+using namespace UPnPP;
+
+// Event reporter. We are not really using it here, apart from printing
+// stuff to the console.
+class MyReporter : public VarEventReporter {
+public:
+ MyReporter(const string& nm, RDCH rdc)
+ : m_nm(nm), m_srv(rdc)
+ {
+ m_srv->installReporter(this);
+ }
+ virtual ~MyReporter() {
+ m_srv->installReporter(0);
+ }
+
+ virtual void changed(const char *nm, int value)
+ {
+ cerr << m_nm << " : Changed: " << nm << " (int): " << value << endl;
+ }
+
+ virtual void changed(const char *nm, const char *value)
+ {
+ cerr << m_nm << " : Changed: " << nm << " (str): " << value << endl;
+ }
+
+private:
+ string m_nm;
+ RDCH m_srv;
+};
+
+
+//
+// Device discovery part. We can't just connect to the device, UPnP
+// does not work like this. The lib is going to broadcast a request
+// for devices to signal their presence, withing a fixed time window
+// (a few seconds). We could just wait for the full window and then
+// connect, but here, we are doing the fancy thing, setting up a
+// callback which will be called as each new device manifests itself,
+// so that we can connect asap. The callback is called from a
+// different thread, so we need locking.
+std::mutex discolock;
+std::condition_variable discocv;
+
+// Using shared variables, but the callback is an std::function, so
+// there are other possibilities.
+UPnPDeviceDesc o_devicedesc;
+string o_name;
+
+static bool discoCB(const UPnPDeviceDesc& device, const UPnPServiceDesc&)
+{
+ std::unique_lock lock(discolock);
+ //cerr << "discoCB: got " << device.friendlyName << endl;
+ if (!device.UDN.compare(o_name) || !device.friendlyName.compare(o_name)) {
+ //cerr << "discoCB: FOUND\n";
+ o_devicedesc = device;
+ discocv.notify_all();
+ }
+ return true;
+}
+
+MRDH getRenderer(const string& name)
+{
+ // Add a discovery callback, and remember about it in case we're
+ // called several times (not the case in this program).
+ o_name = name;
+ static int cbindex = -1;
+ if (cbindex == -1) {
+ cbindex = UPnPDeviceDirectory::addCallback(discoCB);
+ }
+
+ // Initialize and get a discovery directory handle. This must be
+ // done *after* the callback is set up, else we may miss devices.
+ static UPnPDeviceDirectory *superdir;
+ if (superdir == 0) {
+ superdir = UPnPDeviceDirectory::getTheDir();
+ if (superdir == 0) {
+ cerr << "Discovery init failed\n";
+ return MRDH();
+ }
+ }
+
+ // Until the initial delay is through, use the reporter to test
+ // devices as they come, so that we may respond asap
+ for (;;) {
+ std::unique_lock lock(discolock);
+#if FUTURE
+ // Older versions of the lib don't have this.
+ int ms = superdir->getRemainingDelayMs();
+#else
+ int ms = superdir->getRemainingDelay() * 1000;
+#endif
+ if (ms > 0) {
+ discocv.wait_for(lock, std::chrono::milliseconds(ms));
+ if (!o_devicedesc.UDN.compare(name) ||
+ !o_devicedesc.friendlyName.compare(name)) {
+ //cerr << "getRenderer: early wakeup\n";
+ return MRDH(new MediaRenderer(o_devicedesc));
+ }
+ } else {
+ // Initial delay done. We'll try one last time to ask the
+ // directory about our device
+ break;
+ }
+ }
+
+ // Try one last time just in case.
+ if (superdir->getDevByUDN(name, o_devicedesc)) {
+ return MRDH(new MediaRenderer(o_devicedesc));
+ } else if (superdir->getDevByFName(name, o_devicedesc)) {
+ return MRDH(new MediaRenderer(o_devicedesc));
+ }
+
+ cerr << "Can't connect to " << name << endl;
+ return MRDH();
+}
+
+// nothing to see here: character reading, one at a time.
+int mygetch()
+{
+ struct termios oldt, newt;
+ int ch;
+ tcgetattr(STDIN_FILENO, &oldt);
+ newt = oldt;
+ newt.c_lflag &= ~(ICANON | ECHO);
+ tcsetattr(STDIN_FILENO, TCSANOW, &newt);
+ ch = getchar();
+ tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
+ return ch;
+}
+
+int main(int argc, char **argv)
+{
+ argv++;argc--;
+ if (argc != 1) {
+ cerr << "Usage: rdcvolume rendererNameOrUid\n";
+ return 1;
+ }
+ string devname(*argv++);
+ argc--;
+
+ // Initialize libupnpp logging
+ Logger::getTheLog("stderr")->setLogLevel(Logger::LLDEB1);
+
+ // Explicitely initialize libupnpp so that we can display a
+ // possible error
+ LibUPnP *mylib = LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+
+
+ // Connect to the device
+ MRDH rdr = getRenderer(devname);
+ if (!rdr) {
+ cerr << "Renderer " << devname << " not found" << endl;
+ return 1;
+ }
+
+ // The MediaRender class has magic to create the well-know service
+ // class instances, here RenderingControl
+ RDCH rdc = rdr->rdc();
+ if (!rdc) {
+ cerr << "Device " << devname <<
+ " has no RenderingControl service" << endl;
+ return 1;
+ }
+
+ // Create the event-reporting object. Not used here actually, but
+ // it will print volume change events.
+ new MyReporter(devname, rdc);
+
+ cout << "q = quit, 'u' = up, 'd' = down\n";
+ for (;;) {
+ int vol = rdc->getVolume();
+ cout << "Volume now " << vol << endl;
+ int key = mygetch();
+
+ if (key == 'q') {
+ cout << "QUIT\n";
+ break;
+ } else if (key == 'u') {
+ vol += 5;
+ if (vol > 100) {
+ vol = 100;
+ }
+ } else if (key == 'd') {
+ vol -= 5;
+ if (vol < 0) {
+ vol = 0;
+ }
+ } else {
+ cout << "Bad key: " << (char)key << endl;
+ continue;
+ }
+ if (rdc->setVolume(vol)) {
+ cerr << "setVolume(" << vol << ") failed\n";
+ }
+ }
+
+ return 0;
+}
+
diff --git a/other/libupnppsamples-code/src/typedservice.cpp b/other/libupnppsamples-code/src/typedservice.cpp
new file mode 100755
index 000000000..f6d4fc6bd
--- /dev/null
+++ b/other/libupnppsamples-code/src/typedservice.cpp
@@ -0,0 +1,80 @@
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/control/typedservice.hxx"
+
+using namespace std;
+using namespace UPnPClient;
+using namespace UPnPP;
+
+class MReporter : public UPnPClient::VarEventReporter {
+public:
+ void changed(const char *nm, int value) {
+ cerr << "Reporter: changed(char *, int) invoked for nm " << nm <<
+ " ??\n";
+ }
+ void changed(const char *nm, const char *value) {
+ cout << "Changed: " << nm << " : " << value << endl;
+ }
+};
+
+int main(int argc, char **argv)
+{
+ argv++;argc--;
+ if (argc < 3) {
+ cerr << "Usage: tpservice NameOrUid partialservicetype action "
+ "[arg [...]]\n";
+ return 1;
+ }
+ string devname(*argv++);
+ argc--;
+ string servtp(*argv++);
+ argc--;
+ string actnm(*argv++);
+ argc--;
+
+ vector args;
+ while (argc--) {
+ args.push_back(*argv++);
+ }
+
+ // Initialize libupnpp logging
+ Logger::getTheLog("stderr")->setLogLevel(Logger::LLDEB1);
+ // Explicitely initialize libupnpp so that we can display a
+ // possible error
+ LibUPnP *mylib = LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+
+
+ TypedService *srv = findTypedService(devname, servtp, true);
+
+ if (!srv) {
+ cerr << "Service " << devname << "/" << servtp << " not found" << endl;
+ return 1;
+ }
+
+ map data;
+ int ret = srv->runAction(actnm, args, data);
+ if (ret == 0) {
+ for (auto& entry: data) {
+ cout << entry.first << "->" << entry.second << endl;
+ }
+ } else {
+ cerr << "runAction failed with code " << ret << endl;
+ return 1;
+ }
+
+ MReporter reporter;
+ srv->installReporter(&reporter);
+ sleep(1000);
+ return 0;
+}
diff --git a/other/libupnppsamples-code/src/upexplo.cpp b/other/libupnppsamples-code/src/upexplo.cpp
new file mode 100755
index 000000000..68d088d77
--- /dev/null
+++ b/other/libupnppsamples-code/src/upexplo.cpp
@@ -0,0 +1,586 @@
+// Exercise a variety of libupnpp features...
+
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/log.hxx"
+#include "libupnpp/upnpputils.hxx"
+#include "libupnpp/control/service.hxx"
+#include "libupnpp/control/cdirectory.hxx"
+#include "libupnpp/control/mediarenderer.hxx"
+#include "libupnpp/control/renderingcontrol.hxx"
+#include "libupnpp/control/discovery.hxx"
+
+using namespace UPnPClient;
+using namespace UPnPP;
+using namespace std;
+
+static int op_flags;
+#define OPT_a 0x1
+#define OPT_c 0x2
+#define OPT_l 0x4
+#define OPT_M 0x8
+#define OPT_m 0x10
+#define OPT_P 0x20
+#define OPT_p 0x40
+#define OPT_r 0x80
+#define OPT_s 0x100
+#define OPT_u 0x200
+#define OPT_V 0x400
+#define OPT_v 0x800
+#define OPT_1 0x1000
+#define OPT_U 0x2000
+
+UPnPDeviceDirectory *superdir;
+
+std::mutex reporterLock;
+std::condition_variable evloopcond;
+
+vector deviceList;
+static void clearDevices() {
+ deviceList.clear();
+}
+
+static bool findKnownDevice(const string& UDN)
+{
+ for (const auto& device : deviceList) {
+ if (device.UDN == UDN) {
+ return true;
+ }
+ }
+ return false;
+}
+
+static bool
+reporter(const UPnPDeviceDesc& device, const UPnPServiceDesc&)
+{
+ std::unique_lock lock(reporterLock);
+ //cerr << "reporter: " << device.friendlyName << " s " <<
+ // device.deviceType << endl;
+ if (!findKnownDevice(device.UDN)) {
+ deviceList.push_back(device);
+ evloopcond.notify_all();
+ }
+ return true;
+}
+
+static void showDevice(const UPnPDeviceDesc& device)
+{
+ const int namewidth(25);
+ const int typewidth(48);
+ cout << setw(namewidth) << device.friendlyName << setw(0) <<
+ setw(typewidth) << string(" (") + device.deviceType + ")";
+ if (op_flags & OPT_u) {
+ cout << " " << device.URLBase;
+ }
+ if (op_flags & OPT_U) {
+ cout << " " << device.UDN;
+ }
+ cout << endl;
+}
+
+static bool traverser(const UPnPDeviceDesc& device, const UPnPServiceDesc& srv)
+{
+ if (!findKnownDevice(device.UDN)) {
+ showDevice(device);
+ deviceList.push_back(device);
+ }
+ return true;
+}
+
+void listDevices()
+{
+ cout << "UPnP devices:" << endl;
+ static int cbindex = -1;
+ if (cbindex == -1) {
+ cbindex = UPnPDeviceDirectory::addCallback(reporter);
+ }
+ if (superdir == 0) {
+ superdir = UPnPDeviceDirectory::getTheDir(1);
+ if (superdir == 0) {
+ cerr << "can't get superdir\n";
+ exit(1);
+ }
+ }
+
+ // Until the initial delay is through, use the reporter to list
+ // devices as they come
+ unsigned int ndevices = 0;
+ for (;;) {
+ std::unique_lock lock(reporterLock);
+#if FUTURE
+ int ms = superdir->getRemainingDelayMs();
+#else
+ int ms = superdir->getRemainingDelay() * 1000;
+#endif
+ if (ms > 0) {
+ evloopcond.wait_for(lock, std::chrono::milliseconds(ms));
+ if (deviceList.size() > ndevices) {
+ for (unsigned int i = ndevices; i < deviceList.size(); i++) {
+ showDevice(deviceList[i]);
+ }
+ ndevices = deviceList.size();
+ }
+ } else {
+ if (cbindex >= 0) {
+ cerr << "Initial delay done. " << deviceList.size() << " devices\n";
+ UPnPDeviceDirectory::delCallback(cbindex);
+ cbindex = -2;
+ return;
+ } else {
+ break;
+ }
+ }
+ }
+
+
+ // Called after initial delay done. Unset the callback and
+ // traverse the directory
+ clearDevices();
+ auto ret = superdir->traverse(traverser);
+ cerr << "Now having " << deviceList.size() << " devices " << endl;
+}
+
+void listServers()
+{
+ cout << "Content Directories:" << endl;
+ vector dirservices;
+ if (!ContentDirectory::getServices(dirservices)) {
+ cerr << "listDirServices failed" << endl;
+ return;
+ }
+ for (vector::iterator it = dirservices.begin();
+ it != dirservices.end(); it++) {
+ cout << (*it)->getFriendlyName() << endl;
+ }
+ cout << endl;
+}
+
+void listPlayers()
+{
+ cout << "Media Renderers:" << endl;
+ vector vdds;
+ if (!MediaRenderer::getDeviceDescs(vdds)) {
+ cerr << "MediaRenderer::getDeviceDescs" << endl;
+ return;
+ }
+ for (auto& entry : vdds) {
+ cout << entry.friendlyName << endl;
+ }
+ cout << endl;
+}
+
+class MReporter : public UPnPClient::VarEventReporter {
+public:
+ void changed(const char *nm, int value)
+ {
+ cout << "Changed: " << nm << " : " << value << endl;
+ }
+ void changed(const char *nm, const char *value)
+ {
+ cout << "Changed: " << nm << " : " << value << endl;
+ }
+
+ void changed(const char *nm, UPnPDirObject meta)
+ {
+ string s = meta.dump();
+ cout << "Changed: " << nm << " : " << s << endl;
+ }
+
+};
+
+MRDH getRenderer(const string& name)
+{
+ if (superdir == 0) {
+ superdir = UPnPDeviceDirectory::getTheDir();
+ }
+
+ UPnPDeviceDesc ddesc;
+ if (superdir->getDevByUDN(name, ddesc)) {
+ return MRDH(new MediaRenderer(ddesc));
+ } else if (superdir->getDevByFName(name, ddesc)) {
+ return MRDH(new MediaRenderer(ddesc));
+ }
+ cerr << "getDevByFname failed" << endl;
+ return MRDH();
+}
+
+void getsetVolume(const string& friendlyName, int volume = -1)
+{
+ MRDH rdr = getRenderer(friendlyName);
+ if (!rdr) {
+ return;
+ }
+
+ RDCH rdc = rdr->rdc();
+ if (!rdc) {
+ cerr << "Device has no RenderingControl service" << endl;
+ return;
+ }
+
+ if (volume == -1) {
+ volume = rdc->getVolume();
+ cout << "Current volume: " << volume << endl;
+ return;
+ } else {
+ if ((volume = rdc->setVolume(volume)) != 0) {
+ cerr << "Error setting volume: " << volume << endl;
+ return;
+ }
+ }
+}
+
+void tpMonitor(const string& friendlyName)
+{
+ MRDH rdr = getRenderer(friendlyName);
+ if (!rdr) {
+ return;
+ }
+ AVTH avt = rdr->avt();
+ if (!avt) {
+ cerr << "Device has no AVTransport service" << endl;
+ return;
+ }
+ MReporter reporter;
+ avt->installReporter(&reporter);
+
+ while (true) {
+ AVTransport::PositionInfo info;
+ int ret;
+ if ((ret = avt->getPositionInfo(info))) {
+ cerr << "getPositionInfo failed. Code " << ret << endl;
+ } else {
+ cout << info.trackmeta.m_title << " reltime " << info.reltime
+ << endl;
+ }
+ sleep(2);
+ }
+}
+
+int tpAlbumArt(const string& fname)
+{
+ MRDH rdr = getRenderer(fname);
+ if (!rdr) {
+ cerr << "Can't connect to renderer " << fname << endl;
+ return 1;
+ }
+
+ string uri;
+
+ OHIFH ohinfo = rdr->ohif();
+ if (ohinfo) {
+ UPnPDirObject dirent;
+ if (ohinfo->metatext(&dirent) == 0) {
+ uri = dirent.getprop("upnp:albumArtURI");
+ } else {
+ //cerr << "metatext failed\n";
+ }
+ }
+
+ if (uri.empty()) {
+ AVTH avt = rdr->avt();
+ if (avt) {
+ AVTransport::TransportInfo tinfo;
+ int ret;
+ if ((ret = avt->getTransportInfo(tinfo))) {
+ cerr << "getTransportInfo failed. Code " << ret << endl;
+ } else if (tinfo.tpstatus == AVTransport::TPS_Ok &&
+ (tinfo.tpstate == AVTransport::Playing ||
+ tinfo.tpstate == AVTransport::PausedPlayback)) {
+ AVTransport::PositionInfo info;
+ if ((ret = avt->getPositionInfo(info))) {
+ cerr << "getPositionInfo failed. Code " << ret << endl;
+ } else {
+ uri = info.trackmeta.getprop("upnp:albumArtURI");
+ }
+ }
+ }
+ }
+
+ cout << uri << endl;
+ return 0;
+}
+
+void tpPlayStop(const string& friendlyName, bool doplay)
+{
+ MRDH rdr = getRenderer(friendlyName);
+ if (!rdr) {
+ return;
+ }
+ AVTH avt = rdr->avt();
+ if (!avt) {
+ cerr << "Device has no AVTransport service" << endl;
+ return;
+ }
+ int ret;
+ if (doplay) {
+ ret = avt->play();
+ } else {
+ ret = avt->stop();
+ }
+ if (ret != 0) {
+ cerr << "Operation failed: code: " << ret << endl;
+ }
+}
+
+void tpPause(const string& friendlyName)
+{
+ MRDH rdr = getRenderer(friendlyName);
+ if (!rdr) {
+ return;
+ }
+ AVTH avt = rdr->avt();
+ if (!avt) {
+ cerr << "Device has no AVTransport service" << endl;
+ return;
+ }
+
+ avt->pause();
+}
+
+void readdir(const string& friendlyName, const string& cid)
+{
+ cout << "readdir: [" << friendlyName << "] [" << cid << "]" << endl;
+ CDSH server;
+ if (!ContentDirectory::getServerByName(friendlyName, server)) {
+ cerr << "Server not found" << endl;
+ return;
+ }
+ UPnPDirContent dirbuf;
+ int code = server->readDir(cid, dirbuf);
+ if (code) {
+ cerr << LibUPnP::errAsString("readdir", code) << endl;
+ return;
+ }
+ cout << "Browse: got " << dirbuf.m_containers.size() <<
+ " containers and " << dirbuf.m_items.size() << " items " << endl;
+ for (unsigned int i = 0; i < dirbuf.m_containers.size(); i++) {
+ cout << dirbuf.m_containers[i].dump();
+ }
+ for (unsigned int i = 0; i < dirbuf.m_items.size(); i++) {
+ cout << dirbuf.m_items[i].dump();
+ }
+}
+
+void getMetadata(const string& friendlyName, const string& cid)
+{
+ cout << "getMeta: [" << friendlyName << "] [" << cid << "]" << endl;
+ CDSH server;
+ if (!ContentDirectory::getServerByName(friendlyName, server)) {
+ cerr << "Server not found" << endl;
+ return;
+ }
+ UPnPDirContent dirbuf;
+ int code = server->getMetadata(cid, dirbuf);
+ if (code) {
+ cerr << LibUPnP::errAsString("readdir", code) << endl;
+ return;
+ }
+ cout << "getMeta: got " << dirbuf.m_containers.size() <<
+ " containers and " << dirbuf.m_items.size() << " items " << endl;
+ for (unsigned int i = 0; i < dirbuf.m_containers.size(); i++) {
+ cout << dirbuf.m_containers[i].dump();
+ }
+ for (unsigned int i = 0; i < dirbuf.m_items.size(); i++) {
+ cout << dirbuf.m_items[i].dump();
+ }
+}
+
+void search(const string& friendlyName, const string& ss)
+{
+ cout << "search: [" << friendlyName << "] [" << ss << "]" << endl;
+ CDSH server;
+ if (!ContentDirectory::getServerByName(friendlyName, server)) {
+ cerr << "Server not found" << endl;
+ return;
+ }
+ UPnPDirContent dirbuf;
+ string cid("0");
+ int code = server->search(cid, ss, dirbuf);
+ if (code) {
+ cerr << LibUPnP::errAsString("search", code) << endl;
+ return;
+ }
+ cout << "Search: got " << dirbuf.m_containers.size() <<
+ " containers and " << dirbuf.m_items.size() << " items " << endl;
+ for (unsigned int i = 0; i < dirbuf.m_containers.size(); i++) {
+ cout << dirbuf.m_containers[i].dump();
+ }
+ for (unsigned int i = 0; i < dirbuf.m_items.size(); i++) {
+ cout << dirbuf.m_items[i].dump();
+ }
+}
+
+void getSearchCaps(const string& friendlyName)
+{
+ cout << "getSearchCaps: [" << friendlyName << "]" << endl;
+ CDSH server;
+ if (!ContentDirectory::getServerByName(friendlyName, server)) {
+ cerr << "Server not found" << endl;
+ return;
+ }
+ set capa;
+ int code = server->getSearchCapabilities(capa);
+ if (code) {
+ cerr << LibUPnP::errAsString("readdir", code) << endl;
+ return;
+ }
+ if (capa.empty()) {
+ cout << "No search capabilities";
+ } else {
+ for (set::const_iterator it = capa.begin();
+ it != capa.end(); it++) {
+ cout << "[" << *it << "]";
+ }
+ }
+ cout << endl;
+}
+
+
+
+static char *thisprog;
+static char usage [] =
+ " -l : list devices\n"
+ " -1 : loop only once (initial discovery)\n"
+ " [-u] Add url to device lines\n"
+ " -r list object id (root is '0')\n"
+ " -s search for string\n"
+ " -m : list object metadata\n"
+ " -c get search capabilities\n"
+ " -M : monitor AVTransport\n"
+ " -v get volume\n"
+ " -V set volume\n"
+ " -p 1|0 play/stop\n"
+ " -P pause\n"
+ " --album-art print album art uri for playing track\n"
+ "\n params can be either \"friendly names\", or UDNs\n"
+ " params must be \"friendly names\"\n"
+ " \n"
+ ;
+static void
+Usage(void)
+{
+ fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
+ exit(1);
+}
+
+static struct option long_options[] = {
+ {"album-art", 0, 0, 'a'},
+ {0, 0, 0, 0}
+};
+
+int main(int argc, char *argv[])
+{
+ string fname;
+ string arg;
+
+ thisprog = argv[0];
+
+ int ret;
+ int option_index = 0;
+ while ((ret = getopt_long(argc, argv, "1MPSVclmprsUuvx",
+ long_options, &option_index)) != -1) {
+ switch (ret) {
+ case '1': op_flags |= OPT_1; break;
+ case 'a': if (op_flags) Usage(); op_flags |= OPT_a; break;
+ case 'M': if (op_flags) Usage(); op_flags |= OPT_M; break;
+ case 'P': if (op_flags) Usage(); op_flags |= OPT_P; break;
+ case 'V': if (op_flags) Usage(); op_flags |= OPT_V; break;
+ case 'c': if (op_flags) Usage(); op_flags |= OPT_c; break;
+ case 'l': if (op_flags) Usage(); op_flags |= OPT_l; break;
+ case 'm': if (op_flags) Usage(); op_flags |= OPT_m; break;
+ case 'p': if (op_flags) Usage(); op_flags |= OPT_p; break;
+ case 'r': if (op_flags) Usage(); op_flags |= OPT_r; break;
+ case 's': if (op_flags) Usage(); op_flags |= OPT_s; break;
+ case 'u': op_flags |= OPT_u; break;
+ case 'U': op_flags |= OPT_U; break;
+ case 'v': if (op_flags) Usage(); op_flags |= OPT_v; break;
+
+ default:
+ Usage();
+ }
+ }
+
+ if (op_flags & (OPT_l)) {
+ if (optind < argc)
+ Usage();
+ }
+
+ if (op_flags & (OPT_c | OPT_v | OPT_P | OPT_M | OPT_a)) {
+ if (optind != argc - 1)
+ Usage();
+ fname = argv[optind++];
+ }
+ if (op_flags & (OPT_r | OPT_s | OPT_m | OPT_V | OPT_p)) {
+ cerr << "optind " << optind << " argc " << argc << endl;
+ if (optind != argc - 2)
+ Usage();
+ fname = argv[optind++];
+ arg = argv[optind++];
+ }
+
+ if (Logger::getTheLog("/tmp/upexplo.log") == 0) {
+ cerr << "Can't initialize log" << endl;
+ //return 1;
+ }
+ Logger::getTheLog("")->setLogLevel(Logger::LLDEB1);
+
+ string hwa;
+ LibUPnP *mylib = LibUPnP::getLibUPnP(false, &hwa);
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+ //cerr << "hwaddr " << hwa << endl;
+
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+// mylib->setLogFileName("/tmp/libupnp.log", LibUPnP::LogLevelDebug);
+
+ if ((op_flags & OPT_l)) {
+ while (true) {
+ listDevices();
+ if (op_flags & OPT_1) {
+ break;
+ }
+ sleep(5);
+ }
+ } else if ((op_flags & OPT_m)) {
+ getMetadata(fname, arg);
+ } else if ((op_flags & OPT_r)) {
+ readdir(fname, arg);
+ } else if ((op_flags & OPT_s)) {
+ search(fname, arg);
+ } else if ((op_flags & OPT_c)) {
+ getSearchCaps(fname);
+ } else if ((op_flags & OPT_V)) {
+ int volume = atoi(arg.c_str());
+ getsetVolume(fname, volume);
+ } else if ((op_flags & OPT_v)) {
+ getsetVolume(fname);
+ } else if ((op_flags & OPT_M)) {
+ tpMonitor(fname);
+ } else if ((op_flags & OPT_p)) {
+ int iarg = atoi(arg.c_str());
+ tpPlayStop(fname, iarg);
+ } else if ((op_flags & OPT_P)) {
+ tpPause(fname);
+ } else if ((op_flags & OPT_a)) {
+ return tpAlbumArt(fname);
+ } else {
+ Usage();
+ }
+
+ return 0;
+}
diff --git a/other/libupnppsamples-code/src/uplistdir.cpp b/other/libupnppsamples-code/src/uplistdir.cpp
new file mode 100755
index 000000000..1ef1aa0c8
--- /dev/null
+++ b/other/libupnppsamples-code/src/uplistdir.cpp
@@ -0,0 +1,59 @@
+// This libupnpp sample program lists all devices and services found
+// on the local network
+
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/log.hxx"
+#include "libupnpp/control/description.hxx"
+#include "libupnpp/control/discovery.hxx"
+
+using namespace std;
+using namespace UPnPClient;
+using namespace UPnPP;
+
+static bool traverser(const UPnPDeviceDesc& device, const UPnPServiceDesc& srv)
+{
+ cout << device.friendlyName <<" ("<< device.deviceType << ") " <<
+ srv.serviceType << endl;
+ return true;
+}
+
+int main(int argc, char *argv[])
+{
+ // Initialize libupnpp logging
+ Logger::getTheLog("")->setLogLevel(Logger::LLERR);
+
+ // Get a handle to the main lib object. You don't really need to
+ // do this actually. We just do it to check that the lib
+ // initialized ok, but there are other possible uses, see the doc
+ // in the include file.
+ LibUPnP *mylib = LibUPnP::getLibUPnP();
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+
+ // Get a handle to the device directory. You can call this
+ // multiple times, only the first call does something, any further
+ // call will just return the pointer to the singleton.
+ UPnPDeviceDirectory *superdir = UPnPDeviceDirectory::getTheDir();
+ if (superdir == 0) {
+ cerr << "Cant access device directory\n";
+ return 1;
+ }
+
+ // Call the directory traversal. This will wait for the initial
+ // time window. It's possible to see the devices as they appear
+ // instead by using UPnPDeviceDirectory::addCallback(). See for
+ // example rdcvolume.cpp
+ superdir->traverse(traverser);
+
+ return 0;
+}
diff --git a/other/libupnppsamples-code/upsend_src/streamer.cpp b/other/libupnppsamples-code/upsend_src/streamer.cpp
new file mode 100755
index 000000000..a0f24c8cb
--- /dev/null
+++ b/other/libupnppsamples-code/upsend_src/streamer.cpp
@@ -0,0 +1,257 @@
+/* Copyright (C) 2014 J.F.Dockes
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+
+#include "streamer.h"
+#include "libupnpp/log.h"
+
+using namespace std;
+
+#ifndef MIN
+#define MIN(A,B) ((A)<(B)?(A):(B))
+#endif
+
+// #define PRINT_KEYS
+
+// Only accept HTTP connections from localhost: no
+#define ACCEPT_LOCALONLY 0
+
+// The queue for audio blocks coming our way
+static queue dataqueue;
+static std::mutex dataqueueLock;
+static std::condition_variable dataqueueWaitCond;
+
+#ifdef PRINT_KEYS
+static const char *ValueKindToCp(enum MHD_ValueKind kind)
+{
+ switch (kind) {
+ case MHD_RESPONSE_HEADER_KIND: return "Response header";
+ case MHD_HEADER_KIND: return "HTTP header";
+ case MHD_COOKIE_KIND: return "Cookies";
+ case MHD_POSTDATA_KIND: return "POST data";
+ case MHD_GET_ARGUMENT_KIND: return "GET (URI) arguments";
+ case MHD_FOOTER_KIND: return "HTTP footer";
+ default: return "Unknown";
+ }
+}
+
+static int print_out_key (void *cls, enum MHD_ValueKind kind,
+ const char *key, const char *value)
+{
+ LOGDEB(ValueKindToCp(kind) << ": " << key << " -> " << value << endl);
+ return MHD_YES;
+}
+#endif /* PRINT_KEYS */
+
+struct DataGenContext {
+ DataGenContext() :
+ eof(false) {
+ }
+ bool eof;
+};
+
+// This gets called by microhttpd when it needs data.
+static ssize_t
+data_generator(void *cls, uint64_t pos, char *buf, size_t max)
+{
+ LOGDEB1("data_generator: " << " max " << max << endl);
+ DataGenContext *dgc = (DataGenContext *)cls;
+ std::unique_lock lock(dataqueueLock);
+ if (dgc->eof) {
+ LOGDEB1("data_generator: already eof\n");
+ return -1;
+ }
+
+ // Loop reading on the input queue until we have satistified the request
+ size_t bytes = 0;
+ while (bytes < max) {
+ while (dataqueue.empty()) {
+ LOGDEB1("data_generator: waiting for buffer" << endl);
+ dataqueueWaitCond.wait(lock);
+ }
+
+ AudioMessage *m = dataqueue.front();
+ if (m->m_bytes == 0) {
+ // EOF
+ LOGDEB1("data_generator: empty buffer\n");
+ dgc->eof = true;
+ // Do not notify or clear the queue: freeCallback will do it.
+ break;
+ }
+ LOGDEB1("data_generator: data buffer\n");
+
+ size_t newbytes = MIN(max - bytes, m->m_bytes - m->m_curoffs);
+ memcpy(buf + bytes, m->m_buf + m->m_curoffs, newbytes);
+ m->m_curoffs += newbytes;
+ bytes += newbytes;
+ if (m->m_curoffs == m->m_bytes) {
+ delete dataqueue.front();
+ dataqueue.pop();
+ dataqueueWaitCond.notify_all();
+ }
+ }
+
+ LOGDEB1("data_generator: returning " << bytes << " bytes" << endl);
+ return bytes;
+}
+
+static void ContentReaderFreeCallback(void *cls)
+{
+ LOGDEB1("ContentReaderFreeCallback\n");
+ DataGenContext *dgc = (DataGenContext*)cls;
+ std::unique_lock lock(dataqueueLock);
+ while (!dataqueue.empty()) {
+ delete dataqueue.front();
+ dataqueue.pop();
+ }
+ delete dgc;
+ dataqueueWaitCond.notify_all();
+}
+
+static int answer_to_connection(void *cls, struct MHD_Connection *connection,
+ const char *url,
+ const char *method, const char *version,
+ const char *upload_data,
+ size_t *upload_data_size, void **con_cls)
+{
+ AudioSink::Context *ctxt = (AudioSink::Context *)cls;
+
+#ifdef PRINT_KEYS
+ MHD_get_connection_values(connection, MHD_HEADER_KIND, &print_out_key, 0);
+#endif
+
+ static int aptr;
+ if (&aptr != *con_cls) {
+ /* do not respond on first call ?*/
+ *con_cls = &aptr;
+ return MHD_YES;
+ }
+
+ LOGDEB("answer_to_connection: url " << url << " method " << method <<
+ " version " << version << endl);
+
+ long long size = MHD_SIZE_UNKNOWN;
+ DataGenContext *dgc = new DataGenContext();
+
+ // the block size seems to be flatly ignored by libmicrohttpd
+ // Any random value would probably work the same
+ struct MHD_Response *response =
+ MHD_create_response_from_callback(size, 4096, &data_generator,
+ dgc, ContentReaderFreeCallback);
+ if (response == NULL) {
+ LOGERR("httpgate: answer: could not create response" << endl);
+ return MHD_NO;
+ }
+
+ MHD_add_response_header(response, "Content-Type",
+ ctxt->content_type.c_str());
+
+// #define FORCE_CHUNKED
+#if defined(FORCE_CHUNKED)
+#warning content-length is needed for mpd to play wav (else tries to seek).
+ MHD_add_response_header(response, "Transfer-Encoding", "chunked");
+#else
+ char cl[100];
+ sprintf(cl, "%lld", (long long)ctxt->filesize);
+ MHD_add_response_header(response, "Content-Length", cl);
+#endif
+
+ int ret = MHD_queue_response(connection, MHD_HTTP_OK, response);
+ MHD_destroy_response(response);
+ return ret;
+}
+
+static void *audioEater(AudioSink::Context *ctxt)
+{
+ LOGDEB1("audioEater\n");
+ string value;
+ int port = 8869;
+ auto it = ctxt->config.find("httpport");
+ if (it != ctxt->config.end()) {
+ port = atoi(it->second.c_str());
+ }
+
+ WorkQueue *queue = ctxt->queue;
+
+ LOGDEB1("audioEater: queue " << ctxt->queue << " HTTP port " << port
+ << endl);
+
+ struct MHD_Daemon *daemon =
+ MHD_start_daemon(
+ MHD_USE_SELECT_INTERNALLY,
+ port,
+ /* Accept policy callback and arg */
+ NULL, NULL,
+ /* handler and arg */
+ &answer_to_connection, ctxt,
+ MHD_OPTION_END);
+
+ if (NULL == daemon) {
+ queue->workerExit();
+ delete ctxt;
+ return (void *)0;
+ }
+
+ bool eof = false;
+ while (true) {
+ AudioMessage *tsk = nullptr;
+ size_t qsz;
+ if (!queue->take(&tsk, &qsz)) {
+ tsk = nullptr;
+ eof = true;
+ }
+ std::unique_lock lock(dataqueueLock);
+ if (eof) {
+ LOGDEB1("audioEater: pushing empty buffer\n");
+ dataqueue.push(new AudioMessage(nullptr, 0, 0));
+ dataqueueWaitCond.notify_all();
+ }
+
+ /* limit size of queuing / wait for drain. */
+ while (dataqueue.size() > (eof ? 0 : 2)) {
+ if (eof) {
+ LOGDEB1("audioEater: waiting for queue drain, sz " <<
+ dataqueue.size() << endl);
+ }
+ dataqueueWaitCond.wait(lock);
+ }
+ if (eof)
+ break;
+ dataqueue.push(tsk);
+ dataqueueWaitCond.notify_all();
+ }
+ LOGDEB0("audioEater: returning\n");
+ MHD_stop_daemon(daemon);
+ queue->workerExit();
+ delete ctxt;
+ return (void*)1;
+}
+
+AudioSink httpAudioSink(&audioEater);
diff --git a/other/libupnppsamples-code/upsend_src/streamer.h b/other/libupnppsamples-code/upsend_src/streamer.h
new file mode 100755
index 000000000..445e005e2
--- /dev/null
+++ b/other/libupnppsamples-code/upsend_src/streamer.h
@@ -0,0 +1,69 @@
+/* Copyright (C) 2016 J.F.Dockes
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+#ifndef _STREAMER_H_INCLUDED_
+#define _STREAMER_H_INCLUDED_
+
+#include "workqueue.h"
+
+#include
+
+// The audio messages which get passed between the reader and the http
+// server part.
+class AudioMessage {
+public:
+ // buf is is a malloced buffer, and we take ownership. The caller
+ // MUST NOT free it. Bytes is data count, allocbytes is the buffer size.
+ AudioMessage(char *buf, size_t bytes, size_t allocbytes)
+ : m_bytes(bytes), m_allocbytes(allocbytes), m_buf(buf), m_curoffs(0) {
+ }
+
+ ~AudioMessage() {
+ if (m_buf)
+ free(m_buf);
+ }
+ unsigned int m_bytes; // Useful bytes
+ unsigned int m_allocbytes; // buffer size
+ char *m_buf;
+ unsigned int m_curoffs; /* Used by the http data emitter */
+};
+
+class AudioSink {
+public:
+ struct Context {
+ Context(WorkQueue *q)
+ : queue(q), config(0), filesize(0) {
+ }
+ WorkQueue *queue;
+ std::unordered_map config;
+ std::string filename;
+ std::string content_type;
+ std::string ext;
+ off_t filesize;
+ };
+
+ AudioSink(void *(*w)(Context *))
+ : worker(w) {
+ }
+
+ /** Worker routine for fetching bufs from the rcvqueue and sending them
+ * further. The param is actually an AudioSink::Context */
+ void *(*worker)(Context *);
+};
+
+extern AudioSink httpAudioSink;
+
+#endif /* _STREAMER_H_INCLUDED_ */
diff --git a/other/libupnppsamples-code/upsend_src/upsend.cpp b/other/libupnppsamples-code/upsend_src/upsend.cpp
new file mode 100755
index 000000000..421ac1b77
--- /dev/null
+++ b/other/libupnppsamples-code/upsend_src/upsend.cpp
@@ -0,0 +1,323 @@
+/* Copyright (C) 2013 J.F.Dockes
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#include "libupnpp/upnpplib.hxx"
+#include "libupnpp/log.hxx"
+#include "libupnpp/soaphelp.hxx"
+#include "libupnpp/upnpputils.hxx"
+#include "libupnpp/control/mediarenderer.hxx"
+#include "libupnpp/control/avtransport.hxx"
+#include "libupnpp/control/discovery.hxx"
+
+#include "streamer.h"
+#include "wav.h"
+
+using namespace std;
+using namespace UPnPClient;
+using namespace UPnPP;
+
+WorkQueue audioqueue("audioqueue", 4);
+
+// @param name can be uuid or friendly name, we try both. The chance that a
+// device would have a uuid which would be the friendly name of
+// another is small...
+MRDH getRenderer(const string& name)
+{
+ static UPnPDeviceDirectory *superdir;
+ if (superdir == 0) {
+ superdir = UPnPDeviceDirectory::getTheDir();
+ if (superdir == 0) {
+ cerr << "Discovery init failed\n";
+ return MRDH();
+ }
+ }
+
+ UPnPDeviceDesc ddesc;
+ if (superdir->getDevByFName(name, ddesc)) {
+ return MRDH(new MediaRenderer(ddesc));
+ } else if (superdir->getDevByUDN(name, ddesc)) {
+ return MRDH(new MediaRenderer(ddesc));
+ }
+ cerr << "Can't connect to " << name << endl;
+ return MRDH();
+}
+
+static string path_suffix(const string& s)
+{
+ string::size_type dotp = s.rfind('.');
+ if (dotp == string::npos) {
+ return string();
+ }
+ return s.substr(dotp + 1);
+}
+
+static bool whatfile(const string& audiofile, AudioSink::Context *ctxt)
+{
+ if (access(audiofile.c_str(), R_OK) != 0) {
+ cerr << "No read access " << audiofile << " errno " << errno << endl;
+ return false;
+ }
+ struct stat st;
+ if (stat(audiofile.c_str(), &st)) {
+ cerr << "Can't stat " << audiofile << " errno " << errno << endl;
+ return false;
+ }
+
+ string ext = path_suffix(audiofile);
+ ctxt->filename = audiofile;
+ ctxt->filesize = st.st_size;
+ ctxt->ext = ext;
+ const char* cext = ext.c_str();
+ if (!strcasecmp("flac", cext)) {
+ ctxt->content_type = "audio/flac";
+ } else if (!strcasecmp("mp3", cext)) {
+ ctxt->content_type = "audio/mpeg";
+ } else if (!strcasecmp("wav", cext)) {
+ ctxt->content_type = "audio/wav";
+ } else {
+ cerr << "Unknown extension " << ext << endl;
+ return false;
+ }
+ return true;
+}
+
+void *readworker(void *a)
+{
+ AudioSink::Context *ctxt = (AudioSink::Context *)a;
+
+ int fd = 0;
+ if (ctxt->filename.compare("stdin")) {
+ if ((fd = open(ctxt->filename.c_str(), O_RDONLY)) < 0) {
+ cerr << "readWorker: can't open " << ctxt->filename <<
+ " for reading, errno " << errno << endl;
+ exit(1);
+ }
+ }
+
+ for (;;) {
+ unsigned int allocbytes = 4096;
+ char *buf = (char *)malloc(allocbytes);
+ if (buf == 0) {
+ cerr << "readWorker: can't allocate " << allocbytes << " bytes\n";
+ exit(1);
+ }
+ ssize_t readbytes = read(fd, buf, allocbytes);
+ //cerr << "readworker: got " << readbytes << "bytes\n";
+ if (readbytes < 0) {
+ cerr << "readWorker: read error on " << ctxt->filename <<
+ " errno " << errno << endl;
+ exit(1);
+ } else if (readbytes == 0) {
+ audioqueue.waitIdle();
+ audioqueue.setTerminateAndWait();
+ return nullptr;
+ }
+ AudioMessage *ap = new AudioMessage(buf, readbytes, allocbytes);
+ if (!audioqueue.put(ap, false)) {
+ cerr << "readWorker: queue dead: exiting\n";
+ exit(1);
+ }
+ }
+}
+
+string didlmake(const string& uri, const string& mime)
+{
+ ostringstream ss;
+ ss << ""
+ ""
+ << "- ";
+
+ ss << "" << SoapHelp::xmlQuote("Streaming") << "";
+ ss << "object.item.audioItem.musicTrack";
+
+#warning "problem with resource values!"
+ ss << ""
+ << SoapHelp::xmlQuote(uri)
+ << ""
+ << "
";
+ return ss.str();
+}
+
+static char *thisprog;
+static char usage [] =
+" : play audio on given renderer\n"
+ ;
+static void Usage(void)
+{
+ fprintf(stderr, "%s: usage:\n%s", thisprog, usage);
+ exit(1);
+}
+static int op_flags;
+#define OPT_h 0x1
+#define OPT_p 0x2
+static struct option long_options[] = {
+ {"host", required_argument, 0, 'h'},
+ {"port", required_argument, 0, 'p'},
+ {0, 0, 0, 0}
+};
+
+
+int main(int argc, char *argv[])
+{
+ thisprog = argv[0];
+ string host = "localhost";
+ int port = 8869;
+
+ int option_index = 0;
+ int ret;
+ while ((ret = getopt_long(argc, argv, "h:p:",
+ long_options, &option_index)) != -1) {
+ cerr << "ret is " << ret << endl;
+ switch (ret) {
+ case 'h': op_flags |= OPT_h; host = optarg; break;
+ case 'p': op_flags |= OPT_h; port = atoi(optarg); break;
+ default: Usage();
+ }
+ }
+
+ if (optind != argc - 2)
+ Usage();
+ string audiofile = argv[optind++];
+ string renderer = argv[optind++];
+
+ if (Logger::getTheLog("stderr") == 0) {
+ cerr << "Can't initialize log" << endl;
+ return 1;
+ }
+ Logger::getTheLog("")->setLogLevel(Logger::LLDEB1);
+
+ string hwa;
+ LibUPnP *mylib = LibUPnP::getLibUPnP(false, &hwa);
+ if (!mylib) {
+ cerr << "Can't get LibUPnP" << endl;
+ return 1;
+ }
+
+ if (!(op_flags & OPT_h)) {
+#if FUTURE
+ host = mylib->host();
+ if (host.empty()) {
+ cerr << "Can't retrieve IP address\n";
+ return 1;
+ }
+#else
+ char hostname[1024];
+ if (gethostname(hostname, 1024)) {
+ perror("gethostname failed. use -h:");
+ return 1;
+ }
+ host = hostname;
+#endif
+ }
+ if (!mylib->ok()) {
+ cerr << "Lib init failed: " <<
+ mylib->errAsString("main", mylib->getInitError()) << endl;
+ return 1;
+ }
+ //mylib->setLogFileName("/tmp/libupnp.log", LibUPnP::LogLevelDebug);
+
+ MRDH rdr = getRenderer(renderer);
+ if (!rdr) {
+ cerr << "Can't connect to renderer\n";
+ return 1;
+ }
+ AVTH avth = rdr->avt();
+ if (!avth) {
+ cerr << "Device has no AVTransport service" << endl;
+ return 1;
+ }
+
+
+ // Identify file
+ AudioSink::Context *ctxt = new AudioSink::Context(&audioqueue);
+ bool makewav = false;
+ if (!audiofile.compare("stdin")) {
+ ctxt->filename = audiofile;
+ ctxt->ext = "wav";
+ ctxt->content_type = "audio/wav";
+ makewav = true;
+ } else {
+ if (!whatfile(audiofile, ctxt)) {
+ cerr << "Can't identify file " << audiofile << endl;
+ return 1;
+ }
+ }
+
+ unordered_map c{{"httpport", SoapHelp::i2s(port)},
+ {"httphost", host}};
+ ctxt->config = c;
+
+ // Start the http thread
+ audioqueue.start(1, (void *(*)(void *))(httpAudioSink.worker), ctxt);
+
+ if (makewav) {
+ unsigned int allocbytes = 512;
+ char *buf = (char *)malloc(allocbytes);
+ if (buf == 0) {
+ cerr << "Can't allocate " << allocbytes << " bytes\n";
+ exit(1);
+ }
+ int freq = 44100;
+ int bits = 16;
+ int chans = 2;
+ int databytes = 2 * 1000 * 1000 * 1000;
+ // Using buf+bytes in case we ever insert icy before the audio
+ int sz = makewavheader(buf, allocbytes, freq, bits, chans, databytes);
+ AudioMessage *ap = new AudioMessage(buf, sz, allocbytes);
+ audioqueue.put(ap, false);
+ }
+
+ // Start the reading thread
+ std::thread readthread(readworker, ctxt);
+
+ string uri("http://" + host + ":" + SoapHelp::i2s(port) + "/stream." +
+ ctxt->ext);
+
+ // We'd need a few options here to decide what to do if already playing:
+ // wait (would allow to queue multiple songs), or interrupt.
+
+ // Start the renderer
+ if (avth->setAVTransportURI(uri, didlmake(uri, ctxt->content_type)) != 0) {
+ cerr << "setAVTransportURI failed\n";
+ return 1;
+ }
+
+ if (avth->play() != 0) {
+ cerr << "play failed\n";
+ return 1;
+ }
+ readthread.join();
+ return 0;
+}
diff --git a/other/libupnppsamples-code/upsend_src/wav.cpp b/other/libupnppsamples-code/upsend_src/wav.cpp
new file mode 100755
index 000000000..d31e535af
--- /dev/null
+++ b/other/libupnppsamples-code/upsend_src/wav.cpp
@@ -0,0 +1,106 @@
+/* Copyright (C) 2014 J.F.Dockes
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include
+
+#include "wav.h"
+
+inline int inttoichar4(unsigned char *cdb, unsigned int addr)
+{
+ cdb[3] = (addr & 0xff000000) >> 24;
+ cdb[2] = (addr & 0x00ff0000) >> 16;
+ cdb[1] = (addr & 0x0000ff00) >> 8;
+ cdb[0] = addr & 0x000000ff;
+ return 4;
+}
+
+inline int inttoichar2(unsigned char *cdb, unsigned int cnt)
+{
+ cdb[1] = (cnt & 0x0000ff00) >> 8;
+ cdb[0] = cnt & 0x000000ff;
+ return 2;
+}
+
+
+#if 0
+// For reference: definition of a wav header
+// commented values are given for 44100/16/2
+struct wav_header {
+ /*0 */char riff[4]; /* = 'RIFF' */
+ /*4 */int32 rifflen; /* longueur des infos qui suivent= datalen+36 */
+ /*8 */char wave[4]; /* = 'WAVE' */
+
+ /*12*/char fmt[4]; /* = 'fmt ' */
+ /*16*/int32 fmtlen; /* = 16 */
+ /*20*/int16 formtag; /* = 1 : PCM */
+ /*22*/int16 nchan; /* = 2 : nombre de canaux */
+ /*24*/int32 sampspersec; /* = 44100 : Nbr d'echantillons par seconde */
+ /*28*/int32 avgbytpersec;/* = 176400 : Nbr moyen octets par seconde */
+ /*32*/int16 blockalign; /* = 4 : nombre d'octets par echantillon */
+ /*34*/int16 bitspersamp; /* = 16 : bits par echantillon */
+
+ /*36*/char data[4]; /* = 'data' */
+ /*40*/int32 datalen; /* Nombre d'octets de son qui suivent */
+ /*44*/char data[];
+};
+#endif /* if 0 */
+
+#define WAVHSIZE 44
+#define RIFFTOWAVCNT 36
+
+// Format header. Note the use of intel format integers. Input buffer must
+// be of size >= 44
+int makewavheader(char *buf, int maxsize, int freq, int bits,
+ int chans, unsigned int databytecnt)
+{
+ if (maxsize < WAVHSIZE)
+ return -1;
+
+ unsigned char *cp = (unsigned char *)buf;
+ memcpy(cp, "RIFF", 4);
+ cp += 4;
+ inttoichar4(cp, databytecnt + RIFFTOWAVCNT);
+ cp += 4;
+ memcpy(cp, "WAVE", 4);
+ cp += 4;
+
+ memcpy(cp, "fmt ", 4);
+ cp += 4;
+ inttoichar4(cp, 16);
+ cp += 4;
+ inttoichar2(cp, 1);
+ cp += 2;
+ inttoichar2(cp, chans);
+ cp += 2;
+ inttoichar4(cp, freq);
+ cp += 4;
+ inttoichar4(cp, freq * chans * (bits / 8));
+ cp += 4;
+ inttoichar2(cp, chans * bits / 8);
+ cp += 2;
+ inttoichar2(cp, bits);
+ cp += 2;
+
+ memcpy(cp, "data", 4);
+ cp += 4;
+ inttoichar4(cp, databytecnt);
+ cp += 4;
+
+ return WAVHSIZE;
+}
diff --git a/other/libupnppsamples-code/upsend_src/wav.h b/other/libupnppsamples-code/upsend_src/wav.h
new file mode 100755
index 000000000..1be723639
--- /dev/null
+++ b/other/libupnppsamples-code/upsend_src/wav.h
@@ -0,0 +1,23 @@
+/* Copyright (C) 2014 J.F.Dockes
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+#ifndef _WAV_H_INCLUDED_
+#define _WAV_H_INCLUDED_
+
+extern int makewavheader(char *buf, int maxsize, int freq, int bits,
+ int chans, unsigned int databytecnt);
+
+#endif /* _WAV_H_INCLUDED_ */
diff --git a/other/libupnppsamples-code/upsend_src/workqueue.h b/other/libupnppsamples-code/upsend_src/workqueue.h
new file mode 100755
index 000000000..216876acb
--- /dev/null
+++ b/other/libupnppsamples-code/upsend_src/workqueue.h
@@ -0,0 +1,357 @@
+/* Copyright (C) 2006-2016 J.F.Dockes
+ *
+ * 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
+ */
+#ifndef _WORKQUEUE_H_INCLUDED_
+#define _WORKQUEUE_H_INCLUDED_
+
+#include
+#if HAVE_STD_FUTURE
+#include
+#endif
+#include
+#include
+#include
+#include
+#include
+
+#include "log.h"
+
+/**
+ * A WorkQueue manages the synchronisation around a queue of work items,
+ * where a number of client threads queue tasks and a number of worker
+ * threads take and execute them. The goal is to introduce some level
+ * of parallelism between the successive steps of a previously single
+ * threaded pipeline. For example data extraction / data preparation / index
+ * update, but this could have other uses.
+ *
+ * There is no individual task status return. In case of fatal error,
+ * the client or worker sets an end condition on the queue. A second
+ * queue could conceivably be used for returning individual task
+ * status.
+ *
+ * The strange thread functions argument and return values
+ * comes from compatibility with an earlier pthread-based
+ * implementation.
+ */
+template class WorkQueue {
+public:
+
+ /** Create a WorkQueue
+ * @param name for message printing
+ * @param hi number of tasks on queue before clients blocks. Default 0
+ * meaning no limit. hi == -1 means that the queue is disabled.
+ * @param lo minimum count of tasks before worker starts. Default 1.
+ */
+ WorkQueue(const std::string& name, size_t hi = 0, size_t lo = 1)
+ : m_name(name), m_high(hi), m_low(lo), m_workers_exited(0),
+ m_ok(true), m_clients_waiting(0), m_workers_waiting(0),
+ m_tottasks(0), m_nowake(0), m_workersleeps(0), m_clientsleeps(0) {
+ }
+
+ ~WorkQueue() {
+ if (!m_worker_threads.empty()) {
+ setTerminateAndWait();
+ }
+ }
+
+ /** Start the worker threads.
+ *
+ * @param nworkers number of threads copies to start.
+ * @param start_routine thread function. It should loop
+ * taking (QueueWorker::take()) and executing tasks.
+ * @param arg initial parameter to thread function.
+ * @return true if ok.
+ */
+ bool start(int nworkers, void *(workproc)(void *), void *arg) {
+ std::unique_lock lock(m_mutex);
+ for (int i = 0; i < nworkers; i++) {
+ Worker w;
+#if HAVE_STD_FUTURE
+ std::packaged_task task(workproc);
+ w.res = task.get_future();
+ w.thr = std::thread(std::move(task), arg);
+#else
+ w.thr = std::thread(workproc, arg);
+#endif
+ m_worker_threads.push_back(std::move(w));
+ }
+ return true;
+ }
+
+ /** Add item to work queue, called from client.
+ *
+ * Sleeps if there are already too many.
+ */
+ bool put(T t, bool flushprevious = false) {
+ std::unique_lock lock(m_mutex);
+ if (!ok()) {
+ LOGERR("WorkQueue::put:" << m_name << ": !ok\n");
+ return false;
+ }
+
+ while (ok() && m_high > 0 && m_queue.size() >= m_high) {
+ m_clientsleeps++;
+ // Keep the order: we test ok() AFTER the sleep...
+ m_clients_waiting++;
+ m_ccond.wait(lock);
+ if (!ok()) {
+ m_clients_waiting--;
+ return false;
+ }
+ m_clients_waiting--;
+ }
+ if (flushprevious) {
+ while (!m_queue.empty()) {
+ m_queue.pop();
+ }
+ }
+
+ m_queue.push(t);
+ if (m_workers_waiting > 0) {
+ // Just wake one worker, there is only one new task.
+ m_wcond.notify_one();
+ } else {
+ m_nowake++;
+ }
+
+ return true;
+ }
+
+ /** Wait until the queue is inactive. Called from client.
+ *
+ * Waits until the task queue is empty and the workers are all
+ * back sleeping. Used by the client to wait for all current work
+ * to be completed, when it needs to perform work that couldn't be
+ * done in parallel with the worker's tasks, or before shutting
+ * down. Work can be resumed after calling this. Note that the
+ * only thread which can call it safely is the client just above
+ * (which can control the task flow), else there could be
+ * tasks in the intermediate queues.
+ * To rephrase: there is no warranty on return that the queue is actually
+ * idle EXCEPT if the caller knows that no jobs are still being created.
+ * It would be possible to transform this into a safe call if some kind
+ * of suspend condition was set on the queue by waitIdle(), to be reset by
+ * some kind of "resume" call. Not currently the case.
+ */
+ bool waitIdle() {
+ std::unique_lock lock(m_mutex);
+ if (!ok()) {
+ LOGERR("WorkQueue::waitIdle:" << m_name << ": not ok\n");
+ return false;
+ }
+
+ // We're done when the queue is empty AND all workers are back
+ // waiting for a task.
+ while (ok() && (m_queue.size() > 0 ||
+ m_workers_waiting != m_worker_threads.size())) {
+ m_clients_waiting++;
+ m_ccond.wait(lock);
+ m_clients_waiting--;
+ }
+
+ return ok();
+ }
+
+ /** Tell the workers to exit, and wait for them.
+ *
+ * Does not bother about tasks possibly remaining on the queue, so
+ * should be called after waitIdle() for an orderly shutdown.
+ */
+ void *setTerminateAndWait() {
+ std::unique_lock lock(m_mutex);
+ LOGDEB("setTerminateAndWait:" << m_name << "\n");
+
+ if (m_worker_threads.empty()) {
+ // Already called ?
+ return (void*)0;
+ }
+
+ // Wait for all worker threads to have called workerExit()
+ m_ok = false;
+ while (m_workers_exited < m_worker_threads.size()) {
+ m_wcond.notify_all();
+ m_clients_waiting++;
+ m_ccond.wait(lock);
+ m_clients_waiting--;
+ }
+
+ LOGINFO("" << m_name << ": tasks " << m_tottasks << " nowakes " <<
+ m_nowake << " wsleeps " << m_workersleeps << " csleeps " <<
+ m_clientsleeps << "\n");
+ // Perform the thread joins and compute overall status
+ // Workers return (void*)1 if ok
+ void *statusall = (void*)1;
+ while (!m_worker_threads.empty()) {
+#if HAVE_STD_FUTURE
+ void *status = m_worker_threads.front().res.get();
+#else
+ void *status = (void*) 1;
+#endif
+ m_worker_threads.front().thr.join();
+ if (status == (void *)0) {
+ statusall = status;
+ }
+ m_worker_threads.pop_front();
+ }
+
+ // Reset to start state.
+ m_workers_exited = m_clients_waiting = m_workers_waiting =
+ m_tottasks = m_nowake = m_workersleeps = m_clientsleeps = 0;
+ m_ok = true;
+
+ LOGDEB("setTerminateAndWait:" << m_name << " done\n");
+ return statusall;
+ }
+
+ /** Take task from queue. Called from worker.
+ *
+ * Sleeps if there are not enough. Signal if we go to sleep on empty
+ * queue: client may be waiting for our going idle.
+ */
+ bool take(T* tp, size_t *szp = 0) {
+ std::unique_lock lock(m_mutex);
+ if (!ok()) {
+ LOGDEB("WorkQueue::take:" << m_name << ": not ok\n");
+ return false;
+ }
+
+ while (ok() && m_queue.size() < m_low) {
+ m_workersleeps++;
+ m_workers_waiting++;
+ if (m_queue.empty()) {
+ m_ccond.notify_all();
+ }
+ m_wcond.wait(lock);
+ if (!ok()) {
+ // !ok is a normal condition when shutting down
+ m_workers_waiting--;
+ return false;
+ }
+ m_workers_waiting--;
+ }
+
+ m_tottasks++;
+ *tp = m_queue.front();
+ if (szp) {
+ *szp = m_queue.size();
+ }
+ m_queue.pop();
+ if (m_clients_waiting > 0) {
+ // No reason to wake up more than one client thread
+ m_ccond.notify_one();
+ } else {
+ m_nowake++;
+ }
+ return true;
+ }
+
+ bool waitminsz(size_t sz) {
+ std::unique_lock lock(m_mutex);
+ if (!ok()) {
+ return false;
+ }
+
+ while (ok() && m_queue.size() < sz) {
+ m_workersleeps++;
+ m_workers_waiting++;
+ if (m_queue.empty()) {
+ m_ccond.notify_all();
+ }
+ m_wcond.wait(lock);
+ if (!ok()) {
+ m_workers_waiting--;
+ return false;
+ }
+ m_workers_waiting--;
+ }
+ return true;
+ }
+
+ /** Advertise exit and abort queue. Called from worker
+ *
+ * This would happen after an unrecoverable error, or when
+ * the queue is terminated by the client. Workers never exit normally,
+ * except when the queue is shut down (at which point m_ok is set to
+ * false by the shutdown code anyway). The thread must return/exit
+ * immediately after calling this.
+ */
+ void workerExit() {
+ LOGDEB("workerExit:" << m_name << "\n");
+ std::unique_lock lock(m_mutex);
+ m_workers_exited++;
+ m_ok = false;
+ m_ccond.notify_all();
+ }
+
+ size_t qsize() {
+ std::unique_lock lock(m_mutex);
+ return m_queue.size();
+ }
+
+private:
+ bool ok() {
+ bool isok = m_ok && m_workers_exited == 0 && !m_worker_threads.empty();
+ if (!isok) {
+ LOGDEB("WorkQueue:ok:" << m_name << ": not ok m_ok " << m_ok <<
+ " m_workers_exited " << m_workers_exited <<
+ " m_worker_threads size " << m_worker_threads.size() <<
+ "\n");
+ }
+ return isok;
+ }
+
+ struct Worker {
+ std::thread thr;
+#if HAVE_STD_FUTURE
+ std::future res;
+#endif
+ };
+
+ // Configuration
+ std::string m_name;
+ size_t m_high;
+ size_t m_low;
+
+ // Worker threads having called exit. Used to decide when we're done
+ unsigned int m_workers_exited;
+ // Status
+ bool m_ok;
+
+ // Our threads.
+ std::list m_worker_threads;
+
+ // Jobs input queue
+ std::queue m_queue;
+
+ // Synchronization
+ std::condition_variable m_ccond;
+ std::condition_variable m_wcond;
+ std::mutex m_mutex;
+
+ // Client/Worker threads currently waiting for a job
+ unsigned int m_clients_waiting;
+ unsigned int m_workers_waiting;
+
+ // Statistics
+ unsigned int m_tottasks;
+ unsigned int m_nowake;
+ unsigned int m_workersleeps;
+ unsigned int m_clientsleeps;
+};
+
+#endif /* _WORKQUEUE_H_INCLUDED_ */
+
diff --git a/other/mpd/mpd-0.20.12 b/other/mpd/mpd-0.20.12
deleted file mode 100755
index bb0a3fed3..000000000
Binary files a/other/mpd/mpd-0.20.12 and /dev/null differ
diff --git a/other/mpd/mpd-0.20.12.tar.xz b/other/mpd/mpd-0.20.12.tar.xz
deleted file mode 100755
index bedd400b7..000000000
Binary files a/other/mpd/mpd-0.20.12.tar.xz and /dev/null differ
diff --git a/other/mpd/mpd-0.20.18 b/other/mpd/mpd-0.20.18
new file mode 100755
index 000000000..37dcc28f3
Binary files /dev/null and b/other/mpd/mpd-0.20.18 differ
diff --git a/other/mpd/mpd-0.20.18.tar.xz b/other/mpd/mpd-0.20.18.tar.xz
new file mode 100644
index 000000000..a2e8799c6
Binary files /dev/null and b/other/mpd/mpd-0.20.18.tar.xz differ
diff --git a/other/squeezelite/squeezelite-1.8.7-1020.zip b/other/squeezelite/squeezelite-1.8.7-1020.zip
deleted file mode 100644
index f2f1f609d..000000000
Binary files a/other/squeezelite/squeezelite-1.8.7-1020.zip and /dev/null differ
diff --git a/other/squeezelite/squeezelite-1.8.7-1020 b/other/squeezelite/squeezelite-1.8.7-1052
similarity index 61%
rename from other/squeezelite/squeezelite-1.8.7-1020
rename to other/squeezelite/squeezelite-1.8.7-1052
index 4b792583f..1e81037f8 100755
Binary files a/other/squeezelite/squeezelite-1.8.7-1020 and b/other/squeezelite/squeezelite-1.8.7-1052 differ
diff --git a/other/squeezelite/squeezelite-1.8.7-1052.zip b/other/squeezelite/squeezelite-1.8.7-1052.zip
new file mode 100644
index 000000000..5e450fdf4
Binary files /dev/null and b/other/squeezelite/squeezelite-1.8.7-1052.zip differ
diff --git a/other/upmpdcli/upmpdcli-1.2.15.tar.gz b/other/upmpdcli/upmpdcli-1.2.15.tar.gz
deleted file mode 100644
index 64b439541..000000000
Binary files a/other/upmpdcli/upmpdcli-1.2.15.tar.gz and /dev/null differ
diff --git a/other/upmpdcli/upmpdcli-code-1.2.16.tar.gz b/other/upmpdcli/upmpdcli-code-1.2.16.tar.gz
new file mode 100755
index 000000000..ac4b1f6b2
Binary files /dev/null and b/other/upmpdcli/upmpdcli-code-1.2.16.tar.gz differ
diff --git a/other/wiringpi/wiringPi-96344ff/.gitignore b/other/wiringpi/wiringPi-96344ff/.gitignore
deleted file mode 100644
index ed2ec801b..000000000
--- a/other/wiringpi/wiringPi-96344ff/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-*.o
-*.so
-lib*.so.*
-*~
-debian-template/wiringPi
-debian-template/wiringpi-*.deb
-gpio/gpio
diff --git a/other/wiringpi/wiringPi-96344ff/COPYING.LESSER b/other/wiringpi/wiringPi-96344ff/COPYING.LESSER
deleted file mode 100644
index 65c5ca88a..000000000
--- a/other/wiringpi/wiringPi-96344ff/COPYING.LESSER
+++ /dev/null
@@ -1,165 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- 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 that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU 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 as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/other/wiringpi/wiringPi-96344ff/INSTALL b/other/wiringpi/wiringPi-96344ff/INSTALL
deleted file mode 100644
index 8e0c43cf3..000000000
--- a/other/wiringpi/wiringPi-96344ff/INSTALL
+++ /dev/null
@@ -1,36 +0,0 @@
-
-How to install wiringPi
-=======================
-
-The easiest way is to use the supplied 'build' script:
-
- ./build
-
-that should do a complete install or upgrade of wiringPi for you.
-
-That will install a dynamic library.
-
-Some distributions do not have /usr/local/lib in the default LD_LIBRARY_PATH. To
-fix this, you need to edit /etc/ld.so.conf and add in a single line:
-
- /usr/local/lib
-
-then run the ldconfig command.
-
- sudo ldconfig
-
-If you want to install a static library, you may need to do this manually:
-
- cd wiringPi
- make static
- sudo make install-static
-
-
-To un-install wiringPi:
-
- ./build uninstall
-
-Gordon Henderson
-
-projects@drogon.net
-https://projects.drogon.net/
diff --git a/other/wiringpi/wiringPi-96344ff/People b/other/wiringpi/wiringPi-96344ff/People
deleted file mode 100644
index b339494e1..000000000
--- a/other/wiringpi/wiringPi-96344ff/People
+++ /dev/null
@@ -1,33 +0,0 @@
-
-Just a quick note to some people who've provided help, suggestions,
-bug-fixes, etc. along the way...
-
-Nick Lott: (And others)
- Hints about making it work with C++
-
-Philipp Stefan Neininger:
- Minor bug in the Makefile to do with cross compiling
-
-Chris McSweeny
- Hints and tips about the use of arithmetic in gettimeofday()
- inside the dealyMicrosecondsHard() function.
- And spotting a couple of schoolboy errors in the (experimental)
- softServo code, prompting me to completely re-write it.
-
-Armin (Via projects website)
- Some pointers about the i2c-dev.h files.
-
-Arno Wagner
- Suggestions for the mmap calls in wiringPiSetup()
-
-CHARLES Thibaut:
- A small issue in softTone
-
-Xian Stannard
- Fixing some typos in the man page!
-
-Andre Crone
- Suggested the __WIRING_PI.H__ round wiringPi.h
-
-Rik Teerling
- Pointing out some silly mistooks in the I2C code...
diff --git a/other/wiringpi/wiringPi-96344ff/README.TXT b/other/wiringpi/wiringPi-96344ff/README.TXT
deleted file mode 100644
index 7789b2eba..000000000
--- a/other/wiringpi/wiringPi-96344ff/README.TXT
+++ /dev/null
@@ -1,26 +0,0 @@
-
-wiringPi README
-===============
-
-Please note that the official way to get wiringPi is via git from
-git.drogon.net and not GitHub.
-
-ie.
-
- git clone git://git.drogon.net/wiringPi
-
-The version of wiringPi held on GitHub by "Gadgetoid" is used to build the
-wiringPython, Ruby, Perl, etc. wrappers for these other languages. This
-version may lag the official Drogon release. Pull requests may not be
-accepted to Github....
-
-Please see
-
- http://wiringpi.com/
-
-for the official documentation, etc. and the best way to submit bug reports, etc.
-is by sending an email to projects@drogon.net
-
-Thanks!
-
- -Gordon
diff --git a/other/wiringpi/wiringPi-96344ff/VERSION b/other/wiringpi/wiringPi-96344ff/VERSION
deleted file mode 100644
index f454b8169..000000000
--- a/other/wiringpi/wiringPi-96344ff/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.44
diff --git a/other/wiringpi/wiringPi-96344ff/build b/other/wiringpi/wiringPi-96344ff/build
deleted file mode 100755
index 7dc074c24..000000000
--- a/other/wiringpi/wiringPi-96344ff/build
+++ /dev/null
@@ -1,186 +0,0 @@
-#!/bin/sh -e
-
-# build
-# Simple wiringPi build and install script
-#
-# Copyright (c) 2012-2015 Gordon Henderson
-#################################################################################
-# This file is part of wiringPi:
-# A "wiring" library for the Raspberry Pi
-#
-# wiringPi 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 3 of the License, or
-# (at your option) any later version.
-#
-# wiringPi 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 wiringPi. If not, see .
-#################################################################################
-#
-# wiringPi is designed to run on a Raspberry Pi only.
-# However if you're clever enough to actually look at this script to
-# see why it's not building for you, then good luck.
-#
-# To everyone else: Stop using cheap alternatives. Support the
-# Raspberry Pi Foundation as they're the only ones putting money
-# back into education!
-#################################################################################
-
-check_make_ok() {
- if [ $? != 0 ]; then
- echo ""
- echo "Make Failed..."
- echo "Please check the messages and fix any problems. If you're still stuck,"
- echo "then please email all the output and as many details as you can to"
- echo " projects@drogon.net"
- echo ""
- exit 1
- fi
-}
-
-sudo=${WIRINGPI_SUDO-sudo}
-
-if [ x$1 = "xclean" ]; then
- cd wiringPi
- echo -n "wiringPi: " ; make clean
- cd ../devLib
- echo -n "DevLib: " ; make clean
- cd ../gpio
- echo -n "gpio: " ; make clean
- cd ../examples
- echo -n "Examples: " ; make clean
- cd Gertboard
- echo -n "Gertboard: " ; make clean
- cd ../PiFace
- echo -n "PiFace: " ; make clean
- cd ../q2w
- echo -n "Quick2Wire: " ; make clean
- cd ../PiGlow
- echo -n "PiGlow: " ; make clean
- cd ../scrollPhat
- echo -n "scrollPhat: " ; make clean
- exit
-fi
-
-if [ x$1 = "xuninstall" ]; then
- cd wiringPi
- echo -n "wiringPi: " ; $sudo make uninstall
- cd ../devLib
- echo -n "DevLib: " ; $sudo make uninstall
- cd ../gpio
- echo -n "gpio: " ; $sudo make uninstall
- exit
-fi
-
-# Only if you know what you're doing!
-
-if [ x$1 = "xdebian" ]; then
- here=`pwd`
- cd debian-template/wiringPi
- rm -rf usr
- cd $here/wiringPi
- make install-deb
- cd $here/devLib
- make install-deb INCLUDE='-I. -I../wiringPi'
- cd $here/gpio
- make install-deb INCLUDE='-I../wiringPi -I../devLib' LDFLAGS=-L../debian-template/wiringPi/usr/lib
- cd $here/debian-template
- fakeroot dpkg-deb --build wiringPi
- mv wiringPi.deb wiringpi-`cat $here/VERSION`-1.deb
- exit
-fi
-
-if [ x$1 != "x" ]; then
- echo "Usage: $0 [clean | uninstall]"
- exit 1
-fi
-
- echo "wiringPi Build script"
- echo "====================="
- echo
-
- hardware=`fgrep Hardware /proc/cpuinfo | head -1 | awk '{ print $3 }'`
-
-# if [ x$hardware != "xBCM2708" ]; then
-# echo ""
-# echo " +------------------------------------------------------------+"
-# echo " | wiringPi is designed to run on the Raspberry Pi only. |"
-# echo " | This processor does not appear to be a Raspberry Pi. |"
-# echo " +------------------------------------------------------------+"
-# echo " | In the unlikely event that you think it is a Raspberry Pi, |"
-# echo " | then please accept my apologies and email the contents of |"
-# echo " | /proc/cpuinfo to projects@drogon.net. |"
-# echo " | - Thanks, Gordon |"
-# echo " +------------------------------------------------------------+"
-# echo ""
-# exit 1
-# fi
-
-
- echo
- echo "WiringPi Library"
- cd wiringPi
- $sudo make uninstall
- if [ x$1 = "xstatic" ]; then
- make -j5 static
- check_make_ok
- $sudo make install-static
- else
- make -j5
- check_make_ok
- $sudo make install
- fi
- check_make_ok
-
- echo
- echo "WiringPi Devices Library"
- cd ../devLib
- $sudo make uninstall
- if [ x$1 = "xstatic" ]; then
- make -j5 static
- check_make_ok
- $sudo make install-static
- else
- make -j5
- check_make_ok
- $sudo make install
- fi
- check_make_ok
-
- echo
- echo "GPIO Utility"
- cd ../gpio
- make -j5
- check_make_ok
- $sudo make install
- check_make_ok
-
-# echo
-# echo "wiringPi Daemon"
-# cd ../wiringPiD
-# make -j5
-# check_make_ok
-# $sudo make install
-# check_make_ok
-
-# echo
-# echo "Examples"
-# cd ../examples
-# make
-# cd ..
-
-echo
-echo All Done.
-echo ""
-echo "NOTE: To compile programs with wiringPi, you need to add:"
-echo " -lwiringPi"
-echo " to your compile line(s) To use the Gertboard, MaxDetect, etc."
-echo " code (the devLib), you need to also add:"
-echo " -lwiringPiDev"
-echo " to your compile line(s)."
-echo ""
diff --git a/other/wiringpi/wiringPi-96344ff/debian/.gitignore b/other/wiringpi/wiringPi-96344ff/debian/.gitignore
deleted file mode 100644
index 6296064c7..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.debhelper.log
-*.substvars
-tmp
-wiringpi
-libwiringpi2
-libwiringpi-dev
-files
-*.postinst.debhelper
-*.postrm.debhelper
diff --git a/other/wiringpi/wiringPi-96344ff/debian/changelog b/other/wiringpi/wiringPi-96344ff/debian/changelog
deleted file mode 100644
index 7f04ad542..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/changelog
+++ /dev/null
@@ -1,6 +0,0 @@
-wiringpi (2.26~iwj) rpi-unstable; urgency=low
-
- * Initial version with real Debian source package build.
-
- -- Ian Jackson Sat, 12 Sep 2015 18:31:35 +0100
-
diff --git a/other/wiringpi/wiringPi-96344ff/debian/compat b/other/wiringpi/wiringPi-96344ff/debian/compat
deleted file mode 100644
index 45a4fb75d..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/other/wiringpi/wiringPi-96344ff/debian/control b/other/wiringpi/wiringPi-96344ff/debian/control
deleted file mode 100644
index 1d6d228ee..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/control
+++ /dev/null
@@ -1,29 +0,0 @@
-Source: wiringpi
-Section: electronics
-Priority: optional
-Maintainer: Ian Jackson
-Standards-Version: 3.8.0
-Homepage: http://wiringpi.com/
-Build-Depends: debhelper (>= 8)
-
-Package: libwiringpi2
-Section: libs
-Architecture: armhf
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: GPIO librariees for Raspberry Pi (runtime).
- Runtime for the popular wiringPi library.
-
-Package: wiringpi
-Architecture: armhf
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: gpio utility for Raspberry Pi
- The wiringPi gpio command line utility, for GPIO access on a
- Raspberry Pi from the command line.
-
-Package: libwiringpi-dev
-Architecture: armhf
-Depends: libwiringpi2 (= ${binary:Version}), libc6-dev, ${misc:Depends}
-Suggests: wiringpi
-Description: GPIO development library for Raspberry Pi
- Development libraries to allow GPIO access on a Raspberry Pi from C
- and C++ programs.
diff --git a/other/wiringpi/wiringPi-96344ff/debian/copyright b/other/wiringpi/wiringPi-96344ff/debian/copyright
deleted file mode 100644
index de8270108..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/copyright
+++ /dev/null
@@ -1,15 +0,0 @@
-wiringPi is Copyright (C) 2012-2015 Gordon Henderson.
-
-wiringPi 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 3 of the License, or
-(at your option) any later version.
-
-wiringPi 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.
-
-On all Debian and Raspbian systems, a copy of the GNU Lesser General
-Public License version 3 can be found in
-`/usr/share/common-licenses/LGPL-3'.
diff --git a/other/wiringpi/wiringPi-96344ff/debian/libwiringpi-dev.dirs b/other/wiringpi/wiringPi-96344ff/debian/libwiringpi-dev.dirs
deleted file mode 100644
index 44188162e..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/libwiringpi-dev.dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib
-usr/include
diff --git a/other/wiringpi/wiringPi-96344ff/debian/libwiringpi-dev.install b/other/wiringpi/wiringPi-96344ff/debian/libwiringpi-dev.install
deleted file mode 100644
index d7ea901cb..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/libwiringpi-dev.install
+++ /dev/null
@@ -1,3 +0,0 @@
-debian/tmp/usr/include
-debian/tmp/usr/lib/*.so
-examples usr/share/doc/libwiringpi-dev
diff --git a/other/wiringpi/wiringPi-96344ff/debian/libwiringpi2.install b/other/wiringpi/wiringPi-96344ff/debian/libwiringpi2.install
deleted file mode 100644
index c45ebcf2a..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/libwiringpi2.install
+++ /dev/null
@@ -1 +0,0 @@
-debian/tmp/usr/lib/lib*.so.*
diff --git a/other/wiringpi/wiringPi-96344ff/debian/libwiringpi2.shlibs b/other/wiringpi/wiringPi-96344ff/debian/libwiringpi2.shlibs
deleted file mode 100644
index 0be8db165..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/libwiringpi2.shlibs
+++ /dev/null
@@ -1,2 +0,0 @@
-libwiringPi 2 libwiringpi2
-libwiringPiDev 2 libwiringpi2
diff --git a/other/wiringpi/wiringPi-96344ff/debian/rules b/other/wiringpi/wiringPi-96344ff/debian/rules
deleted file mode 100755
index 423a47316..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/rules
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/make -f
-
-.PHONY: build
-
-VERSION:=$(shell cat VERSION)
-export VERSION
-
-soname:=$(shell echo $${VERSION%%.*})
-WIRINGPI_SONAME_SUFFIX:=.$(soname)
-export soname
-export WIRINGPI_SONAME_SUFFIX
-
-build:
- dh $@
-
-override_dh_auto_configure:
-
-override_dh_prep:
- dh_prep -Xdebian/tmp
-
-dirs:
- dh_installdirs -A
- mkdir debian/tmp
- set -e; for p in `dh_listpackages`; do \
- (cd debian/$$p; find -type d) | \
- (cd debian/tmp; xargs mkdir -p) \
- done
-
-override_dh_clean:
- dh_clean
- WIRINGPI_SUDO= bash -xe ./build clean
-
-override_dh_auto_build: dirs
- V=1 LDCONFIG=: WIRINGPI_SUDO= WIRINGPI_SUID=0 \
- DESTDIR=`pwd`/debian/tmp/usr \
- PREFIX= WIRINGPI_SUDO= \
- bash -xe ./build
-
-override_dh_auto_install:
- dh_install
- set -ex; for l in libwiringPi libwiringPiDev; do \
- ln -sf $$l.so.$${VERSION} \
- debian/libwiringpi$$soname/usr/lib/$$l.so.$$soname; \
- ln -sf $$l.so.$${VERSION} \
- debian/libwiringpi-dev/usr/lib/$$l.so; \
- done
-
-%:
- dh $@
diff --git a/other/wiringpi/wiringPi-96344ff/debian/wiringpi.dirs b/other/wiringpi/wiringPi-96344ff/debian/wiringpi.dirs
deleted file mode 100644
index e77248175..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/wiringpi.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/bin
diff --git a/other/wiringpi/wiringPi-96344ff/debian/wiringpi.install b/other/wiringpi/wiringPi-96344ff/debian/wiringpi.install
deleted file mode 100644
index 41ae22d7d..000000000
--- a/other/wiringpi/wiringPi-96344ff/debian/wiringpi.install
+++ /dev/null
@@ -1,4 +0,0 @@
-debian/tmp/usr/bin
-debian/tmp/usr/man usr/share
-README.TXT usr/share/doc/wiringpi
-People usr/share/doc/wiringpi
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/Makefile b/other/wiringpi/wiringPi-96344ff/devLib/Makefile
deleted file mode 100644
index cf665d6ab..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/Makefile
+++ /dev/null
@@ -1,140 +0,0 @@
-#
-# Makefile:
-# wiringPi device - A "wiring" library for the Raspberry Pi
-#
-# Copyright (c) 2012-2016 Gordon Henderson
-#################################################################################
-# This file is part of wiringPi:
-# https://projects.drogon.net/raspberry-pi/wiringpi/
-#
-# wiringPi 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 3 of the License, or
-# (at your option) any later version.
-#
-# wiringPi 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 wiringPi. If not, see .
-#################################################################################
-
-VERSION=$(shell cat ../VERSION)
-DESTDIR?=/usr
-PREFIX?=/local
-
-LDCONFIG?=ldconfig
-
-ifneq ($V,1)
-Q ?= @
-endif
-
-STATIC=libwiringPiDev.a
-DYNAMIC=libwiringPiDev.so.$(VERSION)
-
-#DEBUG = -g -O0
-DEBUG = -O2
-CC = gcc
-INCLUDE = -I.
-DEFS = -D_GNU_SOURCE
-CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
-
-LIBS =
-
-###############################################################################
-
-SRC = ds1302.c maxdetect.c piNes.c \
- gertboard.c piFace.c \
- lcd128x64.c lcd.c \
- scrollPhat.c \
- piGlow.c
-
-OBJ = $(SRC:.c=.o)
-
-HEADERS = ds1302.h gertboard.h lcd128x64.h lcd.h maxdetect.h piFace.h piGlow.h piNes.h\
- scrollPhat.h
-
-all: $(DYNAMIC)
-
-static: $(STATIC)
-
-$(STATIC): $(OBJ)
- $Q echo "[Link (Static)]"
- $Q ar rcs $(STATIC) $(OBJ)
- $Q ranlib $(STATIC)
-# @size $(STATIC)
-
-$(DYNAMIC): $(OBJ)
- $Q echo "[Link (Dynamic)]"
- $Q $(CC) -shared -Wl,-soname,libwiringPiDev.so$(WIRINGPI_SONAME_SUFFIX) -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
-
-.c.o:
- $Q echo [Compile] $<
- $Q $(CC) -c $(CFLAGS) $< -o $@
-
-.PHONY: clean
-clean:
- $Q echo "[Clean]"
- $Q rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
-
-.PHONY: tags
-tags: $(SRC)
- $Q echo [ctags]
- $Q ctags $(SRC)
-
-
-.PHONY: install
-install: $(DYNAMIC)
- $Q echo "[Install Headers]"
- $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/include
- $Q install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
- $Q echo "[Install Dynamic Lib]"
- $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
- $Q install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
- $Q ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so
- $Q $(LDCONFIG)
-
-.PHONY: install-static
-install-static: $(STATIC)
- $Q echo "[Install Headers]"
- $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/include
- $Q install -m 0644 $(HEADERS) $(DESTDIR)$(PREFIX)/include
- $Q echo "[Install Static Lib]"
- $Q install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
- $Q install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib
-
-.PHONY: install-deb
-install-deb: $(DYNAMIC)
- $Q echo "[Install Headers: deb]"
- $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/include
- $Q install -m 0644 $(HEADERS) ~/wiringPi/debian-template/wiringPi/usr/include
- $Q echo "[Install Dynamic Lib: deb]"
- install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/lib
- install -m 0755 libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION)
- ln -sf ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so.$(VERSION) ~/wiringPi/debian-template/wiringPi/usr/lib/libwiringPiDev.so
-
-.PHONY: uninstall
-uninstall:
- $Q echo "[UnInstall]"
- $Q cd $(DESTDIR)$(PREFIX)/include/ && rm -f $(HEADERS)
- $Q cd $(DESTDIR)$(PREFIX)/lib/ && rm -f libwiringPiDev.*
- $Q $(LDCONFIG)
-
-
-.PHONY: depend
-depend:
- makedepend -Y $(SRC)
-
-# DO NOT DELETE
-
-ds1302.o: ds1302.h
-maxdetect.o: maxdetect.h
-piNes.o: piNes.h
-gertboard.o: gertboard.h
-piFace.o: piFace.h
-lcd128x64.o: font.h lcd128x64.h
-lcd.o: lcd.h
-scrollPhat.o: scrollPhatFont.h scrollPhat.h
-piGlow.o: piGlow.h
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/ds1302.c b/other/wiringpi/wiringPi-96344ff/devLib/ds1302.c
deleted file mode 100644
index cf64de77d..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/ds1302.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * ds1302.c:
- * Real Time clock
- *
- * Copyright (c) 2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#include
-#include
-#include
-#include
-
-#include
-
-#include "ds1302.h"
-
-// Register defines
-
-#define RTC_SECS 0
-#define RTC_MINS 1
-#define RTC_HOURS 2
-#define RTC_DATE 3
-#define RTC_MONTH 4
-#define RTC_DAY 5
-#define RTC_YEAR 6
-#define RTC_WP 7
-#define RTC_TC 8
-#define RTC_BM 31
-
-
-// Locals
-
-static int dPin, cPin, sPin ;
-
-/*
- * dsShiftIn:
- * Shift a number in from the chip, LSB first. Note that the data is
- * sampled on the trailing edge of the last clock, so it's valid immediately.
- *********************************************************************************
- */
-
-static unsigned int dsShiftIn (void)
-{
- uint8_t value = 0 ;
- int i ;
-
- pinMode (dPin, INPUT) ; delayMicroseconds (1) ;
-
- for (i = 0 ; i < 8 ; ++i)
- {
- value |= (digitalRead (dPin) << i) ;
- digitalWrite (cPin, HIGH) ; delayMicroseconds (1) ;
- digitalWrite (cPin, LOW) ; delayMicroseconds (1) ;
- }
-
- return value;
-}
-
-
-/*
- * dsShiftOut:
- * A normal LSB-first shift-out, just slowed down a bit - the Pi is
- * a bit faster than the chip can handle.
- *********************************************************************************
- */
-
-static void dsShiftOut (unsigned int data)
-{
- int i ;
-
- pinMode (dPin, OUTPUT) ;
-
- for (i = 0 ; i < 8 ; ++i)
- {
- digitalWrite (dPin, data & (1 << i)) ; delayMicroseconds (1) ;
- digitalWrite (cPin, HIGH) ; delayMicroseconds (1) ;
- digitalWrite (cPin, LOW) ; delayMicroseconds (1) ;
- }
-}
-
-
-/*
- * ds1302regRead: ds1302regWrite:
- * Read/Write a value to an RTC Register or RAM location on the chip
- *********************************************************************************
- */
-
-static unsigned int ds1302regRead (const int reg)
-{
- unsigned int data ;
-
- digitalWrite (sPin, HIGH) ; delayMicroseconds (1) ;
- dsShiftOut (reg) ;
- data = dsShiftIn () ;
- digitalWrite (sPin, LOW) ; delayMicroseconds (1) ;
-
- return data ;
-}
-
-static void ds1302regWrite (const int reg, const unsigned int data)
-{
- digitalWrite (sPin, HIGH) ; delayMicroseconds (1) ;
- dsShiftOut (reg) ;
- dsShiftOut (data) ;
- digitalWrite (sPin, LOW) ; delayMicroseconds (1) ;
-}
-
-
-/*
- * ds1302rtcWrite: ds1302rtcRead:
- * Writes/Reads the data to/from the RTC register
- *********************************************************************************
- */
-
-unsigned int ds1302rtcRead (const int reg)
-{
- return ds1302regRead (0x81 | ((reg & 0x1F) << 1)) ;
-}
-
-void ds1302rtcWrite (int reg, unsigned int data)
-{
- ds1302regWrite (0x80 | ((reg & 0x1F) << 1), data) ;
-}
-
-
-/*
- * ds1302ramWrite: ds1302ramRead:
- * Writes/Reads the data to/from the RTC register
- *********************************************************************************
- */
-
-unsigned int ds1302ramRead (const int addr)
-{
- return ds1302regRead (0xC1 | ((addr & 0x1F) << 1)) ;
-}
-
-void ds1302ramWrite (const int addr, const unsigned int data)
-{
- ds1302regWrite ( 0xC0 | ((addr & 0x1F) << 1), data) ;
-}
-
-/*
- * ds1302clockRead:
- * Read all 8 bytes of the clock in a single operation
- *********************************************************************************
- */
-
-void ds1302clockRead (int clockData [8])
-{
- int i ;
- unsigned int regVal = 0x81 | ((RTC_BM & 0x1F) << 1) ;
-
- digitalWrite (sPin, HIGH) ; delayMicroseconds (1) ;
-
- dsShiftOut (regVal) ;
- for (i = 0 ; i < 8 ; ++i)
- clockData [i] = dsShiftIn () ;
-
- digitalWrite (sPin, LOW) ; delayMicroseconds (1) ;
-}
-
-
-/*
- * ds1302clockWrite:
- * Write all 8 bytes of the clock in a single operation
- *********************************************************************************
- */
-
-void ds1302clockWrite (const int clockData [8])
-{
- int i ;
- unsigned int regVal = 0x80 | ((RTC_BM & 0x1F) << 1) ;
-
- digitalWrite (sPin, HIGH) ; delayMicroseconds (1) ;
-
- dsShiftOut (regVal) ;
- for (i = 0 ; i < 8 ; ++i)
- dsShiftOut (clockData [i]) ;
-
- digitalWrite (sPin, LOW) ; delayMicroseconds (1) ;
-}
-
-
-/*
- * ds1302trickleCharge:
- * Set the bits on the trickle charger.
- * Probably best left alone...
- *********************************************************************************
- */
-
-void ds1302trickleCharge (const int diodes, const int resistors)
-{
- if (diodes + resistors == 0)
- ds1302rtcWrite (RTC_TC, 0x5C) ; // Disabled
- else
- ds1302rtcWrite (RTC_TC, 0xA0 | ((diodes & 3) << 2) | (resistors & 3)) ;
-}
-
-
-
-
-/*
- * ds1302setup:
- * Initialise the chip & remember the pins we're using
- *********************************************************************************
- */
-
-void ds1302setup (const int clockPin, const int dataPin, const int csPin)
-{
- dPin = dataPin ;
- cPin = clockPin ;
- sPin = csPin ;
-
- digitalWrite (dPin, LOW) ;
- digitalWrite (cPin, LOW) ;
- digitalWrite (sPin, LOW) ;
-
- pinMode (dPin, OUTPUT) ;
- pinMode (cPin, OUTPUT) ;
- pinMode (sPin, OUTPUT) ;
-
- ds1302rtcWrite (RTC_WP, 0) ; // Remove write-protect
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/ds1302.h b/other/wiringpi/wiringPi-96344ff/devLib/ds1302.h
deleted file mode 100644
index e82b3ed09..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/ds1302.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * ds1302.h:
- * Real Time clock
- *
- * Copyright (c) 2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern unsigned int ds1302rtcRead (const int reg) ;
-extern void ds1302rtcWrite (const int reg, const unsigned int data) ;
-
-extern unsigned int ds1302ramRead (const int addr) ;
-extern void ds1302ramWrite (const int addr, const unsigned int data) ;
-
-extern void ds1302clockRead (int clockData [8]) ;
-extern void ds1302clockWrite (const int clockData [8]) ;
-
-extern void ds1302trickleCharge (const int diodes, const int resistors) ;
-
-extern void ds1302setup (const int clockPin, const int dataPin, const int csPin) ;
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/font.h b/other/wiringpi/wiringPi-96344ff/devLib/font.h
deleted file mode 100644
index ce99e1687..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/font.h
+++ /dev/null
@@ -1,2577 +0,0 @@
-/**********************************************/
-/* */
-/* Font file generated by cpi2fnt */
-/* ------------------------------ */
-/* Combined with the alpha-numeric */
-/* portion of Greg Harp's old PEARL */
-/* font (from earlier versions of */
-/* linux-m86k) by John Shifflett */
-/* */
-/**********************************************/
-
-static const int fontHeight = 8 ;
-static const int fontWidth = 8 ;
-
-static unsigned char font [] =
-{
- /* 0 0x00 '^@' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 1 0x01 '^A' */
- 0x7e, /* 01111110 */
- 0x81, /* 10000001 */
- 0xa5, /* 10100101 */
- 0x81, /* 10000001 */
- 0xbd, /* 10111101 */
- 0x99, /* 10011001 */
- 0x81, /* 10000001 */
- 0x7e, /* 01111110 */
-
- /* 2 0x02 '^B' */
- 0x7e, /* 01111110 */
- 0xff, /* 11111111 */
- 0xdb, /* 11011011 */
- 0xff, /* 11111111 */
- 0xc3, /* 11000011 */
- 0xe7, /* 11100111 */
- 0xff, /* 11111111 */
- 0x7e, /* 01111110 */
-
- /* 3 0x03 '^C' */
- 0x6c, /* 01101100 */
- 0xfe, /* 11111110 */
- 0xfe, /* 11111110 */
- 0xfe, /* 11111110 */
- 0x7c, /* 01111100 */
- 0x38, /* 00111000 */
- 0x10, /* 00010000 */
- 0x00, /* 00000000 */
-
- /* 4 0x04 '^D' */
- 0x10, /* 00010000 */
- 0x38, /* 00111000 */
- 0x7c, /* 01111100 */
- 0xfe, /* 11111110 */
- 0x7c, /* 01111100 */
- 0x38, /* 00111000 */
- 0x10, /* 00010000 */
- 0x00, /* 00000000 */
-
- /* 5 0x05 '^E' */
- 0x38, /* 00111000 */
- 0x7c, /* 01111100 */
- 0x38, /* 00111000 */
- 0xfe, /* 11111110 */
- 0xfe, /* 11111110 */
- 0xd6, /* 11010110 */
- 0x10, /* 00010000 */
- 0x38, /* 00111000 */
-
- /* 6 0x06 '^F' */
- 0x10, /* 00010000 */
- 0x38, /* 00111000 */
- 0x7c, /* 01111100 */
- 0xfe, /* 11111110 */
- 0xfe, /* 11111110 */
- 0x7c, /* 01111100 */
- 0x10, /* 00010000 */
- 0x38, /* 00111000 */
-
- /* 7 0x07 '^G' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 8 0x08 '^H' */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xe7, /* 11100111 */
- 0xc3, /* 11000011 */
- 0xc3, /* 11000011 */
- 0xe7, /* 11100111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
-
- /* 9 0x09 '^I' */
- 0x00, /* 00000000 */
- 0x3c, /* 00111100 */
- 0x66, /* 01100110 */
- 0x42, /* 01000010 */
- 0x42, /* 01000010 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
-
- /* 10 0x0a '^J' */
- 0xff, /* 11111111 */
- 0xc3, /* 11000011 */
- 0x99, /* 10011001 */
- 0xbd, /* 10111101 */
- 0xbd, /* 10111101 */
- 0x99, /* 10011001 */
- 0xc3, /* 11000011 */
- 0xff, /* 11111111 */
-
- /* 11 0x0b '^K' */
- 0x0f, /* 00001111 */
- 0x07, /* 00000111 */
- 0x0f, /* 00001111 */
- 0x7d, /* 01111101 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0x78, /* 01111000 */
-
- /* 12 0x0c '^L' */
- 0x3c, /* 00111100 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
-
- /* 13 0x0d '^M' */
- 0x3f, /* 00111111 */
- 0x33, /* 00110011 */
- 0x3f, /* 00111111 */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x70, /* 01110000 */
- 0xf0, /* 11110000 */
- 0xe0, /* 11100000 */
-
- /* 14 0x0e '^N' */
- 0x7f, /* 01111111 */
- 0x63, /* 01100011 */
- 0x7f, /* 01111111 */
- 0x63, /* 01100011 */
- 0x63, /* 01100011 */
- 0x67, /* 01100111 */
- 0xe6, /* 11100110 */
- 0xc0, /* 11000000 */
-
- /* 15 0x0f '^O' */
- 0x18, /* 00011000 */
- 0xdb, /* 11011011 */
- 0x3c, /* 00111100 */
- 0xe7, /* 11100111 */
- 0xe7, /* 11100111 */
- 0x3c, /* 00111100 */
- 0xdb, /* 11011011 */
- 0x18, /* 00011000 */
-
- /* 16 0x10 '^P' */
- 0x80, /* 10000000 */
- 0xe0, /* 11100000 */
- 0xf8, /* 11111000 */
- 0xfe, /* 11111110 */
- 0xf8, /* 11111000 */
- 0xe0, /* 11100000 */
- 0x80, /* 10000000 */
- 0x00, /* 00000000 */
-
- /* 17 0x11 '^Q' */
- 0x02, /* 00000010 */
- 0x0e, /* 00001110 */
- 0x3e, /* 00111110 */
- 0xfe, /* 11111110 */
- 0x3e, /* 00111110 */
- 0x0e, /* 00001110 */
- 0x02, /* 00000010 */
- 0x00, /* 00000000 */
-
- /* 18 0x12 '^R' */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
-
- /* 19 0x13 '^S' */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x00, /* 00000000 */
- 0x66, /* 01100110 */
- 0x00, /* 00000000 */
-
- /* 20 0x14 '^T' */
- 0x7f, /* 01111111 */
- 0xdb, /* 11011011 */
- 0xdb, /* 11011011 */
- 0x7b, /* 01111011 */
- 0x1b, /* 00011011 */
- 0x1b, /* 00011011 */
- 0x1b, /* 00011011 */
- 0x00, /* 00000000 */
-
- /* 21 0x15 '^U' */
- 0x3e, /* 00111110 */
- 0x61, /* 01100001 */
- 0x3c, /* 00111100 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x86, /* 10000110 */
- 0x7c, /* 01111100 */
-
- /* 22 0x16 '^V' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x7e, /* 01111110 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
-
- /* 23 0x17 '^W' */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0xff, /* 11111111 */
-
- /* 24 0x18 '^X' */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 25 0x19 '^Y' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 26 0x1a '^Z' */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0xfe, /* 11111110 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 27 0x1b '^[' */
- 0x00, /* 00000000 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
- 0xfe, /* 11111110 */
- 0x60, /* 01100000 */
- 0x30, /* 00110000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 28 0x1c '^\' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 29 0x1d '^]' */
- 0x00, /* 00000000 */
- 0x24, /* 00100100 */
- 0x66, /* 01100110 */
- 0xff, /* 11111111 */
- 0x66, /* 01100110 */
- 0x24, /* 00100100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 30 0x1e '^^' */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x7e, /* 01111110 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 31 0x1f '^_' */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0x7e, /* 01111110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 32 0x20 ' ' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 33 0x21 '!' */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x3c, /* 00111100 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 34 0x22 '"' */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 35 0x23 '#' */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0xfe, /* 11111110 */
- 0x6c, /* 01101100 */
- 0xfe, /* 11111110 */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0x00, /* 00000000 */
-
- /* 36 0x24 '$' */
- 0x18, /* 00011000 */
- 0x3e, /* 00111110 */
- 0x60, /* 01100000 */
- 0x3c, /* 00111100 */
- 0x06, /* 00000110 */
- 0x7c, /* 01111100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 37 0x25 '%' */
- 0x00, /* 00000000 */
- 0xc6, /* 11000110 */
- 0xcc, /* 11001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x66, /* 01100110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 38 0x26 '&' */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0x68, /* 01101000 */
- 0x76, /* 01110110 */
- 0xdc, /* 11011100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 39 0x27 ''' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 40 0x28 '(' */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x00, /* 00000000 */
-
- /* 41 0x29 ')' */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x00, /* 00000000 */
-
- /* 42 0x2a '*' */
- 0x00, /* 00000000 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0xff, /* 11111111 */
- 0x3c, /* 00111100 */
- 0x66, /* 01100110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 43 0x2b '+' */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 44 0x2c ',' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
-
- /* 45 0x2d '-' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 46 0x2e '.' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 47 0x2f '/' */
- 0x03, /* 00000011 */
- 0x06, /* 00000110 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
- 0xc0, /* 11000000 */
- 0x00, /* 00000000 */
-
- /* 48 0x30 '0' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xde, /* 11011110 */
- 0xfe, /* 11111110 */
- 0xf6, /* 11110110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 49 0x31 '1' */
- 0x18, /* 00011000 */
- 0x78, /* 01111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 50 0x32 '2' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
-
- /* 51 0x33 '3' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0x06, /* 00000110 */
- 0x1c, /* 00011100 */
- 0x06, /* 00000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 52 0x34 '4' */
- 0x1c, /* 00011100 */
- 0x3c, /* 00111100 */
- 0x6c, /* 01101100 */
- 0xcc, /* 11001100 */
- 0xfe, /* 11111110 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0x00, /* 00000000 */
-
- /* 53 0x35 '5' */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0xfc, /* 11111100 */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 54 0x36 '6' */
- 0x38, /* 00111000 */
- 0x60, /* 01100000 */
- 0xc0, /* 11000000 */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 55 0x37 '7' */
- 0xfe, /* 11111110 */
- 0x06, /* 00000110 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
- 0x60, /* 01100000 */
- 0x00, /* 00000000 */
-
- /* 56 0x38 '8' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 57 0x39 '9' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7e, /* 01111110 */
- 0x06, /* 00000110 */
- 0x0c, /* 00001100 */
- 0x38, /* 00111000 */
- 0x00, /* 00000000 */
-
- /* 58 0x3a ':' */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 59 0x3b ';' */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
-
- /* 60 0x3c '<' */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x00, /* 00000000 */
-
- /* 61 0x3d '=' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 62 0x3e '>' */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x06, /* 00000110 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x00, /* 00000000 */
-
- /* 63 0x3f '?' */
- 0x3c, /* 00111100 */
- 0x66, /* 01100110 */
- 0x06, /* 00000110 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 64 0x40 '@' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xde, /* 11011110 */
- 0xde, /* 11011110 */
- 0xde, /* 11011110 */
- 0xc0, /* 11000000 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 65 0x41 'A' */
- 0x10, /* 00010000 */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 66 0x42 'B' */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfc, /* 11111100 */
- 0x00, /* 00000000 */
-
- /* 67 0x43 'C' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 68 0x44 'D' */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfc, /* 11111100 */
- 0x00, /* 00000000 */
-
- /* 69 0x45 'E' */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xf8, /* 11111000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
-
- /* 70 0x46 'F' */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xf8, /* 11111000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0x00, /* 00000000 */
-
- /* 71 0x47 'G' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc0, /* 11000000 */
- 0xce, /* 11001110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 72 0x48 'H' */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 73 0x49 'I' */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
-
- /* 74 0x4a 'J' */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 75 0x4b 'K' */
- 0xc6, /* 11000110 */
- 0xcc, /* 11001100 */
- 0xd8, /* 11011000 */
- 0xf0, /* 11110000 */
- 0xd8, /* 11011000 */
- 0xcc, /* 11001100 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 76 0x4c 'L' */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
-
- /* 77 0x4d 'M' */
- 0x82, /* 10000010 */
- 0xc6, /* 11000110 */
- 0xee, /* 11101110 */
- 0xfe, /* 11111110 */
- 0xd6, /* 11010110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 78 0x4e 'N' */
- 0xc6, /* 11000110 */
- 0xe6, /* 11100110 */
- 0xf6, /* 11110110 */
- 0xde, /* 11011110 */
- 0xce, /* 11001110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 79 0x4f 'O' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 80 0x50 'P' */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfc, /* 11111100 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0x00, /* 00000000 */
-
- /* 81 0x51 'Q' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xf6, /* 11110110 */
- 0xde, /* 11011110 */
- 0x7c, /* 01111100 */
- 0x06, /* 00000110 */
-
- /* 82 0x52 'R' */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfc, /* 11111100 */
- 0xd8, /* 11011000 */
- 0xcc, /* 11001100 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 83 0x53 'S' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0x60, /* 01100000 */
- 0x38, /* 00111000 */
- 0x0c, /* 00001100 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 84 0x54 'T' */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 85 0x55 'U' */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 86 0x56 'V' */
- 0xc3, /* 11000011 */
- 0xc3, /* 11000011 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 87 0x57 'W' */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xd6, /* 11010110 */
- 0xfe, /* 11111110 */
- 0xee, /* 11101110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 88 0x58 'X' */
- 0xc3, /* 11000011 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x66, /* 01100110 */
- 0xc3, /* 11000011 */
- 0x00, /* 00000000 */
-
- /* 89 0x59 'Y' */
- 0xc3, /* 11000011 */
- 0xc3, /* 11000011 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 90 0x5a 'Z' */
- 0xfe, /* 11111110 */
- 0x06, /* 00000110 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
-
- /* 91 0x5b '[' */
- 0x3c, /* 00111100 */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
-
- /* 92 0x5c '\' */
- 0xc0, /* 11000000 */
- 0x60, /* 01100000 */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x06, /* 00000110 */
- 0x03, /* 00000011 */
- 0x00, /* 00000000 */
-
- /* 93 0x5d ']' */
- 0x3c, /* 00111100 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
-
- /* 94 0x5e '^' */
- 0x10, /* 00010000 */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 95 0x5f '_' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
-
- /* 96 0x60 '`' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 97 0x61 'a' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7c, /* 01111100 */
- 0x06, /* 00000110 */
- 0x7e, /* 01111110 */
- 0xc6, /* 11000110 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
-
- /* 98 0x62 'b' */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfc, /* 11111100 */
- 0x00, /* 00000000 */
-
- /* 99 0x63 'c' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc0, /* 11000000 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 100 0x64 'd' */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0x7e, /* 01111110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
-
- /* 101 0x65 'e' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 102 0x66 'f' */
- 0x3c, /* 00111100 */
- 0x66, /* 01100110 */
- 0x60, /* 01100000 */
- 0xf0, /* 11110000 */
- 0x60, /* 01100000 */
- 0x60, /* 01100000 */
- 0x60, /* 01100000 */
- 0x00, /* 00000000 */
-
- /* 103 0x67 'g' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7e, /* 01111110 */
- 0x06, /* 00000110 */
- 0x7c, /* 01111100 */
-
- /* 104 0x68 'h' */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 105 0x69 'i' */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x38, /* 00111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 106 0x6a 'j' */
- 0x06, /* 00000110 */
- 0x00, /* 00000000 */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
-
- /* 107 0x6b 'k' */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xcc, /* 11001100 */
- 0xd8, /* 11011000 */
- 0xf0, /* 11110000 */
- 0xd8, /* 11011000 */
- 0xcc, /* 11001100 */
- 0x00, /* 00000000 */
-
- /* 108 0x6c 'l' */
- 0x38, /* 00111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 109 0x6d 'm' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xec, /* 11101100 */
- 0xfe, /* 11111110 */
- 0xd6, /* 11010110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 110 0x6e 'n' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 111 0x6f 'o' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 112 0x70 'p' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfc, /* 11111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfc, /* 11111100 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
-
- /* 113 0x71 'q' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7e, /* 01111110 */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
-
- /* 114 0x72 'r' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xdc, /* 11011100 */
- 0xe6, /* 11100110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0x00, /* 00000000 */
-
- /* 115 0x73 's' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0xc0, /* 11000000 */
- 0x7c, /* 01111100 */
- 0x06, /* 00000110 */
- 0xfc, /* 11111100 */
- 0x00, /* 00000000 */
-
- /* 116 0x74 't' */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x7c, /* 01111100 */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x36, /* 00110110 */
- 0x1c, /* 00011100 */
- 0x00, /* 00000000 */
-
- /* 117 0x75 'u' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 118 0x76 'v' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x6c, /* 01101100 */
- 0x38, /* 00111000 */
- 0x00, /* 00000000 */
-
- /* 119 0x77 'w' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xd6, /* 11010110 */
- 0xfe, /* 11111110 */
- 0x6c, /* 01101100 */
- 0x00, /* 00000000 */
-
- /* 120 0x78 'x' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xc6, /* 11000110 */
- 0x6c, /* 01101100 */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 121 0x79 'y' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xc3, /* 11000011 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
-
- /* 122 0x7a 'z' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0x0c, /* 00001100 */
- 0x38, /* 00111000 */
- 0x60, /* 01100000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
-
- /* 123 0x7b '{' */
- 0x0e, /* 00001110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x70, /* 01110000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x0e, /* 00001110 */
- 0x00, /* 00000000 */
-
- /* 124 0x7c '|' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 125 0x7d '}' */
- 0x70, /* 01110000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x0e, /* 00001110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x70, /* 01110000 */
- 0x00, /* 00000000 */
-
- /* 126 0x7e '~' */
- 0x72, /* 01110010 */
- 0x9c, /* 10011100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 127 0x7f '' */
- 0x00, /* 00000000 */
- 0x10, /* 00010000 */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
-
- /* 128 0x80 '' */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x0c, /* 00001100 */
- 0x78, /* 01111000 */
-
- /* 129 0x81 '' */
- 0xcc, /* 11001100 */
- 0x00, /* 00000000 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 130 0x82 '' */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 131 0x83 '' */
- 0x7c, /* 01111100 */
- 0x82, /* 10000010 */
- 0x78, /* 01111000 */
- 0x0c, /* 00001100 */
- 0x7c, /* 01111100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 132 0x84 '' */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
- 0x78, /* 01111000 */
- 0x0c, /* 00001100 */
- 0x7c, /* 01111100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 133 0x85 '' */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x78, /* 01111000 */
- 0x0c, /* 00001100 */
- 0x7c, /* 01111100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 134 0x86 '' */
- 0x30, /* 00110000 */
- 0x30, /* 00110000 */
- 0x78, /* 01111000 */
- 0x0c, /* 00001100 */
- 0x7c, /* 01111100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 135 0x87 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0x7e, /* 01111110 */
- 0x0c, /* 00001100 */
- 0x38, /* 00111000 */
-
- /* 136 0x88 '' */
- 0x7c, /* 01111100 */
- 0x82, /* 10000010 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 137 0x89 '' */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 138 0x8a '' */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 139 0x8b '' */
- 0x66, /* 01100110 */
- 0x00, /* 00000000 */
- 0x38, /* 00111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
-
- /* 140 0x8c '' */
- 0x7c, /* 01111100 */
- 0x82, /* 10000010 */
- 0x38, /* 00111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
-
- /* 141 0x8d '' */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x38, /* 00111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
-
- /* 142 0x8e '' */
- 0xc6, /* 11000110 */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 143 0x8f '' */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 144 0x90 '' */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0xf8, /* 11111000 */
- 0xc0, /* 11000000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
-
- /* 145 0x91 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0xd8, /* 11011000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
-
- /* 146 0x92 '' */
- 0x3e, /* 00111110 */
- 0x6c, /* 01101100 */
- 0xcc, /* 11001100 */
- 0xfe, /* 11111110 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xce, /* 11001110 */
- 0x00, /* 00000000 */
-
- /* 147 0x93 '' */
- 0x7c, /* 01111100 */
- 0x82, /* 10000010 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 148 0x94 '' */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 149 0x95 '' */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 150 0x96 '' */
- 0x78, /* 01111000 */
- 0x84, /* 10000100 */
- 0x00, /* 00000000 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 151 0x97 '' */
- 0x60, /* 01100000 */
- 0x30, /* 00110000 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 152 0x98 '' */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7e, /* 01111110 */
- 0x06, /* 00000110 */
- 0xfc, /* 11111100 */
-
- /* 153 0x99 '' */
- 0xc6, /* 11000110 */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x6c, /* 01101100 */
- 0x38, /* 00111000 */
- 0x00, /* 00000000 */
-
- /* 154 0x9a '' */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 155 0x9b '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 156 0x9c '' */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0x64, /* 01100100 */
- 0xf0, /* 11110000 */
- 0x60, /* 01100000 */
- 0x66, /* 01100110 */
- 0xfc, /* 11111100 */
- 0x00, /* 00000000 */
-
- /* 157 0x9d '' */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 158 0x9e '' */
- 0xf8, /* 11111000 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xfa, /* 11111010 */
- 0xc6, /* 11000110 */
- 0xcf, /* 11001111 */
- 0xc6, /* 11000110 */
- 0xc7, /* 11000111 */
-
- /* 159 0x9f '' */
- 0x0e, /* 00001110 */
- 0x1b, /* 00011011 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0xd8, /* 11011000 */
- 0x70, /* 01110000 */
- 0x00, /* 00000000 */
-
- /* 160 0xa0 '' */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x78, /* 01111000 */
- 0x0c, /* 00001100 */
- 0x7c, /* 01111100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 161 0xa1 '' */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x38, /* 00111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
-
- /* 162 0xa2 '' */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
-
- /* 163 0xa3 '' */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 164 0xa4 '' */
- 0x76, /* 01110110 */
- 0xdc, /* 11011100 */
- 0x00, /* 00000000 */
- 0xdc, /* 11011100 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x00, /* 00000000 */
-
- /* 165 0xa5 '' */
- 0x76, /* 01110110 */
- 0xdc, /* 11011100 */
- 0x00, /* 00000000 */
- 0xe6, /* 11100110 */
- 0xf6, /* 11110110 */
- 0xde, /* 11011110 */
- 0xce, /* 11001110 */
- 0x00, /* 00000000 */
-
- /* 166 0xa6 '' */
- 0x3c, /* 00111100 */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0x3e, /* 00111110 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 167 0xa7 '' */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0x38, /* 00111000 */
- 0x00, /* 00000000 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 168 0xa8 '' */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x63, /* 01100011 */
- 0x3e, /* 00111110 */
- 0x00, /* 00000000 */
-
- /* 169 0xa9 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 170 0xaa '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0x06, /* 00000110 */
- 0x06, /* 00000110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 171 0xab '' */
- 0x63, /* 01100011 */
- 0xe6, /* 11100110 */
- 0x6c, /* 01101100 */
- 0x7e, /* 01111110 */
- 0x33, /* 00110011 */
- 0x66, /* 01100110 */
- 0xcc, /* 11001100 */
- 0x0f, /* 00001111 */
-
- /* 172 0xac '' */
- 0x63, /* 01100011 */
- 0xe6, /* 11100110 */
- 0x6c, /* 01101100 */
- 0x7a, /* 01111010 */
- 0x36, /* 00110110 */
- 0x6a, /* 01101010 */
- 0xdf, /* 11011111 */
- 0x06, /* 00000110 */
-
- /* 173 0xad '' */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 174 0xae '' */
- 0x00, /* 00000000 */
- 0x33, /* 00110011 */
- 0x66, /* 01100110 */
- 0xcc, /* 11001100 */
- 0x66, /* 01100110 */
- 0x33, /* 00110011 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 175 0xaf '' */
- 0x00, /* 00000000 */
- 0xcc, /* 11001100 */
- 0x66, /* 01100110 */
- 0x33, /* 00110011 */
- 0x66, /* 01100110 */
- 0xcc, /* 11001100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 176 0xb0 '' */
- 0x22, /* 00100010 */
- 0x88, /* 10001000 */
- 0x22, /* 00100010 */
- 0x88, /* 10001000 */
- 0x22, /* 00100010 */
- 0x88, /* 10001000 */
- 0x22, /* 00100010 */
- 0x88, /* 10001000 */
-
- /* 177 0xb1 '' */
- 0x55, /* 01010101 */
- 0xaa, /* 10101010 */
- 0x55, /* 01010101 */
- 0xaa, /* 10101010 */
- 0x55, /* 01010101 */
- 0xaa, /* 10101010 */
- 0x55, /* 01010101 */
- 0xaa, /* 10101010 */
-
- /* 178 0xb2 '' */
- 0x77, /* 01110111 */
- 0xdd, /* 11011101 */
- 0x77, /* 01110111 */
- 0xdd, /* 11011101 */
- 0x77, /* 01110111 */
- 0xdd, /* 11011101 */
- 0x77, /* 01110111 */
- 0xdd, /* 11011101 */
-
- /* 179 0xb3 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 180 0xb4 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xf8, /* 11111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 181 0xb5 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xf8, /* 11111000 */
- 0x18, /* 00011000 */
- 0xf8, /* 11111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 182 0xb6 '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0xf6, /* 11110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 183 0xb7 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 184 0xb8 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xf8, /* 11111000 */
- 0x18, /* 00011000 */
- 0xf8, /* 11111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 185 0xb9 '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0xf6, /* 11110110 */
- 0x06, /* 00000110 */
- 0xf6, /* 11110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 186 0xba '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 187 0xbb '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0x06, /* 00000110 */
- 0xf6, /* 11110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 188 0xbc '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0xf6, /* 11110110 */
- 0x06, /* 00000110 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 189 0xbd '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 190 0xbe '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xf8, /* 11111000 */
- 0x18, /* 00011000 */
- 0xf8, /* 11111000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 191 0xbf '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xf8, /* 11111000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 192 0xc0 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x1f, /* 00011111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 193 0xc1 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 194 0xc2 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 195 0xc3 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x1f, /* 00011111 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 196 0xc4 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 197 0xc5 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xff, /* 11111111 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 198 0xc6 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x1f, /* 00011111 */
- 0x18, /* 00011000 */
- 0x1f, /* 00011111 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 199 0xc7 '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x37, /* 00110111 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 200 0xc8 '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x37, /* 00110111 */
- 0x30, /* 00110000 */
- 0x3f, /* 00111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 201 0xc9 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x3f, /* 00111111 */
- 0x30, /* 00110000 */
- 0x37, /* 00110111 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 202 0xca '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0xf7, /* 11110111 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 203 0xcb '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0xf7, /* 11110111 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 204 0xcc '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x37, /* 00110111 */
- 0x30, /* 00110000 */
- 0x37, /* 00110111 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 205 0xcd '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 206 0xce '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0xf7, /* 11110111 */
- 0x00, /* 00000000 */
- 0xf7, /* 11110111 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 207 0xcf '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 208 0xd0 '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 209 0xd1 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 210 0xd2 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 211 0xd3 '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x3f, /* 00111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 212 0xd4 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x1f, /* 00011111 */
- 0x18, /* 00011000 */
- 0x1f, /* 00011111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 213 0xd5 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x1f, /* 00011111 */
- 0x18, /* 00011000 */
- 0x1f, /* 00011111 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 214 0xd6 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x3f, /* 00111111 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 215 0xd7 '' */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0xff, /* 11111111 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
-
- /* 216 0xd8 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xff, /* 11111111 */
- 0x18, /* 00011000 */
- 0xff, /* 11111111 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 217 0xd9 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xf8, /* 11111000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 218 0xda '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x1f, /* 00011111 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 219 0xdb '' */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
-
- /* 220 0xdc '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
-
- /* 221 0xdd '' */
- 0xf0, /* 11110000 */
- 0xf0, /* 11110000 */
- 0xf0, /* 11110000 */
- 0xf0, /* 11110000 */
- 0xf0, /* 11110000 */
- 0xf0, /* 11110000 */
- 0xf0, /* 11110000 */
- 0xf0, /* 11110000 */
-
- /* 222 0xde '' */
- 0x0f, /* 00001111 */
- 0x0f, /* 00001111 */
- 0x0f, /* 00001111 */
- 0x0f, /* 00001111 */
- 0x0f, /* 00001111 */
- 0x0f, /* 00001111 */
- 0x0f, /* 00001111 */
- 0x0f, /* 00001111 */
-
- /* 223 0xdf '' */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0xff, /* 11111111 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 224 0xe0 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x76, /* 01110110 */
- 0xdc, /* 11011100 */
- 0xc8, /* 11001000 */
- 0xdc, /* 11011100 */
- 0x76, /* 01110110 */
- 0x00, /* 00000000 */
-
- /* 225 0xe1 '' */
- 0x78, /* 01111000 */
- 0xcc, /* 11001100 */
- 0xcc, /* 11001100 */
- 0xd8, /* 11011000 */
- 0xcc, /* 11001100 */
- 0xc6, /* 11000110 */
- 0xcc, /* 11001100 */
- 0x00, /* 00000000 */
-
- /* 226 0xe2 '' */
- 0xfe, /* 11111110 */
- 0xc6, /* 11000110 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0xc0, /* 11000000 */
- 0x00, /* 00000000 */
-
- /* 227 0xe3 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0x00, /* 00000000 */
-
- /* 228 0xe4 '' */
- 0xfe, /* 11111110 */
- 0xc6, /* 11000110 */
- 0x60, /* 01100000 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
-
- /* 229 0xe5 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0xd8, /* 11011000 */
- 0xd8, /* 11011000 */
- 0xd8, /* 11011000 */
- 0x70, /* 01110000 */
- 0x00, /* 00000000 */
-
- /* 230 0xe6 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x7c, /* 01111100 */
- 0xc0, /* 11000000 */
-
- /* 231 0xe7 '' */
- 0x00, /* 00000000 */
- 0x76, /* 01110110 */
- 0xdc, /* 11011100 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
-
- /* 232 0xe8 '' */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x3c, /* 00111100 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
-
- /* 233 0xe9 '' */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0xc6, /* 11000110 */
- 0xfe, /* 11111110 */
- 0xc6, /* 11000110 */
- 0x6c, /* 01101100 */
- 0x38, /* 00111000 */
- 0x00, /* 00000000 */
-
- /* 234 0xea '' */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0xee, /* 11101110 */
- 0x00, /* 00000000 */
-
- /* 235 0xeb '' */
- 0x0e, /* 00001110 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x3e, /* 00111110 */
- 0x66, /* 01100110 */
- 0x66, /* 01100110 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
-
- /* 236 0xec '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0xdb, /* 11011011 */
- 0xdb, /* 11011011 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 237 0xed '' */
- 0x06, /* 00000110 */
- 0x0c, /* 00001100 */
- 0x7e, /* 01111110 */
- 0xdb, /* 11011011 */
- 0xdb, /* 11011011 */
- 0x7e, /* 01111110 */
- 0x60, /* 01100000 */
- 0xc0, /* 11000000 */
-
- /* 238 0xee '' */
- 0x1e, /* 00011110 */
- 0x30, /* 00110000 */
- 0x60, /* 01100000 */
- 0x7e, /* 01111110 */
- 0x60, /* 01100000 */
- 0x30, /* 00110000 */
- 0x1e, /* 00011110 */
- 0x00, /* 00000000 */
-
- /* 239 0xef '' */
- 0x00, /* 00000000 */
- 0x7c, /* 01111100 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0xc6, /* 11000110 */
- 0x00, /* 00000000 */
-
- /* 240 0xf0 '' */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
- 0xfe, /* 11111110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 241 0xf1 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x7e, /* 01111110 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
-
- /* 242 0xf2 '' */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
-
- /* 243 0xf3 '' */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x18, /* 00011000 */
- 0x0c, /* 00001100 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
-
- /* 244 0xf4 '' */
- 0x0e, /* 00001110 */
- 0x1b, /* 00011011 */
- 0x1b, /* 00011011 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
-
- /* 245 0xf5 '' */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0xd8, /* 11011000 */
- 0xd8, /* 11011000 */
- 0x70, /* 01110000 */
-
- /* 246 0xf6 '' */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x7e, /* 01111110 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 247 0xf7 '' */
- 0x00, /* 00000000 */
- 0x76, /* 01110110 */
- 0xdc, /* 11011100 */
- 0x00, /* 00000000 */
- 0x76, /* 01110110 */
- 0xdc, /* 11011100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 248 0xf8 '' */
- 0x38, /* 00111000 */
- 0x6c, /* 01101100 */
- 0x6c, /* 01101100 */
- 0x38, /* 00111000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 249 0xf9 '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 250 0xfa '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x18, /* 00011000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 251 0xfb '' */
- 0x0f, /* 00001111 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0x0c, /* 00001100 */
- 0xec, /* 11101100 */
- 0x6c, /* 01101100 */
- 0x3c, /* 00111100 */
- 0x1c, /* 00011100 */
-
- /* 252 0xfc '' */
- 0x6c, /* 01101100 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x36, /* 00110110 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 253 0xfd '' */
- 0x78, /* 01111000 */
- 0x0c, /* 00001100 */
- 0x18, /* 00011000 */
- 0x30, /* 00110000 */
- 0x7c, /* 01111100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 254 0xfe '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x3c, /* 00111100 */
- 0x3c, /* 00111100 */
- 0x3c, /* 00111100 */
- 0x3c, /* 00111100 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
- /* 255 0xff '' */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
- 0x00, /* 00000000 */
-
-};
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/gertboard.c b/other/wiringpi/wiringPi-96344ff/devLib/gertboard.c
deleted file mode 100644
index 6a8441576..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/gertboard.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * gertboard.c:
- * Access routines for the SPI devices on the Gertboard
- * Copyright (c) 2012 Gordon Henderson
- *
- * The Gertboard has:
- *
- * An MCP3002 dual-channel A to D convertor connected
- * to the SPI bus, selected by chip-select A, and:
- *
- * An MCP4802 dual-channel D to A convertor connected
- * to the SPI bus, selected via chip-select B.
- *
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the
- * License, or (at your option) any later version.
- *
- * wiringPi 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 wiringPi.
- * If not, see .
- ***********************************************************************
- */
-
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include "gertboard.h"
-
-// The A-D convertor won't run at more than 1MHz @ 3.3v
-
-#define SPI_ADC_SPEED 1000000
-#define SPI_DAC_SPEED 1000000
-#define SPI_A2D 0
-#define SPI_D2A 1
-
-
-/*
- * gertboardAnalogWrite:
- * Write an 8-bit data value to the MCP4802 Analog to digital
- * convertor on the Gertboard.
- *********************************************************************************
- */
-
-void gertboardAnalogWrite (const int chan, const int value)
-{
- uint8_t spiData [2] ;
- uint8_t chanBits, dataBits ;
-
- if (chan == 0)
- chanBits = 0x30 ;
- else
- chanBits = 0xB0 ;
-
- chanBits |= ((value >> 4) & 0x0F) ;
- dataBits = ((value << 4) & 0xF0) ;
-
- spiData [0] = chanBits ;
- spiData [1] = dataBits ;
-
- wiringPiSPIDataRW (SPI_D2A, spiData, 2) ;
-}
-
-
-/*
- * gertboardAnalogRead:
- * Return the analog value of the given channel (0/1).
- * The A/D is a 10-bit device
- *********************************************************************************
- */
-
-int gertboardAnalogRead (const int chan)
-{
- uint8_t spiData [2] ;
-
- uint8_t chanBits ;
-
- if (chan == 0)
- chanBits = 0b11010000 ;
- else
- chanBits = 0b11110000 ;
-
- spiData [0] = chanBits ;
- spiData [1] = 0 ;
-
- wiringPiSPIDataRW (SPI_A2D, spiData, 2) ;
-
- return ((spiData [0] << 8) | (spiData [1] >> 1)) & 0x3FF ;
-}
-
-
-/*
- * gertboardSPISetup:
- * Initialise the SPI bus, etc.
- *********************************************************************************
- */
-
-int gertboardSPISetup (void)
-{
- if (wiringPiSPISetup (SPI_A2D, SPI_ADC_SPEED) < 0)
- return -1 ;
-
- if (wiringPiSPISetup (SPI_D2A, SPI_DAC_SPEED) < 0)
- return -1 ;
-
- return 0 ;
-}
-
-
-/*
- * New wiringPi node extension methods.
- *********************************************************************************
- */
-
-static int myAnalogRead (struct wiringPiNodeStruct *node, const int chan)
-{
- return gertboardAnalogRead (chan - node->pinBase) ;
-}
-
-static void myAnalogWrite (struct wiringPiNodeStruct *node, const int chan, const int value)
-{
- gertboardAnalogWrite (chan - node->pinBase, value) ;
-}
-
-
-/*
- * gertboardAnalogSetup:
- * Create a new wiringPi device node for the analog devices on the
- * Gertboard. We create one node with 2 pins - each pin being read
- * and write - although the operations actually go to different
- * hardware devices.
- *********************************************************************************
- */
-
-int gertboardAnalogSetup (const int pinBase)
-{
- struct wiringPiNodeStruct *node ;
- int x ;
-
- if (( x = gertboardSPISetup ()) != 0)
- return x;
-
- node = wiringPiNewNode (pinBase, 2) ;
- node->analogRead = myAnalogRead ;
- node->analogWrite = myAnalogWrite ;
-
- return 0 ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/gertboard.h b/other/wiringpi/wiringPi-96344ff/devLib/gertboard.h
deleted file mode 100644
index 3fa191974..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/gertboard.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * gertboard.h:
- * Access routines for the SPI devices on the Gertboard
- * Copyright (c) 2012 Gordon Henderson
- *
- * The Gertboard has an MCP4802 dual-channel D to A convertor
- * connected to the SPI bus, selected via chip-select B.
- *
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the
- * License, or (at your option) any later version.
- *
- * wiringPi 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 wiringPi.
- * If not, see .
- ***********************************************************************
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Old routines
-
-extern void gertboardAnalogWrite (const int chan, const int value) ;
-extern int gertboardAnalogRead (const int chan) ;
-extern int gertboardSPISetup (void) ;
-
-// New
-
-extern int gertboardAnalogSetup (const int pinBase) ;
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/lcd.c b/other/wiringpi/wiringPi-96344ff/devLib/lcd.c
deleted file mode 100644
index 6c0e47494..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/lcd.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * lcd.c:
- * Text-based LCD driver.
- * This is designed to drive the parallel interface LCD drivers
- * based in the Hitachi HD44780U controller and compatables.
- *
- * Copyright (c) 2012 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#include
-#include
-#include
-
-#include
-
-#include "lcd.h"
-
-#ifndef TRUE
-# define TRUE (1==1)
-# define FALSE (1==2)
-#endif
-
-// HD44780U Commands
-
-#define LCD_CLEAR 0x01
-#define LCD_HOME 0x02
-#define LCD_ENTRY 0x04
-#define LCD_CTRL 0x08
-#define LCD_CDSHIFT 0x10
-#define LCD_FUNC 0x20
-#define LCD_CGRAM 0x40
-#define LCD_DGRAM 0x80
-
-// Bits in the entry register
-
-#define LCD_ENTRY_SH 0x01
-#define LCD_ENTRY_ID 0x02
-
-// Bits in the control register
-
-#define LCD_BLINK_CTRL 0x01
-#define LCD_CURSOR_CTRL 0x02
-#define LCD_DISPLAY_CTRL 0x04
-
-// Bits in the function register
-
-#define LCD_FUNC_F 0x04
-#define LCD_FUNC_N 0x08
-#define LCD_FUNC_DL 0x10
-
-#define LCD_CDSHIFT_RL 0x04
-
-struct lcdDataStruct
-{
- int bits, rows, cols ;
- int rsPin, strbPin ;
- int dataPins [8] ;
- int cx, cy ;
-} ;
-
-struct lcdDataStruct *lcds [MAX_LCDS] ;
-
-static int lcdControl ;
-
-// Row offsets
-
-static const int rowOff [4] = { 0x00, 0x40, 0x14, 0x54 } ;
-
-
-/*
- * strobe:
- * Toggle the strobe (Really the "E") pin to the device.
- * According to the docs, data is latched on the falling edge.
- *********************************************************************************
- */
-
-static void strobe (const struct lcdDataStruct *lcd)
-{
-
-// Note timing changes for new version of delayMicroseconds ()
-
- digitalWrite (lcd->strbPin, 1) ; delayMicroseconds (50) ;
- digitalWrite (lcd->strbPin, 0) ; delayMicroseconds (50) ;
-}
-
-
-/*
- * sentDataCmd:
- * Send an data or command byte to the display.
- *********************************************************************************
- */
-
-static void sendDataCmd (const struct lcdDataStruct *lcd, unsigned char data)
-{
- register unsigned char myData = data ;
- unsigned char i, d4 ;
-
- if (lcd->bits == 4)
- {
- d4 = (myData >> 4) & 0x0F;
- for (i = 0 ; i < 4 ; ++i)
- {
- digitalWrite (lcd->dataPins [i], (d4 & 1)) ;
- d4 >>= 1 ;
- }
- strobe (lcd) ;
-
- d4 = myData & 0x0F ;
- for (i = 0 ; i < 4 ; ++i)
- {
- digitalWrite (lcd->dataPins [i], (d4 & 1)) ;
- d4 >>= 1 ;
- }
- }
- else
- {
- for (i = 0 ; i < 8 ; ++i)
- {
- digitalWrite (lcd->dataPins [i], (myData & 1)) ;
- myData >>= 1 ;
- }
- }
- strobe (lcd) ;
-}
-
-
-/*
- * putCommand:
- * Send a command byte to the display
- *********************************************************************************
- */
-
-static void putCommand (const struct lcdDataStruct *lcd, unsigned char command)
-{
- digitalWrite (lcd->rsPin, 0) ;
- sendDataCmd (lcd, command) ;
- delay (2) ;
-}
-
-static void put4Command (const struct lcdDataStruct *lcd, unsigned char command)
-{
- register unsigned char myCommand = command ;
- register unsigned char i ;
-
- digitalWrite (lcd->rsPin, 0) ;
-
- for (i = 0 ; i < 4 ; ++i)
- {
- digitalWrite (lcd->dataPins [i], (myCommand & 1)) ;
- myCommand >>= 1 ;
- }
- strobe (lcd) ;
-}
-
-
-/*
- *********************************************************************************
- * User Callable code below here
- *********************************************************************************
- */
-
-/*
- * lcdHome: lcdClear:
- * Home the cursor or clear the screen.
- *********************************************************************************
- */
-
-void lcdHome (const int fd)
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
-
- putCommand (lcd, LCD_HOME) ;
- lcd->cx = lcd->cy = 0 ;
- delay (5) ;
-}
-
-void lcdClear (const int fd)
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
-
- putCommand (lcd, LCD_CLEAR) ;
- putCommand (lcd, LCD_HOME) ;
- lcd->cx = lcd->cy = 0 ;
- delay (5) ;
-}
-
-
-/*
- * lcdDisplay: lcdCursor: lcdCursorBlink:
- * Turn the display, cursor, cursor blinking on/off
- *********************************************************************************
- */
-
-void lcdDisplay (const int fd, int state)
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
-
- if (state)
- lcdControl |= LCD_DISPLAY_CTRL ;
- else
- lcdControl &= ~LCD_DISPLAY_CTRL ;
-
- putCommand (lcd, LCD_CTRL | lcdControl) ;
-}
-
-void lcdCursor (const int fd, int state)
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
-
- if (state)
- lcdControl |= LCD_CURSOR_CTRL ;
- else
- lcdControl &= ~LCD_CURSOR_CTRL ;
-
- putCommand (lcd, LCD_CTRL | lcdControl) ;
-}
-
-void lcdCursorBlink (const int fd, int state)
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
-
- if (state)
- lcdControl |= LCD_BLINK_CTRL ;
- else
- lcdControl &= ~LCD_BLINK_CTRL ;
-
- putCommand (lcd, LCD_CTRL | lcdControl) ;
-}
-
-
-/*
- * lcdSendCommand:
- * Send any arbitary command to the display
- *********************************************************************************
- */
-
-void lcdSendCommand (const int fd, unsigned char command)
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
- putCommand (lcd, command) ;
-}
-
-
-/*
- * lcdPosition:
- * Update the position of the cursor on the display.
- * Ignore invalid locations.
- *********************************************************************************
- */
-
-void lcdPosition (const int fd, int x, int y)
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
-
- if ((x > lcd->cols) || (x < 0))
- return ;
- if ((y > lcd->rows) || (y < 0))
- return ;
-
- putCommand (lcd, x + (LCD_DGRAM | rowOff [y])) ;
-
- lcd->cx = x ;
- lcd->cy = y ;
-}
-
-
-/*
- * lcdCharDef:
- * Defines a new character in the CGRAM
- *********************************************************************************
- */
-
-void lcdCharDef (const int fd, int index, unsigned char data [8])
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
- int i ;
-
- putCommand (lcd, LCD_CGRAM | ((index & 7) << 3)) ;
-
- digitalWrite (lcd->rsPin, 1) ;
- for (i = 0 ; i < 8 ; ++i)
- sendDataCmd (lcd, data [i]) ;
-}
-
-
-/*
- * lcdPutchar:
- * Send a data byte to be displayed on the display. We implement a very
- * simple terminal here - with line wrapping, but no scrolling. Yet.
- *********************************************************************************
- */
-
-void lcdPutchar (const int fd, unsigned char data)
-{
- struct lcdDataStruct *lcd = lcds [fd] ;
-
- digitalWrite (lcd->rsPin, 1) ;
- sendDataCmd (lcd, data) ;
-
- if (++lcd->cx == lcd->cols)
- {
- lcd->cx = 0 ;
- if (++lcd->cy == lcd->rows)
- lcd->cy = 0 ;
-
- putCommand (lcd, lcd->cx + (LCD_DGRAM | rowOff [lcd->cy])) ;
- }
-}
-
-
-/*
- * lcdPuts:
- * Send a string to be displayed on the display
- *********************************************************************************
- */
-
-void lcdPuts (const int fd, const char *string)
-{
- while (*string)
- lcdPutchar (fd, *string++) ;
-}
-
-
-/*
- * lcdPrintf:
- * Printf to an LCD display
- *********************************************************************************
- */
-
-void lcdPrintf (const int fd, const char *message, ...)
-{
- va_list argp ;
- char buffer [1024] ;
-
- va_start (argp, message) ;
- vsnprintf (buffer, 1023, message, argp) ;
- va_end (argp) ;
-
- lcdPuts (fd, buffer) ;
-}
-
-
-/*
- * lcdInit:
- * Take a lot of parameters and initialise the LCD, and return a handle to
- * that LCD, or -1 if any error.
- *********************************************************************************
- */
-
-int lcdInit (const int rows, const int cols, const int bits,
- const int rs, const int strb,
- const int d0, const int d1, const int d2, const int d3, const int d4,
- const int d5, const int d6, const int d7)
-{
- static int initialised = 0 ;
-
- unsigned char func ;
- int i ;
- int lcdFd = -1 ;
- struct lcdDataStruct *lcd ;
-
- if (initialised == 0)
- {
- initialised = 1 ;
- for (i = 0 ; i < MAX_LCDS ; ++i)
- lcds [i] = NULL ;
- }
-
-// Simple sanity checks
-
- if (! ((bits == 4) || (bits == 8)))
- return -1 ;
-
- if ((rows < 0) || (rows > 20))
- return -1 ;
-
- if ((cols < 0) || (cols > 20))
- return -1 ;
-
-// Create a new LCD:
-
- for (i = 0 ; i < MAX_LCDS ; ++i)
- {
- if (lcds [i] == NULL)
- {
- lcdFd = i ;
- break ;
- }
- }
-
- if (lcdFd == -1)
- return -1 ;
-
- lcd = (struct lcdDataStruct *)malloc (sizeof (struct lcdDataStruct)) ;
- if (lcd == NULL)
- return -1 ;
-
- lcd->rsPin = rs ;
- lcd->strbPin = strb ;
- lcd->bits = 8 ; // For now - we'll set it properly later.
- lcd->rows = rows ;
- lcd->cols = cols ;
- lcd->cx = 0 ;
- lcd->cy = 0 ;
-
- lcd->dataPins [0] = d0 ;
- lcd->dataPins [1] = d1 ;
- lcd->dataPins [2] = d2 ;
- lcd->dataPins [3] = d3 ;
- lcd->dataPins [4] = d4 ;
- lcd->dataPins [5] = d5 ;
- lcd->dataPins [6] = d6 ;
- lcd->dataPins [7] = d7 ;
-
- lcds [lcdFd] = lcd ;
-
- digitalWrite (lcd->rsPin, 0) ; pinMode (lcd->rsPin, OUTPUT) ;
- digitalWrite (lcd->strbPin, 0) ; pinMode (lcd->strbPin, OUTPUT) ;
-
- for (i = 0 ; i < bits ; ++i)
- {
- digitalWrite (lcd->dataPins [i], 0) ;
- pinMode (lcd->dataPins [i], OUTPUT) ;
- }
- delay (35) ; // mS
-
-
-// 4-bit mode?
-// OK. This is a PIG and it's not at all obvious from the documentation I had,
-// so I guess some others have worked through either with better documentation
-// or more trial and error... Anyway here goes:
-//
-// It seems that the controller needs to see the FUNC command at least 3 times
-// consecutively - in 8-bit mode. If you're only using 8-bit mode, then it appears
-// that you can get away with one func-set, however I'd not rely on it...
-//
-// So to set 4-bit mode, you need to send the commands one nibble at a time,
-// the same three times, but send the command to set it into 8-bit mode those
-// three times, then send a final 4th command to set it into 4-bit mode, and only
-// then can you flip the switch for the rest of the library to work in 4-bit
-// mode which sends the commands as 2 x 4-bit values.
-
- if (bits == 4)
- {
- func = LCD_FUNC | LCD_FUNC_DL ; // Set 8-bit mode 3 times
- put4Command (lcd, func >> 4) ; delay (35) ;
- put4Command (lcd, func >> 4) ; delay (35) ;
- put4Command (lcd, func >> 4) ; delay (35) ;
- func = LCD_FUNC ; // 4th set: 4-bit mode
- put4Command (lcd, func >> 4) ; delay (35) ;
- lcd->bits = 4 ;
- }
- else
- {
- func = LCD_FUNC | LCD_FUNC_DL ;
- putCommand (lcd, func ) ; delay (35) ;
- putCommand (lcd, func ) ; delay (35) ;
- putCommand (lcd, func ) ; delay (35) ;
- }
-
- if (lcd->rows > 1)
- {
- func |= LCD_FUNC_N ;
- putCommand (lcd, func) ; delay (35) ;
- }
-
-// Rest of the initialisation sequence
-
- lcdDisplay (lcdFd, TRUE) ;
- lcdCursor (lcdFd, FALSE) ;
- lcdCursorBlink (lcdFd, FALSE) ;
- lcdClear (lcdFd) ;
-
- putCommand (lcd, LCD_ENTRY | LCD_ENTRY_ID) ;
- putCommand (lcd, LCD_CDSHIFT | LCD_CDSHIFT_RL) ;
-
- return lcdFd ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/lcd.h b/other/wiringpi/wiringPi-96344ff/devLib/lcd.h
deleted file mode 100644
index 0a0e5988c..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/lcd.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * lcd.h:
- * Text-based LCD driver.
- * This is designed to drive the parallel interface LCD drivers
- * based in the Hitachi HD44780U controller and compatables.
- *
- * Copyright (c) 2012 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#define MAX_LCDS 8
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void lcdHome (const int fd) ;
-extern void lcdClear (const int fd) ;
-extern void lcdDisplay (const int fd, int state) ;
-extern void lcdCursor (const int fd, int state) ;
-extern void lcdCursorBlink (const int fd, int state) ;
-extern void lcdSendCommand (const int fd, unsigned char command) ;
-extern void lcdPosition (const int fd, int x, int y) ;
-extern void lcdCharDef (const int fd, int index, unsigned char data [8]) ;
-extern void lcdPutchar (const int fd, unsigned char data) ;
-extern void lcdPuts (const int fd, const char *string) ;
-extern void lcdPrintf (const int fd, const char *message, ...) ;
-
-extern int lcdInit (const int rows, const int cols, const int bits,
- const int rs, const int strb,
- const int d0, const int d1, const int d2, const int d3, const int d4,
- const int d5, const int d6, const int d7) ;
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/lcd128x64.c b/other/wiringpi/wiringPi-96344ff/devLib/lcd128x64.c
deleted file mode 100644
index accd5c3a7..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/lcd128x64.c
+++ /dev/null
@@ -1,673 +0,0 @@
-/*
- * lcd128x64.c:
- * Graphics-based LCD driver.
- * This is designed to drive the parallel interface LCD drivers
- * based on the generic 12864H chips
- *
- * There are many variations on these chips, however they all mostly
- * seem to be similar.
- * This implementation has the Pins from the Pi hard-wired into it,
- * in particular wiringPi pins 0-7 so that we can use
- * digitalWriteByete() to speed things up somewhat.
- *
- * Copyright (c) 2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#include
-#include
-
-#include
-
-#include "font.h"
-#include "lcd128x64.h"
-
-// Size
-
-#define LCD_WIDTH 128
-#define LCD_HEIGHT 64
-
-// Hardware Pins
-// Note pins 0-7 are the 8-bit data port
-
-#define CS1 10
-#define CS2 11
-#define STROBE 12
-#define RS 13
-
-// Software copy of the framebuffer
-// it's 8-bit deep although the display itself is only 1-bit deep.
-
-static unsigned char frameBuffer [LCD_WIDTH * LCD_HEIGHT] ;
-
-static int maxX, maxY ;
-static int lastX, lastY ;
-static int xOrigin, yOrigin ;
-static int lcdOrientation = 0 ;
-
-/*
- * strobe:
- * Toggle the strobe (Really the "E") pin to the device.
- * According to the docs, data is latched on the falling edge.
- *********************************************************************************
- */
-
-static void strobe (void)
-{
- digitalWrite (STROBE, 1) ; delayMicroseconds (1) ;
- digitalWrite (STROBE, 0) ; delayMicroseconds (5) ;
-}
-
-
-/*
- * sentData:
- * Send an data or command byte to the display.
- *********************************************************************************
- */
-
-static void sendData (const int data, const int chip)
-{
- digitalWrite (chip, 0) ;
- digitalWriteByte (data) ;
- strobe () ;
- digitalWrite (chip, 1) ;
-}
-
-
-/*
- * sendCommand:
- * Send a command byte to the display
- *********************************************************************************
- */
-
-static void sendCommand (const int command, const int chip)
-{
- digitalWrite (RS, 0) ;
- sendData (command, chip) ;
- digitalWrite (RS, 1) ;
-}
-
-
-/*
- * setCol: SetLine:
- * Set the column and line addresses
- *********************************************************************************
- */
-
-static void setCol (int col, const int chip)
- { sendCommand (0x40 | (col & 0x3F), chip) ; }
-
-static void setLine (int line, const int chip)
- { sendCommand (0xB8 | (line & 0x07), chip) ; }
-
-
-/*
- * lcd128x64update:
- * Copy our software version to the real display
- *********************************************************************************
- */
-
-void lcd128x64update (void)
-{
- int line, x, y, fbLoc ;
- unsigned char byte ;
-
-// Left side
-
- for (line = 0 ; line < 8 ; ++line)
- {
- setCol (0, CS1) ;
- setLine (line, CS1) ;
-
- for (x = 63 ; x >= 0 ; --x)
- {
- byte = 0 ;
- for (y = 0 ; y < 8 ; ++y)
- {
- fbLoc = x + (((7 - line) * 8) + (7 - y)) * LCD_WIDTH ;
- if (frameBuffer [fbLoc] != 0)
- byte |= (1 << y) ;
- }
- sendData (byte, CS1) ;
- }
- }
-
-// Right side
-
- for (line = 0 ; line < 8 ; ++line)
- {
- setCol (0, CS2) ;
- setLine (line, CS2) ;
-
- for (x = 127 ; x >= 64 ; --x)
- {
- byte = 0 ;
- for (y = 0 ; y < 8 ; ++y)
- {
- fbLoc = x + (((7 - line) * 8) + (7 - y)) * LCD_WIDTH ;
- if (frameBuffer [fbLoc] != 0)
- byte |= (1 << y) ;
- }
- sendData (byte, CS2) ;
- }
- }
-}
-
-
-/*
- * lcd128x64setOrigin:
- * Set the display offset origin
- *********************************************************************************
- */
-
-void lcd128x64setOrigin (int x, int y)
-{
- xOrigin = x ;
- yOrigin = y ;
-}
-
-
-/*
- * lcd128x64setOrientation:
- * Set the display orientation:
- * 0: Normal, the display is portrait mode, 0,0 is top left
- * 1: Landscape
- * 2: Portrait, flipped
- * 3: Landscape, flipped
- *********************************************************************************
- */
-
-void lcd128x64setOrientation (int orientation)
-{
- lcdOrientation = orientation & 3 ;
-
- lcd128x64setOrigin (0,0) ;
-
- switch (lcdOrientation)
- {
- case 0:
- maxX = LCD_WIDTH ;
- maxY = LCD_HEIGHT ;
- break ;
-
- case 1:
- maxX = LCD_HEIGHT ;
- maxY = LCD_WIDTH ;
- break ;
-
- case 2:
- maxX = LCD_WIDTH ;
- maxY = LCD_HEIGHT ;
- break ;
-
- case 3:
- maxX = LCD_HEIGHT ;
- maxY = LCD_WIDTH ;
- break ;
- }
-}
-
-
-/*
- * lcd128x64orientCoordinates:
- * Adjust the coordinates given to the display orientation
- *********************************************************************************
- */
-
-void lcd128x64orientCoordinates (int *x, int *y)
-{
- register int tmp ;
-
- *x += xOrigin ;
- *y += yOrigin ;
- *y = maxY - *y - 1 ;
-
- switch (lcdOrientation)
- {
- case 0:
- break;
-
- case 1:
- tmp = maxY - *y - 1 ;
- *y = *x ;
- *x = tmp ;
- break;
-
- case 2:
- *x = maxX - *x - 1 ;
- *y = maxY - *y - 1 ;
- break;
-
- case 3:
- *x = maxX - *x - 1 ;
- tmp = *y ;
- *y = *x ;
- *x = tmp ;
- break ;
- }
-}
-
-
-/*
- * lcd128x64getScreenSize:
- * Return the max X & Y screen sizes. Needs to be called again, if you
- * change screen orientation.
- *********************************************************************************
- */
-
-void lcd128x64getScreenSize (int *x, int *y)
-{
- *x = maxX ;
- *y = maxY ;
-}
-
-
-/*
- *********************************************************************************
- * Standard Graphical Functions
- *********************************************************************************
- */
-
-
-/*
- * lcd128x64point:
- * Plot a pixel.
- *********************************************************************************
- */
-
-void lcd128x64point (int x, int y, int colour)
-{
- lastX = x ;
- lastY = y ;
-
- lcd128x64orientCoordinates (&x, &y) ;
-
- if ((x < 0) || (x >= LCD_WIDTH) || (y < 0) || (y >= LCD_HEIGHT))
- return ;
-
- frameBuffer [x + y * LCD_WIDTH] = colour ;
-}
-
-
-/*
- * lcd128x64line: lcd128x64lineTo:
- * Classic Bressenham Line code
- *********************************************************************************
- */
-
-void lcd128x64line (int x0, int y0, int x1, int y1, int colour)
-{
- int dx, dy ;
- int sx, sy ;
- int err, e2 ;
-
- lastX = x1 ;
- lastY = y1 ;
-
- dx = abs (x1 - x0) ;
- dy = abs (y1 - y0) ;
-
- sx = (x0 < x1) ? 1 : -1 ;
- sy = (y0 < y1) ? 1 : -1 ;
-
- err = dx - dy ;
-
- for (;;)
- {
- lcd128x64point (x0, y0, colour) ;
-
- if ((x0 == x1) && (y0 == y1))
- break ;
-
- e2 = 2 * err ;
-
- if (e2 > -dy)
- {
- err -= dy ;
- x0 += sx ;
- }
-
- if (e2 < dx)
- {
- err += dx ;
- y0 += sy ;
- }
- }
-
-}
-
-void lcd128x64lineTo (int x, int y, int colour)
-{
- lcd128x64line (lastX, lastY, x, y, colour) ;
-}
-
-
-/*
- * lcd128x64rectangle:
- * A rectangle is a spoilt days fishing
- *********************************************************************************
- */
-
-void lcd128x64rectangle (int x1, int y1, int x2, int y2, int colour, int filled)
-{
- register int x ;
-
- if (filled)
- {
- /**/ if (x1 == x2)
- lcd128x64line (x1, y1, x2, y2, colour) ;
- else if (x1 < x2)
- for (x = x1 ; x <= x2 ; ++x)
- lcd128x64line (x, y1, x, y2, colour) ;
- else
- for (x = x2 ; x <= x1 ; ++x)
- lcd128x64line (x, y1, x, y2, colour) ;
- }
- else
- {
- lcd128x64line (x1, y1, x2, y1, colour) ;
- lcd128x64lineTo (x2, y2, colour) ;
- lcd128x64lineTo (x1, y2, colour) ;
- lcd128x64lineTo (x1, y1, colour) ;
- }
-}
-
-
-/*
- * lcd128x64circle:
- * This is the midpoint circle algorithm.
- *********************************************************************************
- */
-
-void lcd128x64circle (int x, int y, int r, int colour, int filled)
-{
- int ddF_x = 1 ;
- int ddF_y = -2 * r ;
-
- int f = 1 - r ;
- int x1 = 0 ;
- int y1 = r ;
-
- if (filled)
- {
- lcd128x64line (x, y + r, x, y - r, colour) ;
- lcd128x64line (x + r, y, x - r, y, colour) ;
- }
- else
- {
- lcd128x64point (x, y + r, colour) ;
- lcd128x64point (x, y - r, colour) ;
- lcd128x64point (x + r, y, colour) ;
- lcd128x64point (x - r, y, colour) ;
- }
-
- while (x1 < y1)
- {
- if (f >= 0)
- {
- y1-- ;
- ddF_y += 2 ;
- f += ddF_y ;
- }
- x1++ ;
- ddF_x += 2 ;
- f += ddF_x ;
- if (filled)
- {
- lcd128x64line (x + x1, y + y1, x - x1, y + y1, colour) ;
- lcd128x64line (x + x1, y - y1, x - x1, y - y1, colour) ;
- lcd128x64line (x + y1, y + x1, x - y1, y + x1, colour) ;
- lcd128x64line (x + y1, y - x1, x - y1, y - x1, colour) ;
- }
- else
- {
- lcd128x64point (x + x1, y + y1, colour) ; lcd128x64point (x - x1, y + y1, colour) ;
- lcd128x64point (x + x1, y - y1, colour) ; lcd128x64point (x - x1, y - y1, colour) ;
- lcd128x64point (x + y1, y + x1, colour) ; lcd128x64point (x - y1, y + x1, colour) ;
- lcd128x64point (x + y1, y - x1, colour) ; lcd128x64point (x - y1, y - x1, colour) ;
- }
- }
-}
-
-
-/*
- * lcd128x64ellipse:
- * Fast ellipse drawing algorithm by
- * John Kennedy
- * Mathematics Department
- * Santa Monica College
- * 1900 Pico Blvd.
- * Santa Monica, CA 90405
- * jrkennedy6@gmail.com
- * -Confirned in email this algorithm is in the public domain -GH-
- *********************************************************************************
- */
-
-static void plot4ellipsePoints (int cx, int cy, int x, int y, int colour, int filled)
-{
- if (filled)
- {
- lcd128x64line (cx + x, cy + y, cx - x, cy + y, colour) ;
- lcd128x64line (cx - x, cy - y, cx + x, cy - y, colour) ;
- }
- else
- {
- lcd128x64point (cx + x, cy + y, colour) ;
- lcd128x64point (cx - x, cy + y, colour) ;
- lcd128x64point (cx - x, cy - y, colour) ;
- lcd128x64point (cx + x, cy - y, colour) ;
- }
-}
-
-void lcd128x64ellipse (int cx, int cy, int xRadius, int yRadius, int colour, int filled)
-{
- int x, y ;
- int xChange, yChange, ellipseError ;
- int twoAsquare, twoBsquare ;
- int stoppingX, stoppingY ;
-
- twoAsquare = 2 * xRadius * xRadius ;
- twoBsquare = 2 * yRadius * yRadius ;
-
- x = xRadius ;
- y = 0 ;
-
- xChange = yRadius * yRadius * (1 - 2 * xRadius) ;
- yChange = xRadius * xRadius ;
-
- ellipseError = 0 ;
- stoppingX = twoBsquare * xRadius ;
- stoppingY = 0 ;
-
- while (stoppingX >= stoppingY) // 1st set of points
- {
- plot4ellipsePoints (cx, cy, x, y, colour, filled) ;
- ++y ;
- stoppingY += twoAsquare ;
- ellipseError += yChange ;
- yChange += twoAsquare ;
-
- if ((2 * ellipseError + xChange) > 0 )
- {
- --x ;
- stoppingX -= twoBsquare ;
- ellipseError += xChange ;
- xChange += twoBsquare ;
- }
- }
-
- x = 0 ;
- y = yRadius ;
-
- xChange = yRadius * yRadius ;
- yChange = xRadius * xRadius * (1 - 2 * yRadius) ;
-
- ellipseError = 0 ;
- stoppingX = 0 ;
- stoppingY = twoAsquare * yRadius ;
-
- while (stoppingX <= stoppingY) //2nd set of points
- {
- plot4ellipsePoints (cx, cy, x, y, colour, filled) ;
- ++x ;
- stoppingX += twoBsquare ;
- ellipseError += xChange ;
- xChange += twoBsquare ;
-
- if ((2 * ellipseError + yChange) > 0 )
- {
- --y ;
- stoppingY -= twoAsquare ;
- ellipseError += yChange ;
- yChange += twoAsquare ;
- }
- }
-}
-
-
-/*
- * lcd128x64putchar:
- * Print a single character to the screen
- *********************************************************************************
- */
-
-void lcd128x64putchar (int x, int y, int c, int bgCol, int fgCol)
-{
- int y1, y2 ;
-
- unsigned char line ;
- unsigned char *fontPtr ;
-
-// Can't print if we're offscreen
-
-//if ((x < 0) || (x >= (maxX - fontWidth)) || (y < 0) || (y >= (maxY - fontHeight)))
-// return ;
-
- fontPtr = font + c * fontHeight ;
-
- for (y1 = fontHeight - 1 ; y1 >= 0 ; --y1)
- {
- y2 = y + y1 ;
- line = *fontPtr++ ;
- lcd128x64point (x + 0, y2, (line & 0x80) == 0 ? bgCol : fgCol) ;
- lcd128x64point (x + 1, y2, (line & 0x40) == 0 ? bgCol : fgCol) ;
- lcd128x64point (x + 2, y2, (line & 0x20) == 0 ? bgCol : fgCol) ;
- lcd128x64point (x + 3, y2, (line & 0x10) == 0 ? bgCol : fgCol) ;
- lcd128x64point (x + 4, y2, (line & 0x08) == 0 ? bgCol : fgCol) ;
- lcd128x64point (x + 5, y2, (line & 0x04) == 0 ? bgCol : fgCol) ;
- lcd128x64point (x + 6, y2, (line & 0x02) == 0 ? bgCol : fgCol) ;
- lcd128x64point (x + 7, y2, (line & 0x01) == 0 ? bgCol : fgCol) ;
- }
-}
-
-
-/*
- * lcd128x64puts:
- * Send a string to the display. Obeys \n and \r formatting
- *********************************************************************************
- */
-
-void lcd128x64puts (int x, int y, const char *str, int bgCol, int fgCol)
-{
- int c, mx, my ;
-
- mx = x ; my = y ;
-
- while (*str)
- {
- c = *str++ ;
-
- if (c == '\r')
- {
- mx = x ;
- continue ;
- }
-
- if (c == '\n')
- {
- mx = x ;
- my -= fontHeight ;
- continue ;
- }
-
- lcd128x64putchar (mx, my, c, bgCol, fgCol) ;
-
- mx += fontWidth ;
- if (mx >= (maxX - fontWidth))
- {
- mx = 0 ;
- my -= fontHeight ;
- }
- }
-}
-
-
-/*
- * lcd128x64clear:
- * Clear the display to the given colour.
- *********************************************************************************
- */
-
-void lcd128x64clear (int colour)
-{
- register int i ;
- register unsigned char *ptr = frameBuffer ;
-
- for (i = 0 ; i < (maxX * maxY) ; ++i)
- *ptr++ = colour ;
-}
-
-
-
-
-/*
- * lcd128x64setup:
- * Initialise the display and GPIO.
- *********************************************************************************
- */
-
-int lcd128x64setup (void)
-{
- int i ;
-
- for (i = 0 ; i < 8 ; ++i)
- pinMode (i, OUTPUT) ;
-
- digitalWrite (CS1, 1) ;
- digitalWrite (CS2, 1) ;
- digitalWrite (STROBE, 0) ;
- digitalWrite (RS, 1) ;
-
- pinMode (CS1, OUTPUT) ;
- pinMode (CS2, OUTPUT) ;
- pinMode (STROBE, OUTPUT) ;
- pinMode (RS, OUTPUT) ;
-
- sendCommand (0x3F, CS1) ; // Display ON
- sendCommand (0xC0, CS1) ; // Set display start line to 0
-
- sendCommand (0x3F, CS2) ; // Display ON
- sendCommand (0xC0, CS2) ; // Set display start line to 0
-
- lcd128x64clear (0) ;
- lcd128x64setOrientation (0) ;
- lcd128x64update () ;
-
- return 0 ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/lcd128x64.h b/other/wiringpi/wiringPi-96344ff/devLib/lcd128x64.h
deleted file mode 100644
index b448bbc83..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/lcd128x64.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * lcd128x64.h:
- *
- * Copyright (c) 2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-extern void lcd128x64setOrigin (int x, int y) ;
-extern void lcd128x64setOrientation (int orientation) ;
-extern void lcd128x64orientCoordinates (int *x, int *y) ;
-extern void lcd128x64getScreenSize (int *x, int *y) ;
-extern void lcd128x64point (int x, int y, int colour) ;
-extern void lcd128x64line (int x0, int y0, int x1, int y1, int colour) ;
-extern void lcd128x64lineTo (int x, int y, int colour) ;
-extern void lcd128x64rectangle (int x1, int y1, int x2, int y2, int colour, int filled) ;
-extern void lcd128x64circle (int x, int y, int r, int colour, int filled) ;
-extern void lcd128x64ellipse (int cx, int cy, int xRadius, int yRadius, int colour, int filled) ;
-extern void lcd128x64putchar (int x, int y, int c, int bgCol, int fgCol) ;
-extern void lcd128x64puts (int x, int y, const char *str, int bgCol, int fgCol) ;
-extern void lcd128x64update (void) ;
-extern void lcd128x64clear (int colour) ;
-
-extern int lcd128x64setup (void) ;
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/maxdetect.c b/other/wiringpi/wiringPi-96344ff/devLib/maxdetect.c
deleted file mode 100755
index 74ff70e9b..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/maxdetect.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * maxdetect.c:
- * Driver for the MaxDetect series sensors
- *
- * Copyright (c) 2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#include
-#include
-//#include
-//#include
-
-#include
-
-#include "maxdetect.h"
-
-#ifndef TRUE
-# define TRUE (1==1)
-# define FALSE (1==2)
-#endif
-
-
-/*
- * maxDetectLowHighWait:
- * Wait for a transition from low to high on the bus
- *********************************************************************************
- */
-
-static int maxDetectLowHighWait (const int pin)
-{
- struct timeval now, timeOut, timeUp ;
-
-// If already high then wait for pin to go low
-
- gettimeofday (&now, NULL) ;
- timerclear (&timeOut) ;
- timeOut.tv_usec = 1000 ;
- timeradd (&now, &timeOut, &timeUp) ;
-
- while (digitalRead (pin) == HIGH)
- {
- gettimeofday (&now, NULL) ;
- if (timercmp (&now, &timeUp, >))
- return FALSE ;
- }
-
-// Wait for it to go HIGH
-
- gettimeofday (&now, NULL) ;
- timerclear (&timeOut) ;
- timeOut.tv_usec = 1000 ;
- timeradd (&now, &timeOut, &timeUp) ;
-
- while (digitalRead (pin) == LOW)
- {
- gettimeofday (&now, NULL) ;
- if (timercmp (&now, &timeUp, >))
- return FALSE ;
- }
-
- return TRUE ;
-}
-
-
-/*
- * maxDetectClockByte:
- * Read in a single byte from the MaxDetect bus
- *********************************************************************************
- */
-
-static unsigned int maxDetectClockByte (const int pin)
-{
- unsigned int byte = 0 ;
- int bit ;
-
- for (bit = 0 ; bit < 8 ; ++bit)
- {
- if (!maxDetectLowHighWait (pin))
- return 0 ;
-
-// bit starting now - we need to time it.
-
- delayMicroseconds (30) ;
- byte <<= 1 ;
- if (digitalRead (pin) == HIGH) // It's a 1
- byte |= 1 ;
- }
-
- return byte ;
-}
-
-
-/*
- * maxDetectRead:
- * Read in and return the 4 data bytes from the MaxDetect sensor.
- * Return TRUE/FALSE depending on the checksum validity
- *********************************************************************************
- */
-
-int maxDetectRead (const int pin, unsigned char buffer [4])
-{
- int i ;
- unsigned int checksum ;
- unsigned char localBuf [5] ;
- struct timeval now, then, took ;
-
-// See how long we took
-
- gettimeofday (&then, NULL) ;
-
-// Wake up the RHT03 by pulling the data line low, then high
-// Low for 10mS, high for 40uS.
-
- pinMode (pin, OUTPUT) ;
- digitalWrite (pin, 0) ; delay (10) ;
- digitalWrite (pin, 1) ; delayMicroseconds (40) ;
- pinMode (pin, INPUT) ;
-
-// Now wait for sensor to pull pin low
-
- if (!maxDetectLowHighWait (pin))
- return FALSE ;
-
-// and read in 5 bytes (40 bits)
-
- for (i = 0 ; i < 5 ; ++i)
- localBuf [i] = maxDetectClockByte (pin) ;
-
- checksum = 0 ;
- for (i = 0 ; i < 4 ; ++i)
- {
- buffer [i] = localBuf [i] ;
- checksum += localBuf [i] ;
- }
- checksum &= 0xFF ;
-
-// See how long we took
-
- gettimeofday (&now, NULL) ;
- timersub (&now, &then, &took) ;
-
-// Total time to do this should be:
-// 10mS + 40µS - reset
-// + 80µS + 80µS - sensor doing its low -> high thing
-// + 40 * (50µS + 27µS (0) or 70µS (1) )
-// = 15010µS
-// so if we take more than that, we've had a scheduling interruption and the
-// reading is probably bogus.
-
- if ((took.tv_sec != 0) || (took.tv_usec > 16000))
- return FALSE ;
-
- return checksum == localBuf [4] ;
-}
-
-
-/*
- * readRHT03:
- * Read the Temperature & Humidity from an RHT03 sensor
- * Values returned are *10, so 123 is 12.3.
- *********************************************************************************
- */
-
-int readRHT03 (const int pin, int *temp, int *rh)
-{
- static struct timeval then ; // will initialise to zero
- static int lastTemp = 0 ;
- static int lastRh = 0 ;
-
- int result ;
- struct timeval now, timeOut ;
- unsigned char buffer [4] ;
-
-// The data sheets say to not read more than once every 2 seconds, so you
-// get the last good reading
-
- gettimeofday (&now, NULL) ;
- if (timercmp (&now, &then, <))
- {
- *rh = lastRh ;
- *temp = lastTemp ;
- return TRUE ;
- }
-
-// Set timeout for next read
-
- gettimeofday (&now, NULL) ;
- timerclear (&timeOut) ;
- timeOut.tv_sec = 2 ;
- timeradd (&now, &timeOut, &then) ;
-
-// Read ...
-
- result = maxDetectRead (pin, buffer) ;
-
- if (!result) // Try again, but just once
- result = maxDetectRead (pin, buffer) ;
-
- if (!result)
- return FALSE ;
-
- *rh = (buffer [0] * 256 + buffer [1]) ;
- *temp = (buffer [2] * 256 + buffer [3]) ;
-
- if ((*temp & 0x8000) != 0) // Negative
- {
- *temp &= 0x7FFF ;
- *temp = -*temp ;
- }
-
-// Discard obviously bogus readings - the checksum can't detect a 2-bit error
-// (which does seem to happen - no realtime here)
-
- if ((*rh > 999) || (*temp > 800) || (*temp < -400))
- return FALSE ;
-
- lastRh = *rh ;
- lastTemp = *temp ;
-
- return TRUE ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/maxdetect.h b/other/wiringpi/wiringPi-96344ff/devLib/maxdetect.h
deleted file mode 100755
index a1fd742e4..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/maxdetect.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * maxdetect.h:
- * Driver for the MaxDetect series sensors
- *
- * Copyright (c) 2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// Main generic function
-
-int maxDetectRead (const int pin, unsigned char buffer [4]) ;
-
-// Individual sensors
-
-int readRHT03 (const int pin, int *temp, int *rh) ;
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/piFace.c b/other/wiringpi/wiringPi-96344ff/devLib/piFace.c
deleted file mode 100644
index 4475c7f5b..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/piFace.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * piFace.:
- * This file to interface with the PiFace peripheral device which
- * has an MCP23S17 GPIO device connected via the SPI bus.
- *
- * Copyright (c) 2012-2013 Gordon Henderson
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the
- * License, or (at your option) any later version.
- *
- * wiringPi 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 wiringPi.
- * If not, see .
- ***********************************************************************
- */
-
-
-#include
-#include
-
-#include
-#include
-
-#include "piFace.h"
-
-
-/*
- * myDigitalWrite:
- * Perform the digitalWrite function on the PiFace board
- *********************************************************************************
- */
-
-void myDigitalWrite (struct wiringPiNodeStruct *node, int pin, int value)
-{
- digitalWrite (pin + 16, value) ;
-}
-
-
-/*
- * myDigitalRead:
- * Perform the digitalRead function on the PiFace board
- * With a slight twist - if we read from base + 8, then we
- * read from the output latch...
- *********************************************************************************
- */
-
-int myDigitalRead (struct wiringPiNodeStruct *node, int pin)
-{
- if ((pin - node->pinBase) >= 8)
- return digitalRead (pin + 8) ;
- else
- return digitalRead (pin + 16 + 8) ;
-}
-
-
-/*
- * myPullUpDnControl:
- * Perform the pullUpDnControl function on the PiFace board
- *********************************************************************************
- */
-
-void myPullUpDnControl (struct wiringPiNodeStruct *node, int pin, int pud)
-{
- pullUpDnControl (pin + 16 + 8, pud) ;
-}
-
-
-/*
- * piFaceSetup
- * We're going to create an instance of the mcp23s17 here, then
- * provide our own read/write routines on-top of it...
- * The supplied PiFace code (in Pithon) treats it as an 8-bit device
- * where you write the output ports and read the input port using the
- * same pin numbers, however I have had a request to be able to read
- * the output port, so reading 8..15 will read the output latch.
- *********************************************************************************
- */
-
-int piFaceSetup (const int pinBase)
-{
- int i ;
- struct wiringPiNodeStruct *node ;
-
-// Create an mcp23s17 instance:
-
- mcp23s17Setup (pinBase + 16, 0, 0) ;
-
-// Set the direction bits
-
- for (i = 0 ; i < 8 ; ++i)
- {
- pinMode (pinBase + 16 + i, OUTPUT) ; // Port A is the outputs
- pinMode (pinBase + 16 + 8 + i, INPUT) ; // Port B inputs.
- }
-
- node = wiringPiNewNode (pinBase, 16) ;
- node->digitalRead = myDigitalRead ;
- node->digitalWrite = myDigitalWrite ;
- node->pullUpDnControl = myPullUpDnControl ;
-
- return 0 ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/piFace.h b/other/wiringpi/wiringPi-96344ff/devLib/piFace.h
deleted file mode 100644
index 49653144e..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/piFace.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * piFace.h:
- * Control the PiFace Interface board for the Raspberry Pi
- * Copyright (c) 2012-2013 Gordon Henderson
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int piFaceSetup (const int pinBase) ;
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/piFaceOld.c b/other/wiringpi/wiringPi-96344ff/devLib/piFaceOld.c
deleted file mode 100644
index cadbfe80d..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/piFaceOld.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * piFace.:
- * Copyright (c) 2012-2016 Gordon Henderson
- *
- * This file to interface with the PiFace peripheral device which
- * has an MCP23S17 GPIO device connected via the SPI bus.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the
- * License, or (at your option) any later version.
- *
- * wiringPi 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 wiringPi.
- * If not, see .
- ***********************************************************************
- */
-
-
-#include
-#include
-
-#include
-#include
-
-#include "../wiringPi/mcp23x0817.h"
-
-#include "piFace.h"
-
-#define PIFACE_SPEED 4000000
-#define PIFACE_DEVNO 0
-
-
-
-/*
- * writeByte:
- * Write a byte to a register on the MCP23S17 on the SPI bus.
- *********************************************************************************
- */
-
-static void writeByte (uint8_t reg, uint8_t data)
-{
- uint8_t spiData [4] ;
-
- spiData [0] = CMD_WRITE ;
- spiData [1] = reg ;
- spiData [2] = data ;
-
- wiringPiSPIDataRW (PIFACE_DEVNO, spiData, 3) ;
-}
-
-/*
- * readByte:
- * Read a byte from a register on the MCP23S17 on the SPI bus.
- *********************************************************************************
- */
-
-static uint8_t readByte (uint8_t reg)
-{
- uint8_t spiData [4] ;
-
- spiData [0] = CMD_READ ;
- spiData [1] = reg ;
-
- wiringPiSPIDataRW (PIFACE_DEVNO, spiData, 3) ;
-
- return spiData [2] ;
-}
-
-
-/*
- * myDigitalWrite:
- * Perform the digitalWrite function on the PiFace board
- *********************************************************************************
- */
-
-void myDigitalWrite (struct wiringPiNodeStruct *node, int pin, int value)
-{
- uint8_t mask, old ;
-
- pin -= node->pinBase ;
- mask = 1 << pin ;
- old = readByte (MCP23x17_GPIOA) ;
-
- if (value == 0)
- old &= (~mask) ;
- else
- old |= mask ;
-
- writeByte (MCP23x17_GPIOA, old) ;
-}
-
-
-/*
- * myDigitalRead:
- * Perform the digitalRead function on the PiFace board
- *********************************************************************************
- */
-
-int myDigitalRead (struct wiringPiNodeStruct *node, int pin)
-{
- uint8_t mask, reg ;
-
- mask = 1 << ((pin - node->pinBase) & 7) ;
-
- if (pin < 8)
- reg = MCP23x17_GPIOB ; // Input regsiter
- else
- reg = MCP23x17_OLATA ; // Output latch regsiter
-
- if ((readByte (reg) & mask) != 0)
- return HIGH ;
- else
- return LOW ;
-}
-
-
-/*
- * myPullUpDnControl:
- * Perform the pullUpDnControl function on the PiFace board
- *********************************************************************************
- */
-
-void myPullUpDnControl (struct wiringPiNodeStruct *node, int pin, int pud)
-{
- uint8_t mask, old ;
-
- mask = 1 << (pin - node->pinBase) ;
- old = readByte (MCP23x17_GPPUB) ;
-
- if (pud == 0)
- old &= (~mask) ;
- else
- old |= mask ;
-
- writeByte (MCP23x17_GPPUB, old) ;
-}
-
-
-/*
- * piFaceSetup
- * Setup the SPI interface and initialise the MCP23S17 chip
- * We create one node with 16 pins - each if the first 8 pins being read
- * and write - although the operations actually go to different
- * hardware ports. The top 8 let you read the state of the output register.
- *********************************************************************************
- */
-
-int piFaceSetup (const int pinBase)
-{
- int x ;
- struct wiringPiNodeStruct *node ;
-
- if ((x = wiringPiSPISetup (PIFACE_DEVNO, PIFACE_SPEED)) < 0)
- return x ;
-
-// Setup the MCP23S17
-
- writeByte (MCP23x17_IOCON, IOCON_INIT) ;
- writeByte (MCP23x17_IODIRA, 0x00) ; // Port A -> Outputs
- writeByte (MCP23x17_IODIRB, 0xFF) ; // Port B -> Inputs
-
- node = wiringPiNewNode (pinBase, 16) ;
- node->digitalRead = myDigitalRead ;
- node->digitalWrite = myDigitalWrite ;
- node->pullUpDnControl = myPullUpDnControl ;
-
- return 0 ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/piGlow.c b/other/wiringpi/wiringPi-96344ff/devLib/piGlow.c
deleted file mode 100644
index 44e3db8e5..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/piGlow.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * piGlow.c:
- * Easy access to the Pimoroni PiGlow board.
- *
- * Copyright (c) 2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#include
-#include
-
-#include "piGlow.h"
-
-#define PIGLOW_BASE 577
-
-static int leg0 [6] = { 6, 7, 8, 5, 4, 9 } ;
-static int leg1 [6] = { 17, 16, 15, 13, 11, 10 } ;
-static int leg2 [6] = { 0, 1, 2, 3, 14, 12 } ;
-
-
-/*
- * piGlow1:
- * Light up an individual LED
- *********************************************************************************
- */
-
-void piGlow1 (const int leg, const int ring, const int intensity)
-{
- int *legLeds ;
-
- if ((leg < 0) || (leg > 2)) return ;
- if ((ring < 0) || (ring > 5)) return ;
-
- /**/ if (leg == 0)
- legLeds = leg0 ;
- else if (leg == 1)
- legLeds = leg1 ;
- else
- legLeds = leg2 ;
-
- analogWrite (PIGLOW_BASE + legLeds [ring], intensity) ;
-}
-
-/*
- * piGlowLeg:
- * Light up all 6 LEDs on a leg
- *********************************************************************************
- */
-
-void piGlowLeg (const int leg, const int intensity)
-{
- int i ;
- int *legLeds ;
-
- if ((leg < 0) || (leg > 2))
- return ;
-
- /**/ if (leg == 0)
- legLeds = leg0 ;
- else if (leg == 1)
- legLeds = leg1 ;
- else
- legLeds = leg2 ;
-
- for (i = 0 ; i < 6 ; ++i)
- analogWrite (PIGLOW_BASE + legLeds [i], intensity) ;
-}
-
-
-/*
- * piGlowRing:
- * Light up 3 LEDs in a ring. Ring 0 is the outermost, 5 the innermost
- *********************************************************************************
- */
-
-void piGlowRing (const int ring, const int intensity)
-{
- if ((ring < 0) || (ring > 5))
- return ;
-
- analogWrite (PIGLOW_BASE + leg0 [ring], intensity) ;
- analogWrite (PIGLOW_BASE + leg1 [ring], intensity) ;
- analogWrite (PIGLOW_BASE + leg2 [ring], intensity) ;
-}
-
-/*
- * piGlowSetup:
- * Initialise the board & remember the pins we're using
- *********************************************************************************
- */
-
-void piGlowSetup (int clear)
-{
- sn3218Setup (PIGLOW_BASE) ;
-
- if (clear)
- {
- piGlowLeg (0, 0) ;
- piGlowLeg (1, 0) ;
- piGlowLeg (2, 0) ;
- }
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/piGlow.h b/other/wiringpi/wiringPi-96344ff/devLib/piGlow.h
deleted file mode 100644
index a4d89d01b..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/piGlow.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * piglow.h:
- * Easy access to the Pimoroni PiGlow board.
- *
- * Copyright (c) 2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-
-#define PIGLOW_RED 0
-#define PIGLOW_ORANGE 1
-#define PIGLOW_YELLOW 2
-#define PIGLOW_GREEN 3
-#define PIGLOW_BLUE 4
-#define PIGLOW_WHITE 5
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void piGlow1 (const int leg, const int ring, const int intensity) ;
-extern void piGlowLeg (const int leg, const int intensity) ;
-extern void piGlowRing (const int ring, const int intensity) ;
-extern void piGlowSetup (int clear) ;
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/piNes.c b/other/wiringpi/wiringPi-96344ff/devLib/piNes.c
deleted file mode 100644
index a115050e8..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/piNes.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * piNes.c:
- * Driver for the NES Joystick controller on the Raspberry Pi
- * Copyright (c) 2012 Gordon Henderson
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the
- * License, or (at your option) any later version.
- *
- * wiringPi 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 wiringPi.
- * If not, see .
- ***********************************************************************
- */
-
-#include
-
-#include "piNes.h"
-
-#define MAX_NES_JOYSTICKS 8
-
-#define NES_RIGHT 0x01
-#define NES_LEFT 0x02
-#define NES_DOWN 0x04
-#define NES_UP 0x08
-#define NES_START 0x10
-#define NES_SELECT 0x20
-#define NES_B 0x40
-#define NES_A 0x80
-
-
-#define PULSE_TIME 25
-
-// Data to store the pins for each controller
-
-struct nesPinsStruct
-{
- unsigned int cPin, dPin, lPin ;
-} ;
-
-static struct nesPinsStruct nesPins [MAX_NES_JOYSTICKS] ;
-
-static int joysticks = 0 ;
-
-
-/*
- * setupNesJoystick:
- * Create a new NES joystick interface, program the pins, etc.
- *********************************************************************************
- */
-
-int setupNesJoystick (int dPin, int cPin, int lPin)
-{
- if (joysticks == MAX_NES_JOYSTICKS)
- return -1 ;
-
- nesPins [joysticks].dPin = dPin ;
- nesPins [joysticks].cPin = cPin ;
- nesPins [joysticks].lPin = lPin ;
-
- digitalWrite (lPin, LOW) ;
- digitalWrite (cPin, LOW) ;
-
- pinMode (lPin, OUTPUT) ;
- pinMode (cPin, OUTPUT) ;
- pinMode (dPin, INPUT) ;
-
- return joysticks++ ;
-}
-
-
-/*
- * readNesJoystick:
- * Do a single scan of the NES Joystick.
- *********************************************************************************
- */
-
-unsigned int readNesJoystick (int joystick)
-{
- unsigned int value = 0 ;
- int i ;
-
- struct nesPinsStruct *pins = &nesPins [joystick] ;
-
-// Toggle Latch - which presents the first bit
-
- digitalWrite (pins->lPin, HIGH) ; delayMicroseconds (PULSE_TIME) ;
- digitalWrite (pins->lPin, LOW) ; delayMicroseconds (PULSE_TIME) ;
-
-// Read first bit
-
- value = digitalRead (pins->dPin) ;
-
-// Now get the next 7 bits with the clock
-
- for (i = 0 ; i < 7 ; ++i)
- {
- digitalWrite (pins->cPin, HIGH) ; delayMicroseconds (PULSE_TIME) ;
- digitalWrite (pins->cPin, LOW) ; delayMicroseconds (PULSE_TIME) ;
- value = (value << 1) | digitalRead (pins->dPin) ;
- }
-
- return value ^ 0xFF ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/piNes.h b/other/wiringpi/wiringPi-96344ff/devLib/piNes.h
deleted file mode 100644
index 897f18159..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/piNes.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * piNes.h:
- * Driver for the NES Joystick controller on the Raspberry Pi
- * Copyright (c) 2012 Gordon Henderson
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the
- * License, or (at your option) any later version.
- *
- * wiringPi 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 wiringPi.
- * If not, see .
- ***********************************************************************
- */
-
-#define MAX_NES_JOYSTICKS 8
-
-#define NES_RIGHT 0x01
-#define NES_LEFT 0x02
-#define NES_DOWN 0x04
-#define NES_UP 0x08
-#define NES_START 0x10
-#define NES_SELECT 0x20
-#define NES_B 0x40
-#define NES_A 0x80
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int setupNesJoystick (int dPin, int cPin, int lPin) ;
-extern unsigned int readNesJoystick (int joystick) ;
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/scrollPhat.c b/other/wiringpi/wiringPi-96344ff/devLib/scrollPhat.c
deleted file mode 100644
index c1a6f1103..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/scrollPhat.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * scrollPhat.c:
- * Simple driver for the Pimoroni Scroll Phat device
- *
- * Copyright (c) 2015 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include "scrollPhatFont.h"
-#include "scrollPhat.h"
-
-// Size
-
-#define SP_WIDTH 11
-#define SP_HEIGHT 5
-
-// I2C
-
-#define PHAT_I2C_ADDR 0x60
-
-// Software copy of the framebuffer
-// it's 8-bit deep although the display itself is only 1-bit deep.
-
-static unsigned char frameBuffer [SP_WIDTH * SP_HEIGHT] ;
-
-static int lastX, lastY ;
-static int printDelayFactor ;
-static int scrollPhatFd ;
-
-static int putcharX ;
-
-#undef DEBUG
-
-
-/*
- * delay:
- * Wait for some number of milliseconds.
- * This taken from wiringPi as there is no-need to include the whole of
- * wiringPi just for the delay function.
- *********************************************************************************
- */
-
-static void delay (unsigned int howLong)
-{
- struct timespec sleeper, dummy ;
-
- sleeper.tv_sec = (time_t)(howLong / 1000) ;
- sleeper.tv_nsec = (long)(howLong % 1000) * 1000000 ;
-
- nanosleep (&sleeper, &dummy) ;
-}
-
-
-
-/*
- * scrollPhatUpdate:
- * Copy our software version to the real display
- *********************************************************************************
- */
-
-void scrollPhatUpdate (void)
-{
- register int x, y ;
- register unsigned char data, pixel ;
- unsigned char pixels [SP_WIDTH] ;
-
-#ifdef DEBUG
- printf ("+-----------+\n") ;
- for (y = 0 ; y < SP_HEIGHT ; ++y)
- {
- putchar ('|') ;
- for (x = 0 ; x < SP_WIDTH ; ++x)
- {
- pixel = frameBuffer [x + y * SP_WIDTH] ;
- putchar (pixel == 0 ? ' ' : '*') ;
- }
- printf ("|\n") ;
- }
- printf ("+-----------+\n") ;
-#endif
-
- for (x = 0 ; x < SP_WIDTH ; ++x)
- {
- data = 0 ;
- for (y = 0 ; y < SP_HEIGHT ; ++y)
- {
- pixel = frameBuffer [x + y * SP_WIDTH] ;
- data = (data << 1) | ((pixel == 0) ? 0 : 1) ;
- }
- pixels [x] = data ;
- }
-
- for (x = 0 ; x < SP_WIDTH ; ++x)
- wiringPiI2CWriteReg8 (scrollPhatFd, 1 + x, pixels [x]) ;
-
- wiringPiI2CWriteReg8 (scrollPhatFd, 0x0C, 0) ;
-}
-
-
-/*
- *********************************************************************************
- * Standard Graphical Functions
- *********************************************************************************
- */
-
-
-/*
- * scrollPhatPoint:
- * Plot a pixel. Crude clipping - speed is not the essence here.
- *********************************************************************************
- */
-
-void scrollPhatPoint (int x, int y, int colour)
-{
- lastX = x ;
- lastY = y ;
-
- if ((x < 0) || (x >= SP_WIDTH) || (y < 0) || (y >= SP_HEIGHT))
- return ;
-
- frameBuffer [x + y * SP_WIDTH] = colour ;
-}
-
-
-/*
- * scrollPhatLine: scrollPhatLineTo:
- * Classic Bressenham Line code - rely on the point function to do the
- * clipping for us here.
- *********************************************************************************
- */
-
-void scrollPhatLine (int x0, int y0, int x1, int y1, int colour)
-{
- int dx, dy ;
- int sx, sy ;
- int err, e2 ;
-
- lastX = x1 ;
- lastY = y1 ;
-
- dx = abs (x1 - x0) ;
- dy = abs (y1 - y0) ;
-
- sx = (x0 < x1) ? 1 : -1 ;
- sy = (y0 < y1) ? 1 : -1 ;
-
- err = dx - dy ;
-
- for (;;)
- {
- scrollPhatPoint (x0, y0, colour) ;
-
- if ((x0 == x1) && (y0 == y1))
- break ;
-
- e2 = 2 * err ;
-
- if (e2 > -dy)
- {
- err -= dy ;
- x0 += sx ;
- }
-
- if (e2 < dx)
- {
- err += dx ;
- y0 += sy ;
- }
- }
-
-}
-
-void scrollPhatLineTo (int x, int y, int colour)
-{
- scrollPhatLine (lastX, lastY, x, y, colour) ;
-}
-
-
-/*
- * scrollPhatRectangle:
- * A rectangle is a spoilt days fishing
- *********************************************************************************
- */
-
-void scrollPhatRectangle (int x1, int y1, int x2, int y2, int colour, int filled)
-{
- register int x ;
-
- if (filled)
- {
- /**/ if (x1 == x2)
- scrollPhatLine (x1, y1, x2, y2, colour) ;
- else if (x1 < x2)
- for (x = x1 ; x <= x2 ; ++x)
- scrollPhatLine (x, y1, x, y2, colour) ;
- else
- for (x = x2 ; x <= x1 ; ++x)
- scrollPhatLine (x, y1, x, y2, colour) ;
- }
- else
- {
- scrollPhatLine (x1, y1, x2, y1, colour) ;
- scrollPhatLineTo (x2, y2, colour) ;
- scrollPhatLineTo (x1, y2, colour) ;
- scrollPhatLineTo (x1, y1, colour) ;
- }
-}
-
-
-/*
- * scrollPhatPutchar:
- * Print a single character to the screen then advance the pointer by an
- * appropriate ammount (variable width font).
- * We rely on the clipping done by the pixel plot function to keep us
- * out of trouble.
- * Return the width + space
- *********************************************************************************
- */
-
-int scrollPhatPutchar (int c)
-{
- register int x, y ;
-
- unsigned char line ;
- unsigned char *fontPtr ;
- unsigned char *p2 ;
- int lineWidth, width, mask ;
-
-// The font is printable characters, uppercase only...
-// and somewhat varaible width...
-
- c &= 0x7F ;
- if (c > 0x60)
- c -= 64 ;
- else
- c -= 32 ;
-
- fontPtr = scrollPhatFont + c * fontHeight ;
-
-// Work out width of this character
-// There probably is a more efficient way to do this, but...
-
- p2 = fontPtr ;
- width = 0 ;
- for (y = 0 ; y < fontHeight ; ++y)
- {
- mask = 0x80 ;
- for (lineWidth = 8 ; lineWidth > 0 ; --lineWidth)
- {
- if ((*p2 & mask) != 0)
- break ;
- mask >>= 1 ;
- }
- if (lineWidth > width)
- width = lineWidth ;
-
- ++p2 ;
- }
-
- if (width == 0) // Likely to be a blank or space character
- width = 3 ;
-
- for (y = fontHeight - 1 ; y >= 0 ; --y)
- {
- x = 0 ;
- line = *fontPtr++ ;
- for (mask = 1 << (width - 1) ; mask != 0 ; mask >>= 1)
- {
- scrollPhatPoint (putcharX + x, y, (line & mask)) ;
- ++x ;
- }
- }
-
-// make a line of space
-
- for (y = fontHeight - 1 ; y >= 0 ; --y)
- scrollPhatPoint (putcharX + width, y, 0) ;
-
- putcharX = putcharX + width + 1 ;
-
- return width + 1 ;
-}
-
-
-/*
- * scrollPhatPuts:
- * Send a string to the display - and scroll it across.
- * This is somewhat of a hack in that we print the entire string to the
- * display and let the point clipping take care of what's off-screen...
- *********************************************************************************
- */
-
-void scrollPhatPuts (const char *str)
-{
- int i ;
- int movingX = 0 ;
- const char *s ;
- int pixelLen ;
-
-// Print it once, then we know the width in pixels...
-
- putcharX = 0 ;
- s = str ;
- while (*s)
- scrollPhatPutchar (*s++) ;
-
- pixelLen = putcharX ;
-
-// Now scroll it by printing it and moving left one pixel
-
- movingX = 0 ;
- for (i = 0 ; i < pixelLen ; ++i)
- {
- putcharX = movingX ;
- s = str ;
- while (*s)
- scrollPhatPutchar (*s++) ;
- --movingX ;
- scrollPhatUpdate () ;
- delay (printDelayFactor) ;
- }
-}
-
-
-/*
- * scrollPhatPrintf:
- * Does what it says
- *********************************************************************************
- */
-
-void scrollPhatPrintf (const char *message, ...)
-{
- va_list argp ;
- char buffer [1024] ;
-
- va_start (argp, message) ;
- vsnprintf (buffer, 1023, message, argp) ;
- va_end (argp) ;
-
- scrollPhatPuts (buffer) ;
-}
-
-
-/*
- * scrollPhatPrintSpeed:
- * Change the print speed - mS per shift by 1 pixel
- *********************************************************************************
- */
-
-void scrollPhatPrintSpeed (const int pps)
-{
- if (pps < 0)
- printDelayFactor = 0 ;
- else
- printDelayFactor = pps ;
-}
-
-
-/*
- * scrollPhatClear:
- * Clear the display
- *********************************************************************************
- */
-
-void scrollPhatClear (void)
-{
- register int i ;
- register unsigned char *ptr = frameBuffer ;
-
- for (i = 0 ; i < (SP_WIDTH * SP_HEIGHT) ; ++i)
- *ptr++ = 0 ;
-
- scrollPhatUpdate () ;
-}
-
-
-/*
- * scrollPhatIntensity:
- * Set the display brightness - percentage
- *********************************************************************************
- */
-
-void scrollPhatIntensity (const int percent)
-{
- wiringPiI2CWriteReg8 (scrollPhatFd, 0x19, (127 * percent) / 100) ;
-}
-
-
-/*
- * scrollPhatSetup:
- * Initialise the Scroll Phat display
- *********************************************************************************
- */
-
-int scrollPhatSetup (void)
-{
- if ((scrollPhatFd = wiringPiI2CSetup (PHAT_I2C_ADDR)) < 0)
- return scrollPhatFd ;
-
- wiringPiI2CWriteReg8 (scrollPhatFd, 0x00, 0x03) ; // Enable display, set to 5x11 mode
- scrollPhatIntensity (10) ;
- scrollPhatClear () ;
- scrollPhatPrintSpeed (100) ;
-
- return 0 ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/scrollPhat.h b/other/wiringpi/wiringPi-96344ff/devLib/scrollPhat.h
deleted file mode 100644
index 0e762b127..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/scrollPhat.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * scrollPhat.h:
- * Simple driver for the Pimoroni Scroll Phat device
- *
- * Copyright (c) 2015 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-extern void scrollPhatPoint (int x, int y, int colour) ;
-extern void scrollPhatLine (int x0, int y0, int x1, int y1, int colour) ;
-extern void scrollPhatLineTo (int x, int y, int colour) ;
-extern void scrollPhatRectangle (int x1, int y1, int x2, int y2, int colour, int filled) ;
-extern void scrollPhatUpdate (void) ;
-extern void scrollPhatClear (void) ;
-
-extern int scrollPhatPutchar (int c) ;
-//extern void scrollPhatPutchar (int c) ;
-extern void scrollPhatPuts (const char *str) ;
-extern void scrollPhatPrintf (const char *message, ...) ;
-extern void scrollPhatPrintSpeed (const int cps10) ;
-
-extern void scrollPhatIntensity (const int percent) ;
-extern int scrollPhatSetup (void) ;
diff --git a/other/wiringpi/wiringPi-96344ff/devLib/scrollPhatFont.h b/other/wiringpi/wiringPi-96344ff/devLib/scrollPhatFont.h
deleted file mode 100644
index 92f623ac4..000000000
--- a/other/wiringpi/wiringPi-96344ff/devLib/scrollPhatFont.h
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * scrollPhatFont.h:
- * Simple font for the Pimoroni Scroll Phat.
- * Note: this is a very much reduced font - 5 pixels high and
- * mostly 4 pixels wide - sometimes 5. Also only
- * printable characters from space to _ uppercase only.
- *
- * Copyright (c) 2015-2016 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-static const int fontHeight = 5 ;
-
-static unsigned char scrollPhatFont [] =
-{
-
-// 0x20, Space. Handeled as a special case in the code.
-
- 0x0, // ....
- 0x0, // ....
- 0x0, // ....
- 0x0, // ....
- 0x0, // ....
-
-// 0x21, !
-
- 0x1, // *
- 0x1, // *
- 0x1, // *
- 0x0, // .
- 0x1, // *
-
-// 0x22, "
-
- 0x5, // *..*
- 0x5, // *..*
- 0x0, // ....
- 0x0, // ....
- 0x0, // ....
-
-// 0x23, #
-
- 0x9, // *..*
- 0xF, // ****
- 0x9, // *..*
- 0xF, // ****
- 0x9, // *..*
-
-// 0x24, $
-
- 0x1, // ..*.
- 0x7, // .***
- 0x2, // ..*.
- 0xE, // ***.
- 0x8, // ..*.
-
-// 0x25, %
-
- 0x9, // *..*
- 0x1, // ...*
- 0x6, // .**.
- 0x8, // *...
- 0x9, // *..*
-
-// 0x26, &
-
- 0x6, // .**.
- 0x8, // *...
- 0x4, // .*..
- 0xA, // *.*.
- 0x5, // .*.*
-
-// 0x27, '
-
- 0x1, // .*
- 0x2, // *.
- 0x0, // ..
- 0x0, // ..
- 0x0, // ..
-
-// 0x28, (
-
- 0x3, // ..**
- 0x4, // .*..
- 0x8, // *...
- 0x4, // .*..
- 0x3, // ..**
-
-// 0x29, )
-
- 0xC, // **..
- 0x2, // ..*.
- 0x1, // ...*
- 0x2, // ..*.
- 0xC, // **..
-
-// 0x2A, *
-
- 0x9, // *..*
- 0x6, // .**.
- 0xF, // ****
- 0x6, // .**.
- 0x9, // *..*
-
-// 0x2B, +
-
- 0x6, // .**.
- 0x6, // .**.
- 0xF, // ****
- 0x6, // .**.
- 0x6, // .**.
-
-// 0x2C, ,
-
- 0x0, // ..
- 0x0, // ..
- 0x0, // ..
- 0x1, // .*
- 0x2, // *.
-
-// 0x2D, -
-
- 0x0, // ....
- 0x0, // ....
- 0xF, // ****
- 0x0, // ....
- 0x0, // ....
-
-// 0x2E, .
-
- 0x0, // .
- 0x0, // .
- 0x0, // .
- 0x0, // .
- 0x1, // *
-
-// 0x2F, /
-
- 0x1, // ...*
- 0x3, // ..**
- 0x4, // ..*.
- 0xC, // **..
- 0x8, // *...
-
-// 0x30, 0
-
- 0x6, // .**.
- 0x9, // *..*
- 0x9, // *..*
- 0x9, // *..*
- 0x6, // .**.
-
-// 0x31, 1
-
- 0x2, // ..*.
- 0x6, // .**.
- 0x2, // ..*.
- 0x2, // ..*.
- 0x7, // .***
-
-// 0x32, 2
-
- 0x6, // .**.
- 0x1, // ...*
- 0x6, // .**.
- 0x8, // *...
- 0xF, // ****
-
-// 0x33, 3
-
- 0xE, // ***.
- 0x1, // ...*
- 0xE, // ***.
- 0x1, // ...*
- 0xE, // ***.
-
-// 0x34, 4
-
- 0x6, // .**.
- 0xA, // *.*.
- 0xF, // ****
- 0x2, // ..*.
- 0x2, // ..*.
-
-// 0x35, 5
-
- 0xF, // ****
- 0x8, // *...
- 0xF, // ****
- 0x1, // ...*
- 0xE, // ***.
-
-// 0x36, 6
-
- 0x2, // ..*.
- 0x4, // .*..
- 0xA, // *.*.
- 0x9, // *..*
- 0x6, // .**.
-
-// 0x37, 7
-
- 0xF, // ****
- 0x1, // ...*
- 0x2, // ..*.
- 0x4, // .*..
- 0x8, // *...
-
-// 0x38, 8
-
- 0x6, // .**.
- 0x9, // *..*
- 0x6, // .**.
- 0x9, // *..*
- 0x6, // .**.
-
-// 0x39, 9
-
- 0x6, // .**.
- 0x9, // *..*
- 0x7, // .*.*
- 0x1, // ..*.
- 0x2, // .*..
-
-// 0x3A, :
-
- 0x0, // .
- 0x1, // *
- 0x0, // .
- 0x1, // *
- 0x0, // .
-
-// 0x3B, ;
-
- 0x0, // ..
- 0x1, // .*
- 0x0, // ..
- 0x1, // .*
- 0x2, // *.
-
-// 0x3C, <
-
- 0x2, // ..*.
- 0x4, // .*..
- 0x8, // *...
- 0x4, // .*..
- 0x2, // ..*.
-
-// 0x3D, =
-
- 0x0, // ....
- 0xF, // ****
- 0x0, // ....
- 0xF, // ****
- 0x0, // ....
-
-// 0x3E, >
-
- 0x0, // .*..
- 0x0, // ..*.
- 0x0, // ...*
- 0x0, // ..*.
- 0x0, // .*..
-
-// 0x3F, ?
-
- 0x6, // .**.
- 0x1, // ...*
- 0x2, // ..*.
- 0x0, // ....
- 0x2, // ..*.
-
-// 0x40, @
-
- 0x6, // .**.
- 0xD, // **.*
- 0x8, // *...
- 0x4, // .*..
- 0x3, // ..**
-
-// 0x41, A
-
- 0x6, // .**.
- 0x9, // *..*
- 0xF, // ****
- 0x9, // *..*
- 0x9, // *..*
-
-// 0x42, B
-
- 0xE, // ***.
- 0x9, // *..*
- 0xE, // ***.
- 0x9, // *..*
- 0xE, // ***.
-
-// 0x43, C
-
- 0x6, // .**.
- 0x9, // *..*
- 0x8, // *...
- 0x9, // *..*
- 0x6, // .**.
-
-// 0x44, D
-
- 0xE, // ***.
- 0x9, // *..*
- 0x9, // *..*
- 0x9, // *..*
- 0xE, // ***.
-
-// 0x45, E
-
- 0xF, // ****
- 0x8, // *...
- 0xE, // ***.
- 0x8, // *...
- 0xF, // ****
-
-// 0x46, F
-
- 0xF, // ****
- 0x8, // *...
- 0xE, // ***.
- 0x8, // *...
- 0x8, // *...
-
-// 0x47, G
-
- 0x6, // .**.
- 0x9, // *..*
- 0x8, // *...
- 0xB, // *.**
- 0x6, // .**.
-
-// 0x48, H
-
- 0x9, // *..*
- 0x9, // *..*
- 0xF, // ****
- 0x9, // *..*
- 0x9, // *..*
-
-// 0x49, I
-
- 0x7, // ***
- 0x2, // .*.
- 0x2, // .*.
- 0x2, // .*.
- 0x7, // ***
-
-// 0x4A, J
-
- 0x7, // .***
- 0x2, // ..*.
- 0x2, // ..*.
- 0xA, // *.*.
- 0x4, // .*..
-
-// 0x4B, K
-
- 0x9, // *..*
- 0xA, // *.*.
- 0xC, // **..
- 0xA, // *.*.
- 0x9, // *..*
-
-// 0x4C, L
-
- 0x4, // *..
- 0x4, // *..
- 0x4, // *..
- 0x4, // *..
- 0x7, // ***
-
-// 0x4D, M
-
- 0x11, // *...*
- 0x1B, // **.**
- 0x15, // *.*.*
- 0x11, // *...*
- 0x11, // *...*
-
-// 0x4E, N
-
- 0x9, // *..*
- 0xD, // **.*
- 0xB, // *.**
- 0x9, // *..*
- 0x9, // *..*
-
-// 0x4F, O
-
- 0x6, // .**.
- 0x9, // *..*
- 0x9, // *..*
- 0x9, // *..*
- 0x6, // .**.
-
-// 0x50, P
-
- 0xE, // ***.
- 0x9, // *..*
- 0xE, // ***.
- 0x8, // *...
- 0x8, // *...
-
-// 0x51, Q
-
- 0x6, // .**.
- 0x9, // *..*
- 0x9, // *..*
- 0xA, // *.*.
- 0x5, // .*.*
-
-// 0x52, R
-
- 0xE, // ***.
- 0x9, // *..*
- 0xF, // ***.
- 0xA, // *.*.
- 0x9, // *..*
-
-// 0x53, S
-
- 0x6, // .**.
- 0x8, // *...
- 0x6, // .**.
- 0x1, // ...*
- 0x6, // .**.
-
-// 0x54, T
-
- 0x7, // .***
- 0x2, // ..*.
- 0x2, // ..*.
- 0x2, // ..*.
- 0x2, // ..*.
-
-// 0x55, U
-
- 0x9, // *..*
- 0x9, // *..*
- 0x9, // *..*
- 0x9, // *..*
- 0x6, // .**.
-
-// 0x56, V
-
- 0x11, // *...*
- 0x11, // *...*
- 0x11, // *...*
- 0x0A, // .*.*.
- 0x04, // ..*..
-
-// 0x57, W
-
- 0x11, // *...*
- 0x11, // *...*
- 0x11, // *...*
- 0x15, // *.*.*
- 0x1B, // **.**
-
-// 0x58, X
-
- 0x9, // *..*
- 0x9, // *..*
- 0x6, // .**.
- 0x9, // *..*
- 0x9, // *..*
-
-// 0x59, Y
-
- 0x11, // *...*
- 0x0A, // .*.*.
- 0x04, // ..*..
- 0x04, // ..*..
- 0x04, // ..*..
-
-// 0x5A, Z
-
- 0xF, // ****
- 0x1, // ...*
- 0x6, // .**.
- 0x8, // *...
- 0xF, // ****
-
-// 0x5B, [
-
- 0xE, // ***.
- 0x8, // *...
- 0x8, // *...
- 0x8, // *...
- 0xE, // ***.
-
-// 0x5C, Backslash
-
- 0x8, // *...
- 0xC, // **..
- 0x6, // .**.
- 0x3, // ..**
- 0x1, // ...*
-
-// 0x5D, ]
-
- 0x7, // .***
- 0x1, // ...*
- 0x1, // ...*
- 0x1, // ...*
- 0x7, // .***
-
-// 0x5E, ^
-
- 0x6, // .**.
- 0x9, // *..*
- 0x0, // ....
- 0x0, // ....
- 0x0, // ....
-
-// 0x5F, _
-
- 0x0, // ....
- 0x0, // ....
- 0x0, // ....
- 0x0, // ....
- 0xF, // ****
-} ;
diff --git a/other/wiringpi/wiringPi-96344ff/examples/COPYING.LESSER b/other/wiringpi/wiringPi-96344ff/examples/COPYING.LESSER
deleted file mode 100644
index 65c5ca88a..000000000
--- a/other/wiringpi/wiringPi-96344ff/examples/COPYING.LESSER
+++ /dev/null
@@ -1,165 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- 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 that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU 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 as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/other/wiringpi/wiringPi-96344ff/examples/Gertboard/7segments.c b/other/wiringpi/wiringPi-96344ff/examples/Gertboard/7segments.c
deleted file mode 100644
index 8797e492f..000000000
--- a/other/wiringpi/wiringPi-96344ff/examples/Gertboard/7segments.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * 7segments.c:
- * Simple test program to see if we can drive a 7-segment LED
- * display using the GPIO and little else on the Raspberry Pi
- *
- * Copyright (c) 2013 Gordon Henderson
- ***********************************************************************
- */
-
-#undef PHOTO_HACK
-
-#include
-
-#include
-#include
-#include
-#include
-
-/*
- * Segment mapping
- *
- * --a--
- * | |
- * f b
- * | |
- * --g--
- * | |
- * e c
- * | |
- * --d-- p
- */
-
-// GPIO Pin Mapping
-
-static int digits [6] = { 7, 11, 10, 13, 12, 14 } ;
-static int segments [7] = { 6, 5, 4, 3, 2, 1, 0 } ;
-
-
-static const int segmentDigits [] =
-{
-// a b c d e f g Segments
-// 6 5 4 3 2 1 0, // wiringPi pin No.
-
- 1, 1, 1, 1, 1, 1, 0, // 0
- 0, 1, 1, 0, 0, 0, 0, // 1
- 1, 1, 0, 1, 1, 0, 1, // 2
- 1, 1, 1, 1, 0, 0, 1, // 3
- 0, 1, 1, 0, 0, 1, 1, // 4
- 1, 0, 1, 1, 0, 1, 1, // 5
- 1, 0, 1, 1, 1, 1, 1, // 6
- 1, 1, 1, 0, 0, 0, 0, // 7
- 1, 1, 1, 1, 1, 1, 1, // 8
- 1, 1, 1, 1, 0, 1, 1, // 9
- 1, 1, 1, 0, 1, 1, 1, // A
- 0, 0, 1, 1, 1, 1, 1, // b
- 1, 0, 0, 1, 1, 1, 0, // C
- 0, 1, 1, 1, 1, 0, 1, // d
- 1, 0, 0, 1, 1, 1, 1, // E
- 1, 0, 0, 0, 1, 1, 1, // F
- 0, 0, 0, 0, 0, 0, 0, // blank
-} ;
-
-
-// display:
-// A global variable which is written to by the main program and
-// read from by the thread that updates the display. Only the first
-// 6 characters are used.
-
-char display [8] ;
-
-
-/*
- * displayDigits:
- * This is our thread that's run concurrently with the main program.
- * Essentially sit in a loop, parsing and displaying the data held in
- * the "display" global.
- *********************************************************************************
- */
-
-PI_THREAD (displayDigits)
-{
- int digit, segment ;
- int index, d, segVal ;
-
- piHiPri (50) ;
-
- for (;;)
- {
- for (digit = 0 ; digit < 6 ; ++digit)
- {
- for (segment = 0 ; segment < 7 ; ++segment)
- {
- d = toupper (display [digit]) ;
- /**/ if ((d >= '0') && (d <= '9')) // Digit
- index = d - '0' ;
- else if ((d >= 'A') && (d <= 'F')) // Hex
- index = d - 'A' + 10 ;
- else
- index = 16 ; // Blank
-
- segVal = segmentDigits [index * 7 + segment] ;
-
- digitalWrite (segments [segment], segVal) ;
- }
- digitalWrite (digits [digit], 1) ;
- delay (2) ;
- digitalWrite (digits [digit], 0) ;
- }
- }
-}
-
-
-/*
- * setup:
- * Initialise the hardware and start the thread
- *********************************************************************************
- */
-
-void setup (void)
-{
- int i, c ;
-
- wiringPiSetup () ;
-
-// 7 segments
-
- for (i = 0 ; i < 7 ; ++i)
- { digitalWrite (segments [i], 0) ; pinMode (segments [i], OUTPUT) ; }
-
-// 6 digits
-
- for (i = 0 ; i < 6 ; ++i)
- { digitalWrite (digits [i], 0) ; pinMode (digits [i], OUTPUT) ; }
-
- strcpy (display, " ") ;
- piThreadCreate (displayDigits) ;
- delay (10) ; // Just to make sure it's started
-
-// Quick countdown LED test sort of thing
-
- c = 999999 ;
- for (i = 0 ; i < 10 ; ++i)
- {
- sprintf (display, "%06d", c) ;
- delay (400) ;
- c -= 111111 ;
- }
-
- strcpy (display, " ") ;
- delay (400) ;
-
-#ifdef PHOTO_HACK
- sprintf (display, "%s", "123456") ;
- for (;;)
- delay (1000) ;
-#endif
-
-}
-
-
-/*
- * teenager:
- * No explanation needed. (Nor one given!)
- *********************************************************************************
- */
-
-void teenager (void)
-{
- char *message = " feedbeef babe cafe b00b " ;
- int i ;
-
- for (i = 0 ; i < strlen (message) - 4 ; ++i)
- {
- strncpy (display, &message [i], 6) ;
- delay (200) ;
- }
- delay (1000) ;
- for (i = 0 ; i < 3 ; ++i)
- {
- strcpy (display, " ") ;
- delay (150) ;
- strcpy (display, " b00b ") ;
- delay (250) ;
- }
- delay (1000) ;
- strcpy (display, " ") ;
- delay (1000) ;
-}
-
-
-/*
- *********************************************************************************
- * main:
- * Let the fun begin
- *********************************************************************************
- */
-
-int main (void)
-{
- struct tm *t ;
- time_t tim ;
-
- setup () ;
- teenager () ;
-
- tim = time (NULL) ;
- for (;;)
- {
- while (time (NULL) == tim)
- delay (5) ;
-
- tim = time (NULL) ;
- t = localtime (&tim) ;
-
- sprintf (display, "%02d%02d%02d", t->tm_hour, t->tm_min, t->tm_sec) ;
-
- delay (500) ;
- }
-
- return 0 ;
-}
diff --git a/other/wiringpi/wiringPi-96344ff/examples/Gertboard/Makefile b/other/wiringpi/wiringPi-96344ff/examples/Gertboard/Makefile
deleted file mode 100644
index 1939ad6ff..000000000
--- a/other/wiringpi/wiringPi-96344ff/examples/Gertboard/Makefile
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# Makefile:
-# Gertboard - Examples using wiringPi
-#
-# Copyright (c) 2013 Gordon Henderson
-#################################################################################
-
-ifneq ($V,1)
-Q ?= @
-endif
-
-#DEBUG = -g -O0
-DEBUG = -O3
-CC = gcc
-INCLUDE = -I/usr/local/include
-CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
-
-LDFLAGS = -L/usr/local/lib
-LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm
-
-# Should not alter anything below this line
-###############################################################################
-
-SRC = gertboard.c \
- buttons.c 7segments.c \
- voltmeter.c temperature.c vumeter.c \
- record.c
-
-OBJ = $(SRC:.c=.o)
-
-BINS = $(SRC:.c=)
-
-all: $(BINS)
-
-gertboard: gertboard.o
- $Q echo [link]
- $Q $(CC) -o $@ gertboard.o $(LDFLAGS) $(LDLIBS)
-
-buttons: buttons.o
- $Q echo [link]
- $Q $(CC) -o $@ buttons.o $(LDFLAGS) $(LDLIBS)
-
-7segments: 7segments.o
- $Q echo [link]
- $Q $(CC) -o $@ 7segments.o $(LDFLAGS) $(LDLIBS)
-
-voltmeter: voltmeter.o
- $Q echo [link]
- $Q $(CC) -o $@ voltmeter.o $(LDFLAGS) $(LDLIBS)
-
-temperature: temperature.o
- $Q echo [link]
- $Q $(CC) -o $@ temperature.o $(LDFLAGS) $(LDLIBS)
-
-vumeter: vumeter.o
- $Q echo [link]
- $Q $(CC) -o $@ vumeter.o $(LDFLAGS) $(LDLIBS)
-
-record: record.o
- $Q echo [link]
- $Q $(CC) -o $@ record.o $(LDFLAGS) $(LDLIBS)
-
-.c.o:
- $Q echo [CC] $<
- $Q $(CC) -c $(CFLAGS) $< -o $@
-
-clean:
- $Q echo [Clean]
- $Q rm -f $(OBJ) *~ core tags $(BINS)
-
-tags: $(SRC)
- $Q echo [ctags]
- $Q ctags $(SRC)
-
-depend:
- makedepend -Y $(SRC)
-
-# DO NOT DELETE
diff --git a/other/wiringpi/wiringPi-96344ff/examples/Gertboard/buttons.c b/other/wiringpi/wiringPi-96344ff/examples/Gertboard/buttons.c
deleted file mode 100644
index 5f7676412..000000000
--- a/other/wiringpi/wiringPi-96344ff/examples/Gertboard/buttons.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * buttons.c:
- * Read the Gertboard buttons. Each one will act as an on/off
- * tiggle switch for 3 different LEDs
- *
- * Copyright (c) 2012-2013 Gordon Henderson.
- ***********************************************************************
- * This file is part of wiringPi:
- * https://projects.drogon.net/raspberry-pi/wiringpi/
- *
- * wiringPi 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 3 of the License, or
- * (at your option) any later version.
- *
- * wiringPi 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 wiringPi. If not, see .
- ***********************************************************************
- */
-
-#include
-#include
-
-// Array to keep track of our LEDs
-
-int leds [] = { 0, 0, 0 } ;
-
-// scanButton:
-// See if a button is pushed, if so, then flip that LED and
-// wait for the button to be let-go
-
-void scanButton (int button)
-{
- if (digitalRead (button) == HIGH) // Low is pushed
- return ;
-
- leds [button] ^= 1 ; // Invert state
- digitalWrite (4 + button, leds [button]) ;
-
- while (digitalRead (button) == LOW) // Wait for release
- delay (10) ;
-}
-
-int main (void)
-{
- int i ;
-
- printf ("Raspberry Pi Gertboard Button Test\n") ;
-
- wiringPiSetup () ;
-
-// Setup the outputs:
-// Pins 3, 4, 5, 6 and 7 output:
-// We're not using 3 or 4, but make sure they're off anyway
-// (Using same hardware config as blink12.c)
-
- for (i = 3 ; i < 8 ; ++i)
- {
- pinMode (i, OUTPUT) ;
- digitalWrite (i, 0) ;
- }
-
-// Setup the inputs
-
- for (i = 0 ; i < 3 ; ++i)
- {
- pinMode (i, INPUT) ;
- pullUpDnControl (i, PUD_UP) ;
- leds [i] = 0 ;
- }
-
- for (;;)
- {
- for (i = 0 ; i < 3 ; ++i)
- scanButton (i) ;
- delay (1) ;
- }
-}
diff --git a/other/wiringpi/wiringPi-96344ff/examples/Gertboard/gertboard.c b/other/wiringpi/wiringPi-96344ff/examples/Gertboard/gertboard.c
deleted file mode 100644
index aefcb1244..000000000
--- a/other/wiringpi/wiringPi-96344ff/examples/Gertboard/gertboard.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * gertboard.c:
- * Simple test for the SPI bus on the Gertboard
- *
- * Hardware setup:
- * D/A port 0 jumpered to A/D port 0.
- *
- * We output a sine wave on D/A port 0 and sample A/D port 0. We then
- * plot the input value on the terminal as a sort of vertical scrolling
- * oscilloscipe.
- *
- * Copyright (c) 2012-2013 Gordon Henderson.