diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index 0f31a6e155a649fb1adedcbc450a936fa1ad9821..52e5de7fb69d0848634ad8006199e48311da3e98 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -65,103 +65,6 @@ DEPENDPATH += libs/qwt INCLUDEPATH += libs/qwt } -# -# [OPTIONAL] XBee wireless support. This is not necessary for basic serial/UART communications. -# It's only required for speaking directly to the Xbee using their proprietary API. -# Unsupported on Mac. -# Installation on Windows is unnecessary, as we just link to our included .dlls directly. -# Installing on Linux involves running `make;sudo make install` in `libs/thirdParty/libxbee` -# Uninstalling from Linux can be done with `sudo make uninstall`. -# -XBEE_DEPENDENT_HEADERS += \ - src/comm/XbeeLinkInterface.h \ - src/comm/XbeeLink.h \ - src/comm/HexSpinBox.h \ - src/ui/XbeeConfigurationWindow.h \ - src/comm/CallConv.h -XBEE_DEPENDENT_SOURCES += \ - src/comm/XbeeLink.cpp \ - src/comm/HexSpinBox.cpp \ - src/ui/XbeeConfigurationWindow.cpp -XBEE_DEFINES = QGC_XBEE_ENABLED - -contains(DEFINES, DISABLE_XBEE) { - message("Skipping support for native XBee API (manual override from command line)") - DEFINES -= DISABLE_XBEE -# Otherwise the user can still disable this feature in the user_config.pri file. -} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_XBEE) { - message("Skipping support for native XBee API (manual override from user_config.pri)") -} else:LinuxBuild { - linux-g++-64 { - message("Skipping support for XBee API (64-bit Linux builds not supported)") - } else:exists(/usr/include/xbee.h) { - message("Including support for XBee API") - - HEADERS += $$XBEE_DEPENDENT_HEADERS - SOURCES += $$XBEE_DEPENDENT_SOURCES - DEFINES += $$XBEE_DEFINES - LIBS += -L/usr/lib -lxbee - } else { - warning("Skipping support for XBee API (missing libraries, see README)") - } -} else:WindowsBuild { - message("Including support for XBee API") - HEADERS += $$XBEE_DEPENDENT_HEADERS - SOURCES += $$XBEE_DEPENDENT_SOURCES - DEFINES += $$XBEE_DEFINES - INCLUDEPATH += libs/thirdParty/libxbee - LIBS += -l$$BASEDIR/libs/thirdParty/libxbee/lib/libxbee -} else { - message("Skipping support for XBee API (unsupported platform)") -} - -# -# [OPTIONAL] Opal RT-LAB Library. Provides integration with Opal-RT's RT-LAB simulator. -# -contains(DEFINES, DISABLE_RTLAB) { - message("Skipping support for RT-LAB (manual override from command line)") - DEFINES -= DISABLE_RTLAB -# Otherwise the user can still disable this feature in the user_config.pri file. -} else:exists(user_config.pri):infile(user_config.pri, DEFINES, DISABLE_RTLAB) { - message("Skipping support for RT-LAB (manual override from user_config.pri)") -} else:WindowsBuild { - exists(src/lib/opalrt/OpalApi.h) : exists(C:/OPAL-RT/RT-LAB7.2.4/Common/bin) { - message("Including support for RT-LAB") - - DEFINES += QGC_RTLAB_ENABLED - - INCLUDEPATH += - src/lib/opalrt - libs/lib/opal/include \ - - FORMS += src/ui/OpalLinkSettings.ui - - HEADERS += \ - src/comm/OpalRT.h \ - src/comm/OpalLink.h \ - src/comm/Parameter.h \ - src/comm/QGCParamID.h \ - src/comm/ParameterList.h \ - src/ui/OpalLinkConfigurationWindow.h - - SOURCES += \ - src/comm/OpalRT.cc \ - src/comm/OpalLink.cc \ - src/comm/Parameter.cc \ - src/comm/QGCParamID.cc \ - src/comm/ParameterList.cc \ - src/ui/OpalLinkConfigurationWindow.cc - - LIBS += \ - -LC:/OPAL-RT/RT-LAB7.2.4/Common/bin \ - -lOpalApi - } else { - warning("Skipping support for RT-LAB (missing libraries, see README)") - } -} else { - message("Skipping support for RT-LAB (unsupported platform)") -} - # # [REQUIRED] SDL dependency. Provides joystick/gamepad support. # The SDL is packaged with QGC for the Mac and Windows. Linux support requires installing the SDL diff --git a/QGCSetup.pri b/QGCSetup.pri index 3cbfb74015b9a243b2f3c48c25379d55a8f26e62..eabeca15f7ed478b99168c27abcf822a7da0b942 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -63,7 +63,6 @@ WindowsBuild { ReleaseBuild: DLL_QT_DEBUGCHAR = "" COPY_FILE_LIST = \ $$BASEDIR\\libs\\lib\\sdl2\\msvc\\lib\\x86\\SDL2.dll \ - $$BASEDIR\\libs\\thirdParty\\libxbee\\lib\\libxbee.dll \ $$BASEDIR\\deploy\\libeay32.dll for(COPY_FILE, COPY_FILE_LIST) { diff --git a/libs/thirdParty/libxbee/LICENSE b/libs/thirdParty/libxbee/LICENSE deleted file mode 100644 index 94a9ed024d3859793618152ea559a168bbcbb5e2..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/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/libs/thirdParty/libxbee/README b/libs/thirdParty/libxbee/README deleted file mode 100644 index a5dbbfe0f3bd6fc9a433c4532221a140e283b4d4..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/README +++ /dev/null @@ -1,39 +0,0 @@ -Welcome to libxbee! - -I have proveded sample code in the ./sample directory. Hopefully this will help -get you up and running with libxbee. If you would like samples showing a different -aspect of libxbee, then please do not hesitate to file an 'issue' on the project -site, and I will get to it ASAP: - http://code.google.com/p/libxbee/issues/list - - -Documentation is avaliable via the man page system once you have installed the -library, or as HTML in the 'doc' directory. - $ man libxbee - - -Please note that this project is still in development, so should not be used for -any purpose other than learning/playing/testing etc... Basically don't use it to -make money, and then hold me responsible if it breaks! - -Feel free to contact me directly with any queries: - attie@attie.co.uk - - -For those of you that are planning to use this on an embedded board, I have -included a small makefile (umakefile) that has only the information needed to -compile the library. I suggest you use this instead! - -=== Installation === -To install simply type: - $ make install - -For more information, or if you can't install it, please see the wiki: - http://code.google.com/p/libxbee/wiki/install_libxbee - - -=== Usage === -If you are compiling the object file directly into your executable instead -of making use of the shared library, you must include the following link -flags: - -lpthread -lrt diff --git a/libs/thirdParty/libxbee/api.c b/libs/thirdParty/libxbee/api.c deleted file mode 100644 index ef5923b56848f5c345c2712c7430919c40d676ba..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/api.c +++ /dev/null @@ -1,2433 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ -const char *SVN_REV = "$Id: api.c 508 2011-06-12 23:22:34Z attie@attie.co.uk $"; -char svn_rev[128] = "\0"; - -#include "api.h" - -const char *xbee_svn_version(void) { - if (svn_rev[0] == '\0') { - char *t; - sprintf(svn_rev,"r%s",&SVN_REV[11]); - t = strrchr(svn_rev,' '); - if (t) { - t[0] = '\0'; - } - } - return svn_rev; -} - -const char *xbee_build_info(void) { - return "Built on " __DATE__ " @ " __TIME__ " for " HOST_OS; -} - -/* ################################################################# */ -/* ### Memory Handling ############################################# */ -/* ################################################################# */ - -/* malloc wrapper function */ -static void *Xmalloc2(xbee_hnd xbee, size_t size) { - void *t; - t = malloc(size); - if (!t) { - /* uhoh... thats pretty bad... */ - xbee_perror("libxbee:malloc()"); - exit(1); - } - return t; -} - -/* calloc wrapper function */ -static void *Xcalloc2(xbee_hnd xbee, size_t size) { - void *t; - t = calloc(1, size); - if (!t) { - /* uhoh... thats pretty bad... */ - xbee_perror("libxbee:calloc()"); - exit(1); - } - return t; -} - -/* realloc wrapper function */ -static void *Xrealloc2(xbee_hnd xbee, void *ptr, size_t size) { - void *t; - t = realloc(ptr,size); - if (!t) { - /* uhoh... thats pretty bad... */ - fprintf(stderr,"libxbee:realloc(): Returned NULL\n"); - exit(1); - } - return t; -} - -/* free wrapper function (uses the Xfree macro and sets the pointer to NULL after freeing it) */ -static void Xfree2(void **ptr) { - if (!*ptr) return; - free(*ptr); - *ptr = NULL; -} - -/* ################################################################# */ -/* ### Helper Functions ############################################ */ -/* ################################################################# */ - -/* ################################################################# - returns 1 if the packet has data for the digital input else 0 */ -int xbee_hasdigital(xbee_pkt *pkt, int sample, int input) { - int mask = 0x0001; - if (input < 0 || input > 7) return 0; - if (sample >= pkt->samples) return 0; - - mask <<= input; - return !!(pkt->IOdata[sample].IOmask & mask); -} - -/* ################################################################# - returns 1 if the digital input is high else 0 (or 0 if no digital data present) */ -int xbee_getdigital(xbee_pkt *pkt, int sample, int input) { - int mask = 0x0001; - if (!xbee_hasdigital(pkt,sample,input)) return 0; - - mask <<= input; - return !!(pkt->IOdata[sample].IOdigital & mask); -} - -/* ################################################################# - returns 1 if the packet has data for the analog input else 0 */ -int xbee_hasanalog(xbee_pkt *pkt, int sample, int input) { - int mask = 0x0200; - if (input < 0 || input > 5) return 0; - if (sample >= pkt->samples) return 0; - - mask <<= input; - return !!(pkt->IOdata[sample].IOmask & mask); -} - -/* ################################################################# - returns analog input as a voltage if vRef is non-zero, else raw value (or 0 if no analog data present) */ -double xbee_getanalog(xbee_pkt *pkt, int sample, int input, double Vref) { - if (!xbee_hasanalog(pkt,sample,input)) return 0; - - if (Vref) return (Vref / 1023) * pkt->IOdata[sample].IOanalog[input]; - return pkt->IOdata[sample].IOanalog[input]; -} - -/* ################################################################# */ -/* ### XBee Functions ############################################## */ -/* ################################################################# */ - -static void xbee_logf(xbee_hnd xbee, const char *logformat, const char *file, - const int line, const char *function, char *format, ...) { - char buf[128]; - va_list ap; - if (!xbee) return; - if (!xbee->log) return; - va_start(ap,format); - vsnprintf(buf,127,format,ap); - va_end(ap); - fprintf(xbee->log,logformat,file,line,function,buf); -} -void xbee_logitf(char *format, ...) { - char buf[128]; - va_list ap; - va_start(ap,format); - vsnprintf(buf,127,format,ap); - va_end(ap); - xbee_logit(buf); -} -void _xbee_logitf(xbee_hnd xbee, char *format, ...) { - char buf[128]; - va_list ap; - va_start(ap,format); - vsnprintf(buf,127,format,ap); - va_end(ap); - _xbee_logit(xbee, buf); -} -void xbee_logit(char *str) { - _xbee_logit(default_xbee, str); -} -void _xbee_logit(xbee_hnd xbee, char *str) { - if (!xbee) return; - if (!xbee->log) return; - xbee_mutex_lock(xbee->logmutex); - fprintf(xbee->log,LOG_FORMAT"\n",__FILE__,__LINE__,__FUNCTION__,str); - xbee_mutex_unlock(xbee->logmutex); -} - -/* ################################################################# - xbee_sendAT - INTERNAL - allows for an at command to be send, and the reply to be captured */ -static int xbee_sendAT(xbee_hnd xbee, char *command, char *retBuf, int retBuflen) { - return xbee_sendATdelay(xbee, 0, command, retBuf, retBuflen); -} -static int xbee_sendATdelay(xbee_hnd xbee, int guardTime, char *command, char *retBuf, int retBuflen) { - struct timeval to; - - int ret; - int bufi = 0; - - /* if there is a guardTime given, then use it and a bit more */ - if (guardTime) usleep(guardTime * 1200); - - /* get rid of any pre-command sludge... */ - memset(&to, 0, sizeof(to)); - ret = xbee_select(xbee,&to); - if (ret > 0) { - char t[128]; - while (xbee_read(xbee,t,127)); - } - - /* send the requested command */ - xbee_log("sendATdelay: Sending '%s'", command); - xbee_write(xbee,command, strlen(command)); - - /* if there is a guardTime, then use it */ - if (guardTime) { - usleep(guardTime * 900); - - /* get rid of any post-command sludge... */ - memset(&to, 0, sizeof(to)); - ret = xbee_select(xbee,&to); - if (ret > 0) { - char t[128]; - while (xbee_read(xbee,t,127)); - } - } - - /* retrieve the data */ - memset(retBuf, 0, retBuflen); - memset(&to, 0, sizeof(to)); - if (guardTime) { - /* select on the xbee fd... wait at most 0.2 the guardTime for the response */ - to.tv_usec = guardTime * 200; - } else { - /* or 250ms */ - to.tv_usec = 250000; - } - if ((ret = xbee_select(xbee,&to)) == -1) { - xbee_perror("libxbee:xbee_sendATdelay()"); - exit(1); - } - - if (!ret) { - /* timed out, and there is nothing to be read */ - xbee_log("sendATdelay: No Data to read - Timeout..."); - return 1; - } - - /* check for any dribble... */ - do { - /* if there is actually no space in the retBuf then break out */ - if (bufi >= retBuflen - 1) { - break; - } - - /* read as much data as is possible into retBuf */ - if ((ret = xbee_read(xbee,&retBuf[bufi], retBuflen - bufi - 1)) == 0) { - break; - } - - /* advance the 'end of string' pointer */ - bufi += ret; - - /* wait at most 150ms for any more data */ - memset(&to, 0, sizeof(to)); - to.tv_usec = 150000; - if ((ret = xbee_select(xbee,&to)) == -1) { - xbee_perror("libxbee:xbee_sendATdelay()"); - exit(1); - } - - /* loop while data was read */ - } while (ret); - - if (!bufi) { - xbee_log("sendATdelay: No response..."); - return 1; - } - - /* terminate the string */ - retBuf[bufi] = '\0'; - - xbee_log("sendATdelay: Recieved '%s'",retBuf); - return 0; -} - - -/* ################################################################# - xbee_start - sets up the correct API mode for the xbee - cmdSeq = CC - cmdTime = GT */ -static int xbee_startAPI(xbee_hnd xbee) { - char buf[256]; - - if (xbee->cmdSeq == 0 || xbee->cmdTime == 0) return 1; - - /* setup the command sequence string */ - memset(buf,xbee->cmdSeq,3); - buf[3] = '\0'; - - /* try the command sequence */ - if (xbee_sendATdelay(xbee, xbee->cmdTime, buf, buf, sizeof(buf))) { - /* if it failed... try just entering 'AT' which should return OK */ - if (xbee_sendAT(xbee, "AT\r", buf, 4) || strncmp(buf,"OK\r",3)) return 1; - } else if (strncmp(&buf[strlen(buf)-3],"OK\r",3)) { - /* if data was returned, but it wasn't OK... then something went wrong! */ - return 1; - } - - /* get the current API mode */ - if (xbee_sendAT(xbee, "ATAP\r", buf, 3)) return 1; - buf[1] = '\0'; - xbee->oldAPI = atoi(buf); - - if (xbee->oldAPI != 2) { - /* if it wasnt set to mode 2 already, then set it to mode 2 */ - if (xbee_sendAT(xbee, "ATAP2\r", buf, 4) || strncmp(buf,"OK\r",3)) return 1; - } - - /* quit from command mode, ready for some packets! :) */ - if (xbee_sendAT(xbee, "ATCN\r", buf, 4) || strncmp(buf,"OK\r",3)) return 1; - - return 0; -} - -/* ################################################################# - xbee_end - resets the API mode to the saved value - you must have called xbee_setup[log]API */ -int xbee_end(void) { - return _xbee_end(default_xbee); -} -int _xbee_end(xbee_hnd xbee) { - int ret = 1; - xbee_con *con, *ncon; - xbee_pkt *pkt, *npkt; - xbee_hnd xbeet; - - ISREADYR(0); - xbee_log("Stopping libxbee instance..."); - - /* unlink the instance from list... */ - xbee_log("Unlinking instance from list..."); - xbee_mutex_lock(xbee_hnd_mutex); - if (xbee == default_xbee) { - default_xbee = default_xbee->next; - if (!default_xbee) { - xbee_mutex_destroy(xbee_hnd_mutex); - } - } else { - xbeet = default_xbee; - while (xbeet) { - if (xbeet->next == xbee) { - xbeet->next = xbee->next; - break; - } - xbeet = xbeet->next; - } - } - if (default_xbee) xbee_mutex_unlock(xbee_hnd_mutex); - - /* if the api mode was not 2 to begin with then put it back */ - if (xbee->oldAPI == 2) { - xbee_log("XBee was already in API mode 2, no need to reset"); - ret = 0; - } else { - int to = 5; - - con = _xbee_newcon(xbee,'I',xbee_localAT); - con->callback = NULL; - con->waitforACK = 1; - _xbee_senddata(xbee,con,"AP%c",xbee->oldAPI); - - pkt = NULL; - - while (!pkt && to--) { - pkt = _xbee_getpacketwait(xbee,con); - } - if (pkt) { - ret = pkt->status; - Xfree(pkt); - } - _xbee_endcon(xbee,con); - } - - /* xbee_* functions may no longer run... */ - xbee->xbee_ready = 0; - - /* nullify everything */ - - /* stop listening for data... either after timeout or next char read which ever is first */ - xbee->run = 0; - - xbee_thread_cancel(xbee->listent,0); - xbee_thread_join(xbee->listent); - - xbee_thread_cancel(xbee->threadt,0); - xbee_thread_join(xbee->threadt); - - /* free all connections */ - con = xbee->conlist; - xbee->conlist = NULL; - while (con) { - ncon = con->next; - Xfree(con); - con = ncon; - } - - /* free all packets */ - xbee->pktlast = NULL; - pkt = xbee->pktlist; - xbee->pktlist = NULL; - while (pkt) { - npkt = pkt->next; - Xfree(pkt); - pkt = npkt; - } - - /* destroy mutexes */ - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - - /* close the serial port */ - Xfree(xbee->path); - if (xbee->tty) xbee_close(xbee->tty); - - /* close log and tty */ - if (xbee->log) { - fflush(xbee->log); - xbee_close(xbee->log); - } - xbee_mutex_destroy(xbee->logmutex); - - Xfree(xbee); - - return ret; -} - -/* ################################################################# - xbee_setup - opens xbee serial port & creates xbee listen thread - the xbee must be configured for API mode 2 - THIS MUST BE CALLED BEFORE ANY OTHER XBEE FUNCTION */ -int xbee_setup(char *path, int baudrate) { - return xbee_setuplogAPI(path,baudrate,0,0,0); -} -xbee_hnd _xbee_setup(char *path, int baudrate) { - return _xbee_setuplogAPI(path,baudrate,0,0,0); -} -int xbee_setuplog(char *path, int baudrate, int logfd) { - return xbee_setuplogAPI(path,baudrate,logfd,0,0); -} -xbee_hnd _xbee_setuplog(char *path, int baudrate, int logfd) { - return _xbee_setuplogAPI(path,baudrate,logfd,0,0); -} -int xbee_setupAPI(char *path, int baudrate, char cmdSeq, int cmdTime) { - return xbee_setuplogAPI(path,baudrate,0,cmdSeq,cmdTime); -} -xbee_hnd _xbee_setupAPI(char *path, int baudrate, char cmdSeq, int cmdTime) { - return _xbee_setuplogAPI(path,baudrate,0,cmdSeq,cmdTime); -} -int xbee_setuplogAPI(char *path, int baudrate, int logfd, char cmdSeq, int cmdTime) { - if (default_xbee) return 0; - default_xbee = _xbee_setuplogAPI(path,baudrate,logfd,cmdSeq,cmdTime); - return (default_xbee?0:-1); -} -xbee_hnd _xbee_setuplogAPI(char *path, int baudrate, int logfd, char cmdSeq, int cmdTime) { - int ret; - xbee_hnd xbee = NULL; - - /* create a new instance */ - xbee = Xcalloc(sizeof(struct xbee_hnd)); - xbee->next = NULL; - - xbee_mutex_init(xbee->logmutex); -#ifdef DEBUG - if (!logfd) logfd = 2; -#endif - if (logfd) { - xbee->logfd = dup(logfd); - xbee->log = fdopen(xbee->logfd,"w"); - if (!xbee->log) { - /* errno == 9 is bad file descriptor (probrably not provided) */ - if (errno != 9) xbee_perror("xbee_setup(): Failed opening logfile"); - xbee->logfd = 0; - } else { -#ifdef __GNUC__ /* ---- */ - /* set to line buffer - ensure lines are written to file when complete */ - setvbuf(xbee->log,NULL,_IOLBF,BUFSIZ); -#else /* -------------- */ - /* Win32 is rubbish... so we have to completely disable buffering... */ - setvbuf(xbee->log,NULL,_IONBF,BUFSIZ); -#endif /* ------------- */ - } - } - - xbee_logS("---------------------------------------------------------------------"); - xbee_logI("libxbee Starting..."); - xbee_logI("SVN Info: %s",xbee_svn_version()); - xbee_logI("Build Info: %s",xbee_build_info()); - xbee_logE("---------------------------------------------------------------------"); - - /* setup the connection stuff */ - xbee->conlist = NULL; - - /* setup the packet stuff */ - xbee->pktlist = NULL; - xbee->pktlast = NULL; - xbee->pktcount = 0; - xbee->run = 1; - - /* setup the mutexes */ - if (xbee_mutex_init(xbee->conmutex)) { - xbee_perror("xbee_setup():xbee_mutex_init(conmutex)"); - if (xbee->log) xbee_close(xbee->log); - Xfree(xbee); - return NULL; - } - if (xbee_mutex_init(xbee->pktmutex)) { - xbee_perror("xbee_setup():xbee_mutex_init(pktmutex)"); - if (xbee->log) xbee_close(xbee->log); - xbee_mutex_destroy(xbee->conmutex); - Xfree(xbee); - return NULL; - } - if (xbee_mutex_init(xbee->sendmutex)) { - xbee_perror("xbee_setup():xbee_mutex_init(sendmutex)"); - if (xbee->log) xbee_close(xbee->log); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - Xfree(xbee); - return NULL; - } - - /* take a copy of the XBee device path */ - if ((xbee->path = Xmalloc(sizeof(char) * (strlen(path) + 1))) == NULL) { - xbee_perror("xbee_setup():Xmalloc(path)"); - if (xbee->log) xbee_close(xbee->log); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee); - return NULL; - } - strcpy(xbee->path,path); - if (xbee->log) xbee_log("Opening serial port '%s'...",xbee->path); - - /* call the relevant init function */ - if ((ret = init_serial(xbee,baudrate)) != 0) { - xbee_log("Something failed while opening the serial port..."); - if (xbee->log) xbee_close(xbee->log); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee->path); - Xfree(xbee); - return NULL; - } - - /* when xbee_end() is called, if this is not 2 then ATAP will be set to this value */ - xbee->oldAPI = 2; - xbee->cmdSeq = cmdSeq; - xbee->cmdTime = cmdTime; - if (xbee->cmdSeq && xbee->cmdTime) { - if (xbee_startAPI(xbee)) { - if (xbee->log) { - xbee_log("Couldn't communicate with XBee..."); - xbee_close(xbee->log); - } - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee->path); -#ifdef __GNUC__ /* ---- */ - close(xbee->ttyfd); -#endif /* ------------- */ - xbee_close(xbee->tty); - Xfree(xbee); - return NULL; - } - } - - /* allow the listen thread to start */ - xbee->xbee_ready = -1; - - /* can start xbee_listen thread now */ - if (xbee_thread_create(xbee->listent, xbee_listen_wrapper, xbee)) { - xbee_perror("xbee_setup():xbee_thread_create(listent)"); - if (xbee->log) xbee_close(xbee->log); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee->path); -#ifdef __GNUC__ /* ---- */ - close(xbee->ttyfd); -#endif /* ------------- */ - xbee_close(xbee->tty); - Xfree(xbee); - return NULL; - } - - /* can start xbee_thread_watch thread thread now */ - if (xbee_thread_create(xbee->threadt, xbee_thread_watch, xbee)) { - xbee_perror("xbee_setup():xbee_thread_create(threadt)"); - if (xbee->log) xbee_close(xbee->log); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee->path); -#ifdef __GNUC__ /* ---- */ - close(xbee->ttyfd); -#endif /* ------------- */ - xbee_close(xbee->tty); - Xfree(xbee); - return NULL; - } - - usleep(500); - while (xbee->xbee_ready != -2) { - usleep(500); - xbee_log("Waiting for xbee_listen() to be ready..."); - } - - /* allow other functions to be used! */ - xbee->xbee_ready = 1; - - xbee_log("Linking xbee instance..."); - if (!default_xbee) { - xbee_mutex_init(xbee_hnd_mutex); - xbee_mutex_lock(xbee_hnd_mutex); - default_xbee = xbee; - xbee_mutex_unlock(xbee_hnd_mutex); - } else { - xbee_hnd xbeet; - xbee_mutex_lock(xbee_hnd_mutex); - xbeet = default_xbee; - while (xbeet->next) { - xbeet = xbeet->next; - } - xbeet->next = xbee; - xbee_mutex_unlock(xbee_hnd_mutex); - } - - xbee_log("libxbee: Started!"); - - return xbee; -} - -/* ################################################################# - xbee_con - produces a connection to the specified device and frameID - if a connection had already been made, then this connection will be returned */ -xbee_con *xbee_newcon(unsigned char frameID, xbee_types type, ...) { - xbee_con *ret; - va_list ap; - - /* xbee_vnewcon() wants a va_list... */ - va_start(ap, type); - /* hand it over :) */ - ret = _xbee_vnewcon(default_xbee, frameID, type, ap); - va_end(ap); - return ret; -} -xbee_con *_xbee_newcon(xbee_hnd xbee, unsigned char frameID, xbee_types type, ...) { - xbee_con *ret; - va_list ap; - - /* xbee_vnewcon() wants a va_list... */ - va_start(ap, type); - /* hand it over :) */ - ret = _xbee_vnewcon(xbee, frameID, type, ap); - va_end(ap); - return ret; -} -xbee_con *_xbee_vnewcon(xbee_hnd xbee, unsigned char frameID, xbee_types type, va_list ap) { - xbee_con *con, *ocon; - unsigned char tAddr[8]; - int t; - int i; - - ISREADYR(NULL); - - if (!type || type == xbee_unknown) type = xbee_localAT; /* default to local AT */ - else if (type == xbee_remoteAT) type = xbee_64bitRemoteAT; /* if remote AT, default to 64bit */ - - /* if: 64 bit address expected (2 ints) */ - if ((type == xbee_64bitRemoteAT) || - (type == xbee_64bitData) || - (type == xbee_64bitIO) || - (type == xbee2_data)) { - t = va_arg(ap, int); - tAddr[0] = (t >> 24) & 0xFF; - tAddr[1] = (t >> 16) & 0xFF; - tAddr[2] = (t >> 8) & 0xFF; - tAddr[3] = (t ) & 0xFF; - t = va_arg(ap, int); - tAddr[4] = (t >> 24) & 0xFF; - tAddr[5] = (t >> 16) & 0xFF; - tAddr[6] = (t >> 8) & 0xFF; - tAddr[7] = (t ) & 0xFF; - - /* if: 16 bit address expected (1 int) */ - } else if ((type == xbee_16bitRemoteAT) || - (type == xbee_16bitData) || - (type == xbee_16bitIO)) { - t = va_arg(ap, int); - tAddr[0] = (t >> 8) & 0xFF; - tAddr[1] = (t ) & 0xFF; - tAddr[2] = 0; - tAddr[3] = 0; - tAddr[4] = 0; - tAddr[5] = 0; - tAddr[6] = 0; - tAddr[7] = 0; - - /* otherwise clear the address */ - } else { - memset(tAddr,0,8); - } - - /* lock the connection mutex */ - xbee_mutex_lock(xbee->conmutex); - - /* are there any connections? */ - if (xbee->conlist) { - con = xbee->conlist; - while (con) { - /* if: looking for a modemStatus, and the types match! */ - if ((type == xbee_modemStatus) && - (con->type == type)) { - xbee_mutex_unlock(xbee->conmutex); - return con; - - /* if: looking for a txStatus and frameIDs match! */ - } else if ((type == xbee_txStatus) && - (con->type == type) && - (frameID == con->frameID)) { - xbee_mutex_unlock(xbee->conmutex); - return con; - - /* if: looking for a localAT, and the frameIDs match! */ - } else if ((type == xbee_localAT) && - (con->type == type) && - (frameID == con->frameID)) { - xbee_mutex_unlock(xbee->conmutex); - return con; - - /* if: connection types match, the frameIDs match, and the addresses match! */ - } else if ((type == con->type) && - (frameID == con->frameID) && - (!memcmp(tAddr,con->tAddr,8))) { - xbee_mutex_unlock(xbee->conmutex); - return con; - } - - /* if there are more, move along, dont want to loose that last item! */ - if (con->next == NULL) break; - con = con->next; - } - - /* keep hold of the last connection... we will need to link it up later */ - ocon = con; - } - - /* unlock the connection mutex */ - xbee_mutex_unlock(xbee->conmutex); - - /* create a new connection and set its attributes */ - con = Xcalloc(sizeof(xbee_con)); - con->type = type; - /* is it a 64bit connection? */ - if ((type == xbee_64bitRemoteAT) || - (type == xbee_64bitData) || - (type == xbee_64bitIO) || - (type == xbee2_data)) { - con->tAddr64 = TRUE; - } - con->atQueue = 0; /* queue AT commands? */ - con->txDisableACK = 0; /* disable ACKs? */ - con->txBroadcastPAN = 0; /* broadcast? */ - con->frameID = frameID; - con->waitforACK = 0; - memcpy(con->tAddr,tAddr,8); /* copy in the remote address */ - xbee_mutex_init(con->callbackmutex); - xbee_mutex_init(con->callbackListmutex); - xbee_mutex_init(con->Txmutex); - xbee_sem_init(con->waitforACKsem); - - if (xbee->log) { - switch(type) { - case xbee_localAT: - xbee_log("New local AT connection!"); - break; - case xbee_16bitRemoteAT: - case xbee_64bitRemoteAT: - xbee_logc("New %d-bit remote AT connection! (to: ",(con->tAddr64?64:16)); - for (i=0;i<(con->tAddr64?8:2);i++) { - fprintf(xbee->log,(i?":%02X":"%02X"),tAddr[i]); - } - fprintf(xbee->log,")"); - xbee_logcf(); - break; - case xbee_16bitData: - case xbee_64bitData: - xbee_logc("New %d-bit data connection! (to: ",(con->tAddr64?64:16)); - for (i=0;i<(con->tAddr64?8:2);i++) { - fprintf(xbee->log,(i?":%02X":"%02X"),tAddr[i]); - } - fprintf(xbee->log,")"); - xbee_logcf(); - break; - case xbee_16bitIO: - case xbee_64bitIO: - xbee_logc("New %d-bit IO connection! (to: ",(con->tAddr64?64:16)); - for (i=0;i<(con->tAddr64?8:2);i++) { - fprintf(xbee->log,(i?":%02X":"%02X"),tAddr[i]); - } - fprintf(xbee->log,")"); - xbee_logcf(); - break; - case xbee2_data: - xbee_logc("New Series 2 data connection! (to: "); - for (i=0;i<8;i++) { - fprintf(xbee->log,(i?":%02X":"%02X"),tAddr[i]); - } - fprintf(xbee->log,")"); - xbee_logcf(); - break; - case xbee_txStatus: - xbee_log("New Tx status connection!"); - break; - case xbee_modemStatus: - xbee_log("New modem status connection!"); - break; - case xbee_unknown: - default: - xbee_log("New unknown connection!"); - } - } - - /* lock the connection mutex */ - xbee_mutex_lock(xbee->conmutex); - - /* make it the last in the list */ - con->next = NULL; - /* add it to the list */ - if (xbee->conlist) { - ocon->next = con; - } else { - xbee->conlist = con; - } - - /* unlock the mutex */ - xbee_mutex_unlock(xbee->conmutex); - return con; -} - -/* ################################################################# - xbee_conflush - removes any packets that have been collected for the specified - connection */ -void xbee_purgecon(xbee_con *con) { - _xbee_purgecon(default_xbee, con); -} -void _xbee_purgecon(xbee_hnd xbee, xbee_con *con) { - xbee_pkt *r, *p, *n; - - ISREADYP(); - - /* lock the packet mutex */ - xbee_mutex_lock(xbee->pktmutex); - - /* if: there are packets */ - if ((p = xbee->pktlist) != NULL) { - r = NULL; - /* get all packets for this connection */ - do { - /* does the packet match the connection? */ - if (xbee_matchpktcon(xbee,p,con)) { - /* if it was the first packet */ - if (!r) { - /* move the chain along */ - xbee->pktlist = p->next; - } else { - /* otherwise relink the list */ - r->next = p->next; - } - xbee->pktcount--; - - /* free this packet! */ - n = p->next; - Xfree(p); - /* move on */ - p = n; - } else { - /* move on */ - r = p; - p = p->next; - } - } while (p); - xbee->pktlast = r; - } - - /* unlock the packet mutex */ - xbee_mutex_unlock(xbee->pktmutex); -} - -/* ################################################################# - xbee_endcon - close the unwanted connection - free wrapper function (uses the Xfree macro and sets the pointer to NULL after freeing it) */ -void xbee_endcon2(xbee_con **con, int alreadyUnlinked) { - _xbee_endcon2(default_xbee, con, alreadyUnlinked); -} -void _xbee_endcon2(xbee_hnd xbee, xbee_con **con, int alreadyUnlinked) { - xbee_con *t, *u; - - ISREADYP(); - - /* lock the connection mutex */ - xbee_mutex_lock(xbee->conmutex); - - u = t = xbee->conlist; - while (t && t != *con) { - u = t; - t = t->next; - } - if (!t) { - /* this could be true if comming from the destroySelf signal... */ - if (!alreadyUnlinked) { - /* invalid connection given... */ - if (xbee->log) { - xbee_log("Attempted to close invalid connection..."); - } - /* unlock the connection mutex */ - xbee_mutex_unlock(xbee->conmutex); - return; - } - } else { - /* extract this connection from the list */ - if (t == xbee->conlist) { - xbee->conlist = t->next; - } else { - u->next = t->next; - } - } - - /* unlock the connection mutex */ - xbee_mutex_unlock(xbee->conmutex); - - /* check if a callback thread is running... */ - if (t->callback && xbee_mutex_trylock(t->callbackmutex)) { - /* if it is running... tell it to destroy the connection on completion */ - xbee_log("Attempted to close a connection with active callbacks... " - "Connection will be destroyed when callbacks have completeted..."); - t->destroySelf = 1; - return; - } - - /* remove all packets for this connection */ - _xbee_purgecon(xbee,t); - - /* destroy the callback mutex */ - xbee_mutex_destroy(t->callbackmutex); - xbee_mutex_destroy(t->callbackListmutex); - xbee_mutex_destroy(t->Txmutex); - xbee_sem_destroy(t->waitforACKsem); - - /* free the connection! */ - Xfree(*con); -} - -/* ################################################################# - xbee_senddata - send the specified data to the provided connection */ -int xbee_senddata(xbee_con *con, char *format, ...) { - int ret; - va_list ap; - - /* xbee_vsenddata() wants a va_list... */ - va_start(ap, format); - /* hand it over :) */ - ret = _xbee_vsenddata(default_xbee, con, format, ap); - va_end(ap); - return ret; -} -int _xbee_senddata(xbee_hnd xbee, xbee_con *con, char *format, ...) { - int ret; - va_list ap; - - /* xbee_vsenddata() wants a va_list... */ - va_start(ap, format); - /* hand it over :) */ - ret = _xbee_vsenddata(xbee, con, format, ap); - va_end(ap); - return ret; -} - -int xbee_vsenddata(xbee_con *con, char *format, va_list ap) { - return _xbee_vsenddata(default_xbee, con, format, ap); -} -int _xbee_vsenddata(xbee_hnd xbee, xbee_con *con, char *format, va_list ap) { - unsigned char data[128]; /* max payload is 100 bytes... plus a bit of fluff... */ - int length; - - /* make up the data and keep the length, its possible there are nulls in there */ - length = vsnprintf((char *)data, 128, format, ap); - - /* hand it over :) */ - return _xbee_nsenddata(xbee, con, (char *)data, length); -} - -/* returns: - 1 - if NAC was recieved - 0 - if packet was successfully sent (or just sent if waitforACK is off) - -1 - if there was an error building the packet - -2 - if the connection type was unknown */ -int xbee_nsenddata(xbee_con *con, char *data, int length) { - return _xbee_nsenddata(default_xbee, con, data, length); -} -int _xbee_nsenddata(xbee_hnd xbee, xbee_con *con, char *data, int length) { - t_data *pkt; - int i; - unsigned char buf[128]; /* max payload is 100 bytes... plus a bit for the headers etc... */ - - ISREADYR(-1); - - if (!con) return -1; - if (con->type == xbee_unknown) return -1; - if (length > 127) return -1; - - if (xbee->log) { - xbee_logS("--== TX Packet ============--"); - xbee_logIc("Connection Type: "); - switch (con->type) { - case xbee_unknown: fprintf(xbee->log,"Unknown"); break; - case xbee_localAT: fprintf(xbee->log,"Local AT"); break; - case xbee_remoteAT: fprintf(xbee->log,"Remote AT"); break; - case xbee_16bitRemoteAT: fprintf(xbee->log,"Remote AT (16-bit)"); break; - case xbee_64bitRemoteAT: fprintf(xbee->log,"Remote AT (64-bit)"); break; - case xbee_16bitData: fprintf(xbee->log,"Data (16-bit)"); break; - case xbee_64bitData: fprintf(xbee->log,"Data (64-bit)"); break; - case xbee_16bitIO: fprintf(xbee->log,"IO (16-bit)"); break; - case xbee_64bitIO: fprintf(xbee->log,"IO (64-bit)"); break; - case xbee2_data: fprintf(xbee->log,"Series 2 Data"); break; - case xbee2_txStatus: fprintf(xbee->log,"Series 2 Tx Status"); break; - case xbee_txStatus: fprintf(xbee->log,"Tx Status"); break; - case xbee_modemStatus: fprintf(xbee->log,"Modem Status"); break; - } - xbee_logIcf(); - switch (con->type) { - case xbee_localAT: case xbee_remoteAT: case xbee_txStatus: case xbee_modemStatus: - break; - default: - xbee_logIc("Destination: "); - for (i=0;i<(con->tAddr64?8:2);i++) { - fprintf(xbee->log,(i?":%02X":"%02X"),con->tAddr[i]); - } - xbee_logIcf(); - } - xbee_logI("Length: %d",length); - for (i=0;i 32) && (data[i] < 127)) { - fprintf(xbee->log,"'%c'",data[i]); - } else{ - fprintf(xbee->log," _"); - } - xbee_logIcf(); - } - xbee_logEf(); - } - - /* ########################################## */ - /* if: local AT */ - if (con->type == xbee_localAT) { - /* AT commands are 2 chars long (plus optional parameter) */ - if (length < 2) return -1; - if (length > 32) return -1; - - /* use the command? */ - buf[0] = ((!con->atQueue)?XBEE_LOCAL_ATREQ:XBEE_LOCAL_ATQUE); - buf[1] = con->frameID; - - /* copy in the data */ - for (i=0;itype == xbee_16bitRemoteAT) || - (con->type == xbee_64bitRemoteAT)) { - if (length < 2) return -1; /* at commands are 2 chars long (plus optional parameter) */ - if (length > 32) return -1; - buf[0] = XBEE_REMOTE_ATREQ; - buf[1] = con->frameID; - - /* copy in the relevant address */ - if (con->tAddr64) { - memcpy(&buf[2],con->tAddr,8); - buf[10] = 0xFF; - buf[11] = 0xFE; - } else { - memset(&buf[2],0,8); - memcpy(&buf[10],con->tAddr,2); - } - /* queue the command? */ - buf[12] = ((!con->atQueue)?0x02:0x00); - - /* copy in the data */ - for (i=0;itype == xbee_16bitData) || - (con->type == xbee_64bitData)) { - int offset; - if (length > 100) return -1; - - /* if: 16bit Data */ - if (con->type == xbee_16bitData) { - buf[0] = XBEE_16BIT_DATATX; - offset = 5; - /* copy in the address */ - memcpy(&buf[2],con->tAddr,2); - - /* if: 64bit Data */ - } else { /* 64bit Data */ - buf[0] = XBEE_64BIT_DATATX; - offset = 11; - /* copy in the address */ - memcpy(&buf[2],con->tAddr,8); - } - - /* copy frameID */ - buf[1] = con->frameID; - - /* disable ack? broadcast? */ - buf[offset-1] = ((con->txDisableACK)?0x01:0x00) | ((con->txBroadcastPAN)?0x04:0x00); - - /* copy in the data */ - for (i=0;itype == xbee_64bitIO) || - (con->type == xbee_16bitIO)) { - /* not currently implemented... is it even allowed? */ - if (xbee->log) { - xbee_log("******* TODO ********\n"); - } - - /* ########################################## */ - /* if: Series 2 Data */ - } else if (con->type == xbee2_data) { - if (length > 72) return -1; - - buf[0] = XBEE2_DATATX; - buf[1] = con->frameID; - - /* copy in the relevant address */ - memcpy(&buf[2],con->tAddr,8); - buf[10] = 0xFF; - buf[11] = 0xFE; - - /* Maximum Radius/hops */ - buf[12] = 0x00; - - /* Options */ - buf[13] = 0x00; - - /* copy in the data */ - for (i=0;ipktmutex); - - /* if: there are no packets */ - if ((p = xbee->pktlist) == NULL) { - xbee_mutex_unlock(xbee->pktmutex); - /*if (xbee->log) { - xbee_log("No packets avaliable..."); - }*/ - return NULL; - } - - l = NULL; - q = NULL; - /* get the first avaliable packet for this connection */ - do { - /* does the packet match the connection? */ - if (xbee_matchpktcon(xbee, p, con)) { - q = p; - break; - } - /* move on */ - l = p; - p = p->next; - } while (p); - - /* if: no packet was found */ - if (!q) { - xbee_mutex_unlock(xbee->pktmutex); - if (xbee->log) { - struct timeval tv; - xbee_logS("--== Get Packet ==========--"); - gettimeofday(&tv,NULL); - xbee_logE("Didn't get a packet @ %ld.%06ld",tv.tv_sec,tv.tv_usec); - } - return NULL; - } - - /* if it was the first packet */ - if (l) { - /* relink the list */ - l->next = p->next; - if (!l->next) xbee->pktlast = l; - } else { - /* move the chain along */ - xbee->pktlist = p->next; - if (!xbee->pktlist) { - xbee->pktlast = NULL; - } else if (!xbee->pktlist->next) { - xbee->pktlast = xbee->pktlist; - } - } - xbee->pktcount--; - - /* unlink this packet from the chain! */ - q->next = NULL; - - if (xbee->log) { - struct timeval tv; - xbee_logS("--== Get Packet ==========--"); - gettimeofday(&tv,NULL); - xbee_logI("Got a packet @ %ld.%06ld",tv.tv_sec,tv.tv_usec); - xbee_logE("Packets left: %d",xbee->pktcount); - } - - /* unlock the packet mutex */ - xbee_mutex_unlock(xbee->pktmutex); - - /* and return the packet (must be free'd by caller!) */ - return q; -} - -/* ################################################################# - xbee_matchpktcon - INTERNAL - checks if the packet matches the connection */ -static int xbee_matchpktcon(xbee_hnd xbee, xbee_pkt *pkt, xbee_con *con) { - /* if: the connection type matches the packet type OR - the connection is 16/64bit remote AT, and the packet is a remote AT response */ - if ((pkt->type == con->type) || /* -- */ - ((pkt->type == xbee_remoteAT) && /* -- */ - ((con->type == xbee_16bitRemoteAT) || - (con->type == xbee_64bitRemoteAT)))) { - - - /* if: is a modem status (there can only be 1 modem status connection) */ - if (pkt->type == xbee_modemStatus) return 1; - - /* if: the packet is a txStatus or localAT and the frameIDs match */ - if ((pkt->type == xbee_txStatus) || - (pkt->type == xbee_localAT)) { - if (pkt->frameID == con->frameID) { - return 1; - } - /* if: the packet was sent as a 16bit remoteAT, and the 16bit addresss match */ - } else if ((pkt->type == xbee_remoteAT) && - (con->type == xbee_16bitRemoteAT) && - !memcmp(pkt->Addr16,con->tAddr,2)) { - return 1; - /* if: the packet was sent as a 64bit remoteAT, and the 64bit addresss match */ - } else if ((pkt->type == xbee_remoteAT) && - (con->type == xbee_64bitRemoteAT) && - !memcmp(pkt->Addr64,con->tAddr,8)) { - return 1; - /* if: the packet is 64bit addressed, and the addresses match */ - } else if (pkt->sAddr64 && !memcmp(pkt->Addr64,con->tAddr,8)) { - return 1; - /* if: the packet is 16bit addressed, and the addresses match */ - } else if (!pkt->sAddr64 && !memcmp(pkt->Addr16,con->tAddr,2)) { - return 1; - } else if (con->type == pkt->type && - (con->type == xbee_16bitData || con->type == xbee_64bitData) && - (pkt->isBroadcastADR || pkt->isBroadcastPAN)) { - unsigned char t[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - if ((con->tAddr64 && !memcmp(con->tAddr,t,8)) || - (!con->tAddr64 && !memcmp(con->tAddr,t,2))) { - return 1; - } - } - } - return 0; -} - -/* ################################################################# - xbee_parse_io - INTERNAL - parses the data given into the packet io information */ -static int xbee_parse_io(xbee_hnd xbee, xbee_pkt *p, unsigned char *d, - int maskOffset, int sampleOffset, int sample) { - xbee_sample *s = &(p->IOdata[sample]); - - /* copy in the I/O data mask */ - s->IOmask = (((d[maskOffset]<<8) | d[maskOffset + 1]) & 0x7FFF); - - /* copy in the digital I/O data */ - s->IOdigital = (((d[sampleOffset]<<8) | d[sampleOffset+1]) & 0x01FF); - - /* advance over the digital data, if its there */ - sampleOffset += ((s->IOmask & 0x01FF)?2:0); - - /* copy in the analog I/O data */ - if (s->IOmask & 0x0200) { - s->IOanalog[0] = (((d[sampleOffset]<<8) | d[sampleOffset+1]) & 0x03FF); - sampleOffset+=2; - } - if (s->IOmask & 0x0400) { - s->IOanalog[1] = (((d[sampleOffset]<<8) | d[sampleOffset+1]) & 0x03FF); - sampleOffset+=2; - } - if (s->IOmask & 0x0800) { - s->IOanalog[2] = (((d[sampleOffset]<<8) | d[sampleOffset+1]) & 0x03FF); - sampleOffset+=2; - } - if (s->IOmask & 0x1000) { - s->IOanalog[3] = (((d[sampleOffset]<<8) | d[sampleOffset+1]) & 0x03FF); - sampleOffset+=2; - } - if (s->IOmask & 0x2000) { - s->IOanalog[4] = (((d[sampleOffset]<<8) | d[sampleOffset+1]) & 0x03FF); - sampleOffset+=2; - } - if (s->IOmask & 0x4000) { - s->IOanalog[5] = (((d[sampleOffset]<<8) | d[sampleOffset+1]) & 0x03FF); - sampleOffset+=2; - } - - if (xbee->log) { - if (s->IOmask & 0x0001) - xbee_logI("Digital 0: %c",((s->IOdigital & 0x0001)?'1':'0')); - if (s->IOmask & 0x0002) - xbee_logI("Digital 1: %c",((s->IOdigital & 0x0002)?'1':'0')); - if (s->IOmask & 0x0004) - xbee_logI("Digital 2: %c",((s->IOdigital & 0x0004)?'1':'0')); - if (s->IOmask & 0x0008) - xbee_logI("Digital 3: %c",((s->IOdigital & 0x0008)?'1':'0')); - if (s->IOmask & 0x0010) - xbee_logI("Digital 4: %c",((s->IOdigital & 0x0010)?'1':'0')); - if (s->IOmask & 0x0020) - xbee_logI("Digital 5: %c",((s->IOdigital & 0x0020)?'1':'0')); - if (s->IOmask & 0x0040) - xbee_logI("Digital 6: %c",((s->IOdigital & 0x0040)?'1':'0')); - if (s->IOmask & 0x0080) - xbee_logI("Digital 7: %c",((s->IOdigital & 0x0080)?'1':'0')); - if (s->IOmask & 0x0100) - xbee_logI("Digital 8: %c",((s->IOdigital & 0x0100)?'1':'0')); - if (s->IOmask & 0x0200) - xbee_logI("Analog 0: %d (~%.2fv)",s->IOanalog[0],(3.3/1023)*s->IOanalog[0]); - if (s->IOmask & 0x0400) - xbee_logI("Analog 1: %d (~%.2fv)",s->IOanalog[1],(3.3/1023)*s->IOanalog[1]); - if (s->IOmask & 0x0800) - xbee_logI("Analog 2: %d (~%.2fv)",s->IOanalog[2],(3.3/1023)*s->IOanalog[2]); - if (s->IOmask & 0x1000) - xbee_logI("Analog 3: %d (~%.2fv)",s->IOanalog[3],(3.3/1023)*s->IOanalog[3]); - if (s->IOmask & 0x2000) - xbee_logI("Analog 4: %d (~%.2fv)",s->IOanalog[4],(3.3/1023)*s->IOanalog[4]); - if (s->IOmask & 0x4000) - xbee_logI("Analog 5: %d (~%.2fv)",s->IOanalog[5],(3.3/1023)*s->IOanalog[5]); - } - - return sampleOffset; -} - -/* ################################################################# - xbee_listen_stop - stops the listen thread after the current packet has been processed */ -void xbee_listen_stop(xbee_hnd xbee) { - ISREADYP(); - xbee->run = 0; -} - -/* ################################################################# - xbee_listen_wrapper - INTERNAL - the xbee_listen wrapper. Prints an error when xbee_listen ends */ -static void xbee_listen_wrapper(xbee_hnd xbee) { - int ret; - - /* just falls out if the proper 'go-ahead' isn't given */ - if (xbee->xbee_ready != -1) return; - /* now allow the parent to continue */ - xbee->xbee_ready = -2; - -#ifdef _WIN32 /* ---- */ - /* win32 requires this delay... no idea why */ - usleep(1000000); -#endif /* ----------- */ - - while (xbee->run) { - ret = xbee_listen(xbee); - if (!xbee->run) break; - xbee_log("xbee_listen() returned [%d]... Restarting in 25ms!",ret); - usleep(25000); - } -} - -/* xbee_listen - INTERNAL - the xbee xbee_listen thread - reads data from the xbee and puts it into a linked list to keep the xbee buffers free */ -static int xbee_listen(xbee_hnd xbee) { -#define LISTEN_BUFLEN 1024 - unsigned char c, t, d[LISTEN_BUFLEN]; - unsigned int l, i, chksum, o; - int j; - xbee_pkt *p = NULL, *q; - xbee_con *con; - int hasCon; - - /* do this forever :) */ - while (xbee->run) { - /* clean up any undesired storage */ - if (p) Xfree(p); - - /* wait for a valid start byte */ - if ((c = xbee_getrawbyte(xbee)) != 0x7E) { - if (xbee->log) xbee_log("***** Unexpected byte (0x%02X)... *****",c); - continue; - } - if (!xbee->run) return 0; - - xbee_logSf(); - if (xbee->log) { - struct timeval tv; - xbee_logI("--== RX Packet ===========--"); - gettimeofday(&tv,NULL); - xbee_logI("Got a packet @ %ld.%06ld",tv.tv_sec,tv.tv_usec); - } - - /* get the length */ - l = xbee_getbyte(xbee) << 8; - l += xbee_getbyte(xbee); - - /* check it is a valid length... */ - if (!l) { - if (xbee->log) { - xbee_logI("Recived zero length packet!"); - } - continue; - } - if (l > 100) { - if (xbee->log) { - xbee_logI("Recived oversized packet! Length: %d",l - 1); - } - } - if (l > LISTEN_BUFLEN) { - if (xbee->log) { - xbee_logI("Recived packet larger than buffer! Discarding..."); - } - continue; - } - - if (xbee->log) { - xbee_logI("Length: %d",l - 1); - } - - /* get the packet type */ - t = xbee_getbyte(xbee); - - /* start the checksum */ - chksum = t; - - /* suck in all the data */ - for (i = 0; l > 1 && i < LISTEN_BUFLEN; l--, i++) { - /* get an unescaped byte */ - c = xbee_getbyte(xbee); - d[i] = c; - chksum += c; - if (xbee->log) { - xbee_logIc("%3d | 0x%02X | ",i,c); - if ((c > 32) && (c < 127)) fprintf(xbee->log,"'%c'",c); else fprintf(xbee->log," _ "); - - if ((t == XBEE_LOCAL_AT && i == 4) || - (t == XBEE_REMOTE_AT && i == 14) || - (t == XBEE_64BIT_DATARX && i == 10) || - (t == XBEE_16BIT_DATARX && i == 4) || - (t == XBEE_64BIT_IO && i == 13) || - (t == XBEE_16BIT_IO && i == 7)) { - /* mark the beginning of the 'data' bytes */ - fprintf(xbee->log," <-- data starts"); - } else if (t == XBEE_64BIT_IO) { - if (i == 10) fprintf(xbee->log," <-- sample count"); - else if (i == 11) fprintf(xbee->log," <-- mask (msb)"); - else if (i == 12) fprintf(xbee->log," <-- mask (lsb)"); - } else if (t == XBEE_16BIT_IO) { - if (i == 4) fprintf(xbee->log," <-- sample count"); - else if (i == 5) fprintf(xbee->log," <-- mask (msb)"); - else if (i == 6) fprintf(xbee->log," <-- mask (lsb)"); - } - xbee_logIcf(); - } - } - i--; /* it went up too many times!... */ - - /* add the checksum */ - chksum += xbee_getbyte(xbee); - - /* check if the whole packet was recieved, or something else occured... unlikely... */ - if (l>1) { - if (xbee->log) { - xbee_logE("Didn't get whole packet... :("); - } - continue; - } - - /* check the checksum */ - if ((chksum & 0xFF) != 0xFF) { - if (xbee->log) { - chksum &= 0xFF; - xbee_logE("Invalid Checksum: 0x%02X",chksum); - } - continue; - } - - /* make a new packet */ - p = Xcalloc(sizeof(xbee_pkt)); - q = NULL; - p->datalen = 0; - - /* ########################################## */ - /* if: modem status */ - if (t == XBEE_MODEM_STATUS) { - if (xbee->log) { - xbee_logI("Packet type: Modem Status (0x8A)"); - xbee_logIc("Event: "); - switch (d[0]) { - case 0x00: fprintf(xbee->log,"Hardware reset"); break; - case 0x01: fprintf(xbee->log,"Watchdog timer reset"); break; - case 0x02: fprintf(xbee->log,"Associated"); break; - case 0x03: fprintf(xbee->log,"Disassociated"); break; - case 0x04: fprintf(xbee->log,"Synchronization lost"); break; - case 0x05: fprintf(xbee->log,"Coordinator realignment"); break; - case 0x06: fprintf(xbee->log,"Coordinator started"); break; - } - fprintf(xbee->log,"... (0x%02X)",d[0]); - xbee_logIcf(); - } - p->type = xbee_modemStatus; - - p->sAddr64 = FALSE; - p->dataPkt = FALSE; - p->txStatusPkt = FALSE; - p->modemStatusPkt = TRUE; - p->remoteATPkt = FALSE; - p->IOPkt = FALSE; - - /* modem status can only ever give 1 'data' byte */ - p->datalen = 1; - p->data[0] = d[0]; - - /* ########################################## */ - /* if: local AT response */ - } else if (t == XBEE_LOCAL_AT) { - if (xbee->log) { - xbee_logI("Packet type: Local AT Response (0x88)"); - xbee_logI("FrameID: 0x%02X",d[0]); - xbee_logI("AT Command: %c%c",d[1],d[2]); - xbee_logIc("Status: "); - if (d[3] == 0x00) fprintf(xbee->log,"OK"); - else if (d[3] == 0x01) fprintf(xbee->log,"Error"); - else if (d[3] == 0x02) fprintf(xbee->log,"Invalid Command"); - else if (d[3] == 0x03) fprintf(xbee->log,"Invalid Parameter"); - fprintf(xbee->log," (0x%02X)",d[3]); - xbee_logIcf(); - } - p->type = xbee_localAT; - - p->sAddr64 = FALSE; - p->dataPkt = FALSE; - p->txStatusPkt = FALSE; - p->modemStatusPkt = FALSE; - p->remoteATPkt = FALSE; - p->IOPkt = FALSE; - - p->frameID = d[0]; - p->atCmd[0] = d[1]; - p->atCmd[1] = d[2]; - - p->status = d[3]; - - /* copy in the data */ - p->datalen = i-3; - for (;i>3;i--) p->data[i-4] = d[i]; - - /* ########################################## */ - /* if: remote AT response */ - } else if (t == XBEE_REMOTE_AT) { - if (xbee->log) { - xbee_logI("Packet type: Remote AT Response (0x97)"); - xbee_logI("FrameID: 0x%02X",d[0]); - xbee_logIc("64-bit Address: "); - for (j=0;j<8;j++) { - fprintf(xbee->log,(j?":%02X":"%02X"),d[1+j]); - } - xbee_logIcf(); - xbee_logIc("16-bit Address: "); - for (j=0;j<2;j++) { - fprintf(xbee->log,(j?":%02X":"%02X"),d[9+j]); - } - xbee_logIcf(); - xbee_logI("AT Command: %c%c",d[11],d[12]); - xbee_logIc("Status: "); - if (d[13] == 0x00) fprintf(xbee->log,"OK"); - else if (d[13] == 0x01) fprintf(xbee->log,"Error"); - else if (d[13] == 0x02) fprintf(xbee->log,"Invalid Command"); - else if (d[13] == 0x03) fprintf(xbee->log,"Invalid Parameter"); - else if (d[13] == 0x04) fprintf(xbee->log,"No Response"); - fprintf(xbee->log," (0x%02X)",d[13]); - xbee_logIcf(); - } - p->type = xbee_remoteAT; - - p->sAddr64 = FALSE; - p->dataPkt = FALSE; - p->txStatusPkt = FALSE; - p->modemStatusPkt = FALSE; - p->remoteATPkt = TRUE; - p->IOPkt = FALSE; - - p->frameID = d[0]; - - p->Addr64[0] = d[1]; - p->Addr64[1] = d[2]; - p->Addr64[2] = d[3]; - p->Addr64[3] = d[4]; - p->Addr64[4] = d[5]; - p->Addr64[5] = d[6]; - p->Addr64[6] = d[7]; - p->Addr64[7] = d[8]; - - p->Addr16[0] = d[9]; - p->Addr16[1] = d[10]; - - p->atCmd[0] = d[11]; - p->atCmd[1] = d[12]; - - p->status = d[13]; - - p->samples = 1; - - if (p->status == 0x00 && p->atCmd[0] == 'I' && p->atCmd[1] == 'S') { - /* parse the io data */ - xbee_logI("--- Sample -----------------"); - xbee_parse_io(xbee, p, d, 15, 17, 0); - xbee_logI("----------------------------"); - } else { - /* copy in the data */ - p->datalen = i-13; - for (;i>13;i--) p->data[i-14] = d[i]; - } - - /* ########################################## */ - /* if: TX status */ - } else if (t == XBEE_TX_STATUS) { - if (xbee->log) { - xbee_logI("Packet type: TX Status Report (0x89)"); - xbee_logI("FrameID: 0x%02X",d[0]); - xbee_logIc("Status: "); - if (d[1] == 0x00) fprintf(xbee->log,"Success"); - else if (d[1] == 0x01) fprintf(xbee->log,"No ACK"); - else if (d[1] == 0x02) fprintf(xbee->log,"CCA Failure"); - else if (d[1] == 0x03) fprintf(xbee->log,"Purged"); - fprintf(xbee->log," (0x%02X)",d[1]); - xbee_logIcf(); - } - p->type = xbee_txStatus; - - p->sAddr64 = FALSE; - p->dataPkt = FALSE; - p->txStatusPkt = TRUE; - p->modemStatusPkt = FALSE; - p->remoteATPkt = FALSE; - p->IOPkt = FALSE; - - p->frameID = d[0]; - - p->status = d[1]; - - /* never returns data */ - p->datalen = 0; - - /* check for any connections waiting for a status update */ - /* lock the connection mutex */ - xbee_mutex_lock(xbee->conmutex); - xbee_logI("Looking for a connection that wants a status update..."); - con = xbee->conlist; - while (con) { - if ((con->frameID == p->frameID) && - (con->ACKstatus == 0xFF)) { - xbee_logI("Found @ 0x%08X!",con); - con->ACKstatus = p->status; - xbee_sem_post(con->waitforACKsem); - } - con = con->next; - } - - /* unlock the connection mutex */ - xbee_mutex_unlock(xbee->conmutex); - - /* ########################################## */ - /* if: 16 / 64bit data recieve */ - } else if ((t == XBEE_64BIT_DATARX) || - (t == XBEE_16BIT_DATARX)) { - int offset; - if (t == XBEE_64BIT_DATARX) { /* 64bit */ - offset = 8; - } else { /* 16bit */ - offset = 2; - } - if (xbee->log) { - xbee_logI("Packet type: %d-bit RX Data (0x%02X)",((t == XBEE_64BIT_DATARX)?64:16),t); - xbee_logIc("%d-bit Address: ",((t == XBEE_64BIT_DATARX)?64:16)); - for (j=0;jlog,(j?":%02X":"%02X"),d[j]); - } - xbee_logIcf(); - xbee_logI("RSSI: -%ddB",d[offset]); - if (d[offset + 1] & 0x02) xbee_logI("Options: Address Broadcast"); - if (d[offset + 1] & 0x04) xbee_logI("Options: PAN Broadcast"); - } - p->isBroadcastADR = !!(d[offset+1] & 0x02); - p->isBroadcastPAN = !!(d[offset+1] & 0x04); - p->dataPkt = TRUE; - p->txStatusPkt = FALSE; - p->modemStatusPkt = FALSE; - p->remoteATPkt = FALSE; - p->IOPkt = FALSE; - - if (t == XBEE_64BIT_DATARX) { /* 64bit */ - p->type = xbee_64bitData; - - p->sAddr64 = TRUE; - - p->Addr64[0] = d[0]; - p->Addr64[1] = d[1]; - p->Addr64[2] = d[2]; - p->Addr64[3] = d[3]; - p->Addr64[4] = d[4]; - p->Addr64[5] = d[5]; - p->Addr64[6] = d[6]; - p->Addr64[7] = d[7]; - } else { /* 16bit */ - p->type = xbee_16bitData; - - p->sAddr64 = FALSE; - - p->Addr16[0] = d[0]; - p->Addr16[1] = d[1]; - } - - /* save the RSSI / signal strength - this can be used with printf as: - printf("-%ddB\n",p->RSSI); */ - p->RSSI = d[offset]; - - p->status = d[offset + 1]; - - /* copy in the data */ - p->datalen = i-(offset + 1); - for (;i>offset + 1;i--) p->data[i-(offset + 2)] = d[i]; - - /* ########################################## */ - /* if: 16 / 64bit I/O recieve */ - } else if ((t == XBEE_64BIT_IO) || - (t == XBEE_16BIT_IO)) { - int offset,i2; - if (t == XBEE_64BIT_IO) { /* 64bit */ - p->type = xbee_64bitIO; - - p->sAddr64 = TRUE; - - p->Addr64[0] = d[0]; - p->Addr64[1] = d[1]; - p->Addr64[2] = d[2]; - p->Addr64[3] = d[3]; - p->Addr64[4] = d[4]; - p->Addr64[5] = d[5]; - p->Addr64[6] = d[6]; - p->Addr64[7] = d[7]; - - offset = 8; - p->samples = d[10]; - } else { /* 16bit */ - p->type = xbee_16bitIO; - - p->sAddr64 = FALSE; - - p->Addr16[0] = d[0]; - p->Addr16[1] = d[1]; - - offset = 2; - p->samples = d[4]; - } - if (p->samples > 1) { - p = Xrealloc(p, sizeof(xbee_pkt) + (sizeof(xbee_sample) * (p->samples - 1))); - } - if (xbee->log) { - xbee_logI("Packet type: %d-bit RX I/O Data (0x%02X)",((t == XBEE_64BIT_IO)?64:16),t); - xbee_logIc("%d-bit Address: ",((t == XBEE_64BIT_IO)?64:16)); - for (j = 0; j < offset; j++) { - fprintf(xbee->log,(j?":%02X":"%02X"),d[j]); - } - xbee_logIcf(); - xbee_logI("RSSI: -%ddB",d[offset]); - xbee_logI("Samples: %d",d[offset + 2]); - } - i2 = offset + 5; - - /* never returns data */ - p->datalen = 0; - - p->dataPkt = FALSE; - p->txStatusPkt = FALSE; - p->modemStatusPkt = FALSE; - p->remoteATPkt = FALSE; - p->IOPkt = TRUE; - - /* save the RSSI / signal strength - this can be used with printf as: - printf("-%ddB\n",p->RSSI); */ - p->RSSI = d[offset]; - - p->status = d[offset + 1]; - - /* each sample is split into its own packet here, for simplicity */ - for (o = 0; o < p->samples; o++) { - if (i2 >= i) { - xbee_logI("Invalid I/O data! Actually contained %d samples...",o); - p = Xrealloc(p, sizeof(xbee_pkt) + (sizeof(xbee_sample) * ((o>1)?o:1))); - p->samples = o; - break; - } - xbee_logI("--- Sample %3d -------------", o); - - /* parse the io data */ - i2 = xbee_parse_io(xbee, p, d, offset + 3, i2, o); - } - xbee_logI("----------------------------"); - - /* ########################################## */ - /* if: Series 2 Transmit status */ - } else if (t == XBEE2_TX_STATUS) { - if (xbee->log) { - xbee_logI("Packet type: Series 2 Transmit Status (0x%02X)", t); - xbee_logI("FrameID: 0x%02X",d[0]); - xbee_logI("16-bit Delivery Address: %02X:%02X",d[1],d[2]); - xbee_logI("Transmit Retry Count: %02X",d[3]); - xbee_logIc("Delivery Status: "); - if (d[4] == 0x00) fprintf(xbee->log,"Success"); - else if (d[4] == 0x02) fprintf(xbee->log,"CCA Failure"); - else if (d[4] == 0x15) fprintf(xbee->log,"Invalid Destination"); - else if (d[4] == 0x21) fprintf(xbee->log,"Network ACK Failure"); - else if (d[4] == 0x22) fprintf(xbee->log,"Not Joined to Network"); - else if (d[4] == 0x23) fprintf(xbee->log,"Self-Addressed"); - else if (d[4] == 0x24) fprintf(xbee->log,"Address Not Found"); - else if (d[4] == 0x25) fprintf(xbee->log,"Route Not Found"); - else if (d[4] == 0x74) fprintf(xbee->log,"Data Payload Too Large"); /* ??? */ - fprintf(xbee->log," (0x%02X)",d[4]); - xbee_logIcf(); - - xbee_logIc("Discovery Status: "); - if (d[5] == 0x00) fprintf(xbee->log,"No Discovery Overhead"); - else if (d[5] == 0x01) fprintf(xbee->log,"Address Discovery"); - else if (d[5] == 0x02) fprintf(xbee->log,"Route Discovery"); - else if (d[5] == 0x03) fprintf(xbee->log,"Address & Route Discovery"); - fprintf(xbee->log," (0x%02X)",d[5]); - xbee_logIcf(); - } - - p->type = xbee2_txStatus; - - p->sAddr64 = FALSE; - p->dataPkt = FALSE; - p->txStatusPkt = TRUE; - p->modemStatusPkt = FALSE; - p->remoteATPkt = FALSE; - p->IOPkt = FALSE; - - p->frameID = d[0]; - - p->status = d[4]; - - /* never returns data */ - p->datalen = 0; - - /* ########################################## */ - /* if: Series 2 data recieve */ - } else if (t == XBEE2_DATARX) { - int offset; - offset = 10; - if (xbee->log) { - xbee_logI("Packet type: Series 2 Data Rx (0x%02X)", t); - - xbee_logIc("64-bit Address: "); - for (j=0;j<8;j++) { - fprintf(xbee->log,(j?":%02X":"%02X"),d[j]); - } - xbee_logIcf(); - - xbee_logIc("16-bit Address: "); - for (j=0;j<2;j++) { - fprintf(xbee->log,(j?":%02X":"%02X"),d[j+8]); - } - xbee_logIcf(); - - if (d[offset] & 0x01) xbee_logI("Options: Packet Acknowledged"); - if (d[offset] & 0x02) xbee_logI("Options: Packet was a broadcast packet"); - if (d[offset] & 0x20) xbee_logI("Options: Packet Encrypted"); /* ??? */ - if (d[offset] & 0x40) xbee_logI("Options: Packet from end device"); /* ??? */ - } - p->dataPkt = TRUE; - p->txStatusPkt = FALSE; - p->modemStatusPkt = FALSE; - p->remoteATPkt = FALSE; - p->IOPkt = FALSE; - p->type = xbee2_data; - p->sAddr64 = TRUE; - - p->Addr64[0] = d[0]; - p->Addr64[1] = d[1]; - p->Addr64[2] = d[2]; - p->Addr64[3] = d[3]; - p->Addr64[4] = d[4]; - p->Addr64[5] = d[5]; - p->Addr64[6] = d[6]; - p->Addr64[7] = d[7]; - - p->Addr16[0] = d[8]; - p->Addr16[1] = d[9]; - - p->status = d[offset]; - - /* copy in the data */ - p->datalen = i - (offset + 1); - for (;i>offset;i--) { - p->data[i-(offset + 1)] = d[i]; - } - - /* ########################################## */ - /* if: Unknown */ - } else { - xbee_logE("Packet type: Unknown (0x%02X)",t); - continue; - } - p->next = NULL; - - /* lock the connection mutex */ - xbee_mutex_lock(xbee->conmutex); - - hasCon = 0; - if (p->isBroadcastADR || p->isBroadcastPAN) { - unsigned char t[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - /* if the packet was broadcast, search for a broadcast accepting connection */ - con = xbee->conlist; - while (con) { - if (con->type == p->type && - (con->type == xbee_16bitData || con->type == xbee_64bitData) && - ((con->tAddr64 && !memcmp(con->tAddr,t,8)) || - (!con->tAddr64 && !memcmp(con->tAddr,t,2)))) { - hasCon = 1; - xbee_logI("Found broadcasting connection @ 0x%08X",con); - break; - } - con = con->next; - } - } - if (!hasCon || !con) { - con = xbee->conlist; - while (con) { - if (xbee_matchpktcon(xbee, p, con)) { - hasCon = 1; - break; - } - con = con->next; - } - } - - /* unlock the connection mutex */ - xbee_mutex_unlock(xbee->conmutex); - - /* if the packet doesn't have a connection, don't add it! */ - if (!hasCon) { - xbee_logE("Connectionless packet... discarding!"); - continue; - } - - /* if the connection has a callback function then it is passed the packet - and the packet is not added to the list */ - if (con && con->callback) { - t_callback_list *l, *q; - - xbee_mutex_lock(con->callbackListmutex); - l = con->callbackList; - q = NULL; - while (l) { - q = l; - l = l->next; - } - l = Xcalloc(sizeof(t_callback_list)); - l->pkt = p; - if (!con->callbackList || q == NULL) { - con->callbackList = l; - } else { - q->next = l; - } - xbee_mutex_unlock(con->callbackListmutex); - - xbee_logI("Using callback function!"); - xbee_logI(" info block @ 0x%08X",l); - xbee_logI(" function @ 0x%08X",con->callback); - xbee_logI(" connection @ 0x%08X",con); - xbee_logE(" packet @ 0x%08X",p); - - /* if the callback thread not still running, then start a new one! */ - if (!xbee_mutex_trylock(con->callbackmutex)) { - xbee_thread_t t; - int ret; - t_threadList *p, *q; - t_CBinfo info; - info.xbee = xbee; - info.con = con; - xbee_log("Starting new callback thread!"); - if ((ret = xbee_thread_create(t,xbee_callbackWrapper,&info)) != 0) { - xbee_mutex_unlock(con->callbackmutex); - /* this MAY help with future attempts... */ - xbee_sem_post(xbee->threadsem); - xbee_logS("An error occured while starting thread (%d)... Out of resources?", ret); - xbee_logE("This packet has been lost!"); - continue; - } - xbee_log("Started thread 0x%08X!", t); - xbee_mutex_lock(xbee->threadmutex); - p = xbee->threadList; - q = NULL; - while (p) { - q = p; - p = p->next; - } - p = Xcalloc(sizeof(t_threadList)); - if (q == NULL) { - xbee->threadList = p; - } else { - q->next = p; - } - p->thread = t; - p->next = NULL; - xbee_mutex_unlock(xbee->threadmutex); - } else { - xbee_logE("Using existing callback thread... callback has been scheduled."); - } - /* prevent the packet from being free'd */ - p = NULL; - continue; - } - - /* lock the packet mutex, so we can safely add the packet to the list */ - xbee_mutex_lock(xbee->pktmutex); - - /* if: the list is empty */ - if (!xbee->pktlist) { - /* start the list! */ - xbee->pktlist = p; - } else if (xbee->pktlast) { - /* add the packet to the end */ - xbee->pktlast->next = p; - } else { - /* pktlast wasnt set... look for the end and then set it */ - i = 0; - q = xbee->pktlist; - while (q->next) { - q = q->next; - i++; - } - q->next = p; - xbee->pktcount = i; - } - xbee->pktlast = p; - xbee->pktcount++; - - /* unlock the packet mutex */ - xbee_mutex_unlock(xbee->pktmutex); - - xbee_logI("--========================--"); - xbee_logE("Packets: %d",xbee->pktcount); - - p = q = NULL; - } - return 0; -} - -static void xbee_callbackWrapper(t_CBinfo *info) { - xbee_hnd xbee; - xbee_con *con; - xbee_pkt *pkt; - t_callback_list *temp; - xbee = info->xbee; - con = info->con; - /* dont forget! the callback mutex is already locked... by the parent thread :) */ - xbee_mutex_lock(con->callbackListmutex); - while (con->callbackList) { - /* shift the list along 1 */ - temp = con->callbackList; - con->callbackList = temp->next; - xbee_mutex_unlock(con->callbackListmutex); - /* get the packet */ - pkt = temp->pkt; - - xbee_logS("Starting callback function..."); - xbee_logI(" info block @ 0x%08X",temp); - xbee_logI(" function @ 0x%08X",con->callback); - xbee_logI(" connection @ 0x%08X",con); - xbee_logE(" packet @ 0x%08X",pkt); - Xfree(temp); - if (con->callback) { - con->callback(con,pkt); - xbee_log("Callback complete!"); - if (!con->noFreeAfterCB) Xfree(pkt); - } else { - xbee_pkt *q; - int i; - xbee_log("Callback function was removed! Appending packet to main list..."); - /* lock the packet mutex, so we can safely add the packet to the list */ - xbee_mutex_lock(xbee->pktmutex); - - /* if: the list is empty */ - if (!xbee->pktlist) { - /* start the list! */ - xbee->pktlist = pkt; - } else if (xbee->pktlast) { - /* add the packet to the end */ - xbee->pktlast->next = pkt; - } else { - /* pktlast wasnt set... look for the end and then set it */ - i = 0; - q = xbee->pktlist; - while (q->next) { - q = q->next; - i++; - } - q->next = pkt; - xbee->pktcount = i; - } - xbee->pktlast = pkt; - xbee->pktcount++; - - /* unlock the packet mutex */ - xbee_mutex_unlock(xbee->pktmutex); - } - - xbee_mutex_lock(con->callbackListmutex); - } - xbee_mutex_unlock(con->callbackListmutex); - - xbee_log("Callback thread ending..."); - /* releasing the thread mutex is the last thing we do! */ - xbee_mutex_unlock(con->callbackmutex); - - if (con->destroySelf) { - _xbee_endcon2(xbee,&con,1); - } - xbee_sem_post(xbee->threadsem); -} - -/* ################################################################# - xbee_thread_watch - INTERNAL - watches for dead threads and tidies up */ -static void xbee_thread_watch(xbee_hnd xbee) { - -#ifdef _WIN32 /* ---- */ - /* win32 requires this delay... no idea why */ - usleep(1000000); -#endif /* ----------- */ - - xbee_mutex_init(xbee->threadmutex); - xbee_sem_init(xbee->threadsem); - - while (xbee->run) { - t_threadList *p, *q, *t; - xbee_mutex_lock(xbee->threadmutex); - p = xbee->threadList; - q = NULL; - - while (p) { - t = p; - p = p->next; - if (!(xbee_thread_tryjoin(t->thread))) { - xbee_log("Joined with thread 0x%08X...",t->thread); - if (t == xbee->threadList) { - xbee->threadList = t->next; - } else if (q) { - q->next = t->next; - } - free(t); - } else { - q = t; - } - } - - xbee_mutex_unlock(xbee->threadmutex); - xbee_sem_wait(xbee->threadsem); - usleep(100000); /* 100ms to allow the thread to end before we try to join */ - } - - xbee_mutex_destroy(xbee->threadmutex); - xbee_sem_destroy(xbee->threadsem); -} - - -/* ################################################################# - xbee_getbyte - INTERNAL - waits for an escaped byte of data */ -static unsigned char xbee_getbyte(xbee_hnd xbee) { - unsigned char c; - - /* take a byte */ - c = xbee_getrawbyte(xbee); - /* if its escaped, take another and un-escape */ - if (c == 0x7D) c = xbee_getrawbyte(xbee) ^ 0x20; - - return (c & 0xFF); -} - -/* ################################################################# - xbee_getrawbyte - INTERNAL - waits for a raw byte of data */ -static unsigned char xbee_getrawbyte(xbee_hnd xbee) { - int ret; - unsigned char c = 0x00; - - /* the loop is just incase there actually isnt a byte there to be read... */ - do { - /* wait for a read to be possible */ - if ((ret = xbee_select(xbee,NULL)) == -1) { - xbee_perror("libxbee:xbee_getrawbyte()"); - exit(1); - } - if (!xbee->run) break; - if (ret == 0) continue; - - /* read 1 character */ - if (xbee_read(xbee,&c,1) == 0) { - /* for some reason no characters were read... */ - if (xbee_ferror(xbee) || xbee_feof(xbee)) { - xbee_log("Error or EOF detected"); - fprintf(stderr,"libxbee:xbee_read(): Error or EOF detected\n"); - exit(1); /* this should have something nicer... */ - } - /* no error... try again */ - usleep(10); - continue; - } - } while (0); - - return (c & 0xFF); -} - -/* ################################################################# - _xbee_send_pkt - INTERNAL - sends a complete packet of data */ -static int _xbee_send_pkt(xbee_hnd xbee, t_data *pkt, xbee_con *con) { - int retval = 0; - - /* lock connection mutex */ - xbee_mutex_lock(con->Txmutex); - /* lock the send mutex */ - xbee_mutex_lock(xbee->sendmutex); - - /* write and flush the data */ - xbee_write(xbee,pkt->data,pkt->length); - - /* unlock the mutex */ - xbee_mutex_unlock(xbee->sendmutex); - - xbee_logSf(); - if (xbee->log) { - int i,x,y; - /* prints packet in hex byte-by-byte */ - xbee_logIc("TX Packet:"); - for (i=0,x=0,y=0;ilength;i++,x--) { - if (x == 0) { - fprintf(xbee->log,"\n 0x%04X | ",y); - x = 0x8; - y += x; - } - if (x == 4) { - fprintf(xbee->log," "); - } - fprintf(xbee->log,"0x%02X ",pkt->data[i]); - } - xbee_logIcf(); - } - xbee_logEf(); - - if (con->waitforACK && - ((con->type == xbee_16bitData) || - (con->type == xbee_64bitData))) { - con->ACKstatus = 0xFF; /* waiting */ - xbee_log("Waiting for ACK/NAK response..."); - xbee_sem_wait1sec(con->waitforACKsem); - switch (con->ACKstatus) { - case 0: xbee_log("ACK recieved!"); break; - case 1: xbee_log("NAK recieved..."); break; - case 2: xbee_log("CCA failure..."); break; - case 3: xbee_log("Purged..."); break; - case 255: default: xbee_log("Timeout..."); - } - if (con->ACKstatus) retval = 1; /* error */ - } - - /* unlock connection mutex */ - xbee_mutex_unlock(con->Txmutex); - - /* free the packet */ - Xfree(pkt); - - return retval; -} - -/* ################################################################# - xbee_make_pkt - INTERNAL - adds delimiter field - calculates length and checksum - escapes bytes */ -static t_data *xbee_make_pkt(xbee_hnd xbee, unsigned char *data, int length) { - t_data *pkt; - unsigned int l, i, o, t, x, m; - char d = 0; - - /* check the data given isnt too long - 100 bytes maximum payload + 12 bytes header information */ - if (length > 100 + 12) return NULL; - - /* calculate the length of the whole packet - start, length (MSB), length (LSB), DATA, checksum */ - l = 3 + length + 1; - - /* prepare memory */ - pkt = Xcalloc(sizeof(t_data)); - - /* put start byte on */ - pkt->data[0] = 0x7E; - - /* copy data into packet */ - for (t = 0, i = 0, o = 1, m = 1; i <= length; o++, m++) { - /* if: its time for the checksum */ - if (i == length) d = M8((0xFF - M8(t))); - /* if: its time for the high length byte */ - else if (m == 1) d = M8(length >> 8); - /* if: its time for the low length byte */ - else if (m == 2) d = M8(length); - /* if: its time for the normal data */ - else if (m > 2) d = data[i]; - - x = 0; - /* check for any escapes needed */ - if ((d == 0x11) || /* XON */ - (d == 0x13) || /* XOFF */ - (d == 0x7D) || /* Escape */ - (d == 0x7E)) { /* Frame Delimiter */ - l++; - pkt->data[o++] = 0x7D; - x = 1; - } - - /* move data in */ - pkt->data[o] = ((!x)?d:d^0x20); - if (m > 2) { - i++; - t += d; - } - } - - /* remember the length */ - pkt->length = l; - - return pkt; -} diff --git a/libs/thirdParty/libxbee/api.h b/libs/thirdParty/libxbee/api.h deleted file mode 100644 index 692bd7b165cfb9f8ae746af583da2f2c3317fd17..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/api.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -#include -#include - -#include - -#include -#include -#include -#include - -#ifdef __GNUC__ /* ---- */ -#include -#include -#define __USE_GNU -#include -#undef __USE_GNU -#include -#else /* -------------- */ -#include -#include -#include -#include -#endif /* ------------- */ - -#ifdef __UMAKEFILE - #define HOST_OS "Embedded" -#elif defined(__GNUC__) - #define HOST_OS "Linux" -#elif defined(_WIN32) - #define HOST_OS "Win32" -#else - #define HOST_OS "UNKNOWN" -#endif - -#define TRUE 1 -#define FALSE 0 - -#define M8(x) (x & 0xFF) - -/* various connection types */ -#define XBEE_LOCAL_AT 0x88 -#define XBEE_LOCAL_ATREQ 0x08 -#define XBEE_LOCAL_ATQUE 0x09 - -#define XBEE_REMOTE_AT 0x97 -#define XBEE_REMOTE_ATREQ 0x17 - -#define XBEE_MODEM_STATUS 0x8A - -/* XBee Series 1 stuff */ -#define XBEE_TX_STATUS 0x89 -#define XBEE_64BIT_DATATX 0x00 -#define XBEE_64BIT_DATARX 0x80 -#define XBEE_16BIT_DATATX 0x01 -#define XBEE_16BIT_DATARX 0x81 -#define XBEE_64BIT_IO 0x82 -#define XBEE_16BIT_IO 0x83 - -/* XBee Series 2 stuff */ -#define XBEE2_DATATX 0x10 -#define XBEE2_DATARX 0x90 -#define XBEE2_TX_STATUS 0x8B - -typedef struct xbee_hnd* xbee_hnd; - -#define __LIBXBEE_API_H -#include "xbee.h" - -typedef struct t_threadList t_threadList; -struct t_threadList { - xbee_thread_t thread; - t_threadList *next; -}; - -struct xbee_hnd { - xbee_file_t tty; -#ifdef __GNUC__ /* ---- */ - int ttyfd; -#else /* -------------- */ - int ttyr; - int ttyw; - int ttyeof; - - OVERLAPPED ttyovrw; - OVERLAPPED ttyovrr; - OVERLAPPED ttyovrs; -#endif /* ------------- */ - - char *path; /* serial port path */ - - xbee_mutex_t logmutex; - FILE *log; - int logfd; - - xbee_mutex_t conmutex; - xbee_con *conlist; - - xbee_mutex_t pktmutex; - xbee_pkt *pktlist; - xbee_pkt *pktlast; - int pktcount; - - xbee_mutex_t sendmutex; - - xbee_thread_t listent; - - xbee_thread_t threadt; - xbee_mutex_t threadmutex; - xbee_sem_t threadsem; - t_threadList *threadList; - - int run; - - int oldAPI; - char cmdSeq; - int cmdTime; - - /* ready flag. - needs to be set to -1 so that the listen thread can begin. */ - volatile int xbee_ready; - - xbee_hnd next; -}; -xbee_hnd default_xbee = NULL; -xbee_mutex_t xbee_hnd_mutex; - -typedef struct t_data t_data; -struct t_data { - unsigned char data[128]; - unsigned int length; -}; - -typedef struct t_LTinfo t_LTinfo; -struct t_LTinfo { - int i; - xbee_hnd xbee; -}; - -typedef struct t_CBinfo t_CBinfo; -struct t_CBinfo { - xbee_hnd xbee; - xbee_con *con; -}; - -typedef struct t_callback_list t_callback_list; -struct t_callback_list { - xbee_pkt *pkt; - t_callback_list *next; -}; - -static void *Xmalloc2(xbee_hnd xbee, size_t size); -static void *Xcalloc2(xbee_hnd xbee, size_t size); -static void *Xrealloc2(xbee_hnd xbee, void *ptr, size_t size); -static void Xfree2(void **ptr); -#define Xmalloc(x) Xmalloc2(xbee,(x)) -#define Xcalloc(x) Xcalloc2(xbee,(x)) -#define Xrealloc(x,y) Xrealloc2(xbee,(x),(y)) -#define Xfree(x) Xfree2((void **)&x) - -/* usage: - xbee_logSf() lock the log - xbee_logEf() unlock the log - - xbee_log() lock print with \n unlock # to print a single line - xbee_logc() lock print with no \n # to print a single line with a custom ending - xbee_logcf() print \n unlock # to end a custom-ended single line - - xbee_logS() lock print with \n # to start a continuous block - xbee_logI() print with \n # to continue a continuous block - xbee_logIc() print with no \n # to continue a continuous block with a custom ending - xbee_logIcf() print \n # to continue a continuous block with ended custom-ended line - xbee_logE() print with \n unlock # to end a continuous block -*/ -static void xbee_logf(xbee_hnd xbee, const char *logformat, const char *file, - const int line, const char *function, char *format, ...); -#define LOG_FORMAT "[%s:%d] %s(): %s" - -#define xbee_logSf() if (xbee->log) { xbee_mutex_lock(xbee->logmutex); } -#define xbee_logEf() if (xbee->log) { xbee_mutex_unlock(xbee->logmutex); } - -#define xbee_log(...) if (xbee->log) { xbee_logSf(); xbee_logf(xbee,LOG_FORMAT"\n",__FILE__,__LINE__,__FUNCTION__,__VA_ARGS__); xbee_logEf(); } -#define xbee_logc(...) if (xbee->log) { xbee_logSf(); xbee_logf(xbee,LOG_FORMAT ,__FILE__,__LINE__,__FUNCTION__,__VA_ARGS__); } -#define xbee_logcf() if (xbee->log) { fprintf(xbee->log, "\n"); xbee_logEf(); } - -#define xbee_logS(...) if (xbee->log) { xbee_logSf(); xbee_logf(xbee,LOG_FORMAT"\n",__FILE__,__LINE__,__FUNCTION__,__VA_ARGS__); } -#define xbee_logI(...) if (xbee->log) { xbee_logf(xbee,LOG_FORMAT"\n",__FILE__,__LINE__,__FUNCTION__,__VA_ARGS__); } -#define xbee_logIc(...) if (xbee->log) { xbee_logf(xbee,LOG_FORMAT ,__FILE__,__LINE__,__FUNCTION__,__VA_ARGS__); } -#define xbee_logIcf() if (xbee->log) { fprintf(xbee->log, "\n"); } -#define xbee_logE(...) if (xbee->log) { xbee_logf(xbee,LOG_FORMAT"\n",__FILE__,__LINE__,__FUNCTION__,__VA_ARGS__); xbee_logEf(); } - -#define xbee_perror(str) \ - if (xbee->log) xbee_logI("%s:%s",str,strerror(errno)); \ - perror(str); - -static int xbee_startAPI(xbee_hnd xbee); - -static int xbee_sendAT(xbee_hnd xbee, char *command, char *retBuf, int retBuflen); -static int xbee_sendATdelay(xbee_hnd xbee, int guardTime, char *command, char *retBuf, int retBuflen); - -static int xbee_parse_io(xbee_hnd xbee, xbee_pkt *p, unsigned char *d, - int maskOffset, int sampleOffset, int sample); - -static void xbee_thread_watch(xbee_hnd xbee); -static void xbee_listen_wrapper(xbee_hnd xbee); -static int xbee_listen(xbee_hnd xbee); -static unsigned char xbee_getbyte(xbee_hnd xbee); -static unsigned char xbee_getrawbyte(xbee_hnd xbee); -static int xbee_matchpktcon(xbee_hnd xbee, xbee_pkt *pkt, xbee_con *con); - -static t_data *xbee_make_pkt(xbee_hnd xbee, unsigned char *data, int len); -static int _xbee_send_pkt(xbee_hnd xbee, t_data *pkt, xbee_con *con); -static void xbee_callbackWrapper(t_CBinfo *info); - -/* these functions can be found in the xsys files */ -static int init_serial(xbee_hnd xbee, int baudrate); -static int xbee_select(xbee_hnd xbee, struct timeval *timeout); - -#ifdef __GNUC__ /* ---- */ -#include "xsys/linux.c" -#else /* -------------- */ -#include "xsys\win32.c" -#endif /* ------------- */ - -#ifndef Win32Message -#define Win32Message() -#endif - -#define ISREADY(a) if (!xbee || !xbee->xbee_ready) { \ - if (stderr) fprintf(stderr,"libxbee: Run xbee_setup() first!...\n"); \ - Win32Message(); \ - a; \ - } -#define ISREADYP() ISREADY(return) -#define ISREADYR(a) ISREADY(return a) diff --git a/libs/thirdParty/libxbee/doc/man/man3/libxbee.3.html b/libs/thirdParty/libxbee/doc/man/man3/libxbee.3.html deleted file mode 100644 index 57b7f6a0c5721c77483ac1c30a3cd7c266aa78c3..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/libxbee.3.html +++ /dev/null @@ -1,127 +0,0 @@ -Manpage of LIBXBEE - -

LIBXBEE

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -libxbee -  -

DESCRIPTION

- -libxbee is a C library to aid the use of Series 1 Digi XBee radios running in API mode (AP=2). -

-I have tried to keep flexibility to a maximum. -By allowing connections to individual nodes to be created you don't have to address each packet, -or filter through incomming packets to get at the one you are after. This is all taken care of -for you by -libxbee! - -

-libxbee is still in development, so if you find any bugs or have any enhancement requests, please -feel free to submit an issue on the project page: - -

-http://code.google.com/p/libxbee/
-
- - -or contact me (Attie) directly: - -
-attie@attie.co.uk
-
- - -  -

MAN PAGES

- -Documentation is avaliable via the following man pages, or by example in the 'sample' folder in the SVN repository - -

-xbee_pkt(3) - libxbee's packet structure - -xbee_con(3) - libxbee's connection structure - -

-xbee_setup(3) - function to setup libxbee (and its variants) - -xbee_end(3) - function to end the libxbee session and close any open handles - -

-xbee_logit(3) - function that allows the user to add to the xbee log output - -

-xbee_newcon(3) - function to create a new connection - -xbee_flushcon(3) - function to flush packets from a connection - -xbee_endcon(3) - function to end a connection - -

-xbee_senddata(3) - function to send data to a remote XBee (and its variants) - -xbee_getpacket(3) - function to get a packet from a connection (and its variants) - -

-xbee_hasdigital(3) - function to check if digital sample is in the packet - -xbee_getdigital(3) - function to get digital sample from the packet - -

-xbee_hasanalog(3) - function to check if analog sample is in the packet - -xbee_getanalog(3) - function to get the analog sample from the packet - - - -  -

SEE ALSO

- -xbee_pkt(3), - -xbee_con(3), - -xbee_setup(3), - -xbee_end(3), - -xbee_logit(3), - -xbee_newcon(3), - -xbee_flushcon(3), - -xbee_endcon(3), - -xbee_senddata(3), - -xbee_getpacket(3), - -xbee_hasdigital(3), - -xbee_getdigital(3), - -xbee_hasanalog(3), - -xbee_getanalog(3) - -

- -


- 

Index

-
-
NAME
-
DESCRIPTION
-
MAN PAGES
-
SEE ALSO
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_con.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_con.3.html deleted file mode 100644 index 9990d7f2e37d9187140c87fa43d681fce26a4aa7..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_con.3.html +++ /dev/null @@ -1,26 +0,0 @@ -Manpage of LIBXBEE - -

LIBXBEE

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -libxbee -

-This page has not been written yet... -

- -


- 

Index

-
-
NAME
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_end.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_end.3.html deleted file mode 100644 index 7eaa6c27017f7865a490d9b428ed84d979714c5a..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_end.3.html +++ /dev/null @@ -1,27 +0,0 @@ -Manpage of LIBXBEE - -

LIBXBEE

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -libxbee -

-This page has not been written yet... -

-

- -


- 

Index

-
-
NAME
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_endcon.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_endcon.3.html deleted file mode 100644 index d7250a3cc42a2399be2d2f7f85d3a820517256e7..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_endcon.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_endcon.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_flushcon.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_flushcon.3.html deleted file mode 100644 index 1d046d7921238a0569928b2322d5518b29e7a0dd..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_flushcon.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_flushcon.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_getanalog.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_getanalog.3.html deleted file mode 100644 index 1883c3262e23af1b6162b3d2c44c983d0cf53eb7..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_getanalog.3.html +++ /dev/null @@ -1,140 +0,0 @@ -Manpage of XBEE_GETPACKET - -

XBEE_GETPACKET

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -xbee_hasanalog, xbee_getanalog -  -

SYNOPSIS

- -#include <xbee.h> - -

-int xbee_hasanalog(xbee_pkt *pkt,int sample, int input); - -

-double xbee_getanalog(xbee_pkt *pkt,int sample, int input, double Vref); - - -  -

DESCRIPTION

- -The -xbee_hasanalog() - -function will check the packet for the presence of an analog sample on the specified input. -

-The -xbee_getanalog() - -function will read the packet and return the sample value for the specified analog input. -

-They both take 3 arguments, with the same purposes. -

-The argument -pkt - -points to a packet that was previously retrieved with -xbee_getpacket() - -

-The argument -sample - -selects the sample within the packet to use. -

-The argument -input - -specifies which input you are interested in testing. -

-xbee_getanalog() - -also takes a fourth argument that allows you to provide a -Vref - -value. This allows the function to convert the raw ADC value into a voltage for you. -  -

RETURN VALUE

- -The -xbee_hasanalog() - -function will return -1 - -if the provided packet has sample data for the specified input, otherwise -0. - -

-The -xbee_getanalog() - -function will return the raw ADC value (0 - 1023) if the provided packet has sample data for the specified input and Vref was given as zero. -If Vref was non-zero, then the return value will be the voltage read. -A --1 - -will be returned if the packet does not contain sample data. -

-  -

EXAMPLE

- -To read sample data from previously made connection: - -
-#include <xbee.h>
-xbee_pkt *pkt;
-double Vref = 3.3;
-if ((pkt = xbee_getpacket(con)) != NULL) {
-  if (xbee_hasanalog(pkt,0,0)) {
-    printf("A0 read %fv,xbee_getanalog(pkt,0,0,Vref));
-  } else {
-    printf("No A0 data);
-  }
-  free(pkt);
-}
-
- - -  -

AUTHOR

- -Attie Grande <attie@attie.co.uk> -  -

SEE ALSO

- -libxbee(3), - -xbee_pkt(3), - -xbee_getpacket(3), - -xbee_hasdigital(3), - -xbee_getdigital(3) - -

- -


- 

Index

-
-
NAME
-
SYNOPSIS
-
DESCRIPTION
-
RETURN VALUE
-
EXAMPLE
-
AUTHOR
-
SEE ALSO
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_getdigital.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_getdigital.3.html deleted file mode 100644 index 2df9136221c30ff8335915a7d73f6ee5f91111bf..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_getdigital.3.html +++ /dev/null @@ -1,134 +0,0 @@ -Manpage of XBEE_GETPACKET - -

XBEE_GETPACKET

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -xbee_hasdigital, xbee_getdigital -  -

SYNOPSIS

- -#include <xbee.h> - -

-int xbee_hasdigital(xbee_pkt *pkt, int sample, int input); - -

-int xbee_getdigital(xbee_pkt *pkt, int sample, int input); - - -  -

DESCRIPTION

- -The -xbee_hasdigital() - -function will check the packet for the presence of a given sample on the specified input. -

-The -xbee_getdigital() - -function will read the packet and return the sample value for the specified input. -

-They both take 3 arguments, with the same purposes. -

-The argument -pkt - -points to a packet that was previously retrieved with -xbee_getpacket() - -

-The argument -sample - -selects the sample within the packet to use. -

-The argument -input - -specifies which input you are interested in testing. -  -

RETURN VALUE

- -The -xbee_hasdigital() - -function will return -1 - -if the provided packet has sample data for the specified input, otherwise -0. - -

-The -xbee_getdigital() - -function will return -1 - -if the provided packet has sample data for the specified input and the sample was HIGH. -A -0 - -will be returned if the sample was LOW, or the packet does not contain sample data. -

-  -

EXAMPLE

- -To read sample data from previously made connection: - -
-#include <xbee.h>
-xbee_pkt *pkt;
-if ((pkt = xbee_getpacket(con)) != NULL) {
-  if (xbee_hasdigital(pkt,0,0)) {
-    printf("D0 read %d,xbee_getdigital(pkt,0));
-  } else {
-    printf("No D0 data);
-  }
-  free(pkt);
-}
-
- - -  -

AUTHOR

- -Attie Grande <attie@attie.co.uk> -  -

SEE ALSO

- -libxbee(3), - -xbee_pkt(3), - -xbee_getpacket(3), - -xbee_hasanalog(3), - -xbee_getanalog(3) - -

- -


- 

Index

-
-
NAME
-
SYNOPSIS
-
DESCRIPTION
-
RETURN VALUE
-
EXAMPLE
-
AUTHOR
-
SEE ALSO
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_getpacket.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_getpacket.3.html deleted file mode 100644 index 45063f77369f1abf8072bb1d7e39dfcda77574d4..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_getpacket.3.html +++ /dev/null @@ -1,130 +0,0 @@ -Manpage of XBEE_GETPACKET - -

XBEE_GETPACKET

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -xbee_getpacket -  -

SYNOPSIS

- -#include <xbee.h> - -

-xbee_pkt *xbee_getpacket(xbee_con *con); - -

-xbee_pkt *xbee_getpacketwait(xbee_con *con); - - -  -

DESCRIPTION

- -The -xbee_getpacket() - -function will return the next avaliable packet for the provided connection. -It takes 1 argument. -

-The argument -con - -points to a connection made previously with -xbee_newcon(). - -

-The -xbee_getpacketwait() - -function behaves the same, but will wait for an internally specified time for a packet to arrive (currently around 1 second). -  -

RETURN VALUE

- -Upon successful return, this function returns the packet, having unlinked it from the internal list of packets. -You must keep hold of the packet until you are finished with it, and then you must -free() - -it to prevent memory leaks. -

-If a packet was not avaliable for the provided connection, a -NULL - -is returned. -

-If an error occured a -NULL - -is also returned (though unlikely). -

-For more information on the structure of the packet, please see -xbee_pkt(3) - -

-For information on using callback functions with connections instead, please see -xbee_con(3) - -  -

EXAMPLE

- -To recieve a packet from a previously made connection: - -
-#include <xbee.h>
-xbee_pkt *pkt;
-if ((pkt = xbee_getpacket(con)) != NULL) {
-  /* process packet... */
-  free(pkt);
-}
-
- - -  -

AUTHOR

- -Attie Grande <attie@attie.co.uk> -  -

SEE ALSO

- -libxbee(3), - -xbee_setup(3), - -xbee_newcon(3), - -xbee_senddata(3), - -xbee_pkt(3), - -xbee_con(3), - -xbee_hasDigital(3), - -xbee_getDigital(3), - -xbee_hasAnalog(3), - -xbee_getAnalog(3) - -

- -


- 

Index

-
-
NAME
-
SYNOPSIS
-
DESCRIPTION
-
RETURN VALUE
-
EXAMPLE
-
AUTHOR
-
SEE ALSO
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_hasanalog.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_hasanalog.3.html deleted file mode 100644 index e2c495c41a0ee5bd289201f4d5cfced40434af68..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_hasanalog.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_hasanalog.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_hasdigital.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_hasdigital.3.html deleted file mode 100644 index 9774f408171e5530962325df7512425f27aff02c..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_hasdigital.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_hasdigital.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_logit.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_logit.3.html deleted file mode 100644 index 7eaa6c27017f7865a490d9b428ed84d979714c5a..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_logit.3.html +++ /dev/null @@ -1,27 +0,0 @@ -Manpage of LIBXBEE - -

LIBXBEE

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -libxbee -

-This page has not been written yet... -

-

- -


- 

Index

-
-
NAME
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_newcon.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_newcon.3.html deleted file mode 100644 index 32f085b2685782320a34654812647c3898b51a46..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_newcon.3.html +++ /dev/null @@ -1,201 +0,0 @@ -Manpage of XBEE_NEWCON - -

XBEE_NEWCON

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -xbee_newcon -  -

SYNOPSIS

- -#include <xbee.h> - -

-xbee_con *xbee_newcon(unsigned char frameID, xbee_types type, ...); - -

-void xbee_flushcon(xbee_con *con); - -

-void xbee_endcon(xbee_con *con); - - -  -

DESCRIPTION

- -The -xbee_newcon() - -function will setup a new connection with the specified settings. -It takes at least 2 arguments, and possibly up to 4 depending on the -type. - -

-NOTE: - -Packets will only be collected when they match an active connection. -You must setup a connection in order to recieve packets. -

-The argument -frameID - -allows similar functionality to that of TCP/IP port numbers. This is 1 character (or 8-bit integer) that -identifies where the data is coming from or going to. - -The -type - -specifies the type of connection you would like. The following types are avaliable: -

-
xbee_localAT - -
-communicates AT commands with the local XBee -
xbee_txStatus - -
-recieves transmit status information from the local XBee -
xbee_modemStatus - -
-recieves modem status information from the local XBee -
xbee_16bitRemoteAT - -
-communicates AT commands with a remote node (using 16-bit addressing) -
xbee_64bitRemoteAT - -
-communicates AT commands with a remote node (using 64-bit addressing) -
xbee_16bitData - -
-sends/recieves data through a remote node (using 16-bit addressing) -
xbee_64bitData - -
-sends/recieves data through a remote node (using 64-bit addressing) -
xbee_16bitIO - -
-sends/recieves I/O data through a remote node (using 16-bit addressing) -
xbee_64bitIO - -
-sends/recieves I/O data through a remote node (using 64-bit addressing) -
-

- -If you are using -xbee_localAT, xbee_txStatus or xbee_modemStatus - -then only the -frameID - -and -type - -arguments are required. -

-If you are using any 16-bit connection, you must also specify 1 right aligned integer, -containing the 16-bit address (e.g. 0x1234). -

-If you are using any 64-bit connection, you must also specify 2 integers containing the -64-bit address, first the high 32-bits, then the low 32-bits. -

-The -xbee_flushcon() - -function is very basic. It removes any packets that have been collected in the buffer for the specified connection. -

-The -xbee_endcon() - -function is used to end a connection. This will stop collecting packets for the given connection, and remove any packets from the buffer. -  -

RETURN VALUE

- -A pointer to the connection is returned. A connection can only be made once, using the same -type - -, -frameID - -and address (if needed). The second call using the same parameters will return the same -connection. -

-For information on using callback functions for packet handling please see -xbee_con(3) - -  -

EXAMPLE

- -To create a local AT connection: - -
-#include <xbee.h>
-xbee_con *con;
-con = xbee_newcon('A', xbee_localAT);
-
- - -

-To create a 16-bit Data connection: - -

-#include <xbee.h>
-xbee_con *con;
-con = xbee_newcon('A', xbee_16bitData, 0x1234);
-
- - -

-To create a 64-bit Data connection: - -

-#include <xbee.h>
-xbee_con *con;
-con = xbee_newcon('A', xbee_64bitData, 0x0013A200, 0x40081826);
-
- - -  -

AUTHOR

- -Attie Grande <attie@attie.co.uk> -  -

SEE ALSO

- -libxbee(3), - -xbee_setup(3), - -xbee_getpacket(3), - -xbee_con(3), - -xbee_senddata(3) - -

- -


- 

Index

-
-
NAME
-
SYNOPSIS
-
DESCRIPTION
-
RETURN VALUE
-
EXAMPLE
-
AUTHOR
-
SEE ALSO
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_nsenddata.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_nsenddata.3.html deleted file mode 100644 index 3da3c6f217e80896fd86b61a576a2a7285721c2e..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_nsenddata.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_nsenddata.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_pkt.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_pkt.3.html deleted file mode 100644 index 1859405aa7a94fb1384c2d2ba38b0ca6c4fb89df..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_pkt.3.html +++ /dev/null @@ -1,107 +0,0 @@ -Manpage of XBEE_PKT - -

XBEE_PKT

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -xbee_pkt -  -

SYNOPSIS

- -#include <xbee.h> - - -  -

DESCRIPTION

- -This is the packet structure. If you want to get more advanced information from connections (such as RSSI) then this is where it lives. -

- -

-struct xbee_pkt {
-  unsigned char frameID;          /* AT        Status    */
-  unsigned char atCmd[2];         /* AT                  */
-  unsigned char status;           /* AT  Data  Status    */ /* status / options */
-  unsigned char Addr64[8];        /* AT  Data            */
-  unsigned char Addr16[2];        /* AT  Data            */
-  unsigned char data[128];        /* AT  Data            */
-  unsigned char RSSI;             /*     Data            */
-  unsigned int datalen;
-
-  /* X  A5 A4 A3 A2 A1 A0 D8    D7 D6 D5 D4 D3 D2 D1 D0 */
-  unsigned short IOmask;          /*                  IO */
-
-  /* X  X  X  X  X  X  X  D8    D7 D6 D5 D4 D3 D2 D1 D0 */
-  unsigned short IOdata;          /*                  IO */
-
-  /* X  X  X  X  X  D  D  D     D  D  D  D  D  D  D  D  */
-  unsigned short IOanalog[6];     /*                  IO */
-};
-typedef struct xbee_pkt xbee_pkt;
-
- - -

-Most of these fields are fairly self explanatory, however some need attention brought to them -and others need explaining. I will touch on the most important here: -

-
atCmd - -
-This is the 2 character identifier for the AT command response you just recieved. -Of course if you didnt setup an AT connection, you should never see, or try to see data here. -
Addr64 and Addr16 - -
-These contain the address of the XBee that you recieved the packet from. You should really know this -because you setup the connection. However remote AT packets will contain both 16 and 64 bit -addresses. -
data - -
-This is the data you just recieved. Either the AT reponse, or the data from the remote XBee node. -
datalen - -
-Would you be suprised if I told you this is how much data there is?... Dont try and -printf() - -the -data - -as it isn't null terminated. Use this for processing instead. - - -
-  -

AUTHOR

- -Attie Grande <attie@attie.co.uk> -  -

SEE ALSO

- -libxbee(3), - -xbee_getpacket(3) - -

- -


- 

Index

-
-
NAME
-
SYNOPSIS
-
DESCRIPTION
-
AUTHOR
-
SEE ALSO
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_senddata.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_senddata.3.html deleted file mode 100644 index 31baf1c73b44dcb38a0471d1cb3fb5495a53b321..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_senddata.3.html +++ /dev/null @@ -1,129 +0,0 @@ -Manpage of XBEE_SENDDATA - -

XBEE_SENDDATA

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -xbee_senddata, xbee_vsenddata -  -

SYNOPSIS

- -#include <xbee.h> - -

-int xbee_senddata(xbee_con *con, char *format, ...); - -

-int xbee_nsenddata(xbee_con *con, char *data, int length); - -

-#include <stdarg.h> - -

-int xbee_vsenddata(xbee_con *con, char *format, va_list ap); - - -  -

DESCRIPTION

- -The -xbee_senddata() - -function will send data via a provided connection. -It takes at least 2 arguments, and possibly more depending on the format string. -

-The argument -con - -points to a connection made previously with -xbee_newcon(). - -

-The -format - -string and any following parameters are passed to -sprintf() - -within these functions. -Please see the -printf(3) - -man page for more information. -

-If you are using -xbee_nsenddata() - -you must provide a character array of the data, and the data's length. -

-If you are using -xbee_vsenddata() - -you must provide a va_list. See -stdarg(3). - -  -

RETURN VALUE

- -Upon successful completion, these functions return 0. -

-If an invalid packet or connection was provided, -1 is returned. -

-If an unknown error occured, -2 is returned. -

-If -con - -has -waitforACK - -enabled, then these functions return 1 when an ACK was not recieved within 1 second. -  -

EXAMPLE

- -To send the string "Hello World!" through a previously made connection: - -
-#include <xbee.h>
-xbee_senddata(con,"Hello World!");
-
- - -  -

AUTHOR

- -Attie Grande <attie@attie.co.uk> -  -

SEE ALSO

- -libxbee(3), - -xbee_setup(3), - -xbee_newcon(3), - -xbee_getpacket(3) - -

- -


- 

Index

-
-
NAME
-
SYNOPSIS
-
DESCRIPTION
-
RETURN VALUE
-
EXAMPLE
-
AUTHOR
-
SEE ALSO
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_setup.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_setup.3.html deleted file mode 100644 index 5b69945a51c1bff7c75d9d21909791f5f934c41e..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_setup.3.html +++ /dev/null @@ -1,142 +0,0 @@ -Manpage of XBEE_SETUP - -

XBEE_SETUP

-Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index -Return to Main Contents
- -  -

NAME

- -xbee_setup -  -

SYNOPSIS

- -#include <xbee.h> - -

-int xbee_setup(char *path, int baudrate); - -

-int xbee_setuplog(char *path, int baudrate, int logfd); - -

-int xbee_setupAPI(char *path, char cmdSeq, int cmdTime); - -

-int xbee_setuplogAPI(char *path, int baudrate, int logfd, char cmdSeq, int cmdTime); - - -  -

DESCRIPTION

- -

-A VERSION OF THIS FUNCTION MUST BE CALLED BEFORE ANY OTHER libxbee FUNCTION! - -The -xbee_setup() - -function will setup libxbee so that it can handle an XBee. -It takes 2 arguments. -

-The argument -path - -is the path to the serial port that the XBee is connected to (e.g. /dev/ttyUSB0). -

-The -baudrate - -is the baud rate that the local XBee is configured to run at. The following are avaliable: - -

-1200
-2400
-4800
-9600
-19200
-38400
-57600
-115200 - this is potentially unstable (read the XBee manual to find out why...)
-
- - -

-Using -xbee_setuplog() - -is exactly the same, but instead you give an open file descriptor. All log messages will be written to this file (you can use stderr or stdout if you want!). -

-Using -xbee_setupAPI() - -is exactly the same, but instead you provide the 'Command Sequence' character and the 'Guard Time' that your local XBee has been configured with. -libxbee will then place your XBee in API mode 2, and when you call xbee_end() it will return your XBee to its previous API mode. -

-Using -xbee_setuplogAPI() - -is simply a combination of -xbee_setuplog() - -and -xbee_setupAPI() - -  -

RETURN VALUE

- -If any error occures, --1 - -is returned. Otherwise -0 - -is returned. -  -

EXAMPLE

- -To setup libxbee to use /dev/ttyUSB0 at 57600 baud: - -
-#include <xbee.h>
-if (xbee_setup("/dev/ttyUSB0",57600) == -1) {
-  printf("Oh no...);
-  exit(1);
-}
-
- - -  -

AUTHOR

- -Attie Grande <attie@attie.co.uk> -  -

SEE ALSO

- -libxbee(3), - -xbee_newcon(3), - -xbee_getpacket(3), - -xbee_senddata(3) - -

- -


- 

Index

-
-
NAME
-
SYNOPSIS
-
DESCRIPTION
-
RETURN VALUE
-
EXAMPLE
-
AUTHOR
-
SEE ALSO
-
-
-This document was created by -man2html, -using the manual pages.
-Time: 00:08:23 GMT, March 30, 2011 - - diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_setupAPI.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_setupAPI.3.html deleted file mode 100644 index 158f1857c92583be548fb5d24e1ea8b856284f74..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_setupAPI.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_setupAPI.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_setuplog.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_setuplog.3.html deleted file mode 100644 index 16accc571339096d89bb449e201a3f56a72e7dc0..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_setuplog.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_setuplog.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_setuplogAPI.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_setuplogAPI.3.html deleted file mode 100644 index 801cbfaf90d574643d8ed624b7c0838e340df80c..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_setuplogAPI.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_setuplogAPI.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/doc/man/man3/xbee_vsenddata.3.html b/libs/thirdParty/libxbee/doc/man/man3/xbee_vsenddata.3.html deleted file mode 100644 index 5a9b7d948c5ed228bbc005c20bb87dab963cea2f..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/doc/man/man3/xbee_vsenddata.3.html +++ /dev/null @@ -1,4 +0,0 @@ -Invalid Manpage - -

Invalid Manpage

-The requested file ./man/man3/xbee_vsenddata.3 is not a valid (unformatted) man page. diff --git a/libs/thirdParty/libxbee/lib/libxbee.dll b/libs/thirdParty/libxbee/lib/libxbee.dll deleted file mode 100644 index cf1af098e6c3a5fb130ab8d248fe873fe594db94..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/lib/libxbee.dll and /dev/null differ diff --git a/libs/thirdParty/libxbee/lib/libxbee.exp b/libs/thirdParty/libxbee/lib/libxbee.exp deleted file mode 100644 index 1ab830676fc609ead5c1aaab15a204bc98345123..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/lib/libxbee.exp and /dev/null differ diff --git a/libs/thirdParty/libxbee/lib/libxbee.lib b/libs/thirdParty/libxbee/lib/libxbee.lib deleted file mode 100644 index 7b42cadbaede1530f4c126e5c81306195d19784e..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/lib/libxbee.lib and /dev/null differ diff --git a/libs/thirdParty/libxbee/lib/libxbee.map b/libs/thirdParty/libxbee/lib/libxbee.map deleted file mode 100644 index 6adaef145b7bdce3eef1a1b1ea8c52935cd4ec32..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/lib/libxbee.map +++ /dev/null @@ -1,897 +0,0 @@ - libxbee - - Timestamp is 4e2eb2df (Tue Jul 26 14:28:15 2011) - - Preferred load address is 10000000 - - Start Length Name Class - 0001:00000000 00019a38H .text CODE - 0002:00000000 00000188H .idata$5 DATA - 0002:00000188 00000004H .CRT$XCA DATA - 0002:0000018c 00000004H .CRT$XCZ DATA - 0002:00000190 00000004H .CRT$XIA DATA - 0002:00000194 00000010H .CRT$XIC DATA - 0002:000001a4 00000004H .CRT$XIZ DATA - 0002:000001a8 00000004H .CRT$XPA DATA - 0002:000001ac 00000004H .CRT$XPX DATA - 0002:000001b0 00000004H .CRT$XPXA DATA - 0002:000001b4 00000004H .CRT$XPZ DATA - 0002:000001b8 00000004H .CRT$XTA DATA - 0002:000001bc 00000004H .CRT$XTZ DATA - 0002:000001c0 000022c0H .rdata DATA - 0002:00002480 0000000cH .rdata$sxdata DATA - 0002:0000248c 00000004H .rtc$IAA DATA - 0002:00002490 00000000H .rtc$IMZ DATA - 0002:00002490 00000004H .rtc$IZZ DATA - 0002:00002494 00000004H .rtc$TAA DATA - 0002:00002498 00000000H .rtc$TMZ DATA - 0002:00002498 00000004H .rtc$TZZ DATA - 0002:000024a0 0000049cH .xdata$x DATA - 0002:0000293c 0000003cH .idata$2 DATA - 0002:00002978 00000014H .idata$3 DATA - 0002:0000298c 00000188H .idata$4 DATA - 0002:00002b14 000006baH .idata$6 DATA - 0002:000031d0 000005a5H .edata DATA - 0003:00000000 000052f0H .data DATA - 0003:00005300 00001f44H .bss DATA - 0004:00000000 00000058H .rsrc$01 DATA - 0004:00000060 00000400H .rsrc$02 DATA - - Address Publics by Value Rva+Base Lib:Object - - 0000:00000000 __except_list 00000000 - 0000:00000003 ___safe_se_handler_count 00000003 - 0000:00000000 ___ImageBase 10000000 - 0001:00000000 _ver@16 10001000 f api.obj - 0001:000000b0 _xbee_UNLOADALL@0 100010b0 f api.obj - 0001:000000e0 _DllMain@12 100010e0 f api.obj - 0001:00000120 _DllCanUnloadNow@0 10001120 f api.obj - 0001:00000140 _RegWriteKey@24 10001140 f api.obj - 0001:00000210 _DllRegisterServer@0 10001210 f api.obj - 0001:000004b0 _DllUnregisterServer@0 100014b0 f api.obj - 0001:00000670 _xbee_write@12 10001670 f api.obj - 0001:00000720 _xbee_read@12 10001720 f api.obj - 0001:000007d0 _xbee_free@4 100017d0 f api.obj - 0001:00000800 _gettimeofday@8 10001800 f api.obj - 0001:000008a0 _xbee_setupDebugAPI@20 100018a0 f api.obj - 0001:000009b0 _xbee_setupDebug@12 100019b0 f api.obj - 0001:000009e0 _xbee_newcon_simple@8 100019e0 f api.obj - 0001:00000a00 _xbee_newcon_16bit@12 10001a00 f api.obj - 0001:00000a30 _xbee_newcon_64bit@16 10001a30 f api.obj - 0001:00000a60 _xbee_enableACKwait@4 10001a60 f api.obj - 0001:00000a80 _xbee_disableACKwait@4 10001a80 f api.obj - 0001:00000aa0 _xbee_enableDestroySelf@4 10001aa0 f api.obj - 0001:00000ac0 _xbee_callback@8 10001ac0 f api.obj - 0001:00000c70 _xbee_runCallback@12 10001c70 f api.obj - 0001:00000ca0 _xbee_enableCallbacks@8 10001ca0 f api.obj - 0001:00000df0 _xbee_attachCallback@4 10001df0 f api.obj - 0001:00000ea0 _xbee_detachCallback@4 10001ea0 f api.obj - 0001:00000f50 _xbee_svn_version@0 10001f50 f api.obj - 0001:00000fc0 _xbee_build_info@0 10001fc0 f api.obj - 0001:00000fd0 _xbee_hasdigital@12 10001fd0 f api.obj - 0001:00001030 _xbee_getdigital@12 10002030 f api.obj - 0001:00001090 _xbee_hasanalog@12 10002090 f api.obj - 0001:000010f0 _xbee_getanalog@20 100020f0 f api.obj - 0001:00001270 _xbee_logitf 10002270 f api.obj - 0001:00001320 __xbee_logitf 10002320 f api.obj - 0001:000013d0 _xbee_logit@4 100023d0 f api.obj - 0001:000013f0 __xbee_logit@8 100023f0 f api.obj - 0001:00001470 _xbee_end@0 10002470 f api.obj - 0001:00001490 __xbee_end@4 10002490 f api.obj - 0001:00001a30 _xbee_setup@8 10002a30 f api.obj - 0001:00001a60 __xbee_setup@8 10002a60 f api.obj - 0001:00001a90 _xbee_setuplog@12 10002a90 f api.obj - 0001:00001ac0 __xbee_setuplog@12 10002ac0 f api.obj - 0001:00001af0 _xbee_setupAPI@16 10002af0 f api.obj - 0001:00001b20 __xbee_setupAPI@16 10002b20 f api.obj - 0001:00001b50 _xbee_setuplogAPI@20 10002b50 f api.obj - 0001:00001ba0 __xbee_setuplogAPI@20 10002ba0 f api.obj - 0001:00003820 _xbee_newcon 10004820 f api.obj - 0001:00003870 __xbee_newcon 10004870 f api.obj - 0001:000038c0 __xbee_vnewcon@16 100048c0 f api.obj - 0001:000043f0 _xbee_purgecon@4 100053f0 f api.obj - 0001:00004410 __xbee_purgecon@8 10005410 f api.obj - 0001:00004590 _xbee_endcon2@8 10005590 f api.obj - 0001:000045c0 __xbee_endcon2@12 100055c0 f api.obj - 0001:00004880 _xbee_senddata 10005880 f api.obj - 0001:000048d0 __xbee_senddata 100058d0 f api.obj - 0001:00004920 _xbee_vsenddata@12 10005920 f api.obj - 0001:00004950 __xbee_vsenddata@16 10005950 f api.obj - 0001:00004a00 _xbee_nsenddata@12 10005a00 f api.obj - 0001:00004a30 __xbee_nsenddata@16 10005a30 f api.obj - 0001:000053a0 _xbee_getpacketwait@4 100063a0 f api.obj - 0001:000053c0 __xbee_getpacketwait@8 100063c0 f api.obj - 0001:00005440 _xbee_getpacket@4 10006440 f api.obj - 0001:00005460 __xbee_getpacket@8 10006460 f api.obj - 0001:00005ab0 _xbee_listen_stop@4 10006ab0 f api.obj - 0001:0000a47f _sprintf 1000b47f f LIBCMT:sprintf.obj - 0001:0000a503 @__security_check_cookie@4 1000b503 f LIBCMT:secchk.obj - 0001:0000a512 __RTC_CheckEsp 1000b512 f LIBCMT:_stack_.obj - 0001:0000a535 @_RTC_CheckStackVars@8 1000b535 f LIBCMT:_stack_.obj - 0001:0000a591 _free 1000b591 f LIBCMT:free.obj - 0001:0000a5cb __ftime64_s 1000b5cb f LIBCMT:ftime64.obj - 0001:0000a73b __ftime64 1000b73b f LIBCMT:ftime64.obj - 0001:0000a746 __get_errno_from_oserr 1000b746 f LIBCMT:dosmap.obj - 0001:0000a788 __errno 1000b788 f LIBCMT:dosmap.obj - 0001:0000a79b ___doserrno 1000b79b f LIBCMT:dosmap.obj - 0001:0000a7ae __dosmaperr 1000b7ae f LIBCMT:dosmap.obj - 0001:0000af05 __open 1000bf05 f LIBCMT:open.obj - 0001:0000afc0 _strrchr 1000bfc0 f LIBCMT:strrchr.obj - 0001:0000aff0 __cfltcvt_init 1000bff0 f LIBCMT:_fpinit_.obj - 0001:0000b050 __fpmath 1000c050 f LIBCMT:_fpinit_.obj - 0001:0000b069 _fprintf 1000c069 f LIBCMT:fprintf.obj - 0001:0000b175 __flush 1000c175 f LIBCMT:fflush.obj - 0001:0000b1dd __fflush_nolock 1000c1dd f LIBCMT:fflush.obj - 0001:0000b2ff _fflush 1000c2ff f LIBCMT:fflush.obj - 0001:0000b352 __flushall 1000c352 f LIBCMT:fflush.obj - 0001:0000b35b __fclose_nolock 1000c35b f LIBCMT:fclose.obj - 0001:0000b3c8 _fclose 1000c3c8 f LIBCMT:fclose.obj - 0001:0000b43c ___iob_func 1000c43c f LIBCMT:_file.obj - 0001:0000b442 ___initstdio 1000c442 f LIBCMT:_file.obj - 0001:0000b4f3 ___endstdio 1000c4f3 f LIBCMT:_file.obj - 0001:0000b513 __lock_file 1000c513 f LIBCMT:_file.obj - 0001:0000b554 __lock_file2 1000c554 f LIBCMT:_file.obj - 0001:0000b586 __unlock_file 1000c586 f LIBCMT:_file.obj - 0001:0000b5c2 __unlock_file2 1000c5c2 f LIBCMT:_file.obj - 0001:0000b600 _strcpy 1000c600 f LIBCMT:strcat.obj - 0001:0000b610 _strcat 1000c610 f LIBCMT:strcat.obj - 0001:0000b700 _strlen 1000c700 f LIBCMT:strlen.obj - 0001:0000b78b _setvbuf 1000c78b f LIBCMT:setvbuf.obj - 0001:0000b881 __get_sys_err_msg 1000c881 f i LIBCMT:perror.obj - 0001:0000b8a9 _perror 1000c8a9 f LIBCMT:perror.obj - 0001:0000b937 _strerror 1000c937 f LIBCMT:strerror.obj - 0001:0000b9a1 ___crtCorExitProcess 1000c9a1 f LIBCMT:crt0dat.obj - 0001:0000b9cc ___crtExitProcess 1000c9cc f LIBCMT:crt0dat.obj - 0001:0000b9e4 __lockexit 1000c9e4 f LIBCMT:crt0dat.obj - 0001:0000b9ed __unlockexit 1000c9ed f LIBCMT:crt0dat.obj - 0001:0000b9f6 __init_pointers 1000c9f6 f LIBCMT:crt0dat.obj - 0001:0000ba29 __initterm_e 1000ca29 f LIBCMT:crt0dat.obj - 0001:0000ba4d __cinit 1000ca4d f LIBCMT:crt0dat.obj - 0001:0000bc24 _exit 1000cc24 f LIBCMT:crt0dat.obj - 0001:0000bc3a __exit 1000cc3a f LIBCMT:crt0dat.obj - 0001:0000bc50 __cexit 1000cc50 f LIBCMT:crt0dat.obj - 0001:0000bc5f __amsg_exit 1000cc5f f LIBCMT:crt0dat.obj - 0001:0000bc7d _malloc 1000cc7d f LIBCMT:malloc.obj - 0001:0000bd11 _calloc 1000cd11 f LIBCMT:calloc.obj - 0001:0000bd51 _atol 1000cd51 f LIBCMT:atox.obj - 0001:0000bd67 _atoi 1000cd67 f LIBCMT:atox.obj - 0001:0000bd72 _strncmp 1000cd72 f LIBCMT:strncmp.obj - 0001:0000be40 _memset 1000ce40 f LIBCMT:memset.obj - 0001:0000bec0 _memcpy 1000cec0 f LIBCMT:memcpy.obj - 0001:0000c221 _memcmp 1000d221 f LIBCMT:memcmp.obj - 0001:0000d775 _realloc 1000e775 f LIBCMT:realloc.obj - 0001:0000d822 __CRT_INIT@12 1000e822 f LIBCMT:dllcrt0.obj - 0001:0000da7c __DllMainCRTStartup@12 1000ea7c f LIBCMT:dllcrt0.obj - 0001:0000da9f __flsbuf 1000ea9f f LIBCMT:_flsbuf.obj - 0001:0000dc03 ??0_LocaleUpdate@@QAE@PAUlocaleinfo_struct@@@Z 1000ec03 f i LIBCMT:output.obj - 0001:0000dd0a __output_l 1000ed0a f LIBCMT:output.obj - 0001:0000e8b6 __initp_misc_invarg 1000f8b6 f LIBCMT:invarg.obj - 0001:0000e8c5 __call_reportfault 1000f8c5 f LIBCMT:invarg.obj - 0001:0000e9ee __invoke_watson 1000f9ee f LIBCMT:invarg.obj - 0001:0000ea13 __invalid_parameter 1000fa13 f LIBCMT:invarg.obj - 0001:0000ea40 __invalid_parameter_noinfo 1000fa40 f LIBCMT:invarg.obj - 0001:0000ea50 ___report_gsfailure 1000fa50 f LIBCMT:gs_report.obj - 0001:0000ee0e ?_RTC_Failure@@YAXPAXH@Z 1000fe0e f LIBCMT:_error_.obj - 0001:0000ee49 ?_RTC_StackFailure@@YAXPAXPBD@Z 1000fe49 f LIBCMT:_error_.obj - 0001:0000ef3c ?_RTC_GetErrorFunc@@YAP6AHHPBDH00ZZPBX@Z 1000ff3c f LIBCMT:_userapi_.obj - 0001:0000ef42 ?_RTC_GetErrorFuncW@@YAP6AHHPB_WH00ZZPBX@Z 1000ff42 f LIBCMT:_userapi_.obj - 0001:0000ef48 __heap_init 1000ff48 f LIBCMT:heapinit.obj - 0001:0000ef66 __heap_term 1000ff66 f LIBCMT:heapinit.obj - 0001:0000ef7a __get_daylight 1000ff7a f LIBCMT:timeset.obj - 0001:0000efa7 __get_dstbias 1000ffa7 f LIBCMT:timeset.obj - 0001:0000efd4 __get_timezone 1000ffd4 f LIBCMT:timeset.obj - 0001:0000f001 ___daylight 10010001 f LIBCMT:timeset.obj - 0001:0000f007 ___dstbias 10010007 f LIBCMT:timeset.obj - 0001:0000f00d ___timezone 1001000d f LIBCMT:timeset.obj - 0001:0000f013 ___tzname 10010013 f LIBCMT:timeset.obj - 0001:0000f32c ___tzset 1001032c f LIBCMT:tzset.obj - 0001:0000f380 __aullrem 10010380 f LIBCMT:ullrem.obj - 0001:0000f400 __aulldiv 10010400 f LIBCMT:ulldiv.obj - 0001:0000f468 __encoded_null 10010468 f LIBCMT:tidtable.obj - 0001:0000f471 ___crtTlsAlloc@4 10010471 f LIBCMT:tidtable.obj - 0001:0000f47a ___set_flsgetvalue 1001047a f LIBCMT:tidtable.obj - 0001:0000f4ae __mtterm 100104ae f LIBCMT:tidtable.obj - 0001:0000f4eb __initptd 100104eb f LIBCMT:tidtable.obj - 0001:0000f59f __getptd_noexit 1001059f f LIBCMT:tidtable.obj - 0001:0000f618 __getptd 10010618 f LIBCMT:tidtable.obj - 0001:0000f632 __freefls@4 10010632 f LIBCMT:tidtable.obj - 0001:0000f761 __freeptd 10010761 f LIBCMT:tidtable.obj - 0001:0000f7cf __mtinit 100107cf f LIBCMT:tidtable.obj - 0001:0000f94a __set_osfhnd 1001094a f LIBCMT:osfinfo.obj - 0001:0000f9cb __free_osfhnd 100109cb f LIBCMT:osfinfo.obj - 0001:0000fa51 __get_osfhandle 10010a51 f LIBCMT:osfinfo.obj - 0001:0000faba ___lock_fhandle 10010aba f LIBCMT:osfinfo.obj - 0001:0000fb59 __unlock_fhandle 10010b59 f LIBCMT:osfinfo.obj - 0001:0000fb80 __alloc_osfhnd 10010b80 f LIBCMT:osfinfo.obj - 0001:0000fd19 __write_nolock 10010d19 f LIBCMT:write.obj - 0001:00010416 __write 10011416 f LIBCMT:write.obj - 0001:000104ea __lseeki64_nolock 100114ea f LIBCMT:lseeki64.obj - 0001:0001056f __lseeki64 1001156f f LIBCMT:lseeki64.obj - 0001:00010659 __chsize_nolock 10011659 f LIBCMT:chsize.obj - 0001:0001080f __read_nolock 1001180f f LIBCMT:read.obj - 0001:00010dc6 __close_nolock 10011dc6 f LIBCMT:close.obj - 0001:00010e62 __close 10011e62 f LIBCMT:close.obj - 0001:00010f26 __lseek_nolock 10011f26 f LIBCMT:lseek.obj - 0001:00010f9b __ioinit 10011f9b f LIBCMT:ioinit.obj - 0001:000111e0 __ioterm 100121e0 f LIBCMT:ioinit.obj - 0001:00011233 __setmode_nolock 10012233 f LIBCMT:setmode.obj - 0001:000112ee __get_fmode 100122ee f LIBCMT:setmode.obj - 0001:00011320 __SEH_prolog4 10012320 f LIBCMT:sehprolg4.obj - 0001:00011365 __SEH_epilog4 10012365 f LIBCMT:sehprolg4.obj - 0001:00011380 __except_handler4 10012380 f LIBCMT:chandler4.obj - 0001:0001150f __forcdecpt_l 1001250f f LIBCMT:cvt.obj - 0001:00011583 __cropzeros_l 10012583 f LIBCMT:cvt.obj - 0001:00011605 __positive 10012605 f LIBCMT:cvt.obj - 0001:00011621 __fassign_l 10012621 f LIBCMT:cvt.obj - 0001:00011663 __fassign 10012663 f LIBCMT:cvt.obj - 0001:0001169c __forcdecpt 1001269c f LIBCMT:cvt.obj - 0001:000116af __cropzeros 100126af f LIBCMT:cvt.obj - 0001:00011823 __cftoe_l 10012823 f LIBCMT:cvt.obj - 0001:000118ea __cftoe 100128ea f LIBCMT:cvt.obj - 0001:0001190a __cftoa_l 1001290a f LIBCMT:cvt.obj - 0001:00011d83 __cftof_l 10012d83 f LIBCMT:cvt.obj - 0001:00011e44 __cftog_l 10012e44 f LIBCMT:cvt.obj - 0001:00011f31 __cfltcvt_l 10012f31 f LIBCMT:cvt.obj - 0001:00011fb9 __cfltcvt 10012fb9 f LIBCMT:cvt.obj - 0001:00011fdc __initp_misc_cfltcvt_tab 10012fdc f LIBCMT:cmiscdat.obj - 0001:00011fff __setdefaultprecision 10012fff f LIBCMT:fp8.obj - 0001:00012027 __stbuf 10013027 f LIBCMT:_sftbuf.obj - 0001:000120c3 __ftbuf 100130c3 f LIBCMT:_sftbuf.obj - 0001:000120f7 __fileno 100130f7 f LIBCMT:fileno.obj - 0001:0001211d __vsnprintf_l 1001311d f LIBCMT:vsnprint.obj - 0001:000121c9 __vsnprintf 100131c9 f LIBCMT:vsnprint.obj - 0001:000121c9 _vsnprintf 100131c9 f LIBCMT:vsnprint.obj - 0001:000121e6 __commit 100131e6 f LIBCMT:commit.obj - 0001:000122bf __mtinitlocks 100132bf f LIBCMT:mlock.obj - 0001:00012309 __mtdeletelocks 10013309 f LIBCMT:mlock.obj - 0001:00012360 __unlock 10013360 f LIBCMT:mlock.obj - 0001:00012377 __mtinitlocknum 10013377 f LIBCMT:mlock.obj - 0001:00012439 __lock 10013439 f LIBCMT:mlock.obj - 0001:0001246c __freebuf 1001346c f LIBCMT:_freebuf.obj - 0001:0001249d __malloc_crt 1001349d f LIBCMT:crtheap.obj - 0001:000124e2 __calloc_crt 100134e2 f LIBCMT:crtheap.obj - 0001:0001252e __realloc_crt 1001352e f LIBCMT:crtheap.obj - 0001:0001257c __recalloc_crt 1001357c f LIBCMT:crtheap.obj - 0001:000125ce __fcloseall 100135ce f LIBCMT:closeall.obj - 0001:0001266a ___sys_nerr 1001366a f LIBCMT:syserr.obj - 0001:00012670 ___sys_errlist 10013670 f LIBCMT:syserr.obj - 0001:00012676 _strcpy_s 10013676 f LIBCMT:strcpy_s.obj - 0001:000126d5 _strncpy_s 100136d5 f LIBCMT:strncpy_s.obj - 0001:0001278a ?terminate@@YAXXZ 1001378a f LIBCMT:hooks.obj - 0001:000127c3 __initp_eh_hooks 100137c3 f LIBCMT:hooks.obj - 0001:000127d4 __initp_misc_winsig 100137d4 f LIBCMT:winsig.obj - 0001:00012829 ___get_sigabrt 10013829 f LIBCMT:winsig.obj - 0001:00012836 _raise 10013836 f LIBCMT:winsig.obj - 0001:000129d9 __initp_misc_rand_s 100139d9 f LIBCMT:rand_s.obj - 0001:000129e8 __initp_misc_purevirt 100139e8 f LIBCMT:inithelp.obj - 0001:000129f7 __initp_heap_handler 100139f7 f LIBCMT:handler.obj - 0001:00012a06 __callnewh 10013a06 f LIBCMT:handler.obj - 0001:00012ae4 ___onexitinit 10013ae4 f LIBCMT:onexit.obj - 0001:00012b15 __onexit 10013b15 f LIBCMT:onexit.obj - 0001:00012b51 _atexit 10013b51 f LIBCMT:onexit.obj - 0001:00012b68 __RTC_Initialize 10013b68 f LIBCMT:_initsect_.obj - 0001:00012b8e __RTC_Terminate 10013b8e f LIBCMT:_initsect_.obj - 0001:00012bc0 __ValidateImageBase 10013bc0 f LIBCMT:pesect.obj - 0001:00012c00 __FindPESection 10013c00 f LIBCMT:pesect.obj - 0001:00012c50 __IsNonwritableInCurrentImage 10013c50 f LIBCMT:pesect.obj - 0001:00012d0c __GET_RTERRMSG 10013d0c f LIBCMT:crt0msg.obj - 0001:00012d32 __NMSG_WRITE 10013d32 f LIBCMT:crt0msg.obj - 0001:00012ee1 __FF_MSGBANNER 10013ee1 f LIBCMT:crt0msg.obj - 0001:00012f1a __calloc_impl 10013f1a f LIBCMT:calloc_impl.obj - 0001:000131c7 _strtol 100141c7 f LIBCMT:strtol.obj - 0001:000131f2 __VEC_memzero 100141f2 f LIBCMT:p4_memset.obj - 0001:000132ac ___sse2_available_init 100142ac f LIBCMT:cpu_disp.obj - 0001:000132bc __VEC_memcpy 100142bc f LIBCMT:p4_memcpy.obj - 0001:000133bf __setenvp 100143bf f LIBCMT:stdenvp.obj - 0001:00013635 __setargv 10014635 f LIBCMT:stdargv.obj - 0001:000136f0 ___crtGetEnvironmentStringsA 100146f0 f LIBCMT:a_env.obj - 0001:00013787 __XcptFilter 10014787 f LIBCMT:winxfltr.obj - 0001:000138d1 ___CppXcptFilter 100148d1 f LIBCMT:winxfltr.obj - 0001:000138f1 ___security_init_cookie 100148f1 f LIBCMT:gs_support.obj - 0001:0001398c __getbuf 1001498c f LIBCMT:_getbuf.obj - 0001:000139d5 __isatty 100149d5 f LIBCMT:isatty.obj - 0001:00013c4e ___updatetmbcinfo 10014c4e f LIBCMT:mbctype.obj - 0001:00013d6e __setmbcp_nolock 10014d6e f LIBCMT:mbctype.obj - 0001:00013f57 __setmbcp 10014f57 f LIBCMT:mbctype.obj - 0001:000140f1 ___initmbctable 100150f1 f LIBCMT:mbctype.obj - 0001:0001410f ___addlocaleref 1001510f f LIBCMT:localref.obj - 0001:0001419e ___removelocaleref 1001519e f LIBCMT:localref.obj - 0001:00014237 ___freetlocinfo 10015237 f LIBCMT:localref.obj - 0001:00014382 __updatetlocinfoEx_nolock 10015382 f LIBCMT:localref.obj - 0001:000143cf ___updatetlocinfo 100153cf f LIBCMT:localref.obj - 0001:00014448 __get_printf_count_output 10015448 f LIBCMT:printf.obj - 0001:0001445e __wctomb_s_l 1001545e f LIBCMT:wctomb.obj - 0001:000145b3 _wctomb_s 100155b3 f LIBCMT:wctomb.obj - 0001:000145d0 __isleadbyte_l 100155d0 f i LIBCMT:_wctype.obj - 0001:00014608 _isleadbyte 10015608 f i LIBCMT:_wctype.obj - 0001:00014620 __aulldvrm 10015620 f LIBCMT:ulldvrm.obj - 0001:000146b5 __crt_debugger_hook 100156b5 f LIBCMT:dbghook.obj - 0001:00014849 ?_RTC_GetSrcLine@@YAHPAEPA_WKPAH1K@Z 10015849 f LIBCMT:_pdblkup_.obj - 0001:00014ad0 _strcmp 10015ad0 f LIBCMT:strcmp.obj - 0001:00014b58 __getenv_helper_nolock 10015b58 f LIBCMT:getenv.obj - 0001:00014bdf ____lc_codepage_func 10015bdf f LIBCMT:initctyp.obj - 0001:00014c05 __putwch_nolock 10015c05 f LIBCMT:putwch.obj - 0001:00014c47 __mbtowc_l 10015c47 f LIBCMT:mbtowc.obj - 0001:00014d5d _mbtowc 10015d5d f LIBCMT:mbtowc.obj - 0001:00014d80 __chkstk 10015d80 f LIBCMT:chkstk.obj - 0001:00014d80 __alloca_probe 10015d80 LIBCMT:chkstk.obj - 0001:00014db0 __local_unwind4 10015db0 f LIBCMT:exsup4.obj - 0001:00014e86 __seh_longjmp_unwind4@4 10015e86 f LIBCMT:exsup4.obj - 0001:00014ea2 @_EH4_CallFilterFunc@8 10015ea2 f LIBCMT:exsup4.obj - 0001:00014eb9 @_EH4_TransferToHandler@8 10015eb9 f LIBCMT:exsup4.obj - 0001:00014ed2 @_EH4_GlobalUnwind2@8 10015ed2 f LIBCMT:exsup4.obj - 0001:00014eeb @_EH4_LocalUnwind@16 10015eeb f LIBCMT:exsup4.obj - 0001:00014f02 __isdigit_l 10015f02 f i LIBCMT:_ctype.obj - 0001:00014f53 _isdigit 10015f53 f i LIBCMT:_ctype.obj - 0001:00014f81 __tolower_l 10015f81 f LIBCMT:tolower.obj - 0001:00015096 _tolower 10016096 f LIBCMT:tolower.obj - 0001:000150c2 __atodbl_l 100160c2 f LIBCMT:atodbl.obj - 0001:0001516a __atoflt_l 1001616a f LIBCMT:atodbl.obj - 0001:00015220 _memmove 10016220 f LIBCMT:memmove.obj - 0001:00015581 __fptostr 10016581 f LIBCMT:_fptostr.obj - 0001:00015634 ___dtold 10016634 f LIBCMT:_cfout_.obj - 0001:000156e7 __fltout2 100166e7 f LIBCMT:_cfout_.obj - 0001:00015780 __alldvrm 10016780 f LIBCMT:lldvrm.obj - 0001:00015860 __aullshr 10016860 f LIBCMT:ullshr.obj - 0001:0001587f __fptrap 1001687f f LIBCMT:crt0fp.obj - 0001:00015888 __controlfp_s 10016888 f LIBCMT:_contrlfp_.obj - 0001:000158e7 __recalloc 100168e7 f LIBCMT:recalloc.obj - 0001:00015955 _abort 10016955 f LIBCMT:abort.obj - 0001:00015988 __freea 10016988 f i LIBCMT:a_loc.obj - 0001:000159a8 __msize 100169a8 f LIBCMT:msize.obj - 0001:000159db ___crtMessageBoxW 100169db f LIBCMT:crtmboxw.obj - 0001:00015b47 _wcscat_s 10016b47 f LIBCMT:wcscat_s.obj - 0001:00015bbc _wcsncpy_s 10016bbc f LIBCMT:wcsncpy_s.obj - 0001:00015c89 _wcslen 10016c89 f LIBCMT:wcslen.obj - 0001:00015ca4 _wcscpy_s 10016ca4 f LIBCMT:wcscpy_s.obj - 0001:00015d07 __set_error_mode 10016d07 f LIBCMT:errmode.obj - 0001:00015d46 __isctype_l 10016d46 f LIBCMT:isctype.obj - 0001:00015e00 __allmul 10016e00 f LIBCMT:llmul.obj - 0001:00015e87 __ismbblead 10016e87 f LIBCMT:ismbbyte.obj - 0001:00016086 ___crtLCMapStringA 10017086 f LIBCMT:a_map.obj - 0001:000161b3 ___crtGetStringTypeA 100171b3 f LIBCMT:a_str.obj - 0001:000161f3 ___free_lc_time 100171f3 f LIBCMT:inittime.obj - 0001:0001656a ___free_lconv_num 1001756a f LIBCMT:initnum.obj - 0001:000165d3 ___free_lconv_mon 100175d3 f LIBCMT:initmon.obj - 0001:000166d1 __mbsnbicoll_l 100176d1 f LIBCMT:mbsnbico.obj - 0001:000167af __mbsnbicoll 100177af f LIBCMT:mbsnbico.obj - 0001:000167c9 ___wtomb_environ 100177c9 f LIBCMT:wtombenv.obj - 0001:00016860 ___initconout 10017860 f LIBCMT:initcon.obj - 0001:0001687f ___termconout 1001787f f LIBCMT:initcon.obj - 0001:000168a0 __global_unwind2 100178a0 f LIBCMT:exsup.obj - 0001:00016905 __local_unwind2 10017905 f LIBCMT:exsup.obj - 0001:00016989 __abnormal_termination 10017989 f LIBCMT:exsup.obj - 0001:000169ac __NLG_Notify1 100179ac f LIBCMT:exsup.obj - 0001:000169b5 __NLG_Notify 100179b5 f LIBCMT:exsup.obj - 0001:000169cc __NLG_Dispatch 100179cc LIBCMT:exsup.obj - 0001:000169cc __NLG_Dispatch2 100179cc LIBCMT:exsup.obj - 0001:000169d4 __NLG_Call 100179d4 f LIBCMT:exsup.obj - 0001:000169d6 __NLG_Return2 100179d6 LIBCMT:exsup.obj - 0001:000169d7 __ld12tod 100179d7 f LIBCMT:_intrncvt_.obj - 0001:00016f28 __ld12tof 10017f28 f LIBCMT:_intrncvt_.obj - 0001:00017479 ___strgtold12_l 10018479 f LIBCMT:_strgtold_.obj - 0001:00017b55 _$I10_OUTPUT 10018b55 f LIBCMT:_x10fout_.obj - 0001:0001857b __control87 1001957b f i LIBCMT:_ieee87_.obj - 0001:00018890 __alloca_probe_16 10019890 f LIBCMT:alloca16.obj - 0001:000188a6 __alloca_probe_8 100198a6 LIBCMT:alloca16.obj - 0001:000188c0 _strcspn 100198c0 f LIBCMT:strcspn.obj - 0001:00018910 _strpbrk 10019910 f LIBCMT:strpbrk.obj - 0001:00018bbe ___crtCompareStringA 10019bbe f LIBCMT:a_cmp.obj - 0001:00018c00 __strnicoll_l 10019c00 f LIBCMT:strnicol.obj - 0001:00018d9c ___crtsetenv 10019d9c f LIBCMT:setenv.obj - 0001:00018fde ___mtold12 10019fde f LIBCMT:_mantold_.obj - 0001:000191c2 ___set_fpsr_sse2 1001a1c2 f LIBCMT:_fpctrl_.obj - 0001:00019234 __strnicmp_l 1001a234 f LIBCMT:strnicmp.obj - 0001:00019316 __strdup 1001a316 f LIBCMT:strdup.obj - 0001:00019368 __mbschr_l 1001a368 f LIBCMT:mbschr.obj - 0001:00019418 __mbschr 1001a418 f LIBCMT:mbschr.obj - 0001:00019430 ___ascii_strnicmp 1001a430 f LIBCMT:_strnicm.obj - 0001:000194b0 _strchr 1001a4b0 f LIBCMT:strchr.obj - 0001:000194b6 ___from_strstr_to_strchr 1001a4b6 LIBCMT:strchr.obj - 0001:0001956e _RtlUnwind@16 1001a56e f kernel32:KERNEL32.dll - 0001:00019574 __fdopen 1001a574 f LIBCMT:fdopen.obj - 0001:00019574 _fdopen 1001a574 f LIBCMT:fdopen.obj - 0001:00019835 _dup 1001a835 f LIBCMT:dup.obj - 0001:00019835 __dup 1001a835 f LIBCMT:dup.obj - 0001:00019905 __getstream 1001a905 f LIBCMT:stream.obj - 0002:00000000 __imp__RegSetValueExA@24 1001b000 Advapi32:ADVAPI32.dll - 0002:00000004 __imp__RegCreateKeyA@12 1001b004 Advapi32:ADVAPI32.dll - 0002:00000008 __imp__RegDeleteKeyA@8 1001b008 Advapi32:ADVAPI32.dll - 0002:0000000c __imp__RegCloseKey@4 1001b00c Advapi32:ADVAPI32.dll - 0002:00000010 \177ADVAPI32_NULL_THUNK_DATA 1001b010 Advapi32:ADVAPI32.dll - 0002:00000014 __imp__SetEnvironmentVariableA@8 1001b014 kernel32:KERNEL32.dll - 0002:00000018 __imp__CompareStringW@24 1001b018 kernel32:KERNEL32.dll - 0002:0000001c __imp__lstrcpyA@8 1001b01c kernel32:KERNEL32.dll - 0002:00000020 __imp__GetModuleFileNameA@12 1001b020 kernel32:KERNEL32.dll - 0002:00000024 __imp__lstrlenA@4 1001b024 kernel32:KERNEL32.dll - 0002:00000028 __imp__GetOverlappedResult@16 1001b028 kernel32:KERNEL32.dll - 0002:0000002c __imp__GetLastError@0 1001b02c kernel32:KERNEL32.dll - 0002:00000030 __imp__WriteFile@20 1001b030 kernel32:KERNEL32.dll - 0002:00000034 __imp__ReadFile@20 1001b034 kernel32:KERNEL32.dll - 0002:00000038 __imp__SetEvent@4 1001b038 kernel32:KERNEL32.dll - 0002:0000003c __imp__WaitForSingleObject@8 1001b03c kernel32:KERNEL32.dll - 0002:00000040 __imp__TerminateThread@8 1001b040 kernel32:KERNEL32.dll - 0002:00000044 __imp__CloseHandle@4 1001b044 kernel32:KERNEL32.dll - 0002:00000048 __imp__Sleep@4 1001b048 kernel32:KERNEL32.dll - 0002:0000004c __imp__CreateThread@24 1001b04c kernel32:KERNEL32.dll - 0002:00000050 __imp__CreateEventA@16 1001b050 kernel32:KERNEL32.dll - 0002:00000054 __imp__SetCommMask@8 1001b054 kernel32:KERNEL32.dll - 0002:00000058 __imp__SetCommTimeouts@8 1001b058 kernel32:KERNEL32.dll - 0002:0000005c __imp__SetCommState@8 1001b05c kernel32:KERNEL32.dll - 0002:00000060 __imp__GetCommState@8 1001b060 kernel32:KERNEL32.dll - 0002:00000064 __imp__CreateFileA@28 1001b064 kernel32:KERNEL32.dll - 0002:00000068 __imp__WaitCommEvent@12 1001b068 kernel32:KERNEL32.dll - 0002:0000006c __imp__ClearCommError@12 1001b06c kernel32:KERNEL32.dll - 0002:00000070 __imp__HeapFree@12 1001b070 kernel32:KERNEL32.dll - 0002:00000074 __imp__GetTimeZoneInformation@4 1001b074 kernel32:KERNEL32.dll - 0002:00000078 __imp__GetSystemTimeAsFileTime@4 1001b078 kernel32:KERNEL32.dll - 0002:0000007c __imp__GetFileType@4 1001b07c kernel32:KERNEL32.dll - 0002:00000080 __imp__EnterCriticalSection@4 1001b080 kernel32:KERNEL32.dll - 0002:00000084 __imp__LeaveCriticalSection@4 1001b084 kernel32:KERNEL32.dll - 0002:00000088 __imp__GetProcAddress@8 1001b088 kernel32:KERNEL32.dll - 0002:0000008c __imp__GetModuleHandleW@4 1001b08c kernel32:KERNEL32.dll - 0002:00000090 __imp__ExitProcess@4 1001b090 kernel32:KERNEL32.dll - 0002:00000094 __imp__DecodePointer@4 1001b094 kernel32:KERNEL32.dll - 0002:00000098 __imp__HeapAlloc@12 1001b098 kernel32:KERNEL32.dll - 0002:0000009c __imp__HeapReAlloc@16 1001b09c kernel32:KERNEL32.dll - 0002:000000a0 __imp__GetCurrentThreadId@0 1001b0a0 kernel32:KERNEL32.dll - 0002:000000a4 __imp__GetCommandLineA@0 1001b0a4 kernel32:KERNEL32.dll - 0002:000000a8 __imp__UnhandledExceptionFilter@4 1001b0a8 kernel32:KERNEL32.dll - 0002:000000ac __imp__SetUnhandledExceptionFilter@4 1001b0ac kernel32:KERNEL32.dll - 0002:000000b0 __imp__IsDebuggerPresent@0 1001b0b0 kernel32:KERNEL32.dll - 0002:000000b4 __imp__EncodePointer@4 1001b0b4 kernel32:KERNEL32.dll - 0002:000000b8 __imp__TerminateProcess@8 1001b0b8 kernel32:KERNEL32.dll - 0002:000000bc __imp__GetCurrentProcess@0 1001b0bc kernel32:KERNEL32.dll - 0002:000000c0 __imp__RaiseException@16 1001b0c0 kernel32:KERNEL32.dll - 0002:000000c4 __imp__WideCharToMultiByte@32 1001b0c4 kernel32:KERNEL32.dll - 0002:000000c8 __imp__MultiByteToWideChar@24 1001b0c8 kernel32:KERNEL32.dll - 0002:000000cc __imp__LoadLibraryW@4 1001b0cc kernel32:KERNEL32.dll - 0002:000000d0 __imp__HeapCreate@12 1001b0d0 kernel32:KERNEL32.dll - 0002:000000d4 __imp__HeapDestroy@4 1001b0d4 kernel32:KERNEL32.dll - 0002:000000d8 __imp__TlsAlloc@0 1001b0d8 kernel32:KERNEL32.dll - 0002:000000dc __imp__TlsGetValue@4 1001b0dc kernel32:KERNEL32.dll - 0002:000000e0 __imp__TlsSetValue@8 1001b0e0 kernel32:KERNEL32.dll - 0002:000000e4 __imp__TlsFree@4 1001b0e4 kernel32:KERNEL32.dll - 0002:000000e8 __imp__InterlockedIncrement@4 1001b0e8 kernel32:KERNEL32.dll - 0002:000000ec __imp__SetLastError@4 1001b0ec kernel32:KERNEL32.dll - 0002:000000f0 __imp__InterlockedDecrement@4 1001b0f0 kernel32:KERNEL32.dll - 0002:000000f4 __imp__SetStdHandle@8 1001b0f4 kernel32:KERNEL32.dll - 0002:000000f8 __imp__InitializeCriticalSectionAndSpinCount@8 1001b0f8 kernel32:KERNEL32.dll - 0002:000000fc __imp__GetConsoleCP@0 1001b0fc kernel32:KERNEL32.dll - 0002:00000100 __imp__GetConsoleMode@8 1001b100 kernel32:KERNEL32.dll - 0002:00000104 __imp__SetFilePointer@16 1001b104 kernel32:KERNEL32.dll - 0002:00000108 __imp__SetEndOfFile@4 1001b108 kernel32:KERNEL32.dll - 0002:0000010c __imp__GetProcessHeap@0 1001b10c kernel32:KERNEL32.dll - 0002:00000110 __imp__SetHandleCount@4 1001b110 kernel32:KERNEL32.dll - 0002:00000114 __imp__GetStdHandle@4 1001b114 kernel32:KERNEL32.dll - 0002:00000118 __imp__GetStartupInfoW@4 1001b118 kernel32:KERNEL32.dll - 0002:0000011c __imp__DeleteCriticalSection@4 1001b11c kernel32:KERNEL32.dll - 0002:00000120 __imp__FlushFileBuffers@4 1001b120 kernel32:KERNEL32.dll - 0002:00000124 __imp__FreeLibrary@4 1001b124 kernel32:KERNEL32.dll - 0002:00000128 __imp__GetModuleFileNameW@12 1001b128 kernel32:KERNEL32.dll - 0002:0000012c __imp__IsProcessorFeaturePresent@4 1001b12c kernel32:KERNEL32.dll - 0002:00000130 __imp__FreeEnvironmentStringsW@4 1001b130 kernel32:KERNEL32.dll - 0002:00000134 __imp__GetEnvironmentStringsW@0 1001b134 kernel32:KERNEL32.dll - 0002:00000138 __imp__QueryPerformanceCounter@4 1001b138 kernel32:KERNEL32.dll - 0002:0000013c __imp__GetTickCount@0 1001b13c kernel32:KERNEL32.dll - 0002:00000140 __imp__GetCurrentProcessId@0 1001b140 kernel32:KERNEL32.dll - 0002:00000144 __imp__GetCPInfo@8 1001b144 kernel32:KERNEL32.dll - 0002:00000148 __imp__GetACP@0 1001b148 kernel32:KERNEL32.dll - 0002:0000014c __imp__GetOEMCP@0 1001b14c kernel32:KERNEL32.dll - 0002:00000150 __imp__IsValidCodePage@4 1001b150 kernel32:KERNEL32.dll - 0002:00000154 __imp__VirtualQuery@12 1001b154 kernel32:KERNEL32.dll - 0002:00000158 __imp__WriteConsoleW@20 1001b158 kernel32:KERNEL32.dll - 0002:0000015c __imp__RtlUnwind@16 1001b15c kernel32:KERNEL32.dll - 0002:00000160 __imp__HeapSize@12 1001b160 kernel32:KERNEL32.dll - 0002:00000164 __imp__LCMapStringW@24 1001b164 kernel32:KERNEL32.dll - 0002:00000168 __imp__GetStringTypeW@16 1001b168 kernel32:KERNEL32.dll - 0002:0000016c __imp__CreateFileW@28 1001b16c kernel32:KERNEL32.dll - 0002:00000170 __imp__DuplicateHandle@28 1001b170 kernel32:KERNEL32.dll - 0002:00000174 \177KERNEL32_NULL_THUNK_DATA 1001b174 kernel32:KERNEL32.dll - 0002:00000178 __imp__wsprintfA 1001b178 User32:USER32.dll - 0002:0000017c __imp__MessageBoxA@16 1001b17c User32:USER32.dll - 0002:00000180 __imp__SendMessageA@16 1001b180 User32:USER32.dll - 0002:00000184 \177USER32_NULL_THUNK_DATA 1001b184 User32:USER32.dll - 0002:00000188 ___xc_a 1001b188 LIBCMT:crt0init.obj - 0002:0000018c ___xc_z 1001b18c LIBCMT:crt0init.obj - 0002:00000190 ___xi_a 1001b190 LIBCMT:crt0init.obj - 0002:000001a4 ___xi_z 1001b1a4 LIBCMT:crt0init.obj - 0002:000001a8 ___xp_a 1001b1a8 LIBCMT:crt0init.obj - 0002:000001b4 ___xp_z 1001b1b4 LIBCMT:crt0init.obj - 0002:000001b8 ___xt_a 1001b1b8 LIBCMT:crt0init.obj - 0002:000001bc ___xt_z 1001b1bc LIBCMT:crt0init.obj - 0002:000001c0 __real@408ff80000000000 1001b1c0 api.obj - 0002:000001c8 __real@3f6a6d01a6d01a6d 1001b1c8 api.obj - 0002:000001d0 __FPinit 1001b1d0 LIBCMT:_fpinit_.obj - 0002:000001d4 ??_C@_01EEMJAFIK@?6?$AA@ 1001b1d4 LIBCMT:perror.obj - 0002:000001d8 ??_C@_02LMMGGCAJ@?3?5?$AA@ 1001b1d8 LIBCMT:perror.obj - 0002:000001e0 ??_C@_0EA@FCLIIPNN@Visual?5C?$CL?$CL?5CRT?3?5Not?5enough?5memor@ 1001b1e0 LIBCMT:strerror.obj - 0002:00000220 ??_C@_0P@MIGLKIOC@CorExitProcess?$AA@ 1001b220 LIBCMT:crt0dat.obj - 0002:00000230 ??_C@_1BI@BGOHAHKC@?$AAm?$AAs?$AAc?$AAo?$AAr?$AAe?$AAe?$AA?4?$AAd?$AAl?$AAl?$AA?$AA@ 1001b230 LIBCMT:crt0dat.obj - 0002:00000248 __pRawDllMain 1001b248 LIBCMT:dllcrt0.obj - 0002:00000248 __pDefaultRawDllMain 1001b248 LIBCMT:dllcrt0.obj - 0002:0000024c ??_C@_1O@CEDCILHN@?$AA?$CI?$AAn?$AAu?$AAl?$AAl?$AA?$CJ?$AA?$AA@ 1001b24c LIBCMT:output.obj - 0002:0000025c ??_C@_06OJHGLDPL@?$CInull?$CJ?$AA@ 1001b25c LIBCMT:output.obj - 0002:00000268 ___lookuptable 1001b268 LIBCMT:output.obj - 0002:000002cc ??_C@_0BO@GNIAFIKK@Unknown?5Runtime?5Check?5Error?6?$AN?$AA@ 1001b2cc LIBCMT:_error_.obj - 0002:000002ec ??_C@_0CM@NGINOKPC@Stack?5memory?5around?5_alloca?5was?5@ 1001b2ec LIBCMT:_error_.obj - 0002:00000318 ??_C@_0DG@HKJMLLLP@A?5local?5variable?5was?5used?5before@ 1001b318 LIBCMT:_error_.obj - 0002:00000350 ??_C@_0BN@FFOINMNJ@Stack?5memory?5was?5corrupted?6?$AN?$AA@ 1001b350 LIBCMT:_error_.obj - 0002:00000370 ??_C@_0BBN@GPMLNJCF@A?5cast?5to?5a?5smaller?5data?5type?5ha@ 1001b370 LIBCMT:_error_.obj - 0002:00000490 ??_C@_0NN@NGPKDKPD@The?5value?5of?5ESP?5was?5not?5properl@ 1001b490 LIBCMT:_error_.obj - 0002:0000060c ??_C@_0CA@IODNCDPG@Run?9Time?5Check?5Failure?5?$CD?$CFd?5?9?5?$CFs?$AA@ 1001b60c LIBCMT:_error_.obj - 0002:0000062c ??_C@_0BE@GNBOBNCK@Unknown?5Module?5Name?$AA@ 1001b62c LIBCMT:_error_.obj - 0002:00000640 ??_C@_0BB@PFFGGCJP@Unknown?5Filename?$AA@ 1001b640 LIBCMT:_error_.obj - 0002:00000658 ??_C@_1EA@NFKNIFJP@?$AAR?$AAu?$AAn?$AA?9?$AAT?$AAi?$AAm?$AAe?$AA?5?$AAC?$AAh?$AAe?$AAc?$AAk?$AA?5?$AAF?$AAa?$AAi?$AAl?$AAu?$AAr?$AAe?$AA?5?$AA?$CD?$AA?$CF?$AAd?$AA?5?$AA?9?$AA?5?$AA?$CF?$AAs?$AA?$AA@ 1001b658 LIBCMT:_error_.obj - 0002:00000698 ??_C@_1GM@OLMCBDMB@?$AAR?$AAu?$AAn?$AAt?$AAi?$AAm?$AAe?$AA?5?$AAC?$AAh?$AAe?$AAc?$AAk?$AA?5?$AAE?$AAr?$AAr?$AAo?$AAr?$AA?4?$AA?6?$AA?$AN?$AA?5?$AAU?$AAn?$AAa?$AAb?$AAl?$AAe?$AA?5?$AAt?$AAo@ 1001b698 LIBCMT:_error_.obj - 0002:00000704 ??_C@_0CG@IAFNJNEE@Stack?5corrupted?5near?5unknown?5var@ 1001b704 LIBCMT:_error_.obj - 0002:0000072c ??_C@_0BP@OGBCLIBO@Stack?5around?5_alloca?5corrupted?$AA@ 1001b72c LIBCMT:_userapi_.obj - 0002:0000074c ??_C@_0CK@CNLNOEPB@Local?5variable?5used?5before?5initi@ 1001b74c LIBCMT:_userapi_.obj - 0002:00000778 ??_C@_0BI@CIGMDCBH@Stack?5memory?5corruption?$AA@ 1001b778 LIBCMT:_userapi_.obj - 0002:00000790 ??_C@_0CK@FEGOIOPB@Cast?5to?5smaller?5type?5causing?5los@ 1001b790 LIBCMT:_userapi_.obj - 0002:000007bc ??_C@_0BJ@HEGAHDFO@Stack?5pointer?5corruption?$AA@ 1001b7bc LIBCMT:_userapi_.obj - 0002:000007ec ___dnames 1001b7ec LIBCMT:timeset.obj - 0002:00000804 ___mnames 1001b804 LIBCMT:timeset.obj - 0002:0000082c ??_C@_02CLFPBFFP@TZ?$AA@ 1001b82c LIBCMT:tzset.obj - 0002:00000830 ??_C@_1BK@DBDEIDLH@?$AAK?$AAE?$AAR?$AAN?$AAE?$AAL?$AA3?$AA2?$AA?4?$AAD?$AAL?$AAL?$AA?$AA@ 1001b830 LIBCMT:tidtable.obj - 0002:0000084c ??_C@_07PEJMOBNF@FlsFree?$AA@ 1001b84c LIBCMT:tidtable.obj - 0002:00000854 ??_C@_0M@JCPCPOEF@FlsSetValue?$AA@ 1001b854 LIBCMT:tidtable.obj - 0002:00000860 ??_C@_0M@GDNOONDI@FlsGetValue?$AA@ 1001b860 LIBCMT:tidtable.obj - 0002:0000086c ??_C@_08KNHFBNJ@FlsAlloc?$AA@ 1001b86c LIBCMT:tidtable.obj - 0002:00000878 ??_C@_05KLBDPFGC@e?$CL000?$AA@ 1001b878 LIBCMT:cvt.obj - 0002:00000880 ??_C@_0BG@KLEAJEFJ@Illegal?5byte?5sequence?$AA@ 1001b880 LIBCMT:syserr.obj - 0002:00000898 ??_C@_0BE@ICMCHPHH@Directory?5not?5empty?$AA@ 1001b898 LIBCMT:syserr.obj - 0002:000008ac ??_C@_0BJ@IHEHINLI@Function?5not?5implemented?$AA@ 1001b8ac LIBCMT:syserr.obj - 0002:000008c8 ??_C@_0BD@CLHBCGPB@No?5locks?5available?$AA@ 1001b8c8 LIBCMT:syserr.obj - 0002:000008dc ??_C@_0BC@BEDIHIDK@Filename?5too?5long?$AA@ 1001b8dc LIBCMT:syserr.obj - 0002:000008f0 ??_C@_0BK@JAEBMJJM@Resource?5deadlock?5avoided?$AA@ 1001b8f0 LIBCMT:syserr.obj - 0002:0000090c ??_C@_0BB@FCBJFCAJ@Result?5too?5large?$AA@ 1001b90c LIBCMT:syserr.obj - 0002:00000920 ??_C@_0N@MMJPGLJK@Domain?5error?$AA@ 1001b920 LIBCMT:syserr.obj - 0002:00000930 ??_C@_0M@LHEPIIOM@Broken?5pipe?$AA@ 1001b930 LIBCMT:syserr.obj - 0002:0000093c ??_C@_0P@PKCJJLLM@Too?5many?5links?$AA@ 1001b93c LIBCMT:syserr.obj - 0002:0000094c ??_C@_0BG@DDBFNKBH@Read?9only?5file?5system?$AA@ 1001b94c LIBCMT:syserr.obj - 0002:00000964 ??_C@_0N@FEHLOILP@Invalid?5seek?$AA@ 1001b964 LIBCMT:syserr.obj - 0002:00000974 ??_C@_0BI@FEALHKLD@No?5space?5left?5on?5device?$AA@ 1001b974 LIBCMT:syserr.obj - 0002:0000098c ??_C@_0P@LFMMIPAE@File?5too?5large?$AA@ 1001b98c LIBCMT:syserr.obj - 0002:0000099c ??_C@_0CE@ONOKNLPF@Inappropriate?5I?1O?5control?5operat@ 1001b99c LIBCMT:syserr.obj - 0002:000009c0 ??_C@_0BE@INBJMKGG@Too?5many?5open?5files?$AA@ 1001b9c0 LIBCMT:syserr.obj - 0002:000009d4 ??_C@_0BO@IIFBODJE@Too?5many?5open?5files?5in?5system?$AA@ 1001b9d4 LIBCMT:syserr.obj - 0002:000009f4 ??_C@_0BB@HMGGCEBG@Invalid?5argument?$AA@ 1001b9f4 LIBCMT:syserr.obj - 0002:00000a08 ??_C@_0P@NDHGCGKE@Is?5a?5directory?$AA@ 1001ba08 LIBCMT:syserr.obj - 0002:00000a18 ??_C@_0BA@CJBACOOL@Not?5a?5directory?$AA@ 1001ba18 LIBCMT:syserr.obj - 0002:00000a28 ??_C@_0P@NLEIANHE@No?5such?5device?$AA@ 1001ba28 LIBCMT:syserr.obj - 0002:00000a38 ??_C@_0O@OAMDNOCP@Improper?5link?$AA@ 1001ba38 LIBCMT:syserr.obj - 0002:00000a48 ??_C@_0M@NAAJNNGH@File?5exists?$AA@ 1001ba48 LIBCMT:syserr.obj - 0002:00000a54 ??_C@_0BA@BIBLIOEK@Resource?5device?$AA@ 1001ba54 LIBCMT:syserr.obj - 0002:00000a64 ??_C@_0O@NIPGCINC@Unknown?5error?$AA@ 1001ba64 LIBCMT:syserr.obj - 0002:00000a74 ??_C@_0M@LOEHLCJD@Bad?5address?$AA@ 1001ba74 LIBCMT:syserr.obj - 0002:00000a80 ??_C@_0BC@HFNFNKAI@Permission?5denied?$AA@ 1001ba80 LIBCMT:syserr.obj - 0002:00000a94 ??_C@_0BB@IMDKMPFB@Not?5enough?5space?$AA@ 1001ba94 LIBCMT:syserr.obj - 0002:00000aa8 ??_C@_0CB@EPFKGNAK@Resource?5temporarily?5unavailable@ 1001baa8 LIBCMT:syserr.obj - 0002:00000acc ??_C@_0BD@LOHELEP@No?5child?5processes?$AA@ 1001bacc LIBCMT:syserr.obj - 0002:00000ae0 ??_C@_0BE@NFGDDCEF@Bad?5file?5descriptor?$AA@ 1001bae0 LIBCMT:syserr.obj - 0002:00000af4 ??_C@_0BC@HKPNECK@Exec?5format?5error?$AA@ 1001baf4 LIBCMT:syserr.obj - 0002:00000b08 ??_C@_0BC@MFFGCDFL@Arg?5list?5too?5long?$AA@ 1001bb08 LIBCMT:syserr.obj - 0002:00000b1c ??_C@_0BK@DPKMCKJ@No?5such?5device?5or?5address?$AA@ 1001bb1c LIBCMT:syserr.obj - 0002:00000b38 ??_C@_0BD@KKNFOBBD@Input?1output?5error?$AA@ 1001bb38 LIBCMT:syserr.obj - 0002:00000b4c ??_C@_0BK@FJBOAFDK@Interrupted?5function?5call?$AA@ 1001bb4c LIBCMT:syserr.obj - 0002:00000b68 ??_C@_0BA@FKIAIBGA@No?5such?5process?$AA@ 1001bb68 LIBCMT:syserr.obj - 0002:00000b78 ??_C@_0BK@FMDHKPNF@No?5such?5file?5or?5directory?$AA@ 1001bb78 LIBCMT:syserr.obj - 0002:00000b94 ??_C@_0BI@BJFCGOHL@Operation?5not?5permitted?$AA@ 1001bb94 LIBCMT:syserr.obj - 0002:00000bac ??_C@_08INEPGKHH@No?5error?$AA@ 1001bbac LIBCMT:syserr.obj - 0002:00000bb8 ??_C@_1BK@GAEMIDIL@?$AAA?$AAD?$AAV?$AAA?$AAP?$AAI?$AA3?$AA2?$AA?4?$AAD?$AAL?$AAL?$AA?$AA@ 1001bbb8 LIBCMT:rand_s.obj - 0002:00000bd4 ??_C@_1BO@BKOMIGKJ@?$AAr?$AAu?$AAn?$AAt?$AAi?$AAm?$AAe?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?5?$AA?$AA@ 1001bbd4 LIBCMT:crt0msg.obj - 0002:00000bf4 ??_C@_15JNBOKNOG@?$AA?$AN?$AA?6?$AA?$AA@ 1001bbf4 LIBCMT:crt0msg.obj - 0002:00000bfc ??_C@_1BM@JBBEPPHI@?$AAT?$AAL?$AAO?$AAS?$AAS?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AN?$AA?6?$AA?$AA@ 1001bbfc LIBCMT:crt0msg.obj - 0002:00000c18 ??_C@_1BK@KMOMNAAI@?$AAS?$AAI?$AAN?$AAG?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AN?$AA?6?$AA?$AA@ 1001bc18 LIBCMT:crt0msg.obj - 0002:00000c34 ??_C@_1BO@BFCDCGC@?$AAD?$AAO?$AAM?$AAA?$AAI?$AAN?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AN?$AA?6?$AA?$AA@ 1001bc34 LIBCMT:crt0msg.obj - 0002:00000c58 ??_C@_1BOO@KGEDBGAJ@?$AAR?$AA6?$AA0?$AA3?$AA3?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAA?$AAt?$AAt?$AAe?$AAm?$AAp?$AAt?$AA?5?$AAt?$AAo?$AA?5?$AAu?$AAs?$AAe?$AA?5?$AAM?$AAS?$AAI?$AAL?$AA?5?$AAc?$AAo?$AAd@ 1001bc58 LIBCMT:crt0msg.obj - 0002:00000e48 ??_C@_1GG@GOPILAJP@?$AAR?$AA6?$AA0?$AA3?$AA2?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAe?$AAn?$AAo?$AAu?$AAg?$AAh?$AA?5?$AAs?$AAp?$AAa?$AAc?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAl?$AAo@ 1001be48 LIBCMT:crt0msg.obj - 0002:00000eb0 ??_C@_1MG@ENCOOIDF@?$AAR?$AA6?$AA0?$AA3?$AA1?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAA?$AAt?$AAt?$AAe?$AAm?$AAp?$AAt?$AA?5?$AAt?$AAo?$AA?5?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAe?$AA?5?$AAt@ 1001beb0 LIBCMT:crt0msg.obj - 0002:00000f78 ??_C@_1DO@BMFCDCD@?$AAR?$AA6?$AA0?$AA3?$AA0?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAC?$AAR?$AAT?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAe?$AAd?$AA?$AN?$AA?6?$AA?$AA@ 1001bf78 LIBCMT:crt0msg.obj - 0002:00000fb8 ??_C@_1EK@HHFLMAOL@?$AAR?$AA6?$AA0?$AA2?$AA8?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAu?$AAn?$AAa?$AAb?$AAl?$AAe?$AA?5?$AAt?$AAo?$AA?5?$AAi?$AAn?$AAi?$AAt?$AAi?$AAa?$AAl?$AAi?$AAz?$AAe?$AA?5?$AAh?$AAe@ 1001bfb8 LIBCMT:crt0msg.obj - 0002:00001008 ??_C@_1GK@MFGOKLAG@?$AAR?$AA6?$AA0?$AA2?$AA7?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAe?$AAn?$AAo?$AAu?$AAg?$AAh?$AA?5?$AAs?$AAp?$AAa?$AAc?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAl?$AAo@ 1001c008 LIBCMT:crt0msg.obj - 0002:00001078 ??_C@_1GK@MCAAGJMO@?$AAR?$AA6?$AA0?$AA2?$AA6?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAe?$AAn?$AAo?$AAu?$AAg?$AAh?$AA?5?$AAs?$AAp?$AAa?$AAc?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAs?$AAt@ 1001c078 LIBCMT:crt0msg.obj - 0002:000010e8 ??_C@_1EM@MAADIHMB@?$AAR?$AA6?$AA0?$AA2?$AA5?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAp?$AAu?$AAr?$AAe?$AA?5?$AAv?$AAi?$AAr?$AAt?$AAu?$AAa?$AAl?$AA?5?$AAf?$AAu?$AAn?$AAc?$AAt?$AAi?$AAo?$AAn?$AA?5?$AAc@ 1001c0e8 LIBCMT:crt0msg.obj - 0002:00001138 ??_C@_1GK@FHCKBEFA@?$AAR?$AA6?$AA0?$AA2?$AA4?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAe?$AAn?$AAo?$AAu?$AAg?$AAh?$AA?5?$AAs?$AAp?$AAa?$AAc?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AA_?$AAo@ 1001c138 LIBCMT:crt0msg.obj - 0002:000011a8 ??_C@_1FC@ECHBIFBC@?$AAR?$AA6?$AA0?$AA1?$AA9?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAu?$AAn?$AAa?$AAb?$AAl?$AAe?$AA?5?$AAt?$AAo?$AA?5?$AAo?$AAp?$AAe?$AAn?$AA?5?$AAc?$AAo?$AAn?$AAs?$AAo?$AAl?$AAe?$AA?5@ 1001c1a8 LIBCMT:crt0msg.obj - 0002:00001200 ??_C@_1EC@JIBHAOPH@?$AAR?$AA6?$AA0?$AA1?$AA8?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAu?$AAn?$AAe?$AAx?$AAp?$AAe?$AAc?$AAt?$AAe?$AAd?$AA?5?$AAh?$AAe?$AAa?$AAp?$AA?5?$AAe?$AAr?$AAr?$AAo?$AAr?$AA?$AN?$AA?6@ 1001c200 LIBCMT:crt0msg.obj - 0002:00001248 ??_C@_1FK@BEOGODMC@?$AAR?$AA6?$AA0?$AA1?$AA7?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAu?$AAn?$AAe?$AAx?$AAp?$AAe?$AAc?$AAt?$AAe?$AAd?$AA?5?$AAm?$AAu?$AAl?$AAt?$AAi?$AAt?$AAh?$AAr?$AAe?$AAa?$AAd?$AA?5@ 1001c248 LIBCMT:crt0msg.obj - 0002:000012a8 ??_C@_1FI@LOGNIKDM@?$AAR?$AA6?$AA0?$AA1?$AA6?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAe?$AAn?$AAo?$AAu?$AAg?$AAh?$AA?5?$AAs?$AAp?$AAa?$AAc?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAt?$AAh@ 1001c2a8 LIBCMT:crt0msg.obj - 0002:00001300 ??_C@_1EG@BEHAGFJD@?$AAR?$AA6?$AA0?$AA1?$AA0?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAa?$AAb?$AAo?$AAr?$AAt?$AA?$CI?$AA?$CJ?$AA?5?$AAh?$AAa?$AAs?$AA?5?$AAb?$AAe?$AAe?$AAn?$AA?5?$AAc?$AAa?$AAl?$AAl?$AAe?$AAd@ 1001c300 LIBCMT:crt0msg.obj - 0002:00001348 ??_C@_1FI@HONFMGBI@?$AAR?$AA6?$AA0?$AA0?$AA9?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAe?$AAn?$AAo?$AAu?$AAg?$AAh?$AA?5?$AAs?$AAp?$AAa?$AAc?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAe?$AAn@ 1001c348 LIBCMT:crt0msg.obj - 0002:000013a0 ??_C@_1FE@LLNEDJMD@?$AAR?$AA6?$AA0?$AA0?$AA8?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAn?$AAo?$AAt?$AA?5?$AAe?$AAn?$AAo?$AAu?$AAg?$AAh?$AA?5?$AAs?$AAp?$AAa?$AAc?$AAe?$AA?5?$AAf?$AAo?$AAr?$AA?5?$AAa?$AAr@ 1001c3a0 LIBCMT:crt0msg.obj - 0002:000013f8 ??_C@_1FK@PGACCAFB@?$AAR?$AA6?$AA0?$AA0?$AA2?$AA?$AN?$AA?6?$AA?9?$AA?5?$AAf?$AAl?$AAo?$AAa?$AAt?$AAi?$AAn?$AAg?$AA?5?$AAp?$AAo?$AAi?$AAn?$AAt?$AA?5?$AAs?$AAu?$AAp?$AAp?$AAo?$AAr?$AAt?$AA?5@ 1001c3f8 LIBCMT:crt0msg.obj - 0002:00001508 ??_C@_1EK@MBDPDCGA@?$AAM?$AAi?$AAc?$AAr?$AAo?$AAs?$AAo?$AAf?$AAt?$AA?5?$AAV?$AAi?$AAs?$AAu?$AAa?$AAl?$AA?5?$AAC?$AA?$CL?$AA?$CL?$AA?5?$AAR?$AAu?$AAn?$AAt?$AAi?$AAm?$AAe?$AA?5?$AAL?$AAi?$AAb@ 1001c508 LIBCMT:crt0msg.obj - 0002:00001554 ??_C@_15IABLJNFO@?$AA?6?$AA?6?$AA?$AA@ 1001c554 LIBCMT:crt0msg.obj - 0002:0000155c ??_C@_17LGKOMLJ@?$AA?4?$AA?4?$AA?4?$AA?$AA@ 1001c55c LIBCMT:crt0msg.obj - 0002:00001564 ??_C@_1CO@EAEJAADC@?$AA?$DM?$AAp?$AAr?$AAo?$AAg?$AAr?$AAa?$AAm?$AA?5?$AAn?$AAa?$AAm?$AAe?$AA?5?$AAu?$AAn?$AAk?$AAn?$AAo?$AAw?$AAn?$AA?$DO?$AA?$AA@ 1001c564 LIBCMT:crt0msg.obj - 0002:00001594 ??_C@_1DE@JNGNBFGO@?$AAR?$AAu?$AAn?$AAt?$AAi?$AAm?$AAe?$AA?5?$AAE?$AAr?$AAr?$AAo?$AAr?$AA?$CB?$AA?6?$AA?6?$AAP?$AAr?$AAo?$AAg?$AAr?$AAa?$AAm?$AA?3?$AA?5?$AA?$AA@ 1001c594 LIBCMT:crt0msg.obj - 0002:000015c8 __XcptActTab 1001c5c8 LIBCMT:winxfltr.obj - 0002:00001658 __First_FPE_Indx 1001c658 LIBCMT:winxfltr.obj - 0002:0000165c __Num_FPE 1001c65c LIBCMT:winxfltr.obj - 0002:00001660 __XcptActTabSize 1001c660 LIBCMT:winxfltr.obj - 0002:00001664 __XcptActTabCount 1001c664 LIBCMT:winxfltr.obj - 0002:00001668 ??_C@_1BC@GDGBMEMK@?$AAH?$AAH?$AA?3?$AAm?$AAm?$AA?3?$AAs?$AAs?$AA?$AA@ 1001c668 LIBCMT:nlsdata2.obj - 0002:0000167c ??_C@_1CI@KNAKOEBC@?$AAd?$AAd?$AAd?$AAd?$AA?0?$AA?5?$AAM?$AAM?$AAM?$AAM?$AA?5?$AAd?$AAd?$AA?0?$AA?5?$AAy?$AAy?$AAy?$AAy?$AA?$AA@ 1001c67c LIBCMT:nlsdata2.obj - 0002:000016a4 ??_C@_1BC@IEBCMHCM@?$AAM?$AAM?$AA?1?$AAd?$AAd?$AA?1?$AAy?$AAy?$AA?$AA@ 1001c6a4 LIBCMT:nlsdata2.obj - 0002:000016b8 ??_C@_15CLMNNGEL@?$AAP?$AAM?$AA?$AA@ 1001c6b8 LIBCMT:nlsdata2.obj - 0002:000016c0 ??_C@_15ODEHAHHF@?$AAA?$AAM?$AA?$AA@ 1001c6c0 LIBCMT:nlsdata2.obj - 0002:000016c8 ??_C@_1BC@FEMKIFH@?$AAD?$AAe?$AAc?$AAe?$AAm?$AAb?$AAe?$AAr?$AA?$AA@ 1001c6c8 LIBCMT:nlsdata2.obj - 0002:000016dc ??_C@_1BC@BGLIFPF@?$AAN?$AAo?$AAv?$AAe?$AAm?$AAb?$AAe?$AAr?$AA?$AA@ 1001c6dc LIBCMT:nlsdata2.obj - 0002:000016f0 ??_C@_1BA@EPANDLNG@?$AAO?$AAc?$AAt?$AAo?$AAb?$AAe?$AAr?$AA?$AA@ 1001c6f0 LIBCMT:nlsdata2.obj - 0002:00001700 ??_C@_1BE@DKAAMBJL@?$AAS?$AAe?$AAp?$AAt?$AAe?$AAm?$AAb?$AAe?$AAr?$AA?$AA@ 1001c700 LIBCMT:nlsdata2.obj - 0002:00001714 ??_C@_1O@PAHLKOAC@?$AAA?$AAu?$AAg?$AAu?$AAs?$AAt?$AA?$AA@ 1001c714 LIBCMT:nlsdata2.obj - 0002:00001724 ??_C@_19BIFMLPCD@?$AAJ?$AAu?$AAl?$AAy?$AA?$AA@ 1001c724 LIBCMT:nlsdata2.obj - 0002:00001730 ??_C@_19EPFLPGAP@?$AAJ?$AAu?$AAn?$AAe?$AA?$AA@ 1001c730 LIBCMT:nlsdata2.obj - 0002:0000173c ??_C@_1M@GJNLMHFD@?$AAA?$AAp?$AAr?$AAi?$AAl?$AA?$AA@ 1001c73c LIBCMT:nlsdata2.obj - 0002:00001748 ??_C@_1M@IKEENEDF@?$AAM?$AAa?$AAr?$AAc?$AAh?$AA?$AA@ 1001c748 LIBCMT:nlsdata2.obj - 0002:00001754 ??_C@_1BC@JGDDFFAM@?$AAF?$AAe?$AAb?$AAr?$AAu?$AAa?$AAr?$AAy?$AA?$AA@ 1001c754 LIBCMT:nlsdata2.obj - 0002:00001768 ??_C@_1BA@EFMEIEBA@?$AAJ?$AAa?$AAn?$AAu?$AAa?$AAr?$AAy?$AA?$AA@ 1001c768 LIBCMT:nlsdata2.obj - 0002:00001778 ??_C@_17EGKACKIF@?$AAD?$AAe?$AAc?$AA?$AA@ 1001c778 LIBCMT:nlsdata2.obj - 0002:00001780 ??_C@_17BBDMLCIG@?$AAN?$AAo?$AAv?$AA?$AA@ 1001c780 LIBCMT:nlsdata2.obj - 0002:00001788 ??_C@_17FNLKOI@?$AAO?$AAc?$AAt?$AA?$AA@ 1001c788 LIBCMT:nlsdata2.obj - 0002:00001790 ??_C@_17HCHCOKMG@?$AAS?$AAe?$AAp?$AA?$AA@ 1001c790 LIBCMT:nlsdata2.obj - 0002:00001798 ??_C@_17ICPELBCN@?$AAA?$AAu?$AAg?$AA?$AA@ 1001c798 LIBCMT:nlsdata2.obj - 0002:000017a0 ??_C@_17IJPCKHK@?$AAJ?$AAu?$AAl?$AA?$AA@ 1001c7a0 LIBCMT:nlsdata2.obj - 0002:000017a8 ??_C@_17KCJGOCPB@?$AAJ?$AAu?$AAn?$AA?$AA@ 1001c7a8 LIBCMT:nlsdata2.obj - 0002:000017b0 ??_C@_17PNNKMEED@?$AAM?$AAa?$AAy?$AA?$AA@ 1001c7b0 LIBCMT:nlsdata2.obj - 0002:000017b8 ??_C@_17LFPOIHDD@?$AAA?$AAp?$AAr?$AA?$AA@ 1001c7b8 LIBCMT:nlsdata2.obj - 0002:000017c0 ??_C@_17CKNLEDEC@?$AAM?$AAa?$AAr?$AA?$AA@ 1001c7c0 LIBCMT:nlsdata2.obj - 0002:000017c8 ??_C@_17LMDJEKJN@?$AAF?$AAe?$AAb?$AA?$AA@ 1001c7c8 LIBCMT:nlsdata2.obj - 0002:000017d0 ??_C@_17DKNBKCHM@?$AAJ?$AAa?$AAn?$AA?$AA@ 1001c7d0 LIBCMT:nlsdata2.obj - 0002:000017d8 ??_C@_1BC@ENMNNPAJ@?$AAS?$AAa?$AAt?$AAu?$AAr?$AAd?$AAa?$AAy?$AA?$AA@ 1001c7d8 LIBCMT:nlsdata2.obj - 0002:000017ec ??_C@_1O@PDICJHAG@?$AAF?$AAr?$AAi?$AAd?$AAa?$AAy?$AA?$AA@ 1001c7ec LIBCMT:nlsdata2.obj - 0002:000017fc ??_C@_1BC@HHMNLIHE@?$AAT?$AAh?$AAu?$AAr?$AAs?$AAd?$AAa?$AAy?$AA?$AA@ 1001c7fc LIBCMT:nlsdata2.obj - 0002:00001810 ??_C@_1BE@EBOGMDOH@?$AAW?$AAe?$AAd?$AAn?$AAe?$AAs?$AAd?$AAa?$AAy?$AA?$AA@ 1001c810 LIBCMT:nlsdata2.obj - 0002:00001824 ??_C@_1BA@ENFBFFEK@?$AAT?$AAu?$AAe?$AAs?$AAd?$AAa?$AAy?$AA?$AA@ 1001c824 LIBCMT:nlsdata2.obj - 0002:00001834 ??_C@_1O@MMNBFLIA@?$AAM?$AAo?$AAn?$AAd?$AAa?$AAy?$AA?$AA@ 1001c834 LIBCMT:nlsdata2.obj - 0002:00001844 ??_C@_1O@IHNHDHPB@?$AAS?$AAu?$AAn?$AAd?$AAa?$AAy?$AA?$AA@ 1001c844 LIBCMT:nlsdata2.obj - 0002:00001854 ??_C@_17GGIBDPIH@?$AAS?$AAa?$AAt?$AA?$AA@ 1001c854 LIBCMT:nlsdata2.obj - 0002:0000185c ??_C@_17HFOLPPLP@?$AAF?$AAr?$AAi?$AA?$AA@ 1001c85c LIBCMT:nlsdata2.obj - 0002:00001864 ??_C@_17PDPHAADD@?$AAT?$AAh?$AAu?$AA?$AA@ 1001c864 LIBCMT:nlsdata2.obj - 0002:0000186c ??_C@_17CJEDCEPE@?$AAW?$AAe?$AAd?$AA?$AA@ 1001c86c LIBCMT:nlsdata2.obj - 0002:00001874 ??_C@_17BMKGEGOJ@?$AAT?$AAu?$AAe?$AA?$AA@ 1001c874 LIBCMT:nlsdata2.obj - 0002:0000187c ??_C@_17KBOMKBF@?$AAM?$AAo?$AAn?$AA?$AA@ 1001c87c LIBCMT:nlsdata2.obj - 0002:00001884 ??_C@_17MBGCMIPB@?$AAS?$AAu?$AAn?$AA?$AA@ 1001c884 LIBCMT:nlsdata2.obj - 0002:0000188c ??_C@_08JCCMCCIL@HH?3mm?3ss?$AA@ 1001c88c LIBCMT:nlsdata2.obj - 0002:00001898 ??_C@_0BE@CKGJFCPC@dddd?0?5MMMM?5dd?0?5yyyy?$AA@ 1001c898 LIBCMT:nlsdata2.obj - 0002:000018ac ??_C@_08BPBNCDIB@MM?1dd?1yy?$AA@ 1001c8ac LIBCMT:nlsdata2.obj - 0002:000018b8 ??_C@_02CJNFDJBF@PM?$AA@ 1001c8b8 LIBCMT:nlsdata2.obj - 0002:000018bc ??_C@_02DEDBPAFC@AM?$AA@ 1001c8bc LIBCMT:nlsdata2.obj - 0002:000018c0 ??_C@_08EDHMEBNP@December?$AA@ 1001c8c0 LIBCMT:nlsdata2.obj - 0002:000018cc ??_C@_08HCHEGEOA@November?$AA@ 1001c8cc LIBCMT:nlsdata2.obj - 0002:000018d8 ??_C@_07JJNFCEND@October?$AA@ 1001c8d8 LIBCMT:nlsdata2.obj - 0002:000018e0 ??_C@_09BHHEALKD@September?$AA@ 1001c8e0 LIBCMT:nlsdata2.obj - 0002:000018ec ??_C@_06LBBHFDDG@August?$AA@ 1001c8ec LIBCMT:nlsdata2.obj - 0002:000018f4 ??_C@_04MIEPOIFP@July?$AA@ 1001c8f4 LIBCMT:nlsdata2.obj - 0002:000018fc ??_C@_04CNLMGBGM@June?$AA@ 1001c8fc LIBCMT:nlsdata2.obj - 0002:00001904 ??_C@_05DMJDNLEJ@April?$AA@ 1001c904 LIBCMT:nlsdata2.obj - 0002:0000190c ??_C@_05HPCKOFNC@March?$AA@ 1001c90c LIBCMT:nlsdata2.obj - 0002:00001914 ??_C@_08GNJGEPFN@February?$AA@ 1001c914 LIBCMT:nlsdata2.obj - 0002:00001920 ??_C@_07CGJPFGJA@January?$AA@ 1001c920 LIBCMT:nlsdata2.obj - 0002:00001928 ??_C@_03MKABNOCG@Dec?$AA@ 1001c928 LIBCMT:nlsdata2.obj - 0002:0000192c ??_C@_03JPJOFNIA@Nov?$AA@ 1001c92c LIBCMT:nlsdata2.obj - 0002:00001930 ??_C@_03BMAOKBAD@Oct?$AA@ 1001c930 LIBCMT:nlsdata2.obj - 0002:00001934 ??_C@_03GGCAPAJC@Sep?$AA@ 1001c934 LIBCMT:nlsdata2.obj - 0002:00001938 ??_C@_03IFJFEIGA@Aug?$AA@ 1001c938 LIBCMT:nlsdata2.obj - 0002:0000193c ??_C@_03LBGABGKK@Jul?$AA@ 1001c93c LIBCMT:nlsdata2.obj - 0002:00001940 ??_C@_03IDFGHECI@Jun?$AA@ 1001c940 LIBCMT:nlsdata2.obj - 0002:00001944 ??_C@_03CNMDKL@May?$AA@ 1001c944 LIBCMT:nlsdata2.obj - 0002:00001948 ??_C@_03LEOLGMJP@Apr?$AA@ 1001c948 LIBCMT:nlsdata2.obj - 0002:0000194c ??_C@_03ODNJBKGA@Mar?$AA@ 1001c94c LIBCMT:nlsdata2.obj - 0002:00001950 ??_C@_03HJBDCHOM@Feb?$AA@ 1001c950 LIBCMT:nlsdata2.obj - 0002:00001954 ??_C@_03JIHJHPIE@Jan?$AA@ 1001c954 LIBCMT:nlsdata2.obj - 0002:00001958 ??_C@_08INBOOONO@Saturday?$AA@ 1001c958 LIBCMT:nlsdata2.obj - 0002:00001964 ??_C@_06JECMNKMI@Friday?$AA@ 1001c964 LIBCMT:nlsdata2.obj - 0002:0000196c ??_C@_08HACCIKIA@Thursday?$AA@ 1001c96c LIBCMT:nlsdata2.obj - 0002:00001978 ??_C@_09DLIGFAKA@Wednesday?$AA@ 1001c978 LIBCMT:nlsdata2.obj - 0002:00001984 ??_C@_07BAAGCFCM@Tuesday?$AA@ 1001c984 LIBCMT:nlsdata2.obj - 0002:0000198c ??_C@_06JLEDEDGH@Monday?$AA@ 1001c98c LIBCMT:nlsdata2.obj - 0002:00001994 ??_C@_06OOPIFAJ@Sunday?$AA@ 1001c994 LIBCMT:nlsdata2.obj - 0002:0000199c ??_C@_03FEFJNEK@Sat?$AA@ 1001c99c LIBCMT:nlsdata2.obj - 0002:000019a0 ??_C@_03IDIOELNC@Fri?$AA@ 1001c9a0 LIBCMT:nlsdata2.obj - 0002:000019a4 ??_C@_03IOFIKPDN@Thu?$AA@ 1001c9a4 LIBCMT:nlsdata2.obj - 0002:000019a8 ??_C@_03MHOMLAJA@Wed?$AA@ 1001c9a8 LIBCMT:nlsdata2.obj - 0002:000019ac ??_C@_03NAGEINEP@Tue?$AA@ 1001c9ac LIBCMT:nlsdata2.obj - 0002:000019b0 ??_C@_03PDAGKDH@Mon?$AA@ 1001c9b0 LIBCMT:nlsdata2.obj - 0002:000019b4 ??_C@_03KOEHGMDN@Sun?$AA@ 1001c9b4 LIBCMT:nlsdata2.obj - 0002:000019b8 ___lookuptable_s 1001c9b8 LIBCMT:outputs.obj - 0002:00001a30 ??_C@_1CK@HHHCOJPD@?$AAE?$AAn?$AAv?$AAi?$AAr?$AAo?$AAn?$AAm?$AAe?$AAn?$AAt?$AAD?$AAi?$AAr?$AAe?$AAc?$AAt?$AAo?$AAr?$AAy?$AA?$AA@ 1001ca30 LIBCMT:_pdblkup_.obj - 0002:00001a60 ??_C@_1FM@DNCABAP@?$AAS?$AAO?$AAF?$AAT?$AAW?$AAA?$AAR?$AAE?$AA?2?$AAM?$AAi?$AAc?$AAr?$AAo?$AAs?$AAo?$AAf?$AAt?$AA?2?$AAV?$AAi?$AAs?$AAu?$AAa?$AAl?$AAS?$AAt?$AAu?$AAd?$AAi?$AAo?$AA?2@ 1001ca60 LIBCMT:_pdblkup_.obj - 0002:00001abc ??_C@_0M@HLOHPNFA@RegCloseKey?$AA@ 1001cabc LIBCMT:_pdblkup_.obj - 0002:00001ac8 ??_C@_0BB@GLNAEDBD@RegQueryValueExW?$AA@ 1001cac8 LIBCMT:_pdblkup_.obj - 0002:00001adc ??_C@_0O@COHOBMLB@RegOpenKeyExW?$AA@ 1001cadc LIBCMT:_pdblkup_.obj - 0002:00001aec ??_C@_01KDCPPGHE@r?$AA@ 1001caec LIBCMT:_pdblkup_.obj - 0002:00001af0 ??_C@_0BB@KCIACLNC@PDBOpenValidate5?$AA@ 1001caf0 LIBCMT:_pdblkup_.obj - 0002:00001b04 ??_C@_0BI@DFKBFLJE@GetProcessWindowStation?$AA@ 1001cb04 LIBCMT:crtmboxw.obj - 0002:00001b1c ??_C@_0BK@DEKFELLI@GetUserObjectInformationW?$AA@ 1001cb1c LIBCMT:crtmboxw.obj - 0002:00001b38 ??_C@_0BD@HHGDFDBJ@GetLastActivePopup?$AA@ 1001cb38 LIBCMT:crtmboxw.obj - 0002:00001b4c ??_C@_0BA@HNOPNCHB@GetActiveWindow?$AA@ 1001cb4c LIBCMT:crtmboxw.obj - 0002:00001b5c ??_C@_0M@DLDCCGNP@MessageBoxW?$AA@ 1001cb5c LIBCMT:crtmboxw.obj - 0002:00001b68 ??_C@_1BG@GOEBHBDC@?$AAU?$AAS?$AAE?$AAR?$AA3?$AA2?$AA?4?$AAD?$AAL?$AAL?$AA?$AA@ 1001cb68 LIBCMT:crtmboxw.obj - 0002:00001c00 ___newctype 1001cc00 LIBCMT:ctype.obj - 0002:00001f00 __wctype 1001cf00 LIBCMT:ctype.obj - 0002:00002108 ___newclmap 1001d108 LIBCMT:ctype.obj - 0002:00002288 ___newcumap 1001d288 LIBCMT:ctype.obj - 0002:00002408 ??_C@_1BA@BALFACEM@?$AAC?$AAO?$AAN?$AAO?$AAU?$AAT?$AA$?$AA?$AA@ 1001d408 LIBCMT:initcon.obj - 0002:00002418 ??_C@_06IMKFLFPG@1?$CDQNAN?$AA@ 1001d418 LIBCMT:_x10fout_.obj - 0002:00002420 ??_C@_05DNEBIAHO@1?$CDINF?$AA@ 1001d420 LIBCMT:_x10fout_.obj - 0002:00002428 ??_C@_05PHHOCPM@1?$CDIND?$AA@ 1001d428 LIBCMT:_x10fout_.obj - 0002:00002430 ??_C@_06PGGFOGJG@1?$CDSNAN?$AA@ 1001d430 LIBCMT:_x10fout_.obj - 0002:00002438 __load_config_used 1001d438 LIBCMT:loadcfg.obj - 0002:00002480 ___safe_se_handler_table 1001d480 - 0002:0000248c ___rtc_iaa 1001d48c LIBCMT:_initsect_.obj - 0002:00002490 ___rtc_izz 1001d490 LIBCMT:_initsect_.obj - 0002:00002494 ___rtc_taa 1001d494 LIBCMT:_initsect_.obj - 0002:00002498 ___rtc_tzz 1001d498 LIBCMT:_initsect_.obj - 0002:0000293c __IMPORT_DESCRIPTOR_ADVAPI32 1001d93c Advapi32:ADVAPI32.dll - 0002:00002950 __IMPORT_DESCRIPTOR_USER32 1001d950 User32:USER32.dll - 0002:00002964 __IMPORT_DESCRIPTOR_KERNEL32 1001d964 kernel32:KERNEL32.dll - 0002:00002978 __NULL_IMPORT_DESCRIPTOR 1001d978 Advapi32:ADVAPI32.dll - 0003:00000038 _SVN_REV 1001f038 api.obj - 0003:00003f20 ___security_cookie 10022f20 LIBCMT:gs_cookie.obj - 0003:00003f24 ___security_cookie_complement 10022f24 LIBCMT:gs_cookie.obj - 0003:000040a0 __fltused 100230a0 LIBCMT:_fpinit_.obj - 0003:000040a4 __ldused 100230a4 LIBCMT:_fpinit_.obj - 0003:000040a8 __iob 100230a8 LIBCMT:_file.obj - 0003:00004330 ___nullstring 10023330 LIBCMT:output.obj - 0003:00004334 ___wnullstring 10023334 LIBCMT:output.obj - 0003:00004338 ?_RTC_ErrorLevels@@3PAHA 10023338 LIBCMT:_error_.obj - 0003:00004350 __timezone 10023350 LIBCMT:timeset.obj - 0003:00004354 __daylight 10023354 LIBCMT:timeset.obj - 0003:00004358 __dstbias 10023358 LIBCMT:timeset.obj - 0003:000043e0 __tzname 100233e0 LIBCMT:timeset.obj - 0003:00004400 ___flsindex 10023400 LIBCMT:tidtable.obj - 0003:00004404 ___getvalueindex 10023404 LIBCMT:tidtable.obj - 0003:00004408 __lookuptrailbytes 10023408 LIBCMT:read.obj - 0003:00004508 ___badioinfo 10023508 LIBCMT:ioinit.obj - 0003:00004550 __cfltcvt_tab 10023550 LIBCMT:cmiscdat.obj - 0003:00004698 __sys_errlist 10023698 LIBCMT:syserr.obj - 0003:00004748 __sys_nerr 10023748 LIBCMT:syserr.obj - 0003:00004750 ___initialmbcinfo 10023750 LIBCMT:mbctype.obj - 0003:00004970 __mbctype 10023970 LIBCMT:mbctype.obj - 0003:00004a78 __mbcasemap 10023a78 LIBCMT:mbctype.obj - 0003:00004b78 ___ptmbcinfo 10023b78 LIBCMT:mbctype.obj - 0003:00004c70 ___globallocalestatus 10023c70 LIBCMT:glstatus.obj - 0003:00004c74 ___clocalestr 10023c74 LIBCMT:nlsdata2.obj - 0003:00004c78 ___lc_time_c 10023c78 LIBCMT:nlsdata2.obj - 0003:00004de0 ___initiallocinfo 10023de0 LIBCMT:nlsdata2.obj - 0003:00004eb8 ___ptlocinfo 10023eb8 LIBCMT:nlsdata2.obj - 0003:00004ebc ___initiallocalestructinfo 10023ebc LIBCMT:nlsdata2.obj - 0003:00004ed0 __lpdays 10023ed0 LIBCMT:days.obj - 0003:00004f04 __days 10023f04 LIBCMT:days.obj - 0003:00004f40 ___abort_behavior 10023f40 LIBCMT:abort.obj - 0003:00004f50 ___lconv_static_decimal 10023f50 LIBCMT:lconv.obj - 0003:00004f54 ___lconv_static_W_decimal 10023f54 LIBCMT:lconv.obj - 0003:00004f58 ___lconv_c 10023f58 LIBCMT:lconv.obj - 0003:00004fa8 ___lconv 10023fa8 LIBCMT:lconv.obj - 0003:00004fac __pctype 10023fac LIBCMT:ctype.obj - 0003:00004fb0 __pwctype 10023fb0 LIBCMT:ctype.obj - 0003:00004fb4 __confh 10023fb4 LIBCMT:initcon.obj - 0003:00004fc0 __NLG_Destination 10023fc0 LIBCMT:exsup.obj - 0003:00005000 ___mb_cur_max 10024000 LIBCMT:nlsdata1.obj - 0003:00005004 ___decimal_point 10024004 LIBCMT:nlsdata1.obj - 0003:00005008 ___decimal_point_length 10024008 LIBCMT:nlsdata1.obj - 0003:00005010 __pow10pos 10024010 LIBCMT:_constpow_.obj - 0003:00005170 __pow10neg 10024170 LIBCMT:_constpow_.obj - 0003:00005300 _svn_rev 10024300 api.obj - 0003:00005380 _default_xbee 10024380 api.obj - 0003:00005384 _glob_hModule 10024384 api.obj - 0003:00005388 _win32_hWnd 10024388 api.obj - 0003:0000538c _win32_MessageID 1002438c api.obj - 0003:00005398 ___fastflag 10024398 LIBCMT:_fpinit_.obj - 0003:0000539c __cflush 1002439c LIBCMT:_file.obj - 0003:000053a0 __umaskval 100243a0 LIBCMT:crt0dat.obj - 0003:000053a4 ___argc 100243a4 LIBCMT:crt0dat.obj - 0003:000053a8 ___argv 100243a8 LIBCMT:crt0dat.obj - 0003:000053ac ___wargv 100243ac LIBCMT:crt0dat.obj - 0003:000053b0 __environ 100243b0 LIBCMT:crt0dat.obj - 0003:000053b4 ___initenv 100243b4 LIBCMT:crt0dat.obj - 0003:000053b8 __wenviron 100243b8 LIBCMT:crt0dat.obj - 0003:000053bc ___winitenv 100243bc LIBCMT:crt0dat.obj - 0003:000053c0 __pgmptr 100243c0 LIBCMT:crt0dat.obj - 0003:000053c4 __wpgmptr 100243c4 LIBCMT:crt0dat.obj - 0003:000053c8 __exitflag 100243c8 LIBCMT:crt0dat.obj - 0003:000053cc __C_Termination_Done 100243cc LIBCMT:crt0dat.obj - 0003:000053d0 __C_Exit_Done 100243d0 LIBCMT:crt0dat.obj - 0003:000053d8 __aenvptr 100243d8 LIBCMT:dllcrt0.obj - 0003:000053dc __wenvptr 100243dc LIBCMT:dllcrt0.obj - 0003:000053e0 ___error_mode 100243e0 LIBCMT:dllcrt0.obj - 0003:000053e4 ___app_type 100243e4 LIBCMT:dllcrt0.obj - 0003:000053e8 ___pInvalidArgHandler 100243e8 LIBCMT:invarg.obj - 0003:00005714 ?wsprintffp@@3P6AHPADPBDZZA 10024714 LIBCMT:_error_.obj - 0003:00005720 __crtheap 10024720 LIBCMT:heapinit.obj - 0003:000057e0 _gpFlsAlloc 100247e0 LIBCMT:tidtable.obj - 0003:000057e4 _gpFlsGetValue 100247e4 LIBCMT:tidtable.obj - 0003:000057e8 _gpFlsSetValue 100247e8 LIBCMT:tidtable.obj - 0003:000057ec _gpFlsFree 100247ec LIBCMT:tidtable.obj - 0003:000057f0 __stdbuf 100247f0 LIBCMT:_sftbuf.obj - 0003:00005948 __maxwait 10024948 LIBCMT:crtheap.obj - 0003:0000594c ?__pInconsistency@@3P6AXXZA 1002494c LIBCMT:hooks.obj - 0003:00005968 ___pPurecall 10024968 LIBCMT:inithelp.obj - 0003:0000596c ?_pnhHeap@@3P6AHI@ZA 1002496c LIBCMT:handler.obj - 0003:00005f98 __newmode 10024f98 LIBCMT:_newmode.obj - 0003:000060ac ___mbulinfo 100250ac LIBCMT:mbctype.obj - 0003:000060b8 ___mbcodepage 100250b8 LIBCMT:mbctype.obj - 0003:000060bc ___ismbcodepage 100250bc LIBCMT:mbctype.obj - 0003:000060c0 ___mblcid 100250c0 LIBCMT:mbctype.obj - 0003:000060d0 __fmode 100250d0 LIBCMT:txtmode.obj - 0003:000060d4 __outputformat 100250d4 LIBCMT:outputformat.obj - 0003:000060ec ___locale_changed 100250ec LIBCMT:setlocal.obj - 0003:000060f0 ___lconv_static_null 100250f0 LIBCMT:lconv.obj - 0003:000060f4 ___lconv_static_W_null 100250f4 LIBCMT:lconv.obj - 0003:000060f8 __commode 100250f8 LIBCMT:ncommode.obj - 0003:000060fc _xbee_hnd_mutex 100250fc - 0003:00006100 __debugger_hook_dummy 10025100 - 0003:00006104 ___sse2_available 10025104 - 0003:00006108 __pDestructExceptionObject 10025108 - 0003:0000610c __nhandle 1002510c - 0003:00006120 ___pioinfo 10025120 - 0003:00006220 __acmdln 10025220 - 0003:00006224 ___env_initialized 10025224 - 0003:00006228 ___onexitend 10025228 - 0003:0000622c ___onexitbegin 1002522c - 0003:00006230 ___mbctype_initialized 10025230 - 0003:00006234 ___dyn_tls_init_callback 10025234 - 0003:00006238 ___piob 10025238 - 0003:00006240 __bufin 10025240 - 0003:00007240 __nstream 10026240 - - entry point at 0001:0000da7c - - Static symbols - - 0001:00001190 _xbee_logf 10002190 f api.obj - 0001:00001a00 _Xfree2@4 10002a00 f api.obj - 0001:00002af0 _init_serial@8 10003af0 f api.obj - 0001:00002db0 _Xmalloc2@8 10003db0 f api.obj - 0001:00002e50 _Xcalloc2@8 10003e50 f api.obj - 0001:00002ef0 _xbee_startAPI@4 10003ef0 f api.obj - 0001:00003110 _xbee_sendAT@16 10004110 f api.obj - 0001:00003140 _xbee_sendATdelay@20 10004140 f api.obj - 0001:00003630 _xbee_select@8 10004630 f api.obj - 0001:00005820 _xbee_matchpktcon@12 10006820 f api.obj - 0001:00005b20 _xbee_listen_wrapper@4 10006b20 f api.obj - 0001:00005c30 _xbee_listen@4 10006c30 f api.obj - 0001:00008d10 _Xrealloc2@12 10009d10 f api.obj - 0001:00008d70 _xbee_parse_io@24 10009d70 f api.obj - 0001:00009480 _xbee_callbackWrapper@4 1000a480 f api.obj - 0001:00009970 _xbee_thread_watch@4 1000a970 f api.obj - 0001:00009bb0 _xbee_getbyte@4 1000abb0 f api.obj - 0001:00009c00 _xbee_getrawbyte@4 1000ac00 f api.obj - 0001:00009dc0 __xbee_send_pkt@12 1000adc0 f api.obj - 0001:0000a2e0 _xbee_make_pkt@12 1000b2e0 f api.obj - 0001:0000a7d1 __tsopen_nolock 1000b7d1 f LIBCMT:open.obj - 0001:0000b225 _flsall 1000c225 f LIBCMT:fflush.obj - 0001:0000bae4 _doexit 1000cae4 f LIBCMT:crt0dat.obj - 0001:0000d986 ___DllMainCRTStartup 1000e986 f LIBCMT:dllcrt0.obj - 0001:0000dc8a _write_char 1000ec8a f LIBCMT:output.obj - 0001:0000dcbd _write_string 1000ecbd f LIBCMT:output.obj - 0001:0000eb56 ?DebuggerProbe@@YAHK@Z 1000fb56 f LIBCMT:_error_.obj - 0001:0000eba6 ?DebuggerRuntime@@YAHKHPAXPB_W@Z 1000fba6 f LIBCMT:_error_.obj - 0001:0000ec08 ?failwithmessage@@YAXPAXHHPBD@Z 1000fc08 f LIBCMT:_error_.obj - 0001:0000f019 __tzset_nolock 10010019 f LIBCMT:tzset.obj - 0001:0001167d __shift 1001267d f LIBCMT:cvt.obj - 0001:000116c2 __cftoe2_l 100126c2 f LIBCMT:cvt.obj - 0001:00011c80 __cftof2_l 10012c80 f LIBCMT:cvt.obj - 0001:000127f2 _siglookup 100137f2 f LIBCMT:winsig.obj - 0001:00012a2e __onexit_nolock 10013a2e f LIBCMT:onexit.obj - 0001:00012f9c ?strtoxl@@YAKPAUlocaleinfo_struct@@PBDPAPBDHH@Z 10013f9c f LIBCMT:strtol.obj - 0001:0001349b _parse_cmdline 1001449b f LIBCMT:stdargv.obj - 0001:00013a2b ?CPtoLCID@@YAHH@Z 10014a2b f LIBCMT:mbctype.obj - 0001:00013a5a ?setSBCS@@YAXPAUthreadmbcinfostruct@@@Z 10014a5a f LIBCMT:mbctype.obj - 0001:00013abe ?setSBUpLow@@YAXPAUthreadmbcinfostruct@@@Z 10014abe f LIBCMT:mbctype.obj - 0001:00013cf2 ?getSystemCP@@YAHH@Z 10014cf2 f LIBCMT:mbctype.obj - 0001:000146bd ?GetPdbDll@@YAPAUHINSTANCE__@@XZ 100156bd f LIBCMT:_pdblkup_.obj - 0001:00014e40 __unwind_handler4 10015e40 f LIBCMT:exsup4.obj - 0001:00015e34 ?x_ismbbtype_l@@YAHPAUlocaleinfo_struct@@IHH@Z 10016e34 f LIBCMT:ismbbyte.obj - 0001:00015e9f ?__crtLCMapStringA_stat@@YAHPAUlocaleinfo_struct@@KKPBDHPADHHH@Z 10016e9f f LIBCMT:a_map.obj - 0001:000160cc ?__crtGetStringTypeA_stat@@YAHPAUlocaleinfo_struct@@KPBDHPAGHHH@Z 100170cc f LIBCMT:a_str.obj - 0001:000168c0 __unwind_handler 100178c0 f LIBCMT:exsup.obj - 0001:0001844d __hw_cw 1001944d f LIBCMT:_ieee87_.obj - 0001:000184db ___hw_cw_sse2 100194db f LIBCMT:_ieee87_.obj - 0001:00018950 ?__crtCompareStringA_stat@@YAHPAUlocaleinfo_struct@@KKPBDH1HH@Z 10019950 f LIBCMT:a_cmp.obj - 0001:00018cea _findenv 10019cea f LIBCMT:setenv.obj - 0001:00018d3c _copy_environ 10019d3c f LIBCMT:setenv.obj - 0001:000196ea __dup_nolock 1001a6ea f LIBCMT:dup.obj diff --git a/libs/thirdParty/libxbee/main.c b/libs/thirdParty/libxbee/main.c deleted file mode 100644 index 7dcacafa7e1a02da30b1d9397c34e06509143f9f..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/main.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -#include -#include -#include - -#include "xbee.h" - -int main(int argc, char *argv[]) { - xbee_con *con, *con2; - xbee_pkt *pkt, *p; - - if (xbee_setuplog("/dev/ttyUSB0",57600,2) == -1) { - perror("xbee_setuplog()"); - exit(1); - } - if (argc >= 2 && !strcmp(argv[1],"sleep")) { - for (;;) { - sleep(86400); /* sleep for a day... forever :) */ - } - } - - /*if ((con = xbee_newcon(NULL,'X',xbee_localAT)) == (void *)-1) { - printf("error creating connection...\n"); - exit(1); - } - - while(1){sleep(10);} - - xbee_senddata(con,"CH%c",0x0C); - sleep(1); - xbee_senddata(con,"ID%c%c",0x33, 0x32); - sleep(1); - xbee_senddata(con,"DH%c%c%c%c",0x00,0x00,0x00,0x00); - sleep(1); - xbee_senddata(con,"DL%c%c%c%c",0x00,0x00,0x00,0x00); - sleep(1); - xbee_senddata(con,"MY%c%c",0x00,0x00); - sleep(1); - // SH - read only - // SL - read only - xbee_senddata(con,"RR%c",0x00); - sleep(1); - xbee_senddata(con,"RN%c",0x00); - sleep(1); - xbee_senddata(con,"MM%c",0x00); - sleep(1); - xbee_senddata(con,"NT%c",0x19); - sleep(1); - xbee_senddata(con,"NO%c",0x00); - sleep(1); - xbee_senddata(con,"CE%c",0x00); - sleep(1); - xbee_senddata(con,"SC%c%c",0x1F,0xFE); - sleep(1); - xbee_senddata(con,"SD%c",0x04); - sleep(1); - xbee_senddata(con,"A1%c",0x00); - sleep(1); - xbee_senddata(con,"A2%c",0x00); - sleep(1); - // AI - read only - xbee_senddata(con,"EE%c",0x00); - sleep(1); - //xbee_senddata(con,"KY%c",0x00); - //sleep(1); - xbee_senddata(con,"NI%s","TIGGER"); - sleep(1); - xbee_senddata(con,"PL%c",0x04); - sleep(1); - xbee_senddata(con,"CA%c",0x2C); - sleep(1); - xbee_senddata(con,"SM%c",0x00); - sleep(1); - xbee_senddata(con,"ST%c%c",0x13,0x88); - sleep(1); - xbee_senddata(con,"SP%c%c",0x00,0x00); - sleep(1); - xbee_senddata(con,"DP%c%c",0x03,0xE8); - sleep(1); - xbee_senddata(con,"SO%c",0x00); - sleep(1); - xbee_senddata(con,"BD%c",0x06); - sleep(1); - xbee_senddata(con,"RO%c",0x03); - sleep(1); - xbee_senddata(con,"AP%c",0x02); - sleep(1); - xbee_senddata(con,"PR%c",0xFF); - sleep(1); - xbee_senddata(con,"D8%c",0x00); - sleep(1); - xbee_senddata(con,"D7%c",0x01); - sleep(1); - xbee_senddata(con,"D6%c",0x00); - sleep(1); - xbee_senddata(con,"D5%c",0x01); - sleep(1); - xbee_senddata(con,"D4%c",0x00); - sleep(1); - xbee_senddata(con,"D3%c",0x00); - sleep(1); - xbee_senddata(con,"D2%c",0x00); - sleep(1); - xbee_senddata(con,"D1%c",0x00); - sleep(1); - xbee_senddata(con,"D0%c",0x00); - sleep(1); - xbee_senddata(con,"IU%c",0x00); - sleep(1); - xbee_senddata(con,"IT%c",0x01); - sleep(1); - xbee_senddata(con,"IC%c",0x00); - sleep(1); - xbee_senddata(con,"IR%c%c",0x00,0x00); - sleep(1); - xbee_senddata(con,"IA%c%c%c%c%c%c%c%c",0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF); - sleep(1); - xbee_senddata(con,"T0%c",0xFF); - sleep(1); - xbee_senddata(con,"T1%c",0xFF); - sleep(1); - xbee_senddata(con,"T2%c",0xFF); - sleep(1); - xbee_senddata(con,"T3%c",0xFF); - sleep(1); - xbee_senddata(con,"T4%c",0xFF); - sleep(1); - xbee_senddata(con,"T5%c",0xFF); - sleep(1); - xbee_senddata(con,"T6%c",0xFF); - sleep(1); - xbee_senddata(con,"T7%c",0xFF); - sleep(1); - xbee_senddata(con,"P0%c",0x01); - sleep(1); - xbee_senddata(con,"P1%c",0x00); - sleep(1); - xbee_senddata(con,"PT%c",0xFF); - sleep(1); - xbee_senddata(con,"RP%c",0x28); - sleep(1); - // VR - read only - // HV - read only - // DB - read only - // EC - read only - // EA - read only - // DD - read only - xbee_senddata(con,"CT%c",0x64); - sleep(1); - xbee_senddata(con,"GT%c%c",0x03,0xE8); - sleep(1); - xbee_senddata(con,"CC%c",0x2B); - sleep(1); - - sleep(10); - */ - - /* test 64bit IO and Data */ - con = xbee_newcon('I',xbee_64bitIO, 0x0013A200, 0x403af247); - con2 = xbee_newcon('I',xbee_64bitData, 0x0013A200, 0x403af247); - - while (1) { - while ((pkt = xbee_getpacket(con)) != NULL) { - int i; - for (i = 0; i < pkt->samples; i++) { - int m; - for (m = 0; m <= 8; m++) { - if (xbee_hasdigital(pkt,i,m)) printf("D%d: %d ",m,xbee_getdigital(pkt,i,m)); - } -#define Vref 3.23 - for (m = 0; m <= 5; m++) { - if (xbee_hasanalog(pkt,i,m)) printf("A%d: %.2fv ",m,xbee_getanalog(pkt,i,m,Vref)); - } - printf("\n"); - } - if (xbee_senddata(con2, "the time is %d\r", time(NULL))) { - printf("Error: xbee_senddata\n"); - return 1; - } - free(pkt); - if (p) { - switch (p->status) { - case 0x01: printf("XBee: txStatus: No ACK\n"); break; - case 0x02: printf("XBee: txStatus: CCA Failure\n"); break; - case 0x03: printf("XBee: txStatus: Purged\n"); break; - } - free(p); - } - } - while ((pkt = xbee_getpacket(con2)) != NULL) { - printf("he said '%s'\n", pkt->data); - if (xbee_senddata(con2, "you said '%s'\r", pkt->data)) { - printf("Error: xbee_senddata\n"); - return 1; - } - free(pkt); - if (p) { - switch (p->status) { - case 0x01: printf("XBee: txStatus: No ACK\n"); break; - case 0x02: printf("XBee: txStatus: CCA Failure\n"); break; - case 0x03: printf("XBee: txStatus: Purged\n"); break; - } - free(p); - } - } - usleep(100); - } - - return 0; -} diff --git a/libs/thirdParty/libxbee/makefile b/libs/thirdParty/libxbee/makefile deleted file mode 100644 index 11b9d3fa62ba0183ffa10ff4db8c1db8db27e962..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/makefile +++ /dev/null @@ -1,226 +0,0 @@ -#-- set this to the man directory you would like to use -MANPATH:=/usr/share/man - -#-- uncomment this to enable debugging -#DEBUG:=-g -DDEBUG - - -###### YOU SHOULD NOT CHANGE BELOW THIS LINE ###### - -VERSION:=1.4.1 -SHELL:=/bin/bash -SRCS:=api.c -MANS:=man3/libxbee.3 \ - man3/xbee_con.3 \ - man3/xbee_end.3 \ - man3/xbee_endcon.3 \ - man3/xbee_flushcon.3 \ - man3/xbee_purgecon.3 \ - man3/xbee_getanalog.3 \ - man3/xbee_getdigital.3 \ - man3/xbee_getpacket.3 \ - man3/xbee_hasanalog.3 \ - man3/xbee_hasdigital.3 \ - man3/xbee_logit.3 \ - man3/xbee_newcon.3 \ - man3/xbee_nsenddata.3 \ - man3/xbee_pkt.3 \ - man3/xbee_senddata.3 \ - man3/xbee_setup.3 \ - man3/xbee_setupAPI.3 \ - man3/xbee_setuplog.3 \ - man3/xbee_setuplogAPI.3 \ - man3/xbee_vsenddata.3 -MANPATHS:=$(foreach dir,$(shell ls man -ln | grep ^d | tr -s ' ' | cut -d ' ' -f 9),${MANPATH}/$(dir)) - -PDFS:=${SRCS} ${SRCS:.c=.h} makefile main.c xbee.h - -CC:=gcc -CFLAGS:=-Wall -Wstrict-prototypes -Wno-variadic-macros -pedantic -c -fPIC ${DEBUG} -CLINKS:=-lpthread -lrt ${DEBUG} -DEFINES:= - -ifeq ($(strip $(wildcard ${MANPATH}/man3/libxbee.3.bz2)),) -FIRSTTIME:=TRUE -else -FIRSTTIME:=FALSE -endif - -ENSCRIPT:=-MA4 --color -f Courier8 -C --margins=15:15:0:20 -ifneq ($(strip $(wildcard /usr/share/enscript/mine-web.hdr)),) - ENSCRIPT+= --fancy-header=mine-web -else - ENSCRIPT+= --fancy-header=a2ps -endif - -SRCS:=${sort ${SRCS}} -PDFS:=${sort ${PDFS}} - -.PHONY: FORCE -.PHONY: all run new clean cleanpdfs main pdfs html -.PHONY: install install_su install_man -.PHONY: uninstall uninstall_su uninstall_man/ - - -# all - do everything (default) # -all: ./lib/libxbee.so.$(VERSION) - @echo "*** Done! ***" - - -# run - remake main and then run # -run: all main - ./bin/main - - -# new - clean and do everything again # -new: clean all - - -# clean - remove any compiled files and PDFs # -clean: - rm -f ./*~ - rm -f ./sample/*~ - rm -f ./obj/*.o - rm -f ./lib/libxbee.so* - rm -f ./bin/main - -cleanpdfs: - rm -f ./pdf/*.pdf - - -# install - installs library # -install: ./lib/libxbee.so.$(VERSION) - @echo - @echo -ifneq ($(shell echo $$USER),root) - @echo "#######################################################################################" - @echo "### To Install this library I need the root password please!" - @echo "#######################################################################################" -endif - su -c "make install_su --no-print-directory" - @echo -ifeq (${FIRSTTIME},TRUE) - @echo "#######################################################################################" - @echo - @pr -h "" -o 3 -w 86 -tT ./README - @echo - @echo "#######################################################################################" -endif - -install_su: /usr/lib/libxbee.so.$(VERSION) /usr/include/xbee.h install_man - -/usr/lib/libxbee.so.$(VERSION): ./lib/libxbee.so.$(VERSION) - cp ./lib/libxbee.so.$(VERSION) /usr/lib/libxbee.so.$(VERSION) -f - @chmod 755 /usr/lib/libxbee.so.$(VERSION) - @chown root:root /usr/lib/libxbee.so.$(VERSION) - ln ./libxbee.so.$(VERSION) /usr/lib/libxbee.so.1 -sf - @chown root:root /usr/lib/libxbee.so.1 - ln ./libxbee.so.$(VERSION) /usr/lib/libxbee.so -sf - @chown root:root /usr/lib/libxbee.so - -/usr/include/xbee.h: ./xbee.h - cp ./xbee.h /usr/include/xbee.h -f - @chmod 644 /usr/include/xbee.h - @chown root:root /usr/include/xbee.h - -install_man: ${MANPATH} ${MANPATHS} ${addsuffix .bz2,${addprefix ${MANPATH}/,${MANS}}} - -${MANPATH} ${MANPATHS}: - @echo "#######################################################################################" - @echo "### $@ does not exist... cannot install man files here!" - @echo "### Please check the directory and the MANPATH variable in the makefile" - @echo "#######################################################################################" - @false - -${MANPATH}/%.bz2: ./man/% - @echo "cat $< | bzip2 -z > $@" - @cat $< | bzip2 -z > $@ || ( \ - echo "#######################################################################################"; \ - echo "### Installing man page '$*' to '$@' failed..."; \ - echo "#######################################################################################"; ) - @chmod 644 $@ - @chown root:root $@ - -./doc/: - mkdir ./doc/ - -html: ./doc/ ./man/ - cd ./doc/; mkdir -p `find ../man/ -type d -not -path *.svn* | cut -b 2-`; - find ./man/ -type f -not -path *.svn* | cut -d / -f 3- | sort > .html_todo - for item in `cat .html_todo`; do \ - man2html -r ./man/$$item | tail -n +3 > ./doc/man/$$item.html; \ - done 2> /dev/null - rm .html_todo - -uninstall: - @echo - @echo -ifneq ($(shell echo $$USER),root) - @echo "#######################################################################################" - @echo "### To Uninstall this library I need the root password please!" - @echo "#######################################################################################" -endif - su -c "make uninstall_su --no-print-directory" - @echo - @echo - -uninstall_su: ${addprefix uninstall_man/,${MANS}} - rm /usr/lib/libxbee.so.$(VERSION) -f - rm /usr/lib/libxbee.so.1 -f - rm /usr/lib/libxbee.so -f - rm /usr/include/xbee.h -f - -uninstall_man/%: - rm ${MANPATH}/$*.bz2 -f - -# main - compile & link objects # -main: ./bin/main - -./bin/main: ./obj/api.o ./bin/ ./main.c - ${CC} ${CLINKS} ./main.c ./obj/api.o -o ./bin/main ${DEBUG} - -./bin/: - mkdir ./bin/ - -./lib/libxbee.so.$(VERSION): ./lib/ ${addprefix ./obj/,${SRCS:.c=.o}} ./xbee.h - gcc -shared -Wl,-soname,libxbee.so.1 $(CLINKS) -o ./lib/libxbee.so.$(VERSION) ./obj/*.o - ln ./libxbee.so.$(VERSION) ./lib/libxbee.so.1 -sf - ln ./libxbee.so.$(VERSION) ./lib/libxbee.so -sf - -./lib/: - mkdir ./lib/ - -./obj/: - mkdir ./obj/ - -./obj/%.o: ./obj/ %.c %.h xbee.h - ${CC} ${CFLAGS} ${DEFINES} ${DEBUG} $*.c -o $@ - -./obj/%.o: ./obj/ %.c xbee.h - ${CC} ${CFLAGS} ${DEFINES} ${DEBUG} $*.c -o $@ - - -# pdfs - generate PDFs for each source file # -ifneq ($(strip $(wildcard /usr/bin/ps2pdf)),) -ifneq ($(strip $(wildcard /usr/bin/enscript)),) -pdfs: ./pdf/ ${addprefix ./pdf/,${addsuffix .pdf,${PDFS}}} - -./pdf/: - mkdir ./pdf/ - -./pdf/makefile.pdf: ./makefile - enscript ${ENSCRIPT} -Emakefile $< -p - | ps2pdf - $@ - -./pdf/%.pdf: % - enscript ${ENSCRIPT} -Ec $< -p - | ps2pdf - $@ - -./pdf/%.pdf: - @echo "*** Cannot make $@ - '$*' does not exist ***" -else -pdfs: - @echo "WARNING: enscript is not installed - cannot generate PDF files" -endif -else -pdfs: - @echo "WARNING: ps2pdf is not installed - cannot generate PDF files" -endif diff --git a/libs/thirdParty/libxbee/man/man3/libxbee.3 b/libs/thirdParty/libxbee/man/man3/libxbee.3 deleted file mode 100644 index 6bcb978f6f26255ee8bd5260d244e63a8730620a..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/libxbee.3 +++ /dev/null @@ -1,91 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH LIBXBEE 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -libxbee -.SH DESCRIPTION -libxbee is a C library to aid the use of Series 1 Digi XBee radios running in API mode (AP=2). -.sp -I have tried to keep flexibility to a maximum. -By allowing connections to individual nodes to be created - you don't have to address each packet, -or filter through incomming packets to get at the one you are after. This is all taken care of -for you by -.BR libxbee -! -.sp -libxbee is still in development, so if you find any bugs or have any enhancement requests, please -feel free to submit an issue on the project page: -.in +4n -.nf -http://code.google.com/p/libxbee/ -.fi -.in -or contact me (Attie) directly: -.in +4n -.nf -attie@attie.co.uk -.fi -.in -.SH "MAN PAGES" -Documentation is avaliable via the following man pages, or by example in the 'sample' folder in the SVN repository -.in +4n -.sp -.BR xbee_pkt "(3) - libxbee's packet structure" -.sp 0 -.BR xbee_con "(3) - libxbee's connection structure" -.sp -.BR xbee_setup "(3) - function to setup libxbee (and its variants)" -.sp 0 -.BR xbee_end "(3) - function to end the libxbee session and close any open handles" -.sp -.BR xbee_logit "(3) - function that allows the user to add to the xbee log output" -.sp -.BR xbee_newcon "(3) - function to create a new connection" -.sp 0 -.BR xbee_purgecon "(3) - function to purge packets from a connection" -.sp 0 -.BR xbee_endcon "(3) - function to end a connection" -.sp -.BR xbee_senddata "(3) - function to send data to a remote XBee (and its variants)" -.sp 0 -.BR xbee_getpacket "(3) - function to get a packet from a connection (and its variants)" -.sp -.BR xbee_hasdigital "(3) - function to check if digital sample is in the packet" -.sp 0 -.BR xbee_getdigital "(3) - function to get digital sample from the packet" -.sp -.BR xbee_hasanalog "(3) - function to check if analog sample is in the packet" -.sp 0 -.BR xbee_getanalog "(3) - function to get the analog sample from the packet" -.fi -.in -.SH "SEE ALSO" -.BR xbee_pkt (3), -.BR xbee_con (3), -.BR xbee_setup (3), -.BR xbee_end (3), -.BR xbee_logit (3), -.BR xbee_newcon (3), -.BR xbee_flushcon (3), -.BR xbee_endcon (3), -.BR xbee_senddata (3), -.BR xbee_getpacket (3), -.BR xbee_hasdigital (3), -.BR xbee_getdigital (3), -.BR xbee_hasanalog (3), -.BR xbee_getanalog (3) diff --git a/libs/thirdParty/libxbee/man/man3/xbee_con.3 b/libs/thirdParty/libxbee/man/man3/xbee_con.3 deleted file mode 100644 index 37e77050449f6d9365525e0d7df8cb8686e1f26a..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_con.3 +++ /dev/null @@ -1,22 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH LIBXBEE 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -libxbee -.sp -This page has not been written yet... diff --git a/libs/thirdParty/libxbee/man/man3/xbee_end.3 b/libs/thirdParty/libxbee/man/man3/xbee_end.3 deleted file mode 100644 index 5fd1de51279f51a2b0ec8b137b9731463e0d9732..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_end.3 +++ /dev/null @@ -1,23 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH LIBXBEE 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -libxbee -.sp -This page has not been written yet... - diff --git a/libs/thirdParty/libxbee/man/man3/xbee_endcon.3 b/libs/thirdParty/libxbee/man/man3/xbee_endcon.3 deleted file mode 100644 index e64ccedb26c6eed86c4ec13a5d8cbb107cdd6efe..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_endcon.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_newcon.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_flushcon.3 b/libs/thirdParty/libxbee/man/man3/xbee_flushcon.3 deleted file mode 100644 index e64ccedb26c6eed86c4ec13a5d8cbb107cdd6efe..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_flushcon.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_newcon.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_getanalog.3 b/libs/thirdParty/libxbee/man/man3/xbee_getanalog.3 deleted file mode 100644 index f7bc1d0c726036a64c6ace07b4247ccea91e1fcc..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_getanalog.3 +++ /dev/null @@ -1,96 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH XBEE_GETPACKET 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -xbee_hasanalog, xbee_getanalog -.SH SYNOPSIS -.B #include -.sp -.BI "int xbee_hasanalog(xbee_pkt *" pkt ", int " sample ", int " input ");" -.sp -.BI "double xbee_getanalog(xbee_pkt *" pkt ", int " sample ", int " input ", double " Vref ");" -.ad b -.SH DESCRIPTION -The -.BR xbee_hasanalog () -function will check the packet for the presence of an analog sample on the specified input. -.sp -The -.BR xbee_getanalog () -function will read the packet and return the sample value for the specified analog input. -.sp -They both take 3 arguments, with the same purposes. -.sp -The argument -.I pkt -points to a packet that was previously retrieved with -.BR xbee_getpacket () -.sp -The argument -.I sample -selects the sample within the packet to use. -.sp -The argument -.I input -specifies which input you are interested in testing. -.sp -.BR xbee_getanalog () -also takes a fourth argument that allows you to provide a -.I Vref -value. This allows the function to convert the raw ADC value into a voltage for you. -.SH "RETURN VALUE" -The -.BR xbee_hasanalog () -function will return -.B 1 -if the provided packet has sample data for the specified input, otherwise -.BR 0 . -.sp -The -.BR xbee_getanalog () -function will return the raw ADC value (0 - 1023) if the provided packet has sample data for the specified input and Vref was given as zero. -If Vref was non-zero, then the return value will be the voltage read. -A -.B -1 -will be returned if the packet does not contain sample data. -.sp -.SH EXAMPLE -To read sample data from previously made connection: -.in +4n -.nf -#include -xbee_pkt *pkt; -double Vref = 3.3; -if ((pkt = xbee_getpacket(con)) != NULL) { - if (xbee_hasanalog(pkt,0,0)) { - printf("A0 read %fv\\n",xbee_getanalog(pkt,0,0,Vref)); - } else { - printf("No A0 data\\n"); - } - free(pkt); -} -.fi -.in -.SH AUTHOR -Attie Grande -.SH "SEE ALSO" -.BR libxbee (3), -.BR xbee_pkt (3), -.BR xbee_getpacket (3), -.BR xbee_hasdigital (3), -.BR xbee_getdigital (3) diff --git a/libs/thirdParty/libxbee/man/man3/xbee_getdigital.3 b/libs/thirdParty/libxbee/man/man3/xbee_getdigital.3 deleted file mode 100644 index 4a0af65b50b11759c10080b4f5872995951d2489..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_getdigital.3 +++ /dev/null @@ -1,91 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH XBEE_GETPACKET 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -xbee_hasdigital, xbee_getdigital -.SH SYNOPSIS -.B #include -.sp -.BI "int xbee_hasdigital(xbee_pkt *" pkt ", int " sample ", int " input ");" -.sp -.BI "int xbee_getdigital(xbee_pkt *" pkt ", int " sample ", int " input ");" -.ad b -.SH DESCRIPTION -The -.BR xbee_hasdigital () -function will check the packet for the presence of a given sample on the specified input. -.sp -The -.BR xbee_getdigital () -function will read the packet and return the sample value for the specified input. -.sp -They both take 3 arguments, with the same purposes. -.sp -The argument -.I pkt -points to a packet that was previously retrieved with -.BR xbee_getpacket () -.sp -The argument -.I sample -selects the sample within the packet to use. -.sp -The argument -.I input -specifies which input you are interested in testing. -.SH "RETURN VALUE" -The -.BR xbee_hasdigital () -function will return -.B 1 -if the provided packet has sample data for the specified input, otherwise -.BR 0 . -.sp -The -.BR xbee_getdigital () -function will return -.B 1 -if the provided packet has sample data for the specified input and the sample was HIGH. -A -.B 0 -will be returned if the sample was LOW, or the packet does not contain sample data. -.sp -.SH EXAMPLE -To read sample data from previously made connection: -.in +4n -.nf -#include -xbee_pkt *pkt; -if ((pkt = xbee_getpacket(con)) != NULL) { - if (xbee_hasdigital(pkt,0,0)) { - printf("D0 read %d\n",xbee_getdigital(pkt,0)); - } else { - printf("No D0 data\n"); - } - free(pkt); -} -.fi -.in -.SH AUTHOR -Attie Grande -.SH "SEE ALSO" -.BR libxbee (3), -.BR xbee_pkt (3), -.BR xbee_getpacket (3), -.BR xbee_hasanalog (3), -.BR xbee_getanalog (3) diff --git a/libs/thirdParty/libxbee/man/man3/xbee_getpacket.3 b/libs/thirdParty/libxbee/man/man3/xbee_getpacket.3 deleted file mode 100644 index a458e49602017c25295ee13bf3766e9b77ca424b..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_getpacket.3 +++ /dev/null @@ -1,88 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH XBEE_GETPACKET 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -xbee_getpacket, xbee_getpacketwait -.SH SYNOPSIS -.B #include -.sp -.BI "xbee_pkt *xbee_getpacket(xbee_con *" con ");" -.sp -.BI "xbee_pkt *xbee_getpacketwait(xbee_con *" con ");" -.ad b -.SH DESCRIPTION -The -.BR xbee_getpacket () -function will return the next avaliable packet for the provided connection. -It takes 1 argument. -.sp -The argument -.I con -points to a connection made previously with -.BR xbee_newcon (). -.sp -The -.BR xbee_getpacketwait () -function behaves the same, but will wait for an internally specified time for a packet to arrive (currently around 1 second). -.SH "RETURN VALUE" -Upon successful return, this function returns the packet, having unlinked it from the internal list. -You must keep hold of the packet until you are finished with it, and then you must -.BR free () -it to prevent memory leaks. -.sp -If a packet was not avaliable for the provided connection, a -.B NULL -is returned. -.sp -If an error occured a -.B NULL -is also returned (though unlikely). -.sp -For more information on the structure of the packet, please see -.BR xbee_pkt (3) -.sp -For information on using callback functions with connections instead, please see -.BR xbee_con (3) -or -.B callback.c -in the SVN sample directory. -.SH EXAMPLE -To recieve a packet from a previously made connection: -.in +4n -.nf -#include -xbee_pkt *pkt; -if ((pkt = xbee_getpacket(con)) != NULL) { - /* process packet... */ - free(pkt); -} -.fi -.in -.SH AUTHOR -Attie Grande -.SH "SEE ALSO" -.BR libxbee (3), -.BR xbee_setup (3), -.BR xbee_newcon (3), -.BR xbee_senddata (3), -.BR xbee_pkt (3), -.BR xbee_con (3), -.BR xbee_hasDigital (3), -.BR xbee_getDigital (3), -.BR xbee_hasAnalog (3), -.BR xbee_getAnalog (3) diff --git a/libs/thirdParty/libxbee/man/man3/xbee_hasanalog.3 b/libs/thirdParty/libxbee/man/man3/xbee_hasanalog.3 deleted file mode 100644 index 402a3f266f409988c87e9e6f2509cf9e4caeaccf..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_hasanalog.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_getanalog.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_hasdigital.3 b/libs/thirdParty/libxbee/man/man3/xbee_hasdigital.3 deleted file mode 100644 index 5557111123b0eb4622ba68b2a88c41426dfa685e..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_hasdigital.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_getdigital.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_logit.3 b/libs/thirdParty/libxbee/man/man3/xbee_logit.3 deleted file mode 100644 index 5fd1de51279f51a2b0ec8b137b9731463e0d9732..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_logit.3 +++ /dev/null @@ -1,23 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH LIBXBEE 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -libxbee -.sp -This page has not been written yet... - diff --git a/libs/thirdParty/libxbee/man/man3/xbee_newcon.3 b/libs/thirdParty/libxbee/man/man3/xbee_newcon.3 deleted file mode 100644 index 2ec511278d45f27a7d0267bdf4deb2665d2ec6a0..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_newcon.3 +++ /dev/null @@ -1,152 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH XBEE_NEWCON 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -xbee_newcon, xbee_purgecon, xbee_endcon -.SH SYNOPSIS -.B #include -.sp -.BI "xbee_con *xbee_newcon(unsigned char " frameID ", xbee_types " type ", ...);" -.sp -.BI "void xbee_purgecon(xbee_con *" con ");" -.sp -.BI "void xbee_endcon(xbee_con *" con ");" -.ad b -.SH DESCRIPTION -The -.BR xbee_newcon () -function will setup a new connection with the specified settings. -It takes at least 2 arguments, and potentially up to 4 depending on the -.I type. -.sp -.B NOTE: -Packets will only be collected when they match an active connection. -You must setup a connection in order to recieve packets. -.sp -The argument -.I frameID -allows similar functionality to that of TCP/IP port numbers. This is 1 -.I unsigned char -(or 8-bit integer) that identifies where the data is coming from or going to. -.s -The -.I type -specifies the type of connection you would like. The following types are avaliable: -.TP -.B xbee_localAT -communicates AT commands with the local XBee -.TP -.B xbee_txStatus -recieves transmit status information from the local XBee -.TP -.B xbee_modemStatus -recieves modem status information from the local XBee -.TP -.B xbee_16bitRemoteAT -communicates AT commands with a remote node (using 16-bit addressing) -.TP -.B xbee_64bitRemoteAT -communicates AT commands with a remote node (using 64-bit addressing) -.TP -.B xbee_16bitData -sends/recieves data through a remote node (using 16-bit addressing) -.TP -.B xbee_64bitData -sends/recieves data through a remote node (using 64-bit addressing) -.TP -.B xbee_16bitIO -sends/recieves I/O data through a remote node (using 16-bit addressing) -.TP -.B xbee_64bitIO -sends/recieves I/O data through a remote node (using 64-bit addressing) -.TP -.B xbee2_data -sends/recieves data using a Series 2 XBee (uses 64-bit addressing) -.TP -.B xbee2_txStatus -recieves transmit status information from the local Series 2 XBee -.PP -If you are using -.BR xbee_localAT ", " xbee_txStatus ", " xbee2_txStatus " or " xbee_modemStatus -then only the -.I frameID -and -.I type -arguments are required. -.sp -If you are using any 16-bit connection, you must also specify 1 right aligned integer, -containing the 16-bit address (e.g. 0x1234). -.sp -If you are using any 64-bit connection, you must also specify 2 integers containing the -64-bit address, first the high 32-bits, then the low 32-bits. -.sp -The -.BR xbee_purgecon () -function is very basic. It removes any packets that have been collected in the buffer for the specified connection. -.sp -The -.BR xbee_endcon () -function is used to end a connection. This will stop collecting packets for the given connection, and remove any packets from the buffer. -.SH "RETURN VALUE" -A pointer to the connection is returned. A connection can only be made once, using the same -.I type -, -.I frameID -and address (if needed). The second call using the same parameters will return the same -connection. -.sp -For information on using callback functions for packet handling please see -.BR xbee_con (3) -or -.B callback.c -in the SVN sample directory. -.SH EXAMPLE -To create a local AT connection: -.in +4n -.nf -#include -xbee_con *con; -con = xbee_newcon('A', xbee_localAT); -.fi -.in -.sp -To create a 16-bit Data connection: -.in +4n -.nf -#include -xbee_con *con; -con = xbee_newcon('A', xbee_16bitData, 0x1234); -.fi -.in -.sp -To create a 64-bit Data connection: -.in +4n -.nf -#include -xbee_con *con; -con = xbee_newcon('A', xbee_64bitData, 0x0013A200, 0x40081826); -.fi -.in -.SH AUTHOR -Attie Grande -.SH "SEE ALSO" -.BR libxbee (3), -.BR xbee_setup (3), -.BR xbee_getpacket (3), -.BR xbee_con (3), -.BR xbee_senddata (3) diff --git a/libs/thirdParty/libxbee/man/man3/xbee_nsenddata.3 b/libs/thirdParty/libxbee/man/man3/xbee_nsenddata.3 deleted file mode 100644 index b36885d8542376a90c89c5864563bd12398a3cd0..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_nsenddata.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_senddata.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_pkt.3 b/libs/thirdParty/libxbee/man/man3/xbee_pkt.3 deleted file mode 100644 index d5e269c13c7b6a702c91d9d341a732d2184b8a60..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_pkt.3 +++ /dev/null @@ -1,79 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH XBEE_PKT 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -xbee_pkt -.SH SYNOPSIS -.B #include -.ad b -.SH DESCRIPTION -This is the packet structure. If you want to get more advanced information from connections (such as RSSI) then this is where it lives. -.sp -.in +4n -.nf -struct xbee_pkt { - unsigned char frameID; /* AT Status */ - unsigned char atCmd[2]; /* AT */ - unsigned char status; /* AT Data Status */ /* status / options */ - unsigned char Addr64[8]; /* AT Data */ - unsigned char Addr16[2]; /* AT Data */ - unsigned char data[128]; /* AT Data */ - unsigned char RSSI; /* Data */ - unsigned int datalen; - - /* X A5 A4 A3 A2 A1 A0 D8 D7 D6 D5 D4 D3 D2 D1 D0 */ - unsigned short IOmask; /* IO */ - - /* X X X X X X X D8 D7 D6 D5 D4 D3 D2 D1 D0 */ - unsigned short IOdata; /* IO */ - - /* X X X X X D D D D D D D D D D D */ - unsigned short IOanalog[6]; /* IO */ -}; -typedef struct xbee_pkt xbee_pkt; -.fi -.in -.sp -Most of these fields are fairly self explanatory, however some need attention brought to them -and others need explaining. I will touch on the most important here: -.TP -.B atCmd -This is the 2 character identifier for the AT command response you just recieved. -Of course if you didnt setup an AT connection, you should never see, or try to see data here. -.TP -.BR Addr64 " and " Addr16 -These contain the address of the XBee that you recieved the packet from. You should really know this -because you setup the connection. However remote AT packets will contain both 16 and 64 bit -addresses. -.TP -.B data -This is the data you just recieved. Either the AT reponse, or the data from the remote XBee node. -.TP -.B datalen -Would you be suprised if I told you this is how much data there is?... Dont try and -.BR printf () -the -.B data -as it isn't null terminated. Use this for processing instead. -.fi -.in -.SH AUTHOR -Attie Grande -.SH "SEE ALSO" -.BR libxbee (3), -.BR xbee_getpacket (3) diff --git a/libs/thirdParty/libxbee/man/man3/xbee_purgecon.3 b/libs/thirdParty/libxbee/man/man3/xbee_purgecon.3 deleted file mode 100644 index e64ccedb26c6eed86c4ec13a5d8cbb107cdd6efe..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_purgecon.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_newcon.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_senddata.3 b/libs/thirdParty/libxbee/man/man3/xbee_senddata.3 deleted file mode 100644 index 10296bb8c12be3e6ad2c7e4420123a9f9a869ac4..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_senddata.3 +++ /dev/null @@ -1,86 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH XBEE_SENDDATA 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -xbee_senddata, xbee_nsenddata, xbee_vsenddata -.SH SYNOPSIS -.B #include -.sp -.BI "int xbee_senddata(xbee_con *" con ", char *" format ", ...);" -.sp -.BI "int xbee_nsenddata(xbee_con *" con ", char *" data ", int " length ");" -.sp -.B #include -.sp -.BI "int xbee_vsenddata(xbee_con *" con ", char *" format ", va_list " ap "); -.ad b -.SH DESCRIPTION -The -.BR xbee_senddata () -function will send data via a provided connection. -It takes at least 2 arguments, and possibly more depending on the format string. -.sp -The argument -.I con -points to a connection made previously with -.BR xbee_newcon (). -.sp -The -.I format -string and any following parameters are passed to -.BR snprintf () -within these functions. -Please see the -.BR printf (3) -man page for more information. -.sp -If you are using -.BR xbee_nsenddata () -you must provide a character array of the data, and the data's length. -.sp -If you are using -.BR xbee_vsenddata () -you must provide a va_list. See -.BR stdarg (3). -.SH "RETURN VALUE" -Upon successful completion, these functions return 0. -.sp -If an invalid packet or connection was provided, -1 is returned. -.sp -If an unknown error occured, -2 is returned. -.sp -If -.I con -has -.I waitforACK -enabled, then these functions return 1 when an ACK was not recieved within 1 second. -.SH EXAMPLE -To send the string "Hello World!" through a previously made connection: -.in +4n -.nf -#include -xbee_senddata(con,"Hello World!"); -.fi -.in -.SH AUTHOR -Attie Grande -.SH "SEE ALSO" -.BR libxbee (3), -.BR xbee_setup (3), -.BR xbee_newcon (3), -.BR xbee_getpacket (3) diff --git a/libs/thirdParty/libxbee/man/man3/xbee_setup.3 b/libs/thirdParty/libxbee/man/man3/xbee_setup.3 deleted file mode 100644 index 2628c46f71f4cd59789dfa5636d35293bd83e6d2..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_setup.3 +++ /dev/null @@ -1,108 +0,0 @@ -.\" libxbee - a C library to aid the use of Digi's Series 1 XBee modules -.\" running in API mode (AP=2). -.\" -.\" Copyright (C) 2009 Attie Grande (attie@attie.co.uk) -.\" -.\" 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 . -.TH XBEE_SETUP 3 2009-11-01 "GNU" "Linux Programmer's Manual" -.SH NAME -xbee_setup, xbee_setuplog, xbee_setupAPI, xbee_setuplogAPI -.SH SYNOPSIS -.B #include -.sp -.BI "int xbee_setup(char *" path ", int " baudrate ");" -.sp -.BI "int xbee_setuplog(char *" path ", int " baudrate ", int " logfd ");" -.sp -.BI "int xbee_setupAPI(char *" path ", int " baudrate ", char " cmdSeq ", int " cmdTime ");" -.sp -.BI "int xbee_setuplogAPI(char *" path ", int " baudrate ", int " logfd ", char " cmdSeq ", int " cmdTime ");" -.ad b -.SH DESCRIPTION -.sp -.B A VERSION OF THIS FUNCTION MUST BE CALLED BEFORE ANY OTHER libxbee FUNCTION! -The -.BR xbee_setup () -function will setup libxbee so that it can handle an XBee. -It takes 2 arguments. -.sp -The argument -.I path -is the path to the serial port that the XBee is connected to (e.g. /dev/ttyUSB0). -.sp -The -.I baudrate -is the baud rate that the local XBee is configured to run at. The following are avaliable: -.in +2n -.nf -.B 1200 -.B 2400 -.B 4800 -.B 9600 -.B 19200 -.B 38400 -.B 57600 -.BR 115200 " - this is potentially unstable (read the XBee manual to find out why...)" -.fi -.in -.sp -Using -.BR xbee_setuplog () -is exactly the same, but instead you give an open file descriptor. All log messages will be written to this file (you can use stderr or stdout if you want!). NOTE: The file descriptor is -.BR dup ()'ed -before use, so you may close it immediately. Providing a value of -.B 0 -will disable the log output. -.sp -Using -.BR xbee_setupAPI () -is exactly the same, but instead you provide the 'Command Sequence' character and the 'Guard Time' that your local XBee has been configured with. -libxbee will then place your XBee in API mode 2, and when you call -.BR xbee_end () -it will return your XBee to its previous API mode. -.sp -Using -.BR xbee_setuplogAPI () -is simply a combination of -.BR xbee_setuplog () -and -.BR xbee_setupAPI () -.SH "RETURN VALUE" -If any error occures, -.B -1 -is returned. Otherwise -.B 0 -is returned. -.SH EXAMPLE -To setup libxbee to use /dev/ttyUSB0 at 57600 baud: -.in +4n -.nf -#include -if (xbee_setup("/dev/ttyUSB0",57600) == -1) { - printf("Oh no...\n"); - exit(1); -} -.fi -.in -.SH NOTE -If libxbee is compiled with -.B DEBUG -defined, then the log output will ALWAYS be enabled. If no file descriptor is provided, then stderr will be used. -.SH AUTHOR -Attie Grande -.SH "SEE ALSO" -.BR libxbee (3), -.BR xbee_newcon (3), -.BR xbee_getpacket (3), -.BR xbee_senddata (3) diff --git a/libs/thirdParty/libxbee/man/man3/xbee_setupAPI.3 b/libs/thirdParty/libxbee/man/man3/xbee_setupAPI.3 deleted file mode 100644 index 56a5fcac56acdd751ad631991f2ba13495fc9fea..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_setupAPI.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_setup.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_setuplog.3 b/libs/thirdParty/libxbee/man/man3/xbee_setuplog.3 deleted file mode 100644 index 56a5fcac56acdd751ad631991f2ba13495fc9fea..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_setuplog.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_setup.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_setuplogAPI.3 b/libs/thirdParty/libxbee/man/man3/xbee_setuplogAPI.3 deleted file mode 100644 index 56a5fcac56acdd751ad631991f2ba13495fc9fea..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_setuplogAPI.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_setup.3 diff --git a/libs/thirdParty/libxbee/man/man3/xbee_vsenddata.3 b/libs/thirdParty/libxbee/man/man3/xbee_vsenddata.3 deleted file mode 100644 index b36885d8542376a90c89c5864563bd12398a3cd0..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/man/man3/xbee_vsenddata.3 +++ /dev/null @@ -1 +0,0 @@ -.so man3/xbee_senddata.3 diff --git a/libs/thirdParty/libxbee/notes/Notepad++ Style.xml b/libs/thirdParty/libxbee/notes/Notepad++ Style.xml deleted file mode 100644 index 5e56ab9ce39d3f848af6ea05bc753c76fa08db27..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/notes/Notepad++ Style.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - 000000 - - - - - _xbee_nsenddata(): xbee_send_pkt(): - xbee_listen(): - _xbee_logit(): - _xbee_getpacket(): - - - - - - - - - - - - - - - - - - - diff --git a/libs/thirdParty/libxbee/notes/v1-v2.txt b/libs/thirdParty/libxbee/notes/v1-v2.txt deleted file mode 100644 index cb2e1c923dd418a905c61879eecd69ca14118613..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/notes/v1-v2.txt +++ /dev/null @@ -1,29 +0,0 @@ -XBee -0x8A* Modem Status -0x08* AT Command -0x09* AT Command (Queue) -0x88* AT Command Response -0x17* Remote AT Command Request -0x97* Remote AT Command Response -0x00* Tx Request (64-bit) -0x01* Tx Request (16-bit) -0x89* Tx Status -0x80* Rx Data (64-bit) -0x81* Rx Data (16-bit) - -XBee 2.5 -0x8A* Modem Status -0x08* AT Command -0x09* AT Command (Queue) -0x88* AT Command Response -0x17* Remote AT Command Request -0x97* Remote AT Command Response -0x10* ZigBee Transmit Request -0x11 Explicit Addressing ZigBee Command Frame -0x8B* ZigBee Transmit Status -0x90* ZigBee Recieve Packet -0x91 ZigBee Explicit Rx -0x92 ZigBee IO Data Sample Rx -0x94 Xbee Sensor Read -0x95 Node Identification - diff --git a/libs/thirdParty/libxbee/pdf/api.c.pdf b/libs/thirdParty/libxbee/pdf/api.c.pdf deleted file mode 100644 index dc8c75af3cb7130fa8716de8a733fd3a3fe13ba3..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/pdf/api.c.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/pdf/api.h.pdf b/libs/thirdParty/libxbee/pdf/api.h.pdf deleted file mode 100644 index 43d99a493e1864ab981612be1960ae6e71117f56..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/pdf/api.h.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/pdf/main.c.pdf b/libs/thirdParty/libxbee/pdf/main.c.pdf deleted file mode 100644 index 4410e6b8e4d9f3a95779694316ce6943da6202e7..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/pdf/main.c.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/pdf/xbee.h.pdf b/libs/thirdParty/libxbee/pdf/xbee.h.pdf deleted file mode 100644 index a4ee0d754dea35167f2c622db520a173d2fcd0e6..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/pdf/xbee.h.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/sample/README b/libs/thirdParty/libxbee/sample/README deleted file mode 100644 index 3610d034694527c4111e1e8a08652f882ff26b74..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/README +++ /dev/null @@ -1,12 +0,0 @@ -To use these samples, you must first install libxbee. -To install, simply type `make install` and provide the root password. - -If you cannot install the library for any reason, follow these instructions: - http://code.google.com/p/libxbee/wiki/install_libxbee#But_I_can't_install_it! - -The compile line can be found at the top of the source files, surrounded by #ifdef -and #endif. These allow us to run the source file as a shell script. Simply type -`sh simple.c` to compile the simple sample. -If you do not have the library installed, you must edit the compile line, or type -it by hand. - gcc .c ../obj/api.o -o -lpthread -lrt diff --git a/libs/thirdParty/libxbee/sample/analog.c b/libs/thirdParty/libxbee/sample/analog.c deleted file mode 100644 index 84069e39a25e3be537c8c94c45b5e55e947147b8..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/analog.c +++ /dev/null @@ -1,71 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will output the voltage read from analog 0 */ - -#include -#include -#include - -/* set this to the voltage measured between GND and Vref - 3.3 is a good place to start */ -#define Vref 3.3 - -int main(int argc, char *argv[]) { - xbee_con *con; - xbee_pkt *pkt; - int i; - - /* setup libxbee */ - if (xbee_setup("/dev/ttyUSB0",57600) == -1) { - return 1; - } - - /* get a connection to the remote XBee */ - con = xbee_newcon('I',xbee_64bitIO, 0x13A200, 0x403CB26A); - /* do this forever! */ - while (1) { - /* get as many packets as we can */ - while ((pkt = xbee_getpacket(con)) != NULL) { - for (i = 0; i < pkt->samples; i++) { - /* did we get a value for A0? */ - if (!xbee_hasanalog(pkt,i,0)) { - /* there was no data for A0 in the packet */ - printf("A0: -- No Data --\n"); - continue; - } - /* print out the reading in raw, and adjusted */ - printf("A0: %.0f (~%.2fv)\n", - xbee_getanalog(pkt,i,0,0), - xbee_getanalog(pkt,i,0,Vref)); - fflush(stdout); - } - /* release the packet */ - free(pkt); - } - usleep(100); - } - - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/api.c b/libs/thirdParty/libxbee/sample/api.c deleted file mode 100644 index cff70bf1ae9e643b220520753e7cf8493440ac81..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/api.c +++ /dev/null @@ -1,42 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -g -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will show you how to seup the xbee and ensure that it is in API mode */ - -#include -#include -#include - -int main(int argc, char *argv[]) { - /* the extra arguments are the CC ('+' by default) and GT (1000) by default AT values */ - xbee_setuplogAPI("/dev/ttyUSB0",57600,2,'+',1000); - - /* now we can do our stuff! */ - sleep(10); - - /* calling xbee_end() will return the xbee to its previous API mode */ - xbee_end(); - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/atis.c b/libs/thirdParty/libxbee/sample/atis.c deleted file mode 100644 index 66946f184820cf3216089c8d8ffe2a6445523d4d..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/atis.c +++ /dev/null @@ -1,81 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will output the voltage read from analog 0 */ - -#include -#include -#include - -/* set this to the voltage measured between GND and Vref - 3.3 is a good place to start */ -#define Vref 3.3 - -int main(int argc, char *argv[]) { - xbee_con *con; - xbee_pkt *pkt; - - /* setup libxbee */ - if (xbee_setup("/dev/ttyUSB0",57600) == -1) { - printf("xbee_setup failed...\n"); - return 1; - } - - /* create an AT connection */ - con = xbee_newcon('I',xbee_64bitRemoteAT,0x13A200,0x403CB26A); - - /* do this forever! */ - for (;;) { - /* request samples now! */ - xbee_senddata(con,"IS"); - /* get as many packets as we can */ - while ((pkt = xbee_getpacketwait(con)) != NULL) { - if (pkt) { - if (pkt->status != 0x00) { - /* if the return status was not 0x00 (OK) then the request failed... */ - printf("Sample A0: -- Request Failed --\n"); - } else { - if (!xbee_hasanalog(pkt,0,0)) { - /* there was no data for A0 in the packet */ - printf("Sample A0: -- No Data --\n"); - } else { - /* it appears that there is sample data for A0! */ - printf("Sample A0: %.0f (~%.2fv)\n", - xbee_getanalog(pkt,0,0,0), - xbee_getanalog(pkt,0,0,Vref)); - } - } - /* dont forget to free the packet! */ - free(pkt); - } else { - /* couldnt get a packet */ - printf("Sample A0: -- No Packet Returned --\n"); - } - } - /* wait a second for the next sample */ - sleep(1); - } - - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/atsetup.c b/libs/thirdParty/libxbee/sample/atsetup.c deleted file mode 100644 index 13afbe4169882f94c6de568370c0de3e6a7f3741..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/atsetup.c +++ /dev/null @@ -1,157 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will setup certain AT parameters of the local XBee unit */ - -#include -#include -#include -#include - -/* con = connection to use - cmd = 2 character command string, eg NI - parameter = NULL - no parameter - !NULL - command parameter, either NULL terminated string, or block of memory - length = 0 - use parameter as NULL terminated string - !0 - use 'length' bytes from parameter - ret = NULL - don't return anything - !NULL - pointer to pointer. doAT will allocate memory, you must free it! - str = return data pointer - - returns the length of the data in ret, or -ve for error */ -int doAT(xbee_con *con, char *cmd, char *parameter, int length, unsigned char **ret) { - xbee_pkt *pkt; - if (con->type != xbee_localAT && con->type != xbee_16bitRemoteAT && con->type != xbee_64bitRemoteAT) { - printf("Thats not an AT connection!...\n"); - return -1; - } - if (strlen(cmd) != 2) { - printf("Invalid command: \"%s\"\n",cmd); - return -2; - } - if (parameter == NULL) { - xbee_senddata(con,"%s",cmd); - } else if (length != 0) { - char *tmp; - if ((tmp = malloc(1024)) == NULL) { - printf("Failed to get memory!\n"); - return -3; - } - snprintf(tmp,1024,"%s",cmd); - memcpy(&(tmp[2]),parameter,(length>1022)?1022:length); - xbee_nsenddata(con,tmp,length+2); - free(tmp); - } else { - xbee_senddata(con,"%s%s",cmd,parameter); - } - pkt = xbee_getpacketwait(con); - if (pkt == NULL) { - printf("Failed to set %s!\n",cmd); - return -4; - } - if (pkt->status != 0) { - printf("An error occured while setting %s!\n",cmd); - return -5; - } - if (ret && pkt->datalen > 0) { - *ret = realloc(*ret,sizeof(char) * (pkt->datalen + 1)); - memcpy(*ret,pkt->data,pkt->datalen); - (*ret)[pkt->datalen] = '\0'; - free(pkt); - return pkt->datalen; - } - free(pkt); - return 0; -} - -int main(int argc, char *argv[]) { - xbee_con *con; - int ret,i; - unsigned char *str = NULL; - - if (argc != 2) { - printf("Usage: %s \n",argv[0]); - return 1; - } - - /* setup libxbee */ - if (xbee_setup("/dev/ttyUSB0",57600) == -1) { - printf("xbee_setup failed...\n"); - return 1; - } - - /* create an AT connection */ - con = xbee_newcon('I',xbee_localAT); - /*con = xbee_newcon('I',xbee_64bitRemoteAT,0x13A200,0x403CB26A);*/ - - - /* get the node's address! */ - if ((ret = doAT(con,"SH",NULL,0,&str)) < 0) return 1; - if (ret == 4) { - printf("SH: 0x%02X%02X%02X%02X\n", str[0], str[1], str[2], str[3]); - } - if ((ret = doAT(con,"SL",NULL,0,&str)) < 0) return 1; - if (ret == 4) { - printf("SL: 0x%02X%02X%02X%02X\n", str[0], str[1], str[2], str[3]); - } - - /* set the power level - 2 methods, i prefer the first but it generates compile warnings :( */ - /*if ((ret = doAT(con,"PL",&((unsigned char[]){4}),1,&str)) < 0) return 1;*/ - /*{ - char t[] = {0}; - if ((ret = doAT(con,"PL",t,1,&str)) < 0) return 1; - }*/ - - /* get the power level */ - if ((ret = doAT(con,"PL",NULL,0,&str)) < 0) return 1; - if (ret == 1) { - printf("PL: 0x%02X\n", str[0]); - } - - /* get NI */ - if ((ret = doAT(con,"NI",NULL,0,&str)) < 0) return 1; - if (ret > 0) { - printf("NI: "); - for (i = 0; i < ret; i++) { - printf("%c",(str[i]>=32 && str[i]<=126)?str[i]:'.'); - } - printf("\n"); - } - - printf("Setting NI to '%s': ",(argc!=2)?"MyNode":argv[1]); - if ((ret = doAT(con,"NI",(argc!=2)?"MyNode":argv[1],0,NULL)) < 0) return 1; - printf("OK\n"); - - if ((ret = doAT(con,"NI",NULL,0,&str)) < 0) return 1; - if (ret > 0) { - printf("NI: "); - for (i = 0; i < ret; i++) { - printf("%c",(str[i]>=32 && str[i]<=126)?str[i]:'.'); - } - printf("\n"); - } - - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/callback.c b/libs/thirdParty/libxbee/sample/callback.c deleted file mode 100644 index 9e48276b0fcba221e7f294ae07d53822314bd768..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/callback.c +++ /dev/null @@ -1,88 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will return any recieved data, using a callback function */ - -#include -#include -#include -#include - -void sighandler(int sig) { - xbee_pkt *pkt; - if (sig == SIGINT) { - xbee_end(); - exit(0); - } -} - -void callback(xbee_con *con, xbee_pkt *pkt) { - int ret; - /* print the recieved data */ - printf("Rx: %s\n",pkt->data); - /* say thank you */ - if ((ret = xbee_senddata(con,"%s",pkt->data)) != 0) { - printf("xbee_senddata: Error %d... Retrying!\n",ret); - if ((ret = xbee_senddata(con,"%s",pkt->data)) != 0) { - printf("xbee_senddata: Error %d... Data lost!\n",ret); - } else { - printf("xbee_senddata: Success after retry!\n",ret); - } - } -free(pkt); -} - -int main(int argc, char *argv[]) { - xbee_con *con; - xbee_pkt *pkt, *rpkt; - - /* setup the xbee */ - //if (xbee_setupAPI("/dev/ttyUSB0",57600,'+',250) == -1) { - //if (xbee_setuplogAPI("/dev/ttyUSB0",57600,2,'+',250) == -1) { - if (xbee_setuplog("/dev/ttyUSB0",57600,2) == -1) { - /* oh no... it failed */ - printf("xbee_setup() failed...\n"); - exit(1); - } - - /* handle ^C */ - signal(SIGINT, sighandler); - - /* setup a connection */ - con = xbee_newcon('I',xbee_64bitData, 0x0013A200, 0x40081826); - con->waitforACK = 1; - con->callback = callback; - - printf("Waiting...\n"); - - /* do nothing forever! */ - for (;;) { - sleep(86400); /* 24hrs */ - } - - /* shouldn't ever get here but... */ - return 0; -} - diff --git a/libs/thirdParty/libxbee/sample/digital.c b/libs/thirdParty/libxbee/sample/digital.c deleted file mode 100644 index 4b0c9f63310654ae56cdd006b8d443c359b2e505..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/digital.c +++ /dev/null @@ -1,146 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -g -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will control digital output pins of a chosen node */ - -#include -#include -#include -#include - -int mode; -char bitmask; -char outputs; - -void sighandler(int sig) { - if (sig == SIGINT) { - xbee_end(); - exit(0); - } -} - -void doneCB(xbee_con *con, xbee_pkt *pkt) { - /* this packet should be confirmation... */ - xbee_end(); - exit(0); -} -void doCB(xbee_con *con, xbee_pkt *pkt) { - int i,m; - outputs = pkt->IOdata[0].IOdigital; - printf("\n 7 6 5 4 3 2 1 0\n"); - printf("Current output state: "); - for (i = 0; i < 8; i++) { - if (xbee_hasdigital(pkt,0,7-i)) { - if (xbee_getdigital(pkt,0,7-i)) { - printf(" 1"); - } else { - printf(" 0"); - } - } else { - printf(" x"); - } - } - printf("\n"); - switch (mode) { - case 0: outputs |= bitmask; break; - case 1: outputs &= ~bitmask; break; - case 2: default: - xbee_end(); - exit(0); - } - m = outputs; - printf("New output state: "); - for (i = 0; i < 8; i++) { - if (xbee_hasdigital(pkt,0,7-i)) { - if (m & 0x80) { - printf(" 1"); - } else { - printf(" 0"); - } - } else { - printf(" x"); - } - m <<= 1; - } - printf("\n\n"); - con->callback = doneCB; - xbee_senddata(con,"IO%c",outputs); -} - -void usage(char *argv0) { - printf("Usage: %s \n",argv0); - printf("Usage: %s [port[0-7]]...\n",argv0); - exit(1); -} -int main(int argc, char *argv[]) { - xbee_con *con; - - if (argc < 2) usage(argv[0]); - - if (!strcasecmp(argv[1],"on")) { - mode = 0; - } else if (!strcasecmp(argv[1],"off")) { - mode = 1; - } else if (!strcasecmp(argv[1],"query")) { - mode = 2; - } else usage(argv[0]); - - if (mode != 2) { - int i; - char *c; - bitmask = 0; - c = argv[2]; - while (*c != '\0') { - *c -= '0'; - if ((*c >= 0) && (*c <= 7)) { - bitmask |= 0x01 << *c; - } else { - usage(argv[0]); - } - c++; - } - } - - /* setup libxbee */ - if (xbee_setupAPI("/dev/ttyUSB0",57600,'+',250) == -1) { - return 1; - } - - /* handle ^C */ - signal(SIGINT, sighandler); - - /* get a connection to the remote XBee */ - con = xbee_newcon('I',xbee_64bitRemoteAT, 0x0013A200, 0x403CB26B); - con->waitforACK = 1; - con->callback = doCB; - - xbee_senddata(con,"IS"); - - /* timeout after 1 second... */ - sleep(1); - - xbee_end(); - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/digitalout.c b/libs/thirdParty/libxbee/sample/digitalout.c deleted file mode 100644 index 46db084f1381fba9c34d0ebaadfdbc6905748d19..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/digitalout.c +++ /dev/null @@ -1,128 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will control the digital 0 output from the keyboard. Type: - 0, - off - 1, - on - q, - quit */ - -#include -#include -#include - -#include - -int main(int argc,char *argv[]) { - xbee_con *con; - xbee_pkt *pkt; - - printf("Hello\n"); - - if (xbee_setup("/dev/ttyUSB0",57600) == -1) { - printf("failed to setup xbee\n"); - return 1; - } - - con = xbee_newcon('R',xbee_64bitRemoteAT,0x0013a200,0x403af247); - if (!con) { - printf("no connection returned\n"); - return 1; - } - - for (;;) { - - xbee_senddata(con,"D0"); - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("no packet returned from state probe\n"); - return 1; - } - - if (pkt->status != 0) { - printf("state probe failed (ret=0x%02X - ",pkt->status); - switch (pkt->status) { - case 0x1: printf("Error"); break; - case 0x2: printf("Invalid Command"); break; - case 0x3: printf("Invalid Parameter"); break; - case 0x4: printf("No Response"); break; - default: printf("Unknown"); break; - } - printf(")\n"); - return 1; - } - - if (pkt->datalen != 1) { - printf("unexpected datalen from state probe\n"); - return 1; - } - - if (pkt->data[0] == 0x05) { - printf("this port is currently ON\n"); - } else if (pkt->data[0] == 0x04) { - printf("this port is currently OFF\n"); - } else { - printf("this port is currently in an unknown state\n"); - return 1; - } - free(pkt); - pkt = NULL; - - recharprompt: - printf("--> "); - rechar: - switch(getchar()) { - case 'q': case 'Q': - printf("byebye\n"); - return 0; - case '0': - printf("turning off...\n"); - xbee_senddata(con,"D0%c",0x04); - break; - case '1': - printf("turning on...\n"); - xbee_senddata(con,"D0%c",0x05); - break; - case '\n': goto rechar; - default: goto recharprompt; - } - - if ((pkt = xbee_getpacketwait(con)) != NULL) { - if (pkt->status != 0) { - printf("state set failed (ret=0x%02X - ",pkt->status); - switch (pkt->status) { - case 0x1: printf("Error"); break; - case 0x2: printf("Invalid Command"); break; - case 0x3: printf("Invalid Parameter"); break; - case 0x4: printf("No Response"); break; - default: printf("Unknown"); break; - } - printf(")\n"); - return 1; - } - } - - } - - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/multi.c b/libs/thirdParty/libxbee/sample/multi.c deleted file mode 100644 index 107f88f6e9b7a570e293e50edf47e63016afc4be..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/multi.c +++ /dev/null @@ -1,100 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -g -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will make use of multiple instances of libxbee and send messages between the attached XBees */ - -#include -#include -#include -#include - -int mode; -char bitmask; -char outputs; - -xbee_hnd xbee1; -xbee_hnd xbee2; - -void sighandler(int sig) { - if (sig == SIGINT) { - _xbee_end(xbee1); - _xbee_end(xbee2); - exit(0); - } -} - -void xbee1CB(xbee_con *con, xbee_pkt *pkt) { - char data[128]; - snprintf(data,pkt->datalen+1,"%s",pkt->data); - printf("XBee1: Rx[%3d]: %s\n",pkt->datalen,data); -} - -void xbee2CB(xbee_con *con, xbee_pkt *pkt) { - char data[128]; - snprintf(data,pkt->datalen+1,"%s",pkt->data); - printf("XBee2: Rx[%3d]: %s\n",pkt->datalen,data); -} - -int main(int argc, char *argv[]) { - xbee_con *con1; - xbee_con *con2; - - if (!(xbee1 = _xbee_setuplogAPI("/dev/ttyUSB0",57600,3,'+',250))) { - //if (!(xbee1 = _xbee_setupAPI("/dev/ttyUSB0",57600,'+',250))) { - printf("xbee1: setup error...\n"); - return 1; - } - if (!(xbee2 = _xbee_setuplogAPI("/dev/ttyUSB1",57600,4,'+',250))) { - //if (!(xbee2 = _xbee_setupAPI("/dev/ttyUSB1",57600,'+',250))) { - printf("xbee2: setup error...\n"); - return 1; - } - - /* handle ^C */ - signal(SIGINT, sighandler); - - con1 = _xbee_newcon(xbee1,'1',xbee_64bitData, 0x0013A200, 0x40081826); - con1->waitforACK = 1; - con1->callback = xbee1CB; - - con2 = _xbee_newcon(xbee2,'2',xbee_64bitData, 0x0013A200, 0x404B75DE); - con2->waitforACK = 1; - con2->callback = xbee2CB; - - while (1) { - printf("xbee1: Tx\n"); - _xbee_logit(xbee1,"xbee1: Tx"); - _xbee_logit(xbee2,"xbee1: Tx"); - _xbee_senddata(xbee1,con1,"Hello"); - usleep(1000000); - printf("xbee2: Tx\n"); - _xbee_logit(xbee1,"xbee2: Tx"); - _xbee_logit(xbee2,"xbee2: Tx"); - _xbee_senddata(xbee2,con2,"Hi There!"); - usleep(1000000); - } - - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/scan.c b/libs/thirdParty/libxbee/sample/scan.c deleted file mode 100644 index 4546887f9e541782a5b512213ffe72860185f359..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/scan.c +++ /dev/null @@ -1,144 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will scan the currently configured channel for all nodes, - returning the values of a few useful settings */ - -#include -#include -#include -#include -#include -#include - -#define MAXNODES 100 - -int main(int argc, char *argv[]) { - int i; - int saidfull = 0; - int ATNT = 0x19; /* node discover timeout */ - int ATNTc; /* counter */ - - int nodes = 0; - char addrs[MAXNODES][8]; - - xbee_con *con; - xbee_pkt *pkt, *rpkt; - - time_t ttime; - char stime[32]; - - /* setup libxbee */ - if (xbee_setup("/dev/ttyUSB0",57600) == -1) { - return 1; - } - - /* grab a local AT connection */ - con = xbee_newcon('I',xbee_localAT); - - /* get the ND timeout */ - xbee_senddata(con,"NT"); - if ((rpkt = xbee_getpacketwait(con)) == NULL) { - printf("XBee didnt return a result for NT\n"); - return 1; - } - ATNT = rpkt->data[0]; - free(rpkt); - - while (1) { - /* send a ND - Node Discover request */ - xbee_senddata(con,"ND"); - /* only wait for a bit longer than the ND timeout */ - ATNTc = ATNT + 10; - /* loop until the end packet has been received or timeout reached */ - while (ATNTc--) { - /* get a packet */ - pkt = xbee_getpacketwait(con); - /* check a packet was returned, and that its one we are after... */ - if (pkt && !memcmp(pkt->atCmd,"ND",2)) { - /* is this the end packet? you can tell from the 0 datalen */ - if (pkt->datalen == 0) { - /* free the packet */ - free(pkt); - break; - } else { - /* check if we know this node already */ - for (i = 0; i < nodes; i++) { - /* the 64bit address will match one in the list */ - if (!memcmp(&(pkt->data[2]),&(addrs[i]),8)) break; - } - ttime = time(NULL); - strftime(stime,32,"%I:%M:%S %p",gmtime(&ttime)); - /* is there space for another? */ - if ((i == nodes) && - (nodes == MAXNODES) && - (!saidfull)) { - printf("MAXNODES reached... Can't add more...\r"); - /* flush so the change is seen! */ - fflush(stdout); - saidfull = 1; - } else { - /* is this a rewrite? */ - if (i != nodes) { - /* find the line to edit */ - printf("%c[%dA",27,nodes-i); - /* clear the line */ - printf("%c[2K",27); - } - /* write out the info */ - memcpy(&(addrs[nodes]),&(pkt->data[2]),8); - printf("MY: 0x%02X%02X ",pkt->data[0],pkt->data[1]); - printf("SH: 0x%02X%02X%02X%02X ",pkt->data[2],pkt->data[3],pkt->data[4],pkt->data[5]); - printf("SL: 0x%02X%02X%02X%02X ",pkt->data[6],pkt->data[7],pkt->data[8],pkt->data[9]); - printf("dB: -%2d ",pkt->data[10]); - printf("NI: %-20s ",&(pkt->data[11])); - printf("@: %s",stime); - /* is this a rewrite? */ - if (i != nodes) { - /* go back the the bottom */ - printf("%c[%dB\r",27,nodes-i); - } else { - /* new line is only wanted for new nodes */ - printf("\n"); - /* if not, then add 1 to the number of nodes! */ - nodes++; - } - } - /* flush so the change is seen! */ - fflush(stdout); - } - /* free the packet */ - free(pkt); - } - /* sleep for 100ms (same as NT steps) */ - usleep(100000); - } - /* try again! */ - usleep(100000); - } - - return 0; -} - diff --git a/libs/thirdParty/libxbee/sample/scan_adv.c b/libs/thirdParty/libxbee/sample/scan_adv.c deleted file mode 100644 index d3360222cc690f23d6032b6919072ec7377a1664..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/scan_adv.c +++ /dev/null @@ -1,589 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will scan all possible channels for remote nodes and return - the value of a few useful settings */ - -#include -#include -#include -#include -#include -#include -#include - -#define MAXNODES 100 - -int ATCH = 0x0C; /* origional channel number */ -int ATNT = 0x19; /* node discover timeout */ -int ATNTc; /* node discover timeout counter */ -int BREAK = 0; -xbee_con *con; - -void sighandler(int sig) { - xbee_pkt *pkt; - if (sig == SIGINT) { - BREAK = 1; - /* wait for the rest of the timeout... */ - printf("\r%c[2KWaiting for node discover command to timeout...",27); - fflush(stdout); - for (; ATNTc; ATNTc--) { - usleep(100000); - } - /* Restore the XBee's channel setting */ - printf("\r%c[2KRestoring channel to 0x%02X...",27,ATCH); - fflush(stdout); - if (xbee_senddata(con,"CH%c",ATCH)) { - printf("xbee_senddata: Error\n"); - exit(1); - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\r%c[2K*** XBee didnt return a result for CH... ***\nPlease manually reset your channel to 0x%02X\n",27,ATCH); - } - if (pkt->status) { - printf("\r%c[2K*** An error occured while restoring the channel setting... ***\nPlease manually reset your channel to 0x%02X\n",27,ATCH); - } else { - printf("\nDone!\n"); - } - free(pkt); - /* Restore the terminal */ - printf("%c[?25h%c[0m",27,27); - fflush(stdout); - exit(0); - } -} - -int main(int argc, char *argv[]) { - int i; - int saidfull = 0; - int ATCHc; /* current channel number */ - int XBeePro = 0; /* XBee pro? */ - - int nodes = 0; - unsigned char addrs[MAXNODES][19]; /* 0-7 : 64 bit address - 8 : channel - 9-10 : id - 11 : baud - 12 : API - 13-14: HV - 15-16: VR - 17 : CC - 18 : mask - not address */ - - xbee_pkt *pkt, *rpkt; - - time_t ttime; - char stime[32]; - - /* handle ^C */ - signal(SIGINT, sighandler); - - /* setup libxbee */ - if (xbee_setupAPI("/dev/ttyUSB0",57600,'+',250) == -1) { - return 1; - } - - /* grab a local AT connection */ - con = xbee_newcon('I',xbee_localAT); - - /* get the current channel */ - if (xbee_senddata(con,"CH")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("XBee didnt return a result for CH\n"); - return 1; - } - ATCH = pkt->data[0]; - free(pkt); - - /* XBee - 0x0B - 0x1A - XBee Pro - 0x0C - 0x17 */ - if (xbee_senddata(con,"CH%c",0x0B)) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("XBee didnt return a result for CH\n"); - return 1; - } - /* did that fail? */ - if (pkt->status == 0) { - /* nope.. its not a pro */ - printf("Using XBee (not Pro) channels (0x0B - 0x1A)...\n"); - XBeePro = 0; - ATCHc = 0x0B; - } else { - /* yup... its a pro */ - printf("Using XBee Pro channels (0x0C - 0x17)...\n"); - XBeePro = 1; - ATCHc = 0x0C; - } - free(pkt); - - /* find and print data for the local node */ - printf("\n%c[31mCH:%c[32m 0x%02X ",27,27,ATCH); - if (xbee_senddata(con,"ID")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for ID\n"); - return 1; - } - printf("%c[31mID:%c[32m 0x%02X%02X ",27,27,pkt->data[0],pkt->data[1]); - free(pkt); - /* ### */ - if (xbee_senddata(con,"MY")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for MY\n"); - return 1; - } - printf("%c[31mMY:%c[32m 0x%02X%02X ",27,27,pkt->data[0],pkt->data[1]); - free(pkt); - /* ### */ - if (xbee_senddata(con,"SH")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for SH\n"); - return 1; - } - printf("%c[31mSH:%c[32m 0x%02X%02X%02X%02X ",27,27,pkt->data[0],pkt->data[1],pkt->data[2],pkt->data[3]); - free(pkt); - /* ### */ - if (xbee_senddata(con,"SL")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for SL\n"); - return 1; - } - printf("%c[31mSL:%c[32m 0x%02X%02X%02X%02X ",27,27,pkt->data[0],pkt->data[1],pkt->data[2],pkt->data[3]); - free(pkt); - /* ### */ - if (xbee_senddata(con,"BD")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for BD\n"); - return 1; - } - printf("%c[31mBD:%c[32m ",27,27); - /* print the baud rate */ - switch (pkt->data[3]) { - case 0: printf(" 1200"); break; - case 1: printf(" 2400"); break; - case 2: printf(" 4800"); break; - case 3: printf(" 9600"); break; - case 4: printf(" 19200"); break; - case 5: printf(" 38400"); break; - case 6: printf(" 57600"); break; - case 7: printf("115200"); break; - default: printf(" other"); break; - } - printf(" "); - free(pkt); - /* ### */ - if (xbee_senddata(con,"AP")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for AP\n"); - return 1; - } - printf("%c[31mAP:%c[32m 0x%02X ",27,27,pkt->data[0]); - free(pkt); - /* ### */ - if (xbee_senddata(con,"HV")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for HV\n"); - return 1; - } - printf("%c[31mHV:%c[32m 0x%02X%02X ",27,27,pkt->data[0],pkt->data[1]); - free(pkt); - /* ### */ - if (xbee_senddata(con,"VR")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for VR\n"); - return 1; - } - printf("%c[31mVR:%c[32m 0x%02X%02X ",27,27,pkt->data[0],pkt->data[1]); - free(pkt); - /* ### */ - if (xbee_senddata(con,"CC")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for CC\n"); - return 1; - } - printf("%c[31mCC:%c[32m '%c' (0x%02X) ",27,27,pkt->data[0],pkt->data[0]); - free(pkt); - /* ### */ - if (xbee_senddata(con,"NI")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("\nXBee didnt return a result for NI\n"); - return 1; - } - printf("%c[31mNI:%c[32m %-20s ",27,27,pkt->data); - free(pkt); - /* ### */ - printf("%c[95m* This is the lobal XBee *",27); - - printf("%c[34m\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------%c[0m\n\n",27,27); - - /* get the ND timeout */ - if (xbee_senddata(con,"NT")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if ((pkt = xbee_getpacketwait(con)) == NULL) { - printf("XBee didnt return a result for NT\n"); - return 1; - } - ATNT = pkt->data[0]; - free(pkt); - - printf("%c[?25l",27); - fflush(stdout); - - usleep(100000); - - while (!BREAK) { - /* set the channel to scan */ - if (xbee_senddata(con,"CH%c",ATCHc)) { - printf("xbee_senddata: Error\n"); - return 1; - } - pkt = xbee_getpacketwait(con); - if (!pkt || pkt->status) { - printf("\nXBee didnt return a result for CH\n"); - return 1; - } - free(pkt); - printf("%c[2KScanning channel 0x%02X...\r",27,ATCHc); - fflush(stdout); - /* send a ND - Node Discover request */ - if (!xbee_senddata(con,"ND")) { - /* only wait for a bit longer than the ND timeout */ - ATNTc = ATNT + 10; - /* loop until the end packet has been received or timeout reached */ - while (!BREAK && ATNTc--) { - /* get a packet */ - pkt = xbee_getpacket(con); - /* check a packet was returned, and that its one we are after... */ - if (pkt && !memcmp(pkt->atCmd,"ND",2)) { - /* is this the end packet? you can tell from the 0 datalen */ - if (pkt->datalen == 0) { - /* free the packet */ - free(pkt); - break; - } else { - /* check if we know this node already */ - for (i = 0; i < nodes; i++) { - /* the 64bit address will match one in the list */ - if (!memcmp(&(pkt->data[2]),&(addrs[i][0]),8)) break; - } - ttime = time(NULL); - strftime(stime,32,"%I:%M:%S %p",gmtime(&ttime)); - /* is there space for another? */ - if ((i == nodes) && - (nodes == MAXNODES) && - (!saidfull)) { - printf("%c[2KMAXNODES reached... Can't add more...\r",27); - /* flush so the change is seen! */ - fflush(stdout); - saidfull = 1; - } else { - /* is this a rewrite? */ - if (i != nodes) { - /* find the line to edit */ - printf("%c[%dA",27,nodes-i+1); - /* clear the line */ - printf("%c[2K",27); - } else { - /* fill the blank line */ - printf("%c[%dA",27,1); - } - /* save the channel */ - addrs[i][8] = ATCHc; - /* write out the info */ - printf("%c[31mCH:%c[32m 0x%02X ",27,27,ATCHc); - printf("%c[31mID:%c[32m 0x",27,27); - if (i == nodes || !(addrs[i][18] & 0x80)) { - printf("...."); - } else { - printf("%02X%02X",addrs[i][9],addrs[i][10]); - } - printf(" "); - printf("%c[31mMY:%c[32m 0x%02X%02X ",27,27,pkt->data[0],pkt->data[1]); - printf("%c[31mSH:%c[32m 0x%02X%02X%02X%02X ",27,27,pkt->data[2],pkt->data[3],pkt->data[4],pkt->data[5]); - printf("%c[31mSL:%c[32m 0x%02X%02X%02X%02X ",27,27,pkt->data[6],pkt->data[7],pkt->data[8],pkt->data[9]); - printf("%c[31mBD:%c[32m ",27,27); - if (i == nodes || !(addrs[i][18] & 0x40)) { - printf("......"); - } else { - switch (addrs[i][11]) { - case 0: printf(" 1200"); break; - case 1: printf(" 2400"); break; - case 2: printf(" 4800"); break; - case 3: printf(" 9600"); break; - case 4: printf(" 19200"); break; - case 5: printf(" 38400"); break; - case 6: printf(" 57600"); break; - case 7: printf("115200"); break; - default: printf(" other"); break; - } - } - printf(" "); - printf("%c[31mAP:%c[32m 0x",27,27); - if (i == nodes || !(addrs[i][18] & 0x20)) { - printf(".."); - } else { - printf("%02X",addrs[i][12]); - } - printf(" "); - printf("%c[31mHV:%c[32m 0x",27,27); - if (i == nodes || !(addrs[i][18] & 0x10)) { - printf("...."); - } else { - printf("%02X%02X",addrs[i][13],addrs[i][14]); - } - printf(" "); - printf("%c[31mVR:%c[32m 0x",27,27); - if (i == nodes || !(addrs[i][18] & 0x08)) { - printf("...."); - } else { - printf("%02X%02X",addrs[i][15],addrs[i][16]); - } - printf(" "); - printf("%c[31mCC:%c[32m ",27,27); - if (i == nodes || !(addrs[i][18] & 0x04)) { - printf(" . (0x..)"); - } else { - printf("'%c' (0x%02X)",addrs[i][17],addrs[i][17]); - } - printf(" "); - printf("%c[31mNI:%c[32m %-20s ",27,27,&(pkt->data[11])); - printf("%c[31mdB:%c[32m -%2d ",27,27,pkt->data[10]); - printf("%c[31m@:%c[32m %s",27,27,stime); - /* is this a rewrite? */ - if (i != nodes) { - /* go back the the bottom */ - printf("%c[%dB\r",27,nodes-i+1); - } else { - /* if its new... save the address */ - memcpy(&(addrs[nodes][0]),&(pkt->data[2]),8); - /* turn off all the flags */ - addrs[nodes][18] = 0; - /* new line is only wanted for new nodes */ - printf("\n%c[2K\n%c[0m",27,27); - /* if not, then add 1 to the number of nodes! */ - nodes++; - } - printf("%c[0m%c[2KScanning channel 0x%02X...\r",27,27,ATCHc); - fflush(stdout); - } - /* flush so the change is seen! */ - fflush(stdout); - } - /* free the packet */ - free(pkt); - } - /* sleep for 100ms (same as NT steps */ - usleep(100000); - } - } - fflush(stdout); - /* check for all nodes on this channel, and get thier pan id */ - for (i = 0; i < nodes; i++) { - int first = 1; - if (addrs[i][8] == ATCHc) { - xbee_con *tcon; - unsigned int dh,dl; - if (first) { - printf("%c[2KGathering settings for nodes on channel 0x%02X...\r",27,ATCHc); - first = 0; - } - /* get the address, and turn it the right way up! */ - memcpy(&dh,&(addrs[i][0]),4); - dh = ((dh & 0xFF) << 24) | ((dh & 0xFF00) << 8) | ((dh & 0xFF0000) >> 8) | ((dh & 0xFF000000) >> 24); - memcpy(&dl,&(addrs[i][4]),4); - dl = ((dl & 0xFF) << 24) | ((dl & 0xFF00) << 8) | ((dl & 0xFF0000) >> 8) | ((dl & 0xFF000000) >> 24); - /* setup a connection the the remote node */ - if ((tcon = xbee_newcon('I',xbee_64bitRemoteAT,dh,dl)) != NULL) { - /* find the line to edit */ - printf("\r%c[%dA",27,nodes-i+1); - - /* in this case we dont care if we dont get a response packet... */ - if (xbee_senddata(tcon,"ID")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if (((rpkt = xbee_getpacketwait(tcon)) != NULL) && (rpkt->status == 0)) { - /* move over the ID column */ - printf("\r%c[18C",27); - /* print the ID */ - printf("%c[32m%02X%02X%c[0m",27,rpkt->data[0],rpkt->data[1],27); - addrs[i][9] = rpkt->data[0]; - addrs[i][10] = rpkt->data[1]; - /* turn on the flag */ - addrs[i][18] |= 0x80; - free(rpkt); - } - - /* in this case we dont care if we dont get a response packet... */ - if (xbee_senddata(tcon,"BD")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if (((rpkt = xbee_getpacketwait(tcon)) != NULL) && (rpkt->status == 0)) { - /* move over the BD column */ - printf("\r%c[80C",27); - if ((rpkt->data[0] != 0x00) || (rpkt->data[1] != 0x00) || (rpkt->data[2] != 0x00) || ((rpkt->data[3] & 0xF8) != 0x00)) { - addrs[i][11] = 8; - } else { - addrs[i][11] = rpkt->data[3]; - } - /* turn on the flag */ - addrs[i][18] |= 0x40; - /* print the baud rate */ - printf("%c[32m",27); - switch (addrs[i][11]) { - case 0: printf(" 1200"); break; - case 1: printf(" 2400"); break; - case 2: printf(" 4800"); break; - case 3: printf(" 9600"); break; - case 4: printf(" 19200"); break; - case 5: printf(" 38400"); break; - case 6: printf(" 57600"); break; - case 7: printf("115200"); break; - default: printf(" other"); break; - } - printf("%c[0m",27); - free(rpkt); - } - /* in this case we dont care if we dont get a response packet... */ - if (xbee_senddata(tcon,"AP")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if (((rpkt = xbee_getpacketwait(tcon)) != NULL) && (rpkt->status == 0)) { - /* move over the AP column */ - printf("\r%c[96C",27); - /* print the ID */ - printf("%c[32m%02X%c[0m",27,rpkt->data[0],27); - addrs[i][12] = rpkt->data[0]; - /* turn on the flag */ - addrs[i][18] |= 0x20; - free(rpkt); - } - /* in this case we dont care if we dont get a response packet... */ - if (xbee_senddata(tcon,"HV")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if (((rpkt = xbee_getpacketwait(tcon)) != NULL) && (rpkt->status == 0)) { - /* move over the HV column */ - printf("\r%c[108C",27); - /* print the ID */ - printf("%c[32m%02X%02X%c[0m",27,rpkt->data[0],rpkt->data[1],27); - addrs[i][13] = rpkt->data[0]; - addrs[i][14] = rpkt->data[1]; - /* turn on the flag */ - addrs[i][18] |= 0x10; - free(rpkt); - } - /* in this case we dont care if we dont get a response packet... */ - if (xbee_senddata(tcon,"VR")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if (((rpkt = xbee_getpacketwait(tcon)) != NULL) && (rpkt->status == 0)) { - /* move over the VR column */ - printf("\r%c[122C",27); - /* print the ID */ - printf("%c[32m%02X%02X%c[0m",27,rpkt->data[0],rpkt->data[1],27); - addrs[i][15] = rpkt->data[0]; - addrs[i][16] = rpkt->data[1]; - /* turn on the flag */ - addrs[i][18] |= 0x08; - free(rpkt); - } - /* in this case we dont care if we dont get a response packet... */ - if (xbee_senddata(tcon,"CC")) { - printf("xbee_senddata: Error\n"); - return 1; - } - if (((rpkt = xbee_getpacketwait(tcon)) != NULL) && (rpkt->status == 0)) { - /* move over the CC column */ - printf("\r%c[134C",27); - /* print the ID */ - printf("%c[32m'%c' (0x%02X)%c[0m",27,rpkt->data[0],rpkt->data[0],27); - addrs[i][17] = rpkt->data[0]; - /* turn on the flag */ - addrs[i][18] |= 0x04; - free(rpkt); - } - /* go back the the bottom */ - printf("%c[%dB\r",27,nodes-i+1); - fflush(stdout); - } - } - } - /* fall back to the first channel if that was the last */ - if (XBeePro && ATCHc == 0x17) { - ATCHc = 0x0C; - } else if (!XBeePro && ATCHc == 0x1A) { - ATCHc = 0x0B; - } else { - /* else move onto next channel */ - ATCHc++; - } - usleep(100000); - } - - return 0; -} - diff --git a/libs/thirdParty/libxbee/sample/simple.c b/libs/thirdParty/libxbee/sample/simple.c deleted file mode 100644 index 8ab776f127556968cf90f2a26b3daf30b02c4ea1..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/simple.c +++ /dev/null @@ -1,68 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will politely return any recieved data */ - -#include -#include -#include - -int main(int argc, char *argv[]) { - xbee_con *con; - xbee_pkt *pkt, *rpkt; - - /* setup the xbee */ - if (xbee_setup("/dev/ttyUSB0",57600) == -1) { - /* oh no... it failed */ - printf("xbee_setup() failed...\n"); - exit(1); - } - - /* setup a connection */ - con = xbee_newcon('I',xbee_64bitData, 0x0013A200, 0x40081826); - - printf("Waiting...\n"); - - /* just wait for data, and echo it back! */ - while (1) { - /* while there are packets avaliable... */ - while ((pkt = xbee_getpacket(con)) != NULL) { - /* print the recieved data */ - printf("Rx: %s\n",pkt->data); - /* say thank you */ - if (xbee_senddata(con,"thank you for saying '%s'\r\n",pkt->data)) { - printf("xbee_senddata: Error\n"); - return 1; - } - /* free the packet */ - free(pkt); - } - usleep(100000); - } - - /* shouldn't ever get here but... */ - return 0; -} - diff --git a/libs/thirdParty/libxbee/sample/talk_to_me.c b/libs/thirdParty/libxbee/sample/talk_to_me.c deleted file mode 100644 index 26750988abade8d0c1db9820391e660bc6cd7764..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/talk_to_me.c +++ /dev/null @@ -1,82 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -g -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample will make the remote XBee talk to us! */ - -#include -#include -#include -#include - -int main(int argc, char *argv[]) { - union { - unsigned char as8[8]; - unsigned int as32[2]; - } addr; - xbee_con *atCon, *rCon; - xbee_pkt *pkt; - - /* the extra arguments are the CC ('+' by default) and GT (1000) by default AT values */ - xbee_setuplogAPI("/dev/ttyUSB0",57600,2,'+',1000); - - atCon = xbee_newcon('@', xbee_localAT); - - xbee_senddata(atCon, "SH"); - pkt = xbee_getpacketwait(atCon); - if (!pkt || pkt->status || pkt->atCmd[0] != 'S' || pkt->atCmd[1] != 'H') { - printf("Missing SH Packet!\n"); - return 1; - } - addr.as8[3] = pkt->data[0]; - addr.as8[2] = pkt->data[1]; - addr.as8[1] = pkt->data[2]; - addr.as8[0] = pkt->data[3]; - free(pkt); - - xbee_senddata(atCon, "SL"); - pkt = xbee_getpacketwait(atCon); - if (!pkt || pkt->status || pkt->atCmd[0] != 'S' || pkt->atCmd[1] != 'L') { - printf("Missing SL Packet!\n"); - return 1; - } - addr.as8[7] = pkt->data[0]; - addr.as8[6] = pkt->data[1]; - addr.as8[5] = pkt->data[2]; - addr.as8[4] = pkt->data[3]; - free(pkt); - - printf("Local XBee address is: 0x%08X %08X\n", addr.as32[0], addr.as32[1]); - - rCon = xbee_newcon('#', xbee_64bitRemoteAT, 0x13A200, 0x403CB26A); - - xbee_senddata(rCon, "DH%c%c%c%c", addr.as8[3], addr.as8[2], addr.as8[1], addr.as8[0]); - usleep(250000); - xbee_senddata(rCon, "DL%c%c%c%c", addr.as8[7], addr.as8[6], addr.as8[5], addr.as8[4]); - usleep(250000); - - /* calling xbee_end() will return the xbee to its previous API mode */ - xbee_end(); - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/vb6/README.txt b/libs/thirdParty/libxbee/sample/vb6/README.txt deleted file mode 100644 index fe13a7dfcb43ee491a575dd2458781a8511ae2a0..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/vb6/README.txt +++ /dev/null @@ -1,8 +0,0 @@ -These sample projects provide a quick demo of how to use various functions - -Running these assume that you have first compiled libxbee.dll successfully -You will also need to either copy libxbee.dll into this folder or into a - directory in your PATH - -If you want to use libxbee in your own projects, you must include libxbee.bas - which will provide you with access to the functions and type declarations diff --git a/libs/thirdParty/libxbee/sample/vb6/demo/Form1.frm b/libs/thirdParty/libxbee/sample/vb6/demo/Form1.frm deleted file mode 100644 index 4c7c6655bce1337956327e4676c5a025526583f2..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/vb6/demo/Form1.frm +++ /dev/null @@ -1,64 +0,0 @@ -VERSION 5.00 -Begin VB.Form Form1 - Caption = "Form1" - ClientHeight = 2250 - ClientLeft = 120 - ClientTop = 450 - ClientWidth = 3855 - LinkTopic = "Form1" - ScaleHeight = 2250 - ScaleWidth = 3855 - StartUpPosition = 3 'Windows Default - Begin VB.TextBox tb - Height = 1995 - Left = 120 - MultiLine = -1 'True - TabIndex = 0 - Top = 120 - Width = 3615 - End -End -Attribute VB_Name = "Form1" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Option Explicit - -Dim myCon As Long -Dim myDataCon As Long - -Private Sub Form_Load() - Dim i As Long - Dim x As Byte - Dim ctype, addrH, addrL As Long - Me.Show - DoEvents - - ' Connect to the XBee on COM1 with a baud rate of 57600 - ' The XBee should be in API mode 2 (ATAP2) - If xbee_setupDebug("COM8", 57600, "xbee.log") <> 0 Then - MsgBox "Error while setting up the local XBee module", vbCritical, "xbee_setup()" - End - End If - xbee_logit "Hello!" - - ' Enable callbacks, this only needs to be done ONCE - ' The window handle provided must remain in memory (dont unload the form - callbacks will automatically be disabled) - xbee_enableCallbacks Me.hWnd - - ' Create a Remote AT connection to a node using 64-bit addressing - myCon = xbee_newcon_64bit(&H30, xbee_64bitRemoteAT, &H13A200, &H404B75DE) - xbee_enableACKwait myCon - - myDataCon = xbee_newcon_64bit(&H31, xbee_64bitData, &H13A200, &H404B75DE) - - ' Setup callbacks - xbee_attachCallback myCon, AddressOf Module1.callback1 - xbee_attachCallback myDataCon, AddressOf Module1.callback2 - - ' Send the AT command NI (Node Identifier) - tb.text = "Sending 'ATNI'..." - xbee_sendstring myCon, "NI" -End Sub - diff --git a/libs/thirdParty/libxbee/sample/vb6/demo/demo.bas b/libs/thirdParty/libxbee/sample/vb6/demo/demo.bas deleted file mode 100644 index b1e51fd90780c9bc8ae03e29760788520990b97b..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/vb6/demo/demo.bas +++ /dev/null @@ -1,19 +0,0 @@ -Attribute VB_Name = "Module1" -Public Function callback1(ByVal con As Long, ByRef pkt As xbee_pkt) As Long - ' Check the returned status, if it isnt 0 then an error occured - If pkt.status <> 0 Then - Form1.tb.Text = Form1.tb.Text & vbNewLine & "An error occured (" & pkt.status & ")" - Exit Function - End If - - ' Display the Node Identifier - Form1.tb.Text = Form1.tb.Text & vbNewLine & "Node Identifier:" & StrConv(pkt.data, vbUnicode) - Form1.tb.SelStart = Len(Form1.tb.Text) -End Function - -Public Function callback2(ByVal con As Long, ByRef pkt As xbee_pkt) As Long - ' Display the data - Form1.tb.Text = Form1.tb.Text & vbNewLine & "Rx:" & StrConv(pkt.data, vbUnicode) - Form1.tb.SelStart = Len(Form1.tb.Text) -End Function - diff --git a/libs/thirdParty/libxbee/sample/vb6/demo/demo.vbp b/libs/thirdParty/libxbee/sample/vb6/demo/demo.vbp deleted file mode 100644 index 815e949e70ca2644e8bb8a92a830e0aee07670ac..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/vb6/demo/demo.vbp +++ /dev/null @@ -1,33 +0,0 @@ -Type=Exe -Form=Form1.frm -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\..\Windows\SysWOW64\stdole2.tlb#OLE Automation -Module=Module1; demo.bas -Module=libxbee; ..\libxbee.bas -IconForm="Form1" -Startup="Form1" -ExeName32="demo.exe" -Command32="" -Name="Project1" -HelpContextID="0" -CompatibleMode="0" -MajorVer=1 -MinorVer=0 -RevisionVer=0 -AutoIncrementVer=0 -ServerSupportFiles=0 -VersionCompanyName="Microsoft" -CompilationType=0 -OptimizationType=0 -FavorPentiumPro(tm)=0 -CodeViewDebugInfo=0 -NoAliasing=0 -BoundsCheck=0 -OverflowCheck=0 -FlPointCheck=0 -FDIVCheck=0 -UnroundedFP=0 -StartMode=0 -Unattended=0 -Retained=0 -ThreadPerObject=0 -MaxNumberOfThreads=1 diff --git a/libs/thirdParty/libxbee/sample/vb6/libxbee.bas b/libs/thirdParty/libxbee/sample/vb6/libxbee.bas deleted file mode 100644 index 0875907f91b157d595fe58d4906c4c42e53bddcb..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/vb6/libxbee.bas +++ /dev/null @@ -1,285 +0,0 @@ -Attribute VB_Name = "libxbee" -Option Explicit - -Enum xbee_types - xbee_unknown - - xbee_localAT - xbee_remoteAT - xbee_modemStatus - xbee_txStatus - - ' XBee Series 1 stuff - xbee_16bitRemoteAT - xbee_64bitRemoteAT - - xbee_16bitData - xbee_64bitData - - xbee_16bitIO - xbee_64bitIO - - ' XBee Series 2 stuff - xbee2_data - xbee2_txStatus -End Enum - -Type xbee_sample - '# X A5 A4 A3 A2 A1 A0 D8 D7 D6 D5 D4 D3 D2 D1 D0 - IOmask As Integer - '# X X X X X X X D8 D7 D6 D5 D4 D3 D2 D1 D0 - IOdigital As Integer - '# X X X X X D D D D D D D D D D D - IOanalog(0 To 5) As Integer -End Type - -Type xbee_pkt - flags As Long '# bit 0 - is64 - '# bit 1 - dataPkt - '# bit 2 - txStatusPkt - '# bit 3 - modemStatusPkt - '# bit 4 - remoteATPkt - '# bit 5 - IOPkt - frameID As Byte - atCmd(0 To 1) As Byte - - status As Byte - samples As Byte - RSSI As Byte - - Addr16(0 To 1) As Byte - - Addr64(0 To 7) As Byte - - data(0 To 127) As Byte - - datalen As Long - - type As Long ' enum xbee_types - - SPARE As Long ' IGNORE THIS (is the pointer to the next packet in C... this will ALWAYS be 0 in VB) - - IOdata As xbee_sample -End Type - -Private OldhWndHandler As Long -Private ActivehWnd As Long -Private callbackMessageID As Long -Private Callbacks As New Collection - -Public Declare Sub xbee_free Lib "libxbee.dll" (ByVal ptr As Long) - -Public Declare Function xbee_setup Lib "libxbee.dll" (ByVal port As String, ByVal baudRate As Long) As Long -Public Declare Function xbee_setupDebug Lib "libxbee.dll" (ByVal port As String, ByVal baudRate As Long, ByVal logfile As String) As Long -Private Declare Function xbee_setupDebugAPIRaw Lib "libxbee.dll" Alias "xbee_setupDebugAPI" (ByVal port As String, ByVal baudRate As Long, ByVal logfile As String, ByVal cmdSeq As Byte, ByVal cmdTime As Long) As Long -Private Declare Function xbee_setupAPIRaw Lib "libxbee.dll" Alias "xbee_setupAPI" (ByVal port As String, ByVal baudRate As Long, ByVal cmdSeq As Byte, ByVal cmdTime As Long) As Long - -Public Declare Function xbee_end Lib "libxbee.dll" () As Long - -Public Declare Function xbee_newcon_simple Lib "libxbee.dll" (ByVal frameID As Byte, ByVal conType As Long) As Long 'xbee_con * -Public Declare Function xbee_newcon_16bit Lib "libxbee.dll" (ByVal frameID As Byte, ByVal conType As Long, ByVal addr16bit As Long) As Long 'xbee_con * -Public Declare Function xbee_newcon_64bit Lib "libxbee.dll" (ByVal frameID As Byte, ByVal conType As Long, ByVal addr64bitLow As Long, ByVal addr64bitHigh As Long) As Long 'xbee_con * -Public Declare Sub xbee_enableACKwait Lib "libxbee.dll" (ByVal con As Long) -Public Declare Sub xbee_disableACKwait Lib "libxbee.dll" (ByVal con As Long) -Public Declare Sub xbee_enableDestroySelf Lib "libxbee.dll" (ByVal con As Long) - -Private Declare Sub xbee_enableCallbacksRaw Lib "libxbee.dll" Alias "xbee_enableCallbacks" (ByVal hWnd As Long, ByVal uMsg As Long) -Private Declare Sub xbee_attachCallbackRaw Lib "libxbee.dll" Alias "xbee_attachCallback" (ByVal con As Long) -Private Declare Sub xbee_detachCallbackRaw Lib "libxbee.dll" Alias "xbee_detachCallback" (ByVal con As Long) -Private Declare Function xbee_runCallback Lib "libxbee.dll" (ByVal func As Long, ByVal con As Long, ByVal pkt As Long) As Long - -Public Declare Sub xbee_endcon2 Lib "libxbee.dll" (ByVal con As Long) -Public Declare Sub xbee_flushcon Lib "libxbee.dll" (ByVal con As Long) - -Public Declare Function xbee_senddata Lib "libxbee.dll" Alias "xbee_nsenddata" (ByVal con As Long, ByRef data As Byte, ByVal Length As Long) As Long -Private Declare Function xbee_senddata_str Lib "libxbee.dll" Alias "xbee_nsenddata" (ByVal con As Long, ByVal data As String, ByVal Length As Long) As Long - -Public Declare Function xbee_getpacketRaw Lib "libxbee.dll" Alias "xbee_getpacket" (ByVal con As Long) As Long 'xbee_pkt * - -Public Declare Function xbee_hasanalog Lib "libxbee.dll" (ByRef pkt As xbee_pkt, ByVal sample As Long, ByVal inputPin As Long) As Long -Public Declare Function xbee_getanalog Lib "libxbee.dll" (ByRef pkt As xbee_pkt, ByVal sample As Long, ByVal inputPin As Long, ByVal Vref As Double) As Double - -Public Declare Function xbee_hasdigital Lib "libxbee.dll" (ByRef pkt As xbee_pkt, ByVal sample As Long, ByVal inputPin As Long) As Long -Public Declare Function xbee_getdigital Lib "libxbee.dll" (ByRef pkt As xbee_pkt, ByVal sample As Long, ByVal inputPin As Long) As Long - -Private Declare Function xbee_svn_versionRaw Lib "libxbee.dll" Alias "xbee_svn_version" () As Long -Public Declare Sub xbee_logit Lib "libxbee.dll" (ByVal text As String) - -'########################################################################################################################################################################### - -Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long) -Private Declare Function lstrlenW Lib "kernel32" (ByVal lpString As Long) As Long -Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long -Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long -Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long -Private Const WM_DESTROY = &H2 -Private Const GWL_WNDPROC = -4 - -Public Function PointerToString(lngPtr As Long) As String - Dim strTemp As String - Dim lngLen As Long - If lngPtr Then - lngLen = lstrlenW(lngPtr) * 2 - If lngLen Then - strTemp = Space(lngLen) - CopyMemory ByVal strTemp, ByVal lngPtr, lngLen - PointerToString = Replace(strTemp, Chr(0), "") - End If - End If -End Function - -Public Function ArrayToString(data() As Byte, Optional lb As Integer = -1, Optional ub As Integer = -1) As String - Dim tmp As String - Dim i - If lb = -1 Then lb = LBound(data) - If ub = -1 Then ub = UBound(data) - tmp = "" - For i = lb To ub - If (data(i) = 0) Then Exit For - tmp = tmp & Chr(data(i)) - Next - ArrayToString = tmp -End Function - -Public Function xbee_pointerToPacket(lngPtr As Long) As xbee_pkt - Dim p As xbee_pkt - CopyMemory p, ByVal lngPtr, Len(p) - xbee_pointerToPacket = p -End Function - -Public Sub libxbee_load() - ' this function is simply to get VB6 to call a libxbee function - ' if you are using any C DLLs that make use of libxbee, then you should call this function first so that VB6 will load libxbee - xbee_svn_versionRaw -End Sub - -Public Function xbee_svn_version() As String - xbee_svn_version = PointerToString(xbee_svn_versionRaw()) -End Function - -Public Function xbee_setupAPI(ByVal port As String, ByVal baudRate As Long, ByVal cmdSeq As String, ByVal cmdTime As Long) - xbee_setupAPI = xbee_setupAPIRaw(port, baudRate, Asc(cmdSeq), cmdTime) -End Function - -Public Function xbee_setupDebugAPI(ByVal port As String, ByVal baudRate As Long, ByVal logfile As String, ByVal cmdSeq As String, ByVal cmdTime As Long) - xbee_setupDebugAPI = xbee_setupDebugAPIRaw(port, baudRate, logfile, Asc(cmdSeq), cmdTime) -End Function - -Private Sub xbee_ensureMessageID() - If callbackMessageID = 0 Then - callbackMessageID = RegisterWindowMessage("libxbee") - End If - xbee_enableCallbacksRaw ActivehWnd, callbackMessageID -End Sub - -Public Sub xbee_attachCallback(ByVal con As Long, ByVal func As Long) - Dim t(0 To 1) As Long - Dim c As String - If ActivehWnd = 0 Then - Debug.Print "Callbacks not enabled!" - Exit Sub - End If - xbee_ensureMessageID - c = CStr(con) - t(0) = con - t(1) = func - On Error Resume Next - Callbacks.Remove c - Callbacks.Add t, c - On Error GoTo 0 - xbee_attachCallbackRaw con -End Sub - -Public Sub xbee_detachCallback(ByVal con As Long) - If ActivehWnd = 0 Then - Debug.Print "Callbacks not enabled!" - Exit Sub - End If - On Error Resume Next - xbee_detachCallbackRaw con - Callbacks.Remove CStr(con) -End Sub - -Public Sub xbee_enableCallbacks(ByVal hWnd As Long) - If ActivehWnd <> 0 Then - Debug.Print "Callbacks already enabled!" - Exit Sub - End If - ActivehWnd = hWnd - OldhWndHandler = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf libxbee.xbee_messageHandler) - xbee_ensureMessageID -End Sub - -Public Sub xbee_disableCallbacks() - Dim id As Variant - If ActivehWnd = 0 Then - Debug.Print "Callbacks not enabled!" - Exit Sub - End If - For Each id In Callbacks - xbee_detachCallback id(0) - Next - SetWindowLong ActivehWnd, GWL_WNDPROC, OldhWndHandler - ActivehWnd = 0 - OldhWndHandler = 0 -End Sub - -Private Function xbee_messageHandler(ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long - If uMsg = callbackMessageID Then - Dim t As Long - On Error Resume Next - Err.Clear - t = Callbacks.Item(CStr(wParam))(1) - If Err.Number = 0 Then - On Error GoTo 0 - xbee_messageHandler = xbee_runCallback(t, wParam, lParam) - Exit Function - End If - On Error GoTo 0 - xbee_logit "Unable to match Connection with active callback!" - End If - xbee_messageHandler = CallWindowProc(OldhWndHandler, hWnd, uMsg, wParam, lParam) - If uMsg = WM_DESTROY And ActivehWnd <> 0 Then - ' Disable the MessageHandler if the form "unload" event is detected - xbee_disableCallbacks - End If -End Function - -Public Sub xbee_endcon(ByRef con As Long) - xbee_endcon2 con - con = 0 -End Sub - -Public Function xbee_sendstring(ByVal con As Long, ByVal str As String) - xbee_sendstring = xbee_senddata_str(con, str, Len(str)) -End Function - -Public Function xbee_getpacketPtr(ByVal con As Long, ByRef pkt As Long) As Integer - Dim ptr As Long - - ptr = xbee_getpacketRaw(con) - If ptr = 0 Then - pkt = 0 - xbee_getpacketPtr = 0 - Exit Function - End If - - pkt = ptr - xbee_getpacketPtr = 1 -End Function - -Public Function xbee_getpacket(ByVal con As Long, ByRef pkt As xbee_pkt) As Integer - Dim ptr As Long - - ptr = xbee_getpacketRaw(con) - If ptr = 0 Then - xbee_getpacket = 0 - Exit Function - End If - - pkt = xbee_pointerToPacket(ptr) - xbee_free ptr - - xbee_getpacket = 1 -End Function - diff --git a/libs/thirdParty/libxbee/sample/vb6/talk_to_me/Form1.frm b/libs/thirdParty/libxbee/sample/vb6/talk_to_me/Form1.frm deleted file mode 100644 index 426a9df9395c731c789ccc64ec25a3f70fc8f160..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/vb6/talk_to_me/Form1.frm +++ /dev/null @@ -1,1197 +0,0 @@ -VERSION 5.00 -Begin VB.Form Form1 - BorderStyle = 1 'Fixed Single - Caption = "Talk to Me" - ClientHeight = 7875 - ClientLeft = 45 - ClientTop = 375 - ClientWidth = 7515 - LinkTopic = "Form1" - MaxButton = 0 'False - ScaleHeight = 7875 - ScaleWidth = 7515 - StartUpPosition = 1 'CenterOwner - Begin VB.Timer tmr_timeout - Enabled = 0 'False - Interval = 5000 - Left = 3720 - Top = 1380 - End - Begin VB.Frame Frame2 - Caption = " Actions " - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 1335 - Left = 180 - TabIndex = 1 - Top = 6420 - Width = 7215 - Begin VB.CommandButton write_settings - Caption = "Write Settings" - Enabled = 0 'False - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 375 - Left = 1920 - TabIndex = 50 - Top = 780 - Width = 1935 - End - Begin VB.CommandButton set_default - Caption = "Set Default" - Enabled = 0 'False - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 375 - Left = 180 - TabIndex = 49 - Top = 780 - Width = 1575 - End - Begin VB.CommandButton reset_node - Caption = "Reset Node" - Enabled = 0 'False - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 375 - Left = 4020 - TabIndex = 47 - Top = 780 - Width = 1575 - End - Begin VB.CommandButton set_dest - Caption = "Set destination" - Enabled = 0 'False - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 375 - Left = 1920 - TabIndex = 46 - Top = 300 - Width = 1935 - End - Begin VB.CommandButton talk_to_me - Caption = "Talk to Me" - Enabled = 0 'False - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 375 - Left = 180 - TabIndex = 45 - Top = 300 - Width = 1575 - End - Begin VB.CommandButton set_ni - Caption = "Set Node Identifier" - Enabled = 0 'False - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 375 - Left = 4020 - TabIndex = 51 - Top = 300 - Width = 2355 - End - End - Begin VB.Frame Frame1 - Caption = " Settings " - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 3315 - Left = 180 - TabIndex = 0 - Top = 3000 - Width = 7215 - Begin VB.Label ni - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 24 - Top = 300 - Width = 3915 - End - Begin VB.Label sl - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 22 - Top = 1020 - Width = 3915 - End - Begin VB.Label sh - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 20 - Top = 780 - Width = 3915 - End - Begin VB.Label my - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 18 - Top = 540 - Width = 3915 - End - Begin VB.Label ap - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 17 - Top = 1260 - Width = 3915 - End - Begin VB.Label bd - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 16 - Top = 1500 - Width = 3915 - End - Begin VB.Label ch - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 15 - Top = 1740 - Width = 3915 - End - Begin VB.Label dh - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 14 - Top = 1980 - Width = 3915 - End - Begin VB.Label dl - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 13 - Top = 2220 - Width = 3915 - End - Begin VB.Label ia - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 11 - Top = 2460 - Width = 3915 - End - Begin VB.Label vr - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 10 - Top = 2940 - Width = 3915 - End - Begin VB.Label hv - BackStyle = 0 'Transparent - Caption = "-" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Left = 3180 - TabIndex = 12 - Top = 2700 - Width = 3915 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "NI - Node Identifier" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 17 - Left = 180 - TabIndex = 25 - Top = 300 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "MY - 16-bit Address" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 13 - Left = 180 - TabIndex = 19 - Top = 540 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "VR - Firmware Version" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 14 - Left = 180 - TabIndex = 9 - Top = 2940 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "IA - I/O Address" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 12 - Left = 180 - TabIndex = 8 - Top = 2460 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "DL - Destination Low" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 10 - Left = 180 - TabIndex = 6 - Top = 2220 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "DH - Destination High" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 9 - Left = 180 - TabIndex = 5 - Top = 1980 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "CH - Channel" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 8 - Left = 180 - TabIndex = 4 - Top = 1740 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "BD - Interface Rate" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 7 - Left = 180 - TabIndex = 3 - Top = 1500 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "AP - API Enable" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 6 - Left = 180 - TabIndex = 2 - Top = 1260 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "HV - Hardware Version" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 11 - Left = 180 - TabIndex = 7 - Top = 2700 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " .....:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 29 - Left = 180 - TabIndex = 44 - Top = 2700 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " ...........:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 28 - Left = 180 - TabIndex = 43 - Top = 1260 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " .......:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 27 - Left = 180 - TabIndex = 42 - Top = 1500 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " ..............:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 26 - Left = 180 - TabIndex = 41 - Top = 1740 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " .....:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 25 - Left = 180 - TabIndex = 40 - Top = 1980 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " ......:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 24 - Left = 180 - TabIndex = 39 - Top = 2220 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " ..........:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 23 - Left = 180 - TabIndex = 38 - Top = 2460 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " .....:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 22 - Left = 180 - TabIndex = 37 - Top = 2940 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " .......:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 21 - Left = 180 - TabIndex = 36 - Top = 540 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " ......:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 18 - Left = 180 - TabIndex = 33 - Top = 300 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "SL - 64-bit Address (Lo)" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 16 - Left = 180 - TabIndex = 23 - Top = 1020 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "SH - 64-bit Address (Hi)" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 255 - Index = 15 - Left = 180 - TabIndex = 21 - Top = 780 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " ..:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 20 - Left = 180 - TabIndex = 35 - Top = 780 - Width = 2955 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = " ..:" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 255 - Index = 19 - Left = 180 - TabIndex = 34 - Top = 1020 - Width = 2955 - End - End - Begin VB.Timer tmr_refresh - Enabled = 0 'False - Interval = 500 - Left = 3240 - Top = 1380 - End - Begin VB.Frame Frame3 - Caption = " Node List " - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 2775 - Left = 180 - TabIndex = 26 - Top = 120 - Width = 7215 - Begin VB.ListBox nodelist - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 2085 - Left = 180 - TabIndex = 27 - Top = 540 - Width = 6855 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "16-bit" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 195 - Index = 0 - Left = 240 - TabIndex = 32 - Top = 300 - Width = 675 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "RSSI" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 195 - Index = 3 - Left = 3660 - TabIndex = 30 - Top = 300 - Width = 435 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "@" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 195 - Index = 4 - Left = 4440 - TabIndex = 29 - Top = 300 - Width = 135 - End - Begin VB.Label Label - BackStyle = 0 'Transparent - Caption = "Node Name" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 195 - Index = 5 - Left = 4740 - TabIndex = 28 - Top = 300 - Width = 915 - End - Begin VB.Label Label - Alignment = 2 'Center - BackStyle = 0 'Transparent - Caption = "- -" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - ForeColor = &H00C0C0C0& - Height = 195 - Index = 2 - Left = 1020 - TabIndex = 48 - Top = 300 - Width = 2355 - End - Begin VB.Label Label - Alignment = 2 'Center - BackStyle = 0 'Transparent - Caption = "(Hi) 64-bit (Lo)" - BeginProperty Font - Name = "Courier New" - Size = 9 - Charset = 0 - Weight = 400 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 195 - Index = 1 - Left = 1020 - TabIndex = 31 - Top = 300 - Width = 2355 - End - End -End -Attribute VB_Name = "Form1" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Dim dieNow As Boolean - -Private Sub Form_Load() - Me.Show - DoEvents - dieNow = False - - ' setup libxbee - If (xbee_setupDebugAPI("COM8", 57600, "xbee.log", "+", 250) = -1) Then - MsgBox "libxbee setup failed...", vbCritical - Unload Me - End - End If - - ' enable callback functions - xbee_enableCallbacks Me.hWnd - - ' setup a local at connection - atcon = xbee_newcon_simple(Asc("A"), xbee_localAT) - xbee_enableACKwait atcon - xbee_attachCallback atcon, AddressOf localCB - - ' set off the chain reaction! - xbeesend atcon, "MY" -End Sub - -Private Sub Form_Unload(Cancel As Integer) - Static c As Integer - dieNow = 1 - Cancel = 1 - Me.Caption = "Waiting for command to complete..." - c = c + 1 - If (c >= 2) Then - Cancel = 0 - End If -End Sub - -Private Sub nodelist_Click() - Dim tmp() As String - If nodelist.ListCount = 0 Or nodelist.ListIndex = -1 Then Exit Sub - If set_dest.Tag = "yes" Then - nodelist.Enabled = False - Else - If nodelist.ListIndex = 0 Then - remoteCon = atcon - Else - str2 = Split(nodelist.text, " ") - remoteCon = xbee_newcon_64bit(Asc("2"), xbee_64bitRemoteAT, CLng("&H" & Right(str2(1), 8)), CLng("&H" & Right(str2(2), 8))) - End If - setButtons False - nodelist.Enabled = False - tmp = Split(nodelist.List(nodelist.ListIndex), " ") - ni = tmp(5) - my = tmp(0) - sh = tmp(1) - sl = tmp(2) - ap = "-" - bd = "-" - ch = "-" - dh = "-" - dl = "-" - ia = "-" - hv = "-" - vr = "-" - End If -End Sub - -Private Sub reset_node_Click() - If nodelist.ListCount = 0 Or nodelist.ListIndex = -1 Then Exit Sub - nodelist.Enabled = False - setButtons False - reset_node.Tag = "yes" -End Sub - -Private Sub set_default_Click() - If nodelist.ListCount = 0 Or nodelist.ListIndex = -1 Then Exit Sub - nodelist.Enabled = False - setButtons False - set_default.Tag = "yes" -End Sub - -Private Sub set_dest_Click() - If nodelist.ListCount = 0 Or nodelist.ListIndex = -1 Then Exit Sub - nodelist.Tag = nodelist.ListIndex - setButtons False - set_dest.Tag = "yes" -End Sub - -Private Sub set_ni_Click() - Dim newni As String - Dim oldni As String - oldni = Split(nodelist.text, " ")(5) - newni = InputBox("New node identifier:", "Set Node Identifier", oldni) - If newni = oldni Then Exit Sub - nodelist.Enabled = False - setButtons False - set_ni.Tag = newni -End Sub - -Private Sub talk_to_me_Click() - If nodelist.ListCount = 0 Or nodelist.ListIndex = -1 Then Exit Sub - nodelist.Enabled = False - setButtons False - talk_to_me.Tag = "yes" -End Sub - -Private Sub tmr_refresh_Timer() - Dim str As String - Dim str2() As String - tmr_refresh.Enabled = False - If atcon = 0 Then Exit Sub - - If (dieNow) Then - xbee_end - DoEvents - xbee_disableCallbacks - Unload Me - End - End If - - If nodelist.Enabled = False Then - xbee_attachCallback remoteCon, AddressOf remoteCB - If talk_to_me.Tag = "yes" Then - str2 = Split(Form1.nodelist.text, " ") - xbee_attachCallback remoteCon, AddressOf setupCB_TTM - str2 = Split(nodelist.List(0), " ") - str = Chr(CInt("&H" & Mid(str2(1), 9, 2))) - str = Chr(CInt("&H" & Mid(str2(1), 7, 2))) & str - str = Chr(CInt("&H" & Mid(str2(1), 5, 2))) & str - str = Chr(CInt("&H" & Mid(str2(1), 3, 2))) & str - str = "DH" & str - xbeesend remoteCon, str - ElseIf set_dest.Tag = "yes" Then - str2 = Split(Form1.nodelist.text, " ") - xbee_attachCallback remoteCon, AddressOf setupCB_SDEST - str2 = Split(nodelist.text, " ") - str = Chr(CInt("&H" & Mid(str2(1), 9, 2))) - str = Chr(CInt("&H" & Mid(str2(1), 7, 2))) & str - str = Chr(CInt("&H" & Mid(str2(1), 5, 2))) & str - str = Chr(CInt("&H" & Mid(str2(1), 3, 2))) & str - str = "DH" & str - xbeesend remoteCon, str - ElseIf reset_node.Tag = "yes" Then - xbee_sendstring remoteCon, "FR" - setButtons True - reset_node.Tag = "" - tmr_refresh.Enabled = True - ElseIf write_settings.Tag = "yes" Then - xbee_sendstring remoteCon, "WR" - setButtons True - write_settings.Tag = "" - tmr_refresh.Enabled = True - ElseIf set_default.Tag = "yes" Then - setupCB_Default_Start - ElseIf set_ni.Tag <> "" Then - xbeesend remoteCon, "NI" & set_ni.Tag - set_ni.Tag = "" - Else - xbeesend remoteCon, "AP" - End If - Exit Sub - End If - ' initiate network scan - xbee_attachCallback atcon, AddressOf localCB - xbeesend atcon, "MY" -End Sub - -Private Sub tmr_timeout_Timer() - Dim con As Long - Dim str As String - Dim str2() As String - tmr_timeout.Enabled = False - str2 = Split(tmr_timeout.Tag, Chr(1), 2) - con = CStr(str2(0)) - str = str2(1) - If MsgBox("Request timed out... Retry?", vbYesNo + vbQuestion, "Retry?") = vbNo Then - setButtons True - nodelist.Enabled = True - tmr_refresh.Enabled = True - Exit Sub - End If - xbeesend con, str -End Sub - -Private Sub write_settings_Click() - If nodelist.ListCount = 0 Or nodelist.ListIndex = -1 Then Exit Sub - nodelist.Enabled = False - setButtons False - write_settings.Tag = "yes" -End Sub diff --git a/libs/thirdParty/libxbee/sample/vb6/talk_to_me/talk_to_me.bas b/libs/thirdParty/libxbee/sample/vb6/talk_to_me/talk_to_me.bas deleted file mode 100644 index dc9f5f76d16bf1e09c4be2fc43ad579c411b04c2..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/vb6/talk_to_me/talk_to_me.bas +++ /dev/null @@ -1,431 +0,0 @@ -Attribute VB_Name = "Module1" -Public atcon As Long -Public remoteCon As Long - -Public Sub setButtons(ByVal state As Boolean) - Form1.talk_to_me.Tag = "" - Form1.talk_to_me.Enabled = state - Form1.set_dest.Tag = "" - Form1.set_dest.Enabled = state - Form1.reset_node.Tag = "" - Form1.reset_node.Enabled = state - Form1.set_default.Tag = "" - Form1.set_default.Enabled = state - Form1.write_settings.Tag = "" - Form1.write_settings.Enabled = state - Form1.set_ni.Tag = "" - Form1.set_ni.Enabled = state -End Sub - -Public Function xbeesend(ByVal con As Long, ByVal str As String) As Long - Form1.tmr_timeout.Enabled = False - Form1.tmr_timeout.Tag = CStr(con) & Chr(1) & str - Form1.tmr_timeout.Enabled = True - xbee_sendstring con, str -End Function - -Public Sub setupCB_Default_Start() - xbee_attachCallback remoteCon, AddressOf setupCB_Default - xbee_attachCallback atcon, AddressOf setupCB_Default - xbeesend remoteCon, "CH" & Chr(16) -End Sub -Public Function setupCB_Default(ByVal con As Long, ByRef pkt As xbee_pkt) As Long - Dim str As String - Dim str2() As String - ' default values (in order of setting): - ' CH = 10 - ' local CH = 10 - ' MY = FF - ' T3 = 1 - ' BD = 6 - ' AP = 0 - ' RO = 1 - ' D0 = 5 (turn on rest of system) - ' D1 = 2 (battery reading) - ' D2 = 0 - ' D3 = 5 (reset) - ' D4 = 4 (battery reading power) - ' D5 = 0 - ' D6 = 0 - ' D7 = 0 - ' D8 = 0 - ' IA = 0xFFFF (accept inputs from anyone) - ' IU = 0 - Debug.Print ArrayToString(pkt.atCmd) - If con = atcon Then - xbee_attachCallback con, AddressOf localCB - xbeesend remoteCon, "MY" & Chr(255) & Chr(255) - Exit Function - End If - Select Case ArrayToString(pkt.atCmd) - Case "CH" - xbeesend atcon, "CH" & Chr(16) - Case "MY" - xbeesend con, "T3" & Chr(1) - Case "T3" - xbeesend con, "BD" & Chr(0) & Chr(0) & Chr(0) & Chr(6) - Case "BD" - xbeesend con, "AP" & Chr(0) - Case "AP" - xbeesend con, "RO" & Chr(1) - Case "RO" - xbeesend con, "D0" & Chr(5) - Case "D0" - xbeesend con, "D1" & Chr(2) - Case "D1" - xbeesend con, "D2" & Chr(0) - Case "D2" - xbeesend con, "D3" & Chr(4) - Case "D3" - xbeesend con, "D4" & Chr(4) - Case "D4" - xbeesend con, "D5" & Chr(0) - Case "D5" - xbeesend con, "D6" & Chr(0) - Case "D6" - xbeesend con, "D7" & Chr(0) - Case "D7" - xbeesend con, "D8" & Chr(0) - Case "D8" - xbeesend con, "IA" & Chr(0) & Chr(0) & Chr(0) & Chr(0) & Chr(0) & Chr(0) & Chr(255) & Chr(255) - Case "IA" - xbeesend con, "IU" & Chr(0) - Case "IU" - Form1.set_default.Tag = "" - Form1.tmr_refresh.Enabled = True - Form1.tmr_timeout.Enabled = False - End Select -End Function - -Public Function setupCB_TTM(ByVal con As Long, ByRef pkt As xbee_pkt) As Long - Dim str As String - Dim str2() As String - Select Case ArrayToString(pkt.atCmd) - Case "DH" - str2 = Split(Form1.nodelist.List(0), " ") - str = Chr(CInt("&H" & Mid(str2(2), 9, 2))) - str = Chr(CInt("&H" & Mid(str2(2), 7, 2))) & str - str = Chr(CInt("&H" & Mid(str2(2), 5, 2))) & str - str = Chr(CInt("&H" & Mid(str2(2), 3, 2))) & str - str = "DL" & str - xbeesend con, str - Case "DL" - Form1.talk_to_me.Tag = "" - Form1.tmr_refresh.Enabled = True - End Select -End Function - -Public Function setupCB_SDEST(ByVal con As Long, ByRef pkt As xbee_pkt) As Long - Dim str As String - Dim str2() As String - Select Case ArrayToString(pkt.atCmd) - Case "DH" - str2 = Split(Form1.nodelist.text, " ") - str = Chr(CInt("&H" & Mid(str2(2), 9, 2))) - str = Chr(CInt("&H" & Mid(str2(2), 7, 2))) & str - str = Chr(CInt("&H" & Mid(str2(2), 5, 2))) & str - str = Chr(CInt("&H" & Mid(str2(2), 3, 2))) & str - str = "DL" & str - xbeesend con, str - Case "DL" - Form1.set_dest.Tag = "" - Form1.nodelist.ListIndex = Form1.nodelist.Tag - Form1.tmr_refresh.Enabled = True - End Select -End Function - -Public Function remoteCB(ByVal con As Long, ByRef pkt As xbee_pkt) As Long - Dim t As String - Dim i As Long - Debug.Print "<+>", ArrayToString(pkt.atCmd) - Form1.tmr_timeout.Enabled = False - Select Case ArrayToString(pkt.atCmd) - Case "AP" - Select Case pkt.data(0) - Case 0 - Form1.ap.Caption = "0 - API Disabled" - Case 1 - Form1.ap.Caption = "1 - API Enabled (no escapes)" - Case 2 - Form1.ap.Caption = "2 - API Enabled (with escapes)" - Case Default - Form1.ap.Caption = "0x" & Hex(pkt.data(0)) & " - Unknown..." - End Select - xbeesend con, "BD" - Case "BD" - t = Hex(pkt.data(3)) - If (Len(t) < 2) Then t = "0" & t - t = Hex(pkt.data(2)) & t - If (Len(t) < 4) Then t = "0" & t - t = Hex(pkt.data(1)) & t - If (Len(t) < 6) Then t = "0" & t - t = Hex(pkt.data(0)) & t - If (Len(t) < 8) Then t = "0" & t - i = CStr("&H" & t) - Select Case i - Case 0 - Form1.bd.Caption = "0 - 1200 bps" - Case 1 - Form1.bd.Caption = "1 - 2400 bps" - Case 2 - Form1.bd.Caption = "2 - 4800 bps" - Case 3 - Form1.bd.Caption = "3 - 9600 bps" - Case 4 - Form1.bd.Caption = "4 - 19200 bps" - Case 5 - Form1.bd.Caption = "5 - 38400 bps" - Case 6 - Form1.bd.Caption = "6 - 57600 bps" - Case 7 - Form1.bd.Caption = "7 - 115200 bps" - Case Default - Form1.bd.Caption = "0x" & Hex(i) & " - Unknwon..." - End Select - xbeesend con, "CH" - Case "CH" - t = Hex(pkt.data(0)) - If (Len(t) < 2) Then t = "0" & t - Form1.ch.Caption = "0x" & t - xbeesend con, "DH" - Case "DH" - t = Hex(pkt.data(3)) - If (Len(t) < 2) Then t = "0" & t - t = Hex(pkt.data(2)) & t - If (Len(t) < 4) Then t = "0" & t - t = Hex(pkt.data(1)) & t - If (Len(t) < 6) Then t = "0" & t - t = Hex(pkt.data(0)) & t - If (Len(t) < 8) Then t = "0" & t - Form1.dh.Caption = "0x" & t - xbeesend con, "DL" - Case "DL" - t = Hex(pkt.data(3)) - If (Len(t) < 2) Then t = "0" & t - t = Hex(pkt.data(2)) & t - If (Len(t) < 4) Then t = "0" & t - t = Hex(pkt.data(1)) & t - If (Len(t) < 6) Then t = "0" & t - t = Hex(pkt.data(0)) & t - If (Len(t) < 8) Then t = "0" & t - Form1.dl.Caption = "0x" & t - xbeesend con, "IA" - Case "IA" - t = Hex(pkt.data(7)) & t - If (Len(t) < 2) Then t = "0" & t - t = Hex(pkt.data(6)) & t - If (Len(t) < 4) Then t = "0" & t - t = Hex(pkt.data(5)) & t - If (Len(t) < 6) Then t = "0" & t - t = Hex(pkt.data(4)) & t - If (Len(t) < 8) Then t = "0" & t - t = Hex(pkt.data(3)) & t - If (Len(t) < 10) Then t = "0" & t - t = Hex(pkt.data(2)) & t - If (Len(t) < 12) Then t = "0" & t - t = Hex(pkt.data(1)) & t - If (Len(t) < 14) Then t = "0" & t - t = Hex(pkt.data(0)) & t - If (Len(t) < 16) Then t = "0" & t - Form1.ia.Caption = "0x" & t - xbeesend con, "HV" - Case "HV" - t = Hex(pkt.data(1)) - If (Len(t) < 2) Then t = "0" & t - t = Hex(pkt.data(0)) & t - If (Len(t) < 4) Then t = "0" & t - Form1.hv.Caption = "0x" & t - xbeesend con, "VR" - Case "VR" - t = Hex(pkt.data(1)) - If (Len(t) < 2) Then t = "0" & t - t = Hex(pkt.data(0)) & t - If (Len(t) < 4) Then t = "0" & t - Form1.vr.Caption = "0x" & t - If con = atcon Then - xbee_attachCallback con, AddressOf localCB - End If - setButtons True - Form1.nodelist.Enabled = True - Form1.tmr_refresh.Enabled = True - Form1.tmr_timeout.Enabled = False - Case Else - If con = atcon Then - xbee_attachCallback con, AddressOf localCB - End If - setButtons True - Form1.nodelist.Enabled = True - Form1.tmr_refresh.Enabled = True - Form1.tmr_timeout.Enabled = False - End Select -End Function - -Public Function localCB(ByVal con As Long, ByRef pkt As xbee_pkt) As Long - Dim nodeinfo As String - Dim nodename As String - Dim tmp As String - Dim tmp2() As String - Dim sh, sl As String - Dim i, m As Integer - Dim AT As String - Form1.tmr_timeout.Enabled = False - AT = ArrayToString(pkt.atCmd) - ' handle initial stuff - Select Case AT - Case "MY" - nodeinfo = "0x" - tmp = Hex(pkt.data(0)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - tmp = Hex(pkt.data(1)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - If Form1.nodelist.ListCount > 0 Then - Form1.nodelist.List(0) = nodeinfo - Else - Form1.nodelist.AddItem nodeinfo - End If - ' issue next command - xbeesend con, "SH" - Case "SH" - nodeinfo = Form1.nodelist.List(0) & " 0x" - tmp = Hex(pkt.data(0)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - tmp = Hex(pkt.data(1)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - tmp = Hex(pkt.data(2)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - tmp = Hex(pkt.data(3)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - Form1.nodelist.List(0) = nodeinfo - ' issue next command - xbeesend con, "SL" - Case "SL" - nodeinfo = Form1.nodelist.List(0) & " 0x" - tmp = Hex(pkt.data(0)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - tmp = Hex(pkt.data(1)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - tmp = Hex(pkt.data(2)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - tmp = Hex(pkt.data(3)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - nodeinfo = nodeinfo & tmp - Form1.nodelist.List(0) = nodeinfo - ' issue next command - xbeesend con, "NI" - Case "NI" - nodeinfo = Form1.nodelist.List(0) & " -***dB * " - tmp = ArrayToString(pkt.data) - nodeinfo = nodeinfo & tmp - Form1.nodelist.List(0) = nodeinfo - ' issue next command - xbeesend con, "ND" - End Select - - If (AT <> "ND") Then Exit Function - If (pkt.status <> 0) Then - MsgBox "An error occured when attempting to scan!", vbCritical - Exit Function - End If - - If (pkt.datalen = 0) Then - ' increment the counter for each node - For i = 0 To Form1.nodelist.ListCount - 1 - tmp2 = Split(Form1.nodelist.List(i), " ") - If tmp2(4) <> "+" And tmp2(4) <> "*" Then - tmp2(4) = CInt(tmp2(4)) + 1 - If (CInt(tmp2(4)) > 9) Then tmp2(4) = "+" - End If - tmp = "" - For m = LBound(tmp2) To UBound(tmp2) - If m > 0 Then tmp = tmp & " " - tmp = tmp & tmp2(m) - Next - Form1.nodelist.List(i) = tmp - Next - - ' restart the refresh timer - Form1.tmr_refresh.Enabled = True - Exit Function - End If - - ' extract the 16-bit address - nodeinfo = "" - tmp = Hex(pkt.data(1)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - tmp = Hex(pkt.data(0)) & tmp - If (Len(tmp) < 4) Then tmp = "0" & tmp - tmp = "0x" & tmp - nodeinfo = nodeinfo & tmp - - nodeinfo = nodeinfo & " " - - ' extract the high portion of the 64-bit address - nodeinfo = nodeinfo - tmp = Hex(pkt.data(5)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - tmp = Hex(pkt.data(4)) & tmp - If (Len(tmp) < 4) Then tmp = "0" & tmp - tmp = Hex(pkt.data(3)) & tmp - If (Len(tmp) < 6) Then tmp = "0" & tmp - tmp = Hex(pkt.data(2)) & tmp - If (Len(tmp) < 8) Then tmp = "0" & tmp - tmp = "0x" & tmp - nodeinfo = nodeinfo & tmp - sh = tmp - - nodeinfo = nodeinfo & " " - - ' extract the low portion of the 64-bit address - nodeinfo = nodeinfo - tmp = Hex(pkt.data(9)) - If (Len(tmp) < 2) Then tmp = "0" & tmp - tmp = Hex(pkt.data(8)) & tmp - If (Len(tmp) < 4) Then tmp = "0" & tmp - tmp = Hex(pkt.data(7)) & tmp - If (Len(tmp) < 6) Then tmp = "0" & tmp - tmp = Hex(pkt.data(6)) & tmp - If (Len(tmp) < 8) Then tmp = "0" & tmp - tmp = "0x" & tmp - nodeinfo = nodeinfo & tmp - sl = tmp - - nodeinfo = nodeinfo & " " - - ' extract the rssi (signal strength) - tmp = "-" & CStr(pkt.data(10)) - If Len(tmp) < 3 Then tmp = " " & tmp - If Len(tmp) < 4 Then tmp = " " & tmp - tmp = tmp & "dB" - nodeinfo = nodeinfo & tmp - - nodeinfo = nodeinfo & " " - ' add a number of scans - nodeinfo = nodeinfo & 0 - - nodeinfo = nodeinfo & " " - - ' extract the node name - nodename = ArrayToString(pkt.data, 11) - nodeinfo = nodeinfo & nodename - - ' see if we have already got this node - For i = 0 To Form1.nodelist.ListCount - 1 - tmp2 = Split(Form1.nodelist.List(i), " ") - If tmp2(1) = sh And tmp2(2) = sl Then - Form1.nodelist.List(i) = nodeinfo - Exit Function - End If - Next - - ' otherwise add the info to the list - Form1.nodelist.AddItem nodeinfo -End Function diff --git a/libs/thirdParty/libxbee/sample/vb6/talk_to_me/talk_to_me.vbp b/libs/thirdParty/libxbee/sample/vb6/talk_to_me/talk_to_me.vbp deleted file mode 100644 index a80cc9bf25076b17986bd5d820465024fc8da7b5..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/vb6/talk_to_me/talk_to_me.vbp +++ /dev/null @@ -1,33 +0,0 @@ -Type=Exe -Form=Form1.frm -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\..\..\Windows\SysWOW64\stdole2.tlb#OLE Automation -Module=libxbee; ..\libxbee.bas -Module=Module1; talk_to_me.bas -IconForm="Form1" -Startup="Form1" -ExeName32="talk_to_me.exe" -Command32="" -Name="Project1" -HelpContextID="0" -CompatibleMode="0" -MajorVer=1 -MinorVer=0 -RevisionVer=0 -AutoIncrementVer=0 -ServerSupportFiles=0 -VersionCompanyName="Microsoft" -CompilationType=0 -OptimizationType=0 -FavorPentiumPro(tm)=0 -CodeViewDebugInfo=0 -NoAliasing=0 -BoundsCheck=0 -OverflowCheck=0 -FlPointCheck=0 -FDIVCheck=0 -UnroundedFP=0 -StartMode=0 -Unattended=0 -Retained=0 -ThreadPerObject=0 -MaxNumberOfThreads=1 diff --git a/libs/thirdParty/libxbee/sample/xbee2_rx.c b/libs/thirdParty/libxbee/sample/xbee2_rx.c deleted file mode 100644 index 223ddcf63777e04cb991872a9e62facafa09cdf5..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/xbee2_rx.c +++ /dev/null @@ -1,60 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -g -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample demonstrates how to communicate using series 2 radios */ - -#include -#include -#include -#include - -void callback(xbee_con *con, xbee_pkt *pkt) { - int ret; - /* print the recieved data */ - printf("Rx: %s\n",pkt->data); -} - -int main(int argc, char *argv[]) { - union { - unsigned char as8[8]; - unsigned int as32[2]; - } addr; - xbee_con *rCon; - xbee_pkt *pkt; - - xbee_setuplog("/dev/ttyUSB1",57600, 2); - - rCon = xbee_newcon('#', xbee2_data, 0x13A200, 0x403302B1); - rCon->waitforACK = 1; - rCon->callback = callback; - - for (;;) { - sleep(60); - } - - /* calling xbee_end() will return the xbee to its previous API mode */ - xbee_end(); - return 0; -} diff --git a/libs/thirdParty/libxbee/sample/xbee2_tx.c b/libs/thirdParty/libxbee/sample/xbee2_tx.c deleted file mode 100644 index db49fe6fa618226cdcfba3c99b8cf79e4a57765a..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/sample/xbee2_tx.c +++ /dev/null @@ -1,54 +0,0 @@ -#ifdef shell -gcc -o ${0//.c/} $0 -lxbee -g -exit -} -#endif -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this sample demonstrates how to communicate using series 2 radios */ - -#include -#include -#include -#include - -int main(int argc, char *argv[]) { - union { - unsigned char as8[8]; - unsigned int as32[2]; - } addr; - xbee_con *rCon; - xbee_pkt *pkt; - - xbee_setuplog("/dev/ttyUSB0",57600, 2); - - rCon = xbee_newcon('#', xbee2_data, 0x13A200, 0x403302BF); - - for (;;) { - xbee_senddata(rCon, "Hello!"); - printf("Sent!\n"); - sleep(1); - } - - /* calling xbee_end() will return the xbee to its previous API mode */ - xbee_end(); - return 0; -} diff --git a/libs/thirdParty/libxbee/umakefile b/libs/thirdParty/libxbee/umakefile deleted file mode 100644 index 597a32377f01ad4e74fc4f3029c817512035da6f..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/umakefile +++ /dev/null @@ -1,91 +0,0 @@ -#-- uncomment this to enable debugging -#DEBUG:=-g -DDEBUG - -#-- what compiler are you using? -CC:=gcc - - -###### YOU SHOULD NOT CHANGE BELOW THIS LINE ###### - -VERSION:=1.4.0 -SRCS:=api.c - -CFLAGS:=-Wall -Wstrict-prototypes -Wno-variadic-macros -pedantic -c -fPIC ${DEBUG} -CLINKS:=-lpthread -lrt ${DEBUG} -DEFINES:=-D__UMAKEFILE - -SRCS:=${sort ${SRCS}} - -.PHONY: all run new clean main - - -# all - do everything (default) # -all: ./lib/libxbee.so.$(VERSION) main - @echo "*** Done! ***" - - -# run - remake main and then run # -run: main - ./bin/main - - -# new - clean and do everything again # -new: clean all - - -# clean - remove any compiled files and PDFs # -clean: - rm -f ./*~ - rm -f ./sample/*~ - rm -f ./obj/*.o - rm -f ./lib/libxbee.so* - rm -f ./bin/main - -# install - installs library # -install: /usr/lib/libxbee.so.$(VERSION) /usr/include/xbee.h - -/usr/lib/libxbee.so.$(VERSION): ./lib/libxbee.so.$(VERSION) - cp ./lib/libxbee.so.$(VERSION) /usr/lib/libxbee.so.$(VERSION) -f - @chmod 755 /usr/lib/libxbee.so.$(VERSION) - @chown root:root /usr/lib/libxbee.so.$(VERSION) - ln ./libxbee.so.$(VERSION) /usr/lib/libxbee.so.1 -sf - @chown root:root /usr/lib/libxbee.so.1 - ln ./libxbee.so.$(VERSION) /usr/lib/libxbee.so -sf - @chown root:root /usr/lib/libxbee.so - -/usr/include/xbee.h: ./xbee.h - cp ./xbee.h /usr/include/xbee.h -f - @chmod 644 /usr/include/xbee.h - @chown root:root /usr/include/xbee.h - -uninstall: - rm /usr/lib/libxbee.so.$(VERSION) -f - rm /usr/lib/libxbee.so.1 -f - rm /usr/lib/libxbee.so -f - rm /usr/include/xbee.h -f - -# main - compile & link objects # -main: ./bin/main - -./bin/main: ./obj/api.o ./bin/ ./main.c - ${CC} ${CLINKS} ./main.c ./obj/api.o -o ./bin/main ${DEBUG} - -./bin/: - mkdir ./bin/ - -./lib/libxbee.so.$(VERSION): ./lib/ ${addprefix ./obj/,${SRCS:.c=.o}} ./xbee.h - gcc -shared -Wl,-soname,libxbee.so.1 -o ./lib/libxbee.so.$(VERSION) ./obj/*.o -lrt - ln ./libxbee.so.$(VERSION) ./lib/libxbee.so.1 -sf - ln ./libxbee.so.$(VERSION) ./lib/libxbee.so -sf - -./lib/: - mkdir ./lib/ - -./obj/: - mkdir ./obj/ - -./obj/%.o: ./obj/ %.c %.h xbee.h - ${CC} ${CFLAGS} ${DEFINES} ${DEBUG} $*.c -o $@ - -./obj/%.o: ./obj/ %.c xbee.h - ${CC} ${CFLAGS} ${DEFINES} ${DEBUG} $*.c -o $@ diff --git a/libs/thirdParty/libxbee/win32.README.txt b/libs/thirdParty/libxbee/win32.README.txt deleted file mode 100644 index f16dc0d94eda4b5ad239c31e806ee2a90f970d92..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/win32.README.txt +++ /dev/null @@ -1,31 +0,0 @@ -Welcome to libxbee! - -I have proveded sample code in the ./sample directory. Hopefully this will help -get you up and running with libxbee. If you would like samples showing a different -aspect of libxbee, then please do not hesitate to file an 'issue' on the project -site, and I will get to it ASAP: - http://code.google.com/p/libxbee/issues/list - - -Documentation is avaliable as HTML in the 'doc' folder. - - -Please note that this project is still in development, so should not be used for -any purpose other than learning/playing/testing etc... Basically don't use it to -make money, and then hold me responsible if it breaks! - -Feel free to contact me directly with any queries: - attie@attie.co.uk - - -=== Compiling & Using === - -To compile you must: - 1) Have Visual C++ 2008 (v9.0) installed (Express or otherwise) - 2) Have make installed - see GnuWin - 3) Modify win32.makefile so that the paths at the top are correct - -Compile using `make -f win32.makefile` from the command prompt - -For C/C++ (and probrably others) just include xbee.h and link with libxbee.dll -For VB6 see ./sample/vb6/ for more info & examples diff --git a/libs/thirdParty/libxbee/win32.makefile b/libs/thirdParty/libxbee/win32.makefile deleted file mode 100644 index d90965681799c87a2e9f7b4b0da82d67f4d418bc..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/win32.makefile +++ /dev/null @@ -1,48 +0,0 @@ -#-- uncomment this to enable debugging -#DEBUG:=/Zi /DDEBUG /MTd -#LDBUG:=/DEBUG - -#-- you may need to edit these lines if your installation is different -VCPath:=C:\Program Files\Microsoft Visual Studio 10.0\VC -SDKPath:=C:\Program Files\Microsoft SDKs\Windows\v7.1 - -#!! if using visual studio 2010, you may need to run the following in a shell, -# and then within the same shell run `make -f win32.makefile` -# C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat - -###### YOU SHOULD NOT CHANGE BELOW THIS LINE ###### -SHELL:=cmd -DEBUG?=/MT - -SRCS:=api.c - -CC:="${VCPath}\bin\cl.exe" -LINK:="${VCPath}\bin\link.exe" -RC:="${SDKPath}\bin\rc.exe" - -.PHONY: all new clean - -all: .\lib\libxbee.dll - -new: clean all - -clean: - -rmdir /Q /S lib - -rmdir /Q /S obj - -.\obj: - mkdir obj - -.\lib: - mkdir lib - -.\lib\libxbee.dll: .\lib .\obj\api.obj .\obj\win32.res - ${LINK} ${LDBUG} /nologo /DLL /MAP:lib\libxbee.map /DEF:xsys\win32.def \ - "/LIBPATH:${SDKPath}\Lib" "/LIBPATH:${VCPath}\lib" \ - /OUT:.\lib\libxbee.dll .\obj\api.obj .\obj\win32.res - -.\obj\api.obj: .\obj api.c api.h xbee.h - ${CC} ${DEBUG} /nologo "/I${SDKPath}\Include" "/I${VCPath}\include" /RTCs /Gz /c /Fd.\lib\libxbee.pdb /Fo.\obj\api.obj ${SRCS} - -.\obj\win32.res: .\xsys\win32.rc - ${RC} "/I${SDKPath}\Include" "/I${VCPath}\include" /n /fo.\obj\win32.res .\xsys\win32.rc diff --git a/libs/thirdParty/libxbee/xbee.h b/libs/thirdParty/libxbee/xbee.h deleted file mode 100644 index 61331d84434f4170501acda1e794a6a8d669ad3c..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xbee.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ -#ifndef XBEE_H -#define XBEE_H - -#if !defined(__GNUC__) && !defined(_WIN32) -#error "This library is only currently compatible with Linux and Win32" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __LIBXBEE_API_H -typedef void* xbee_hnd; -#endif - -#include - -#ifdef __GNUC__ /* ---- */ -#include -typedef pthread_mutex_t xbee_mutex_t; -typedef pthread_cond_t xbee_cond_t; -typedef pthread_t xbee_thread_t; -typedef sem_t xbee_sem_t; -typedef FILE* xbee_file_t; -#elif (defined(WIN32) || defined(_WIN32)) /* -------------- */ -#include -#define CALLTYPE __stdcall -#define CALLTYPEVA __cdecl -typedef HANDLE xbee_mutex_t; -typedef CONDITION_VARIABLE xbee_cond_t; -typedef HANDLE xbee_thread_t; -typedef HANDLE xbee_sem_t; -typedef HANDLE xbee_file_t; -#else -#error "Unknown operating system or compiler" -#endif /* ------------- */ - -#ifndef CALLTYPE -#define CALLTYPE -#endif - -#ifndef CALLTYPEVA -#define CALLTYPEVA -#endif - -enum xbee_types { - xbee_unknown, - - xbee_localAT, /* frame ID */ - xbee_remoteAT, - xbee_modemStatus, - xbee_txStatus, - - /* XBee Series 1 stuff */ - xbee_16bitRemoteAT, /* frame ID */ - xbee_64bitRemoteAT, /* frame ID */ - - xbee_16bitData, /* frame ID for ACKs */ - xbee_64bitData, /* frame ID for ACKs */ - - xbee_16bitIO, - xbee_64bitIO, - - /* XBee Series 2 stuff */ - xbee2_data, - xbee2_txStatus -}; -typedef enum xbee_types xbee_types; - -typedef struct xbee_sample xbee_sample; -struct xbee_sample { - /* X A5 A4 A3 A2 A1 A0 D8 D7 D6 D5 D4 D3 D2 D1 D0 */ - unsigned short IOmask; /* IO */ - /* X X X X X X X D8 D7 D6 D5 D4 D3 D2 D1 D0 */ - unsigned short IOdigital; /* IO */ - /* X X X X X D D D D D D D D D D D */ - unsigned short IOanalog[6]; /* IO */ -}; - -typedef struct xbee_pkt xbee_pkt; -struct xbee_pkt { - unsigned int sAddr64 : 1; /* yes / no */ - unsigned int dataPkt : 1; /* if no - AT packet */ - unsigned int txStatusPkt : 1; - unsigned int modemStatusPkt : 1; - unsigned int remoteATPkt : 1; - unsigned int IOPkt : 1; - unsigned int isBroadcastADR : 1; - unsigned int isBroadcastPAN : 1; - - unsigned char frameID; /* AT Status */ - unsigned char atCmd[2]; /* AT */ - - unsigned char status; /* AT Data Status */ /* status / options */ - unsigned char samples; - unsigned char RSSI; /* Data */ - - unsigned char Addr16[2]; /* AT Data */ - - unsigned char Addr64[8]; /* AT Data */ - - unsigned char data[128]; /* AT Data */ - - unsigned int datalen; - xbee_types type; - - xbee_pkt *next; - - xbee_sample IOdata[1]; /* this array can be extended by using a this trick: - p = calloc(sizeof(xbee_pkt) + (sizeof(xbee_sample) * (samples - 1))) */ -}; - -typedef struct xbee_con xbee_con; -struct xbee_con { - unsigned int tAddr64 : 1; - unsigned int atQueue : 1; /* queues AT commands until AC is sent */ - unsigned int txDisableACK : 1; - unsigned int txBroadcastPAN: 1; /* broadcasts to PAN */ - unsigned int destroySelf : 1; /* if set, the callback thread will destroy the connection - after all of the packets have been processed */ - unsigned int waitforACK : 1; /* waits for the ACK or NAK after transmission */ - unsigned int noFreeAfterCB : 1; /* prevents libxbee from free'ing the packet after the callback has completed */ - unsigned int __spare__ : 1; - xbee_types type; - unsigned char frameID; - unsigned char tAddr[8]; /* 64-bit 0-7 16-bit 0-1 */ - void *customData; /* can be used to store data related to this connection */ - void (CALLTYPE *callback)(xbee_con*,xbee_pkt*); /* call back function */ - void *callbackList; - xbee_mutex_t callbackmutex; - xbee_mutex_t callbackListmutex; - xbee_mutex_t Txmutex; - xbee_sem_t waitforACKsem; - volatile unsigned char ACKstatus; /* 255 = waiting, 0 = success, 1 = no ack, 2 = cca fail, 3 = purged */ - xbee_con *next; -}; - -int CALLTYPE xbee_setup(char *path, int baudrate); -int CALLTYPE xbee_setuplog(char *path, int baudrate, int logfd); -int CALLTYPE xbee_setupAPI(char *path, int baudrate, char cmdSeq, int cmdTime); -int CALLTYPE xbee_setuplogAPI(char *path, int baudrate, int logfd, char cmdSeq, int cmdTime); -xbee_hnd CALLTYPE _xbee_setup(char *path, int baudrate); -xbee_hnd CALLTYPE _xbee_setuplog(char *path, int baudrate, int logfd); -xbee_hnd CALLTYPE _xbee_setupAPI(char *path, int baudrate, char cmdSeq, int cmdTime); -xbee_hnd CALLTYPE _xbee_setuplogAPI(char *path, int baudrate, int logfd, char cmdSeq, int cmdTime); - -int CALLTYPE xbee_end(void); -int CALLTYPE _xbee_end(xbee_hnd xbee); - -void CALLTYPE xbee_logitf(char *format, ...); -void CALLTYPE _xbee_logitf(xbee_hnd xbee, char *format, ...); -void CALLTYPE xbee_logit(char *str); -void CALLTYPE _xbee_logit(xbee_hnd xbee, char *str); - -xbee_con * CALLTYPEVA xbee_newcon(unsigned char frameID, xbee_types type, ...); -xbee_con * CALLTYPEVA _xbee_newcon(xbee_hnd xbee, unsigned char frameID, xbee_types type, ...); -xbee_con * CALLTYPE _xbee_vnewcon(xbee_hnd xbee, unsigned char frameID, xbee_types type, va_list ap); - -void CALLTYPE xbee_purgecon(xbee_con *con); -void CALLTYPE _xbee_purgecon(xbee_hnd xbee, xbee_con *con); - -void CALLTYPE xbee_endcon2(xbee_con **con, int alreadyUnlinked); -void CALLTYPE _xbee_endcon2(xbee_hnd xbee, xbee_con **con, int alreadyUnlinked); -#define xbee_endcon(x) xbee_endcon2(&(x),0) -#define _xbee_endcon(xbee,x) _xbee_endcon2((xbee),&(x),0) - -int CALLTYPE xbee_nsenddata(xbee_con *con, char *data, int length); -int CALLTYPE _xbee_nsenddata(xbee_hnd xbee, xbee_con *con, char *data, int length); -int CALLTYPEVA xbee_senddata(xbee_con *con, char *format, ...); -int CALLTYPEVA _xbee_senddata(xbee_hnd xbee, xbee_con *con, char *format, ...); -int CALLTYPE xbee_vsenddata(xbee_con *con, char *format, va_list ap); -int CALLTYPE _xbee_vsenddata(xbee_hnd xbee, xbee_con *con, char *format, va_list ap); - -#if defined(WIN32) -/* oh and just 'cos windows has rubbish memory management rules... this too */ -void CALLTYPE xbee_free(void *ptr); -#endif /* ------------- */ - -xbee_pkt * CALLTYPE xbee_getpacket(xbee_con *con); -xbee_pkt * CALLTYPE _xbee_getpacket(xbee_hnd xbee, xbee_con *con); -xbee_pkt * CALLTYPE xbee_getpacketwait(xbee_con *con); -xbee_pkt * CALLTYPE _xbee_getpacketwait(xbee_hnd xbee, xbee_con *con); - -int CALLTYPE xbee_hasdigital(xbee_pkt *pkt, int sample, int input); -int CALLTYPE xbee_getdigital(xbee_pkt *pkt, int sample, int input); - -int CALLTYPE xbee_hasanalog(xbee_pkt *pkt, int sample, int input); -double CALLTYPE xbee_getanalog(xbee_pkt *pkt, int sample, int input, double Vref); - -const char * CALLTYPE xbee_svn_version(void); -const char * CALLTYPE xbee_build_info(void); - -void CALLTYPE xbee_listen_stop(xbee_hnd xbee); - -#ifdef __cplusplus -} /* cplusplus */ -#endif - -#endif diff --git a/libs/thirdParty/libxbee/xsys/README b/libs/thirdParty/libxbee/xsys/README deleted file mode 100644 index 48d3928505730bab3f66fd31195b427700648bd3..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xsys/README +++ /dev/null @@ -1 +0,0 @@ -This directory contains cross-system support files. \ No newline at end of file diff --git a/libs/thirdParty/libxbee/xsys/linux.c b/libs/thirdParty/libxbee/xsys/linux.c deleted file mode 100644 index 768d5b3d4ecb9edf05cc53bbc2c088df398810d6..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xsys/linux.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* ################################################################# */ -/* ### Linux Code ################################################## */ -/* ################################################################# */ - -/* this file contains code that is used by Linux ONLY */ -#ifndef __GNUC__ -#error "This file should only be used on a Linux system" -#endif - -#include "linux.h" - -int init_serial(xbee_hnd xbee, int baudrate) { - struct flock fl; - struct termios tc; - speed_t chosenbaud; - - /* select the baud rate */ - switch (baudrate) { - case 1200: chosenbaud = B1200; break; - case 2400: chosenbaud = B2400; break; - case 4800: chosenbaud = B4800; break; - case 9600: chosenbaud = B9600; break; - case 19200: chosenbaud = B19200; break; - case 38400: chosenbaud = B38400; break; - case 57600: chosenbaud = B57600; break; - case 115200:chosenbaud = B115200; break; - default: - fprintf(stderr,"%s(): Unknown or incompatiable baud rate specified... (%d)\n",__FUNCTION__,baudrate); - return -1; - }; - - /* open the serial port as a file descriptor */ - if ((xbee->ttyfd = open(xbee->path,O_RDWR | O_NOCTTY | O_NONBLOCK)) == -1) { - xbee_perror("xbee_setup():open()"); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee->path); - return -1; - } - - /* lock the file */ - fl.l_type = F_WRLCK | F_RDLCK; - fl.l_whence = SEEK_SET; - fl.l_start = 0; - fl.l_len = 0; - fl.l_pid = getpid(); - if (fcntl(xbee->ttyfd, F_SETLK, &fl) == -1) { - xbee_perror("xbee_setup():fcntl()"); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee->path); - close(xbee->ttyfd); - return -1; - } - - /* open the serial port as a FILE* */ - if ((xbee->tty = fdopen(xbee->ttyfd,"r+")) == NULL) { - xbee_perror("xbee_setup():fdopen()"); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee->path); - close(xbee->ttyfd); - return -1; - } - - /* flush the serial port */ - fflush(xbee->tty); - - /* disable buffering */ - setvbuf(xbee->tty,NULL,_IONBF,BUFSIZ); - - /* setup the baud rate and other io attributes */ - tcgetattr(xbee->ttyfd, &tc); - /* input flags */ - tc.c_iflag &= ~ IGNBRK; /* enable ignoring break */ - tc.c_iflag &= ~(IGNPAR | PARMRK); /* disable parity checks */ - tc.c_iflag &= ~ INPCK; /* disable parity checking */ - tc.c_iflag &= ~ ISTRIP; /* disable stripping 8th bit */ - tc.c_iflag &= ~(INLCR | ICRNL); /* disable translating NL <-> CR */ - tc.c_iflag &= ~ IGNCR; /* disable ignoring CR */ - tc.c_iflag &= ~(IXON | IXOFF); /* disable XON/XOFF flow control */ - /* output flags */ - tc.c_oflag &= ~ OPOST; /* disable output processing */ - tc.c_oflag &= ~(ONLCR | OCRNL); /* disable translating NL <-> CR */ - tc.c_oflag &= ~ OFILL; /* disable fill characters */ - /* control flags */ - tc.c_cflag |= CREAD; /* enable reciever */ - tc.c_cflag &= ~ PARENB; /* disable parity */ - tc.c_cflag &= ~ CSTOPB; /* disable 2 stop bits */ - tc.c_cflag &= ~ CSIZE; /* remove size flag... */ - tc.c_cflag |= CS8; /* ...enable 8 bit characters */ - tc.c_cflag |= HUPCL; /* enable lower control lines on close - hang up */ - /* local flags */ - tc.c_lflag &= ~ ISIG; /* disable generating signals */ - tc.c_lflag &= ~ ICANON; /* disable canonical mode - line by line */ - tc.c_lflag &= ~ ECHO; /* disable echoing characters */ - tc.c_lflag &= ~ ECHONL; /* ??? */ - tc.c_lflag &= ~ NOFLSH; /* disable flushing on SIGINT */ - tc.c_lflag &= ~ IEXTEN; /* disable input processing */ - /* control characters */ - memset(tc.c_cc,0,sizeof(tc.c_cc)); - /* i/o rates */ - cfsetspeed(&tc, chosenbaud); /* set i/o baud rate */ - tcsetattr(xbee->ttyfd, TCSANOW, &tc); - tcflow(xbee->ttyfd, TCOON|TCION); /* enable input & output transmission */ - - return 0; -} - -static int xbee_select(xbee_hnd xbee, struct timeval *timeout) { - fd_set fds; - - FD_ZERO(&fds); - FD_SET(xbee->ttyfd, &fds); - - return select(xbee->ttyfd+1, &fds, NULL, NULL, timeout); -} - -#define xbee_sem_wait1sec(a) xbee_sem_wait1sec2(&(a)) -static inline int xbee_sem_wait1sec2(xbee_sem_t *sem) { - struct timespec to; - clock_gettime(CLOCK_REALTIME,&to); - to.tv_sec++; - return sem_timedwait(sem,&to); -} diff --git a/libs/thirdParty/libxbee/xsys/linux.h b/libs/thirdParty/libxbee/xsys/linux.h deleted file mode 100644 index 886bbf5bf1c33ed4a59fa6d7396dc198ff3d9342..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xsys/linux.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this file contains code that is used by Linux ONLY */ -#ifndef __GNUC__ -#error "This file should only be used on a Linux system" -#endif - -/* ################################################################# */ -/* ### Linux Code ################################################## */ -/* ################################################################# */ - -#define xbee_thread_create(a,b,c) pthread_create(&(a),NULL,(void *(*)(void *))(b),(void *)(c)) -#define xbee_thread_cancel(a,b) pthread_cancel((a)) -#define xbee_thread_join(a) pthread_join((a),NULL) -#define xbee_thread_tryjoin(a) pthread_tryjoin_np((a),NULL) - -#define xbee_mutex_init(a) pthread_mutex_init(&(a),NULL) -#define xbee_mutex_destroy(a) pthread_mutex_destroy(&(a)) -#define xbee_mutex_lock(a) pthread_mutex_lock(&(a)) -#define xbee_mutex_trylock(a) pthread_mutex_trylock(&(a)) -#define xbee_mutex_unlock(a) pthread_mutex_unlock(&(a)) - -#define xbee_sem_init(a) sem_init(&(a),0,0) -#define xbee_sem_destroy(a) sem_destroy(&(a)) -#define xbee_sem_wait(a) sem_wait(&(a)) -#define xbee_sem_post(a) sem_post(&(a)) - -#define xbee_cond_init(a) pthread_cond_init(&(a),NULL) -#define xbee_cond_destroy(a) pthread_cond_destroy(&(a)) -#define xbee_cond_wait(a,b) pthread_cond_wait(&(a),&(b)) -#define xbee_cond_signal(a) pthread_cond_signal(&(a)) -#define xbee_cond_broadcast(a) pthread_cond_broadcast(&(a)) - -#define xbee_write(xbee,a,b) fwrite((a),1,(b),(xbee)->tty) -#define xbee_read(xbee,a,b) fread((a),1,(b),(xbee)->tty) -#define xbee_ferror(xbee) ferror((xbee)->tty) -#define xbee_feof(xbee) feof((xbee)->tty) -#define xbee_close(a) fclose((a)) - diff --git a/libs/thirdParty/libxbee/xsys/pdf/linux.c.pdf b/libs/thirdParty/libxbee/xsys/pdf/linux.c.pdf deleted file mode 100644 index 75a9a38b29af858ad4bb773704982d44fa400b32..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/xsys/pdf/linux.c.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/xsys/pdf/linux.h.pdf b/libs/thirdParty/libxbee/xsys/pdf/linux.h.pdf deleted file mode 100644 index a4c65ae408966bc912ed72e08fc49c4edee516ff..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/xsys/pdf/linux.h.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/xsys/pdf/win32.c.pdf b/libs/thirdParty/libxbee/xsys/pdf/win32.c.pdf deleted file mode 100644 index ec776c30b824ae659ab2cb2f31907df2f608dff8..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/xsys/pdf/win32.c.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/xsys/pdf/win32.def.pdf b/libs/thirdParty/libxbee/xsys/pdf/win32.def.pdf deleted file mode 100644 index 99b0548e4d2703b57cf69ec0fde18166639f570e..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/xsys/pdf/win32.def.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/xsys/pdf/win32.dll.c.pdf b/libs/thirdParty/libxbee/xsys/pdf/win32.dll.c.pdf deleted file mode 100644 index 97d7acb34cfe49904b5c08b6c227512fc8bc6048..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/xsys/pdf/win32.dll.c.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/xsys/pdf/win32.h.pdf b/libs/thirdParty/libxbee/xsys/pdf/win32.h.pdf deleted file mode 100644 index b844726f1a19607952831452b160be3896a412b1..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/xsys/pdf/win32.h.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/xsys/pdf/win32.rc.pdf b/libs/thirdParty/libxbee/xsys/pdf/win32.rc.pdf deleted file mode 100644 index 8ff8a7956bff9e4e4ff4b5cb33683835c635a36c..0000000000000000000000000000000000000000 Binary files a/libs/thirdParty/libxbee/xsys/pdf/win32.rc.pdf and /dev/null differ diff --git a/libs/thirdParty/libxbee/xsys/win32.c b/libs/thirdParty/libxbee/xsys/win32.c deleted file mode 100644 index a05950a94b6a44e84db33f067f85c07ae9c90342..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xsys/win32.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* ################################################################# */ -/* ### Win32 Code ################################################## */ -/* ################################################################# */ - -/* this file contains code that is used by Win32 ONLY */ -#ifndef _WIN32 -#error "This file should only be used on a Win32 system" -#endif - -#include "win32.h" -#include "win32.dll.c" - -static int init_serial(xbee_hnd xbee, int baudrate) { - int chosenbaud; - DCB tc; - int evtMask; - COMMTIMEOUTS timeouts; - - /* open the serial port */ - xbee->tty = CreateFile(TEXT(xbee->path), - GENERIC_READ | GENERIC_WRITE, - 0, /* exclusive access */ - NULL, /* default security attributes */ - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, - NULL); - if (xbee->tty == INVALID_HANDLE_VALUE) { - xbee_logS("Invalid file handle..."); - xbee_logE("Is the XBee plugged in and avaliable on the correct port?"); - xbee_mutex_destroy(xbee->conmutex); - xbee_mutex_destroy(xbee->pktmutex); - xbee_mutex_destroy(xbee->sendmutex); - Xfree(xbee->path); - return -1; - } - - GetCommState(xbee->tty, &tc); - tc.BaudRate = baudrate; - tc.fBinary = TRUE; - tc.fParity = FALSE; - tc.fOutxCtsFlow = FALSE; - tc.fOutxDsrFlow = FALSE; - tc.fDtrControl = DTR_CONTROL_DISABLE; - tc.fDsrSensitivity = FALSE; - tc.fTXContinueOnXoff = FALSE; - tc.fOutX = FALSE; - tc.fInX = FALSE; - tc.fErrorChar = FALSE; - tc.fNull = FALSE; - tc.fRtsControl = RTS_CONTROL_DISABLE; - tc.fAbortOnError = FALSE; - tc.ByteSize = 8; - tc.Parity = NOPARITY; - tc.StopBits = ONESTOPBIT; - SetCommState(xbee->tty, &tc); - - timeouts.ReadIntervalTimeout = MAXDWORD; - timeouts.ReadTotalTimeoutMultiplier = 0; - timeouts.ReadTotalTimeoutConstant = 0; - timeouts.WriteTotalTimeoutMultiplier = 0; - timeouts.WriteTotalTimeoutConstant = 0; - SetCommTimeouts(xbee->tty, &timeouts); - - SetCommMask(xbee->tty, EV_RXCHAR); - - return 0; -} - -/* a replacement for the linux select() function... for a serial port */ -static int xbee_select(xbee_hnd xbee, struct timeval *timeout) { - int evtMask = 0; - COMSTAT status; - int ret; - - for (;;) { - /* find out how many bytes are in the Rx buffer... */ - if (ClearCommError(xbee->tty,NULL,&status) && (status.cbInQue > 0)) { - /* if there is data... return! */ - return 1; /*status.cbInQue;*/ - } else if (timeout && timeout->tv_sec == 0 && timeout->tv_usec == 0) { - /* if the timeout was 0 (return immediately) then return! */ - return 0; - } - - /* otherwise wait for an Rx event... */ - memset(&(xbee->ttyovrs),0,sizeof(OVERLAPPED)); - xbee->ttyovrs.hEvent = CreateEvent(NULL,TRUE,FALSE,NULL); - if (!WaitCommEvent(xbee->tty,&evtMask,&(xbee->ttyovrs))) { - if (GetLastError() == ERROR_IO_PENDING) { - DWORD timeoutval; - if (!timeout) { - /* behave like the linux function... if the timeout pointer was NULL - then wait indefinately */ - timeoutval = INFINITE; - } else { - /* Win32 doesn't give the luxury of microseconds and seconds... just miliseconds! */ - timeoutval = (timeout->tv_sec * 1000) + (timeout->tv_usec / 1000); - } - ret = WaitForSingleObject(xbee->ttyovrs.hEvent,timeoutval); - if (ret == WAIT_TIMEOUT) { - /* cause the WaitCommEvent() call to stop */ - SetCommMask(xbee->tty, EV_RXCHAR); - /* if a timeout occured, then return 0 */ - CloseHandle(xbee->ttyovrs.hEvent); - return 0; - } - } else { - return -1; - } - } - CloseHandle(xbee->ttyovrs.hEvent); - } - - /* always return -1 (error) for now... */ - return -1; -} - -/* this offers the same behavior as non-blocking I/O under linux */ -int xbee_write(xbee_hnd xbee, const void *ptr, size_t size) { - xbee->ttyeof = FALSE; - if (!WriteFile(xbee->tty, ptr, size, NULL, &(xbee->ttyovrw)) && - (GetLastError() != ERROR_IO_PENDING)) return 0; - if (!GetOverlappedResult(xbee->tty, &(xbee->ttyovrw), &(xbee->ttyw), TRUE)) { - if (GetLastError() == ERROR_HANDLE_EOF) xbee->ttyeof = TRUE; - return 0; - } - return xbee->ttyw; -} - -/* this offers the same behavior as non-blocking I/O under linux */ -int xbee_read(xbee_hnd xbee, void *ptr, size_t size) { - xbee->ttyeof = FALSE; - if (!ReadFile(xbee->tty, ptr, size, NULL, &(xbee->ttyovrr)) && - (GetLastError() != ERROR_IO_PENDING)) return 0; - if (!GetOverlappedResult(xbee->tty, &(xbee->ttyovrr), &(xbee->ttyr), TRUE)) { - if (GetLastError() == ERROR_HANDLE_EOF) xbee->ttyeof = TRUE; - return 0; - } - return xbee->ttyr; -} - -/* this is because Win32 has some weird memory management rules... - - the thread that allocated the memory, MUST free it... */ -void xbee_free(void *ptr) { - if (!ptr) return; - free(ptr); -} - -/* win32 equivalent of unix gettimeofday() */ -int gettimeofday(struct timeval *tv, struct timezone *tz) { - if (tv) { - struct _timeb timeb; - _ftime(&timeb); - tv->tv_sec = timeb.time; - tv->tv_usec = timeb.millitm * 1000; - } - /* ignore tz for now */ - return 0; -} - -/* ################################################################# */ -/* ### Helper Functions (Mainly for VB6 use) ####################### */ -/* ################################################################# */ - -/* enable the debug output to a custom file or fallback to stderr */ -int xbee_setupDebugAPI(char *path, int baudrate, char *logfile, char cmdSeq, int cmdTime) { - xbee_hnd xbee = NULL; - int fd, ret; - if ((fd = _open(logfile,_O_WRONLY | _O_CREAT | _O_TRUNC)) == -1) { - fd = 2; - } - ret = xbee_setuplogAPI(path,baudrate,fd,cmdSeq,cmdTime); - if (fd > 2) { /* close fd, as libxbee dup'ed it */ - //_close(fd); - } - if (!ret) { /* libxbee started correctly */ - xbee = default_xbee; - if (fd == -1) { - xbee_log("Error opening logfile '%s' (errno=%d)... using stderr instead!",logfile,errno); - } - } - return ret; -} -int xbee_setupDebug(char *path, int baudrate, char *logfile) { - return xbee_setupDebugAPI(path,baudrate,logfile,0,0); -} - -/* These silly little functions are required for VB6 - - it freaks out when you call a function that uses va_args... */ -xbee_con *xbee_newcon_simple(unsigned char frameID, xbee_types type) { - return xbee_newcon(frameID, type); -} -xbee_con *xbee_newcon_16bit(unsigned char frameID, xbee_types type, int addr) { - return xbee_newcon(frameID, type, addr); -} -xbee_con *xbee_newcon_64bit(unsigned char frameID, xbee_types type, int addrL, int addrH) { - return xbee_newcon(frameID, type, addrL, addrH); -} - -void xbee_enableACKwait(xbee_con *con) { - con->waitforACK = 1; -} -void xbee_disableACKwait(xbee_con *con) { - con->waitforACK = 0; -} - -void xbee_enableDestroySelf(xbee_con *con) { - con->destroySelf = 1; -} - -/* for vb6... it will send a message to the given hWnd which can in turn check for a packet */ -void xbee_callback(xbee_con *con, xbee_pkt *pkt) { - xbee_hnd xbee = default_xbee; - - if (!win32_hWnd) { - xbee_log("*** Cannot do callback! No hWnd set... ***"); - return; - } - if (!win32_MessageID) { - xbee_log("*** Cannot do callback! No MessageID set... ***"); - return; - } - - xbee_log("Callback message sent!"); - SendMessage(win32_hWnd, win32_MessageID, (int)con, (int)pkt); -} - -/* very simple C function to provide more functionality to VB6 */ -int xbee_runCallback(int(*func)(xbee_con*,xbee_pkt*), xbee_con *con, xbee_pkt *pkt) { - return func(con,pkt); -} - -void xbee_enableCallbacks(HWND hWnd, UINT uMsg) { - xbee_hnd xbee = default_xbee; - if (!win32_MessageID || win32_MessageID != uMsg) { - xbee_log("Configuring libxbee to use MessageID = 0x%08X", uMsg); - win32_MessageID = uMsg; - } - if (!win32_hWnd || win32_hWnd != hWnd) { - xbee_log("Configuring libxbee to use hWnd = 0x%08X", hWnd); - win32_hWnd = hWnd; - } -} - -void xbee_attachCallback(xbee_con *con) { - xbee_hnd xbee = default_xbee; - - /* setup the callback function */ - xbee_log("Setting callback for connection @ 0x%08X",con); - con->callback = xbee_callback; -} - -void xbee_detachCallback(xbee_con *con) { - xbee_hnd xbee = default_xbee; - - /* un-setup the callback function */ - xbee_log("Unsetting callback for connection @ 0x%08X",con); - con->callback = NULL; -} diff --git a/libs/thirdParty/libxbee/xsys/win32.def b/libs/thirdParty/libxbee/xsys/win32.def deleted file mode 100644 index 888040ee38085c483632a80f083ba61390c36eb5..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xsys/win32.def +++ /dev/null @@ -1,71 +0,0 @@ -LIBRARY libxbee - -EXPORTS - ver - DllMain - DllCanUnloadNow PRIVATE - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE - - xbee_free - - xbee_setup - _xbee_setup - xbee_setuplog - _xbee_setuplog - xbee_setupAPI - _xbee_setupAPI - xbee_setuplogAPI - _xbee_setuplogAPI - xbee_setupDebug - xbee_setupDebugAPI - - xbee_end - _xbee_end - xbee_listen_stop - - xbee_newcon - _xbee_newcon - xbee_newcon_simple - xbee_newcon_16bit - xbee_newcon_64bit - - xbee_enableACKwait - xbee_disableACKwait - xbee_enableDestroySelf - - xbee_enableCallbacks - xbee_attachCallback - xbee_detachCallback - xbee_runCallback - - xbee_endcon2 - _xbee_endcon2 - xbee_purgecon - _xbee_purgecon - - xbee_senddata - _xbee_senddata - xbee_nsenddata - _xbee_nsenddata - xbee_vsenddata - _xbee_vsenddata - - xbee_getpacket - _xbee_getpacket - xbee_getpacketwait - _xbee_getpacketwait - - xbee_hasanalog - xbee_getanalog - - xbee_hasdigital - xbee_getdigital - - xbee_svn_version - xbee_build_info - - xbee_logit - _xbee_logit - xbee_logitf - _xbee_logitf diff --git a/libs/thirdParty/libxbee/xsys/win32.dll.c b/libs/thirdParty/libxbee/xsys/win32.dll.c deleted file mode 100644 index 1a9ebcaa8573d6b77f9af6cdc70d12eeaa6b308b..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xsys/win32.dll.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* ################################################################# */ -/* ### Win32 DLL Code ############################################## */ -/* ################################################################# */ - -/* this file contains code that is used by Win32 ONLY */ -#ifndef _WIN32 -#error "This file should only be used on a Win32 system" -#endif - -int ver(HWND hwnd, HINSTANCE hinst, LPWSTR lpszCmdLine, int nCmdShow) { - char t[256]; - sprintf(t,"libxbee.dll\n%s\n%s",xbee_svn_version(),xbee_build_info()); - MessageBox(NULL, t, "libxbee Win32 DLL", MB_OK); - return 0; -} - -void xbee_UNLOADALL(void) { - while (default_xbee) { - _xbee_end(default_xbee); - } -} - -/* this gets called when the dll is loaded and unloaded... */ -BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved) { - if (dwReason == DLL_PROCESS_DETACH) { - /* ensure that libxbee has been shut down nicely */ - xbee_UNLOADALL(); - } else if (dwReason == DLL_PROCESS_ATTACH || dwReason == DLL_THREAD_ATTACH) { - if (!glob_hModule) { - /* keep a handle on the module */ - glob_hModule = (HMODULE)hModule; - } - } - return TRUE; -} - -HRESULT DllCanUnloadNow(void) { - if (default_xbee) return 0; - return 1; -} - -/* ################################################################# */ -/* ### Win32 DLL COM Code ########################################## */ -/* ################################################################# */ - -/* this function is from this tutorial: - http://www.codeguru.com/Cpp/COM-Tech/activex/tutorials/article.php/c5567 */ -BOOL RegWriteKey(HKEY roothk, const char *lpSubKey, LPCTSTR val_name, - DWORD dwType, void *lpvData, DWORD dwDataSize) { - /* roothk: HKEY_CLASSES_ROOT, HKEY_LOCAL_MACHINE, etc - lpSubKey: the key relative to 'roothk' - val_name: the key value name where the data will be written - dwType: REG_SZ,REG_BINARY, etc. - lpvData: a pointer to the data buffer - dwDataSize: the size of the data pointed to by lpvData */ - HKEY hk; - if (ERROR_SUCCESS != RegCreateKey(roothk,lpSubKey,&hk) ) return FALSE; - if (ERROR_SUCCESS != RegSetValueEx(hk,val_name,0,dwType,(CONST BYTE *)lpvData,dwDataSize)) return FALSE; - if (ERROR_SUCCESS != RegCloseKey(hk)) return FALSE; - return TRUE; -} - -/* this is used by the regsrv32 application */ -STDAPI DllRegisterServer(void) { - char key[MAX_PATH]; - char value[MAX_PATH]; - - wsprintf(key,"CLSID\\%s",dllGUID); - wsprintf(value,"%s",dlldesc); - RegWriteKey(HKEY_CLASSES_ROOT, key, NULL, REG_SZ, (void *)value, lstrlen(value)); - - wsprintf(key,"CLSID\\%s\\InprocServer32",dllGUID); - GetModuleFileName(glob_hModule,value,MAX_PATH); - RegWriteKey(HKEY_CLASSES_ROOT, key, NULL, REG_SZ, (void *)value, lstrlen(value)); - - wsprintf(key,"CLSID\\%s\\ProgId",dllGUID); - lstrcpy(value,dllid); - RegWriteKey(HKEY_CLASSES_ROOT, key, NULL, REG_SZ, (void *)value, lstrlen(value)); - - lstrcpy(key,dllid); - lstrcpy(value,dlldesc); - RegWriteKey(HKEY_CLASSES_ROOT, key, NULL, REG_SZ, (void *)value, lstrlen(value)); - - wsprintf(key,"%s\\CLSID",dllid); - RegWriteKey(HKEY_CLASSES_ROOT, key, NULL, REG_SZ, (void *)dllGUID, lstrlen(dllGUID)); - - return S_OK; -} - -/* this is used by the regsrv32 application */ -STDAPI DllUnregisterServer(void) { - char key[MAX_PATH]; - char value[MAX_PATH]; - - wsprintf(key,"%s\\CLSID",dllid); - RegDeleteKey(HKEY_CLASSES_ROOT,key); - - wsprintf(key,"%s",dllid); - RegDeleteKey(HKEY_CLASSES_ROOT,key); - - wsprintf(key,"CLSID\\%s\\InprocServer32",dllGUID); - RegDeleteKey(HKEY_CLASSES_ROOT,key); - - wsprintf(key,"CLSID\\%s\\ProgId",dllGUID); - RegDeleteKey(HKEY_CLASSES_ROOT,key); - - wsprintf(key,"CLSID\\%s",dllGUID); - RegDeleteKey(HKEY_CLASSES_ROOT,key); - - return S_OK; -} diff --git a/libs/thirdParty/libxbee/xsys/win32.h b/libs/thirdParty/libxbee/xsys/win32.h deleted file mode 100644 index 65f19f805cb978899aa3e9a19cf3e9fd115185e4..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xsys/win32.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - libxbee - a C library to aid the use of Digi's Series 1 XBee modules - running in API mode (AP=2). - - Copyright (C) 2009 Attie Grande (attie@attie.co.uk) - - 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 . -*/ - -/* this file contains code that is used by Win32 ONLY */ -#ifndef _WIN32 -#error "This file should only be used on a Win32 system" -#endif - -/* ################################################################# */ -/* ### Win32 Code ################################################## */ -/* ################################################################# */ - -#pragma comment(lib, "Advapi32.lib") -#pragma comment(lib, "User32.lib") - -#define dllid "attie-co-uk.libxbee" -#define dlldesc "libxbee - XBee API Library" -/* libxbee's GUID is {7A6E25AA-ECB5-4370-87B5-A1D31840FE23} */ -#define dllGUID "{7A6E25AA-ECB5-4370-87B5-A1D31840FE23}" - -#define Win32Message() MessageBox(0,"Run xbee_setup() first!...","libxbee",MB_OK); - -HMODULE glob_hModule = NULL; - -/* this uses miliseconds not microseconds... */ -#define usleep(a) Sleep((a)/1000) - -#define xbee_thread_create(a,b,c) (((a) = CreateThread(NULL,0,(void *)(b),(void *)(c),0,NULL)) == NULL) -#define xbee_thread_cancel(a,b) TerminateThread((a),(b)) -#define xbee_thread_join(a) WaitForSingleObject((a),INFINITE) -#define xbee_thread_tryjoin(a) WaitForSingleObject((a),0) - -#define xbee_mutex_init(a) (((a) = CreateEvent(NULL,FALSE,TRUE,NULL)) == NULL) -#define xbee_mutex_destroy(a) CloseHandle((a)) -#define xbee_mutex_lock(a) WaitForSingleObject((a),INFINITE) -#define xbee_mutex_trylock(a) WaitForSingleObject((a),0) -#define xbee_mutex_unlock(a) SetEvent((a)) - -#define xbee_sem_init(a) (((a) = CreateEvent(NULL,FALSE,FALSE,NULL)) == NULL) -#define xbee_sem_destroy(a) CloseHandle((a)) -#define xbee_sem_wait(a) WaitForSingleObject((a),INFINITE) -#define xbee_sem_wait1sec(a) WaitForSingleObject((a),1000) -#define xbee_sem_post(a) SetEvent((a)) - -#define xbee_cond_init(a) InitializeConditionVariable(&(a)) -#define xbee_cond_destroy(a) -#define xbee_cond_wait(a,b) SleepConditionVariableCS(&(a),&(b),INFINITE) -#define xbee_cond_signal(a) WakeConditionVariable(&(a)) -#define xbee_cond_broadcast(a) WakeAllConditionVariable(&(a)) - -#define xbee_feof(a) (xbee->ttyeof) -#define xbee_ferror(a) (0) -#define xbee_close(a) (((a)==xbee->log)?fclose((a)):CloseHandle((a))) - -HWND win32_hWnd = 0; -UINT win32_MessageID = 0; diff --git a/libs/thirdParty/libxbee/xsys/win32.rc b/libs/thirdParty/libxbee/xsys/win32.rc deleted file mode 100644 index 80f7d33bc4d151193b3f12e5a59baf6c5b545405..0000000000000000000000000000000000000000 --- a/libs/thirdParty/libxbee/xsys/win32.rc +++ /dev/null @@ -1,47 +0,0 @@ -/* more info: http://msdn.microsoft.com/en-us/library/aa381058(v=vs.85).aspx */ - -#define APSTUDIO_READONLY_SYMBOLS -#include "winresrc.h" -#undef APSTUDIO_READONLY_SYMBOLS - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) - -#ifdef _WIN32 -/* Englush (UK) */ -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,1,0 - FILEFLAGSMASK 0x00L - FILEFLAGS 0x00L - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "Provides a simple interface for XBee radios" - VALUE "CompanyName", "attie.co.uk" - VALUE "FileDescription", "Provides a simple interface for XBee radios" - VALUE "InternalName", "libxbee" - VALUE "LegalCopyright", "Copyright (C) 2009 onwards Attie Grande" - VALUE "LegalTrademarks", "" - VALUE "OriginalFilename", "libxbee.dll" - VALUE "PrivateBuild", "" - VALUE "ProductName", "libxbee - http://code.google.com/p/libxbee/" - VALUE "ProductVersion", "v1.4.1" - VALUE "SpecialBuild", "" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x809, 1200 - END -END - - -#endif diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index c0cd800d16faac75e43e3856bcafa2beab6cac18..ce9cd426e25aad33e02e7ea7d8a87634f83221cb 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -641,6 +641,7 @@ SOURCES += \ src/VehicleSetup/JoystickConfigController.cc \ src/audio/QGCAudioWorker.cpp \ src/comm/LinkConfiguration.cc \ + src/comm/LinkInterface.cc \ src/comm/LinkManager.cc \ src/comm/MAVLinkProtocol.cc \ src/comm/QGCMAVLink.cc \ diff --git a/src/QmlControls/QGroundControlQmlGlobal.cc b/src/QmlControls/QGroundControlQmlGlobal.cc index 2a8168db32061e1c2cccb1a2d6733f0a5a02fc93..27966dd365445c63dde0887f526ba79f3f81eea3 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.cc +++ b/src/QmlControls/QGroundControlQmlGlobal.cc @@ -155,8 +155,8 @@ void QGroundControlQmlGlobal::stopAllMockLinks(void) #ifdef QT_DEBUG LinkManager* linkManager = qgcApp()->toolbox()->linkManager(); - for (int i=0; ilinks()->count(); i++) { - LinkInterface* link = linkManager->links()->value(i); + for (int i=0; ilinks().count(); i++) { + LinkInterface* link = linkManager->links()[i]; MockLink* mockLink = qobject_cast(link); if (mockLink) { diff --git a/src/Vehicle/MultiVehicleManager.cc b/src/Vehicle/MultiVehicleManager.cc index 5baa4fab65451ac1d53554284e4c3fac91b5218e..eae33e12bf7f898b754a20268f360e9cd4617392 100644 --- a/src/Vehicle/MultiVehicleManager.cc +++ b/src/Vehicle/MultiVehicleManager.cc @@ -306,9 +306,9 @@ void MultiVehicleManager::setGcsHeartbeatEnabled(bool gcsHeartBeatEnabled) void MultiVehicleManager::_sendGCSHeartbeat(void) { // Send a heartbeat out on each link - QmlObjectListModel* links = _toolbox->linkManager()->links(); - for (int i=0; icount(); i++) { - LinkInterface* link = links->value(i); + LinkManager* linkMgr = _toolbox->linkManager(); + for (int i=0; ilinks().count(); i++) { + LinkInterface* link = linkMgr->links()[i]; if (link->isConnected()) { mavlink_message_t message; mavlink_msg_heartbeat_pack_chan(_mavlinkProtocol->getSystemId(), diff --git a/src/Vehicle/SendMavCommandTest.cc b/src/Vehicle/SendMavCommandTest.cc index 850bcc98001422fcd5d7a6d0e12c79846a778a32..de4a8c7ad7b08d67ac3809c2bcc84e9f981eccd2 100644 --- a/src/Vehicle/SendMavCommandTest.cc +++ b/src/Vehicle/SendMavCommandTest.cc @@ -14,7 +14,7 @@ void SendMavCommandTest::_noFailure(void) { - _connectMockLink(); + _connectMockLink(MAV_AUTOPILOT_ARDUPILOTMEGA); MultiVehicleManager* vehicleMgr = qgcApp()->toolbox()->multiVehicleManager(); Vehicle* vehicle = vehicleMgr->activeVehicle(); @@ -37,7 +37,7 @@ void SendMavCommandTest::_failureShowError(void) // Will pop error about request failure setExpectedMessageBox(QMessageBox::Ok); - _connectMockLink(); + _connectMockLink(MAV_AUTOPILOT_ARDUPILOTMEGA); MultiVehicleManager* vehicleMgr = qgcApp()->toolbox()->multiVehicleManager(); Vehicle* vehicle = vehicleMgr->activeVehicle(); @@ -60,7 +60,7 @@ void SendMavCommandTest::_failureShowError(void) void SendMavCommandTest::_failureNoShowError(void) { - _connectMockLink(); + _connectMockLink(MAV_AUTOPILOT_ARDUPILOTMEGA); MultiVehicleManager* vehicleMgr = qgcApp()->toolbox()->multiVehicleManager(); Vehicle* vehicle = vehicleMgr->activeVehicle(); @@ -80,7 +80,7 @@ void SendMavCommandTest::_failureNoShowError(void) void SendMavCommandTest::_noFailureAfterRetry(void) { - _connectMockLink(); + _connectMockLink(MAV_AUTOPILOT_ARDUPILOTMEGA); MultiVehicleManager* vehicleMgr = qgcApp()->toolbox()->multiVehicleManager(); Vehicle* vehicle = vehicleMgr->activeVehicle(); @@ -103,7 +103,7 @@ void SendMavCommandTest::_failureAfterRetry(void) // Will pop error about request failure setExpectedMessageBox(QMessageBox::Ok); - _connectMockLink(); + _connectMockLink(MAV_AUTOPILOT_ARDUPILOTMEGA); MultiVehicleManager* vehicleMgr = qgcApp()->toolbox()->multiVehicleManager(); Vehicle* vehicle = vehicleMgr->activeVehicle(); @@ -129,7 +129,7 @@ void SendMavCommandTest::_failureAfterNoReponse(void) // Will pop error about request failure setExpectedMessageBox(QMessageBox::Ok); - _connectMockLink(); + _connectMockLink(MAV_AUTOPILOT_ARDUPILOTMEGA); MultiVehicleManager* vehicleMgr = qgcApp()->toolbox()->multiVehicleManager(); Vehicle* vehicle = vehicleMgr->activeVehicle(); @@ -138,7 +138,7 @@ void SendMavCommandTest::_failureAfterNoReponse(void) vehicle->sendMavCommand(MAV_COMP_ID_ALL, MAV_CMD_USER_5, true /* showError */); QSignalSpy spyResult(vehicle, SIGNAL(mavCommandResult(int, int, int, int, bool))); - QCOMPARE(spyResult.wait(10000), true); + QCOMPARE(spyResult.wait(20000), true); QList arguments = spyResult.takeFirst(); QCOMPARE(arguments.count(), 5); QCOMPARE(arguments.at(0).toInt(), vehicle->id()); diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 9eecb02d4518911b9d2a8f6b1942ac0b09cc9be3..45cc6b6fdddf2f86fbaae8257d3b9076a68f9c83 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -923,8 +923,9 @@ bool Vehicle::_containsLink(LinkInterface* link) void Vehicle::_addLink(LinkInterface* link) { if (!_containsLink(link)) { - _links += link; qCDebug(VehicleLog) << "_addLink:" << QString("%1").arg((ulong)link, 0, 16); + _links += link; + _updatePriorityLink(); connect(qgcApp()->toolbox()->linkManager(), &LinkManager::linkInactive, this, &Vehicle::_linkInactiveOrDeleted); connect(qgcApp()->toolbox()->linkManager(), &LinkManager::linkDeleted, this, &Vehicle::_linkInactiveOrDeleted); } @@ -935,6 +936,7 @@ void Vehicle::_linkInactiveOrDeleted(LinkInterface* link) qCDebug(VehicleLog) << "_linkInactiveOrDeleted linkCount" << _links.count(); _links.removeOne(link); + _updatePriorityLink(); if (_links.count() == 0 && !_allLinksInactiveSent) { qCDebug(VehicleLog) << "All links inactive"; @@ -980,26 +982,42 @@ void Vehicle::_sendMessageOnLink(LinkInterface* link, mavlink_message_t message) emit messagesSentChanged(); } -/// @return Direct usb connection link to board if one, NULL if none -LinkInterface* Vehicle::priorityLink(void) +void Vehicle::_updatePriorityLink(void) { #ifndef NO_SERIAL_LINK - foreach (LinkInterface* link, _links) { + LinkInterface* newPriorityLink = NULL; + + // Note that this routine specificallty does not clear _priorityLink when there are no links remaining. + // By doing this we hold a reference on the last link as the Vehicle shuts down. Thus preventing shutdown + // ordering NULL pointer crashes where priorityLink() is still called during shutdown sequence. + for (int i=0; i<_links.count(); i++) { + LinkInterface* link = _links[i]; if (link->isConnected()) { SerialLink* pSerialLink = qobject_cast(link); if (pSerialLink) { - LinkConfiguration* pLinkConfig = pSerialLink->getLinkConfiguration(); - if (pLinkConfig) { - SerialConfiguration* pSerialConfig = qobject_cast(pLinkConfig); + LinkConfiguration* config = pSerialLink->getLinkConfiguration(); + if (config) { + SerialConfiguration* pSerialConfig = qobject_cast(config); if (pSerialConfig && pSerialConfig->usbDirect()) { - return link; + if (_priorityLink.data() != link) { + newPriorityLink = link; + break; + } + return; } } } } } + + if (!newPriorityLink && !_priorityLink.data() && _links.count()) { + newPriorityLink = _links[0]; + } + + if (newPriorityLink) { + _priorityLink = qgcApp()->toolbox()->linkManager()->sharedLinkInterfacePointerForLink(newPriorityLink); + } #endif - return _links.count() ? _links[0] : NULL; } void Vehicle::setLatitude(double latitude) diff --git a/src/Vehicle/Vehicle.h b/src/Vehicle/Vehicle.h index df0d0036c996980f475bf556e2216a82d7ccc30f..96f2f5e747648ee49ddbb82c55b5c963e470ba5c 100644 --- a/src/Vehicle/Vehicle.h +++ b/src/Vehicle/Vehicle.h @@ -416,8 +416,9 @@ public: MAV_TYPE vehicleType(void) const { return _vehicleType; } Q_INVOKABLE QString vehicleTypeName(void) const; - /// Returns the highest quality link available to the Vehicle - LinkInterface* priorityLink(void); + /// Returns the highest quality link available to the Vehicle. If you need to hold a refernce to this link use + /// LinkManager::sharedLinkInterfaceForGet to get QSharedPointer for link. + LinkInterface* priorityLink(void) { return _priorityLink.data(); } /// Sends a message to the specified link /// @return true: message sent, false: Link no longer connected @@ -720,6 +721,7 @@ private: void _handleMavlinkLoggingDataAcked(mavlink_message_t& message); void _ackMavlinkLogData(uint16_t sequence); void _sendNextQueuedMavCommand(void); + void _updatePriorityLink(void); private: int _id; ///< Mavlink system id @@ -850,6 +852,8 @@ private: static const int _lowBatteryAnnounceRepeatMSecs; // Amount of time in between each low battery announcement QElapsedTimer _lowBatteryAnnounceTimer; + SharedLinkInterfacePointer _priorityLink; // We always keep a reference to the priority link to manage shutdown ordering + // FactGroup facts Fact _rollFact; diff --git a/src/comm/BluetoothLink.cc b/src/comm/BluetoothLink.cc index 93bc9b8de268e679e577f5eb47b3d510773aa9e9..c5a019acd1d74bbd21cb2d6f970365f9d993b5b1 100644 --- a/src/comm/BluetoothLink.cc +++ b/src/comm/BluetoothLink.cc @@ -29,24 +29,20 @@ #include "BluetoothLink.h" #include "QGC.h" -BluetoothLink::BluetoothLink(BluetoothConfiguration* config) - : _connectState(false) +BluetoothLink::BluetoothLink(SharedLinkConfigurationPointer& config) + : LinkInterface(config) + , _connectState(false) , _targetSocket(NULL) #ifdef __ios__ , _discoveryAgent(NULL) #endif , _shutDown(false) { - Q_ASSERT(config != NULL); - _config = config; - _config->setLink(this); - //moveToThread(this); + } BluetoothLink::~BluetoothLink() { - // Disconnect link from configuration - _config->setLink(NULL); _disconnect(); #ifdef __ios__ if(_discoveryAgent) { diff --git a/src/comm/BluetoothLink.h b/src/comm/BluetoothLink.h index 2a2b98144dde866c2aaa10ad5521f0e1a08d6b73..9e9d318bb7d1ae752825e33e9ece17c4b0514c7e 100644 --- a/src/comm/BluetoothLink.h +++ b/src/comm/BluetoothLink.h @@ -169,7 +169,7 @@ protected: private: // Links are only created/destroyed by LinkManager so constructor/destructor is not public - BluetoothLink(BluetoothConfiguration* config); + BluetoothLink(SharedLinkConfigurationPointer& config); ~BluetoothLink(); // From LinkInterface diff --git a/src/comm/HexSpinBox.cpp b/src/comm/HexSpinBox.cpp deleted file mode 100644 index 878e9409e6ca56e11b27fcc3bb6e4bdc2350ff9e..0000000000000000000000000000000000000000 --- a/src/comm/HexSpinBox.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "HexSpinBox.h" - -#include - -HexSpinBox::HexSpinBox(QWidget *parent) - : QSpinBox(parent), validator(NULL) -{ - setRange(0, 0x7fffffff); - validator = new QRegExpValidator(QRegExp("[0-9A-Fa-f]{1,8}"), this); -} - -HexSpinBox::~HexSpinBox(void) -{ - if(this->validator) - { - delete this->validator; - this->validator = NULL; - } -} - -QValidator::State HexSpinBox::validate(QString &text, int &pos) const -{ - return validator->validate(text, pos); -} - -QString HexSpinBox::textFromValue(int value) const -{ - return QString::number(value, 16).toUpper(); -} - -int HexSpinBox::valueFromText(const QString &text) const -{ - bool ok; - return text.toInt(&ok, 16); -} \ No newline at end of file diff --git a/src/comm/HexSpinBox.h b/src/comm/HexSpinBox.h deleted file mode 100644 index 84703c95c79e94c931a850a3e64c2bd1cc7a0060..0000000000000000000000000000000000000000 --- a/src/comm/HexSpinBox.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef HEXSPINBOX_H_ -#define HEXSPINBOX_H_ - -#include - -class QRegExpValidator; - -class HexSpinBox : public QSpinBox -{ - Q_OBJECT -public: - HexSpinBox(QWidget *parent = 0); - ~HexSpinBox(void); - -protected: - QValidator::State validate(QString &text, int &pos) const; - int valueFromText(const QString &text) const; - QString textFromValue(int value) const; - -private: - QRegExpValidator *validator; -}; - -#endif // HEXSPINBOX_H_ - diff --git a/src/comm/LinkConfiguration.h b/src/comm/LinkConfiguration.h index 59fa8f36ffc7ec07adbfb3f9bf4eae0f2f879c52..42a181bf48db68686ef74aa37bf57a69fb66e9d5 100644 --- a/src/comm/LinkConfiguration.h +++ b/src/comm/LinkConfiguration.h @@ -7,7 +7,6 @@ * ****************************************************************************/ - #ifndef LINKCONFIGURATION_H #define LINKCONFIGURATION_H @@ -37,7 +36,7 @@ public: // Property accessors - const QString name(void) { return _name; } + QString name(void) const { return _name; } LinkInterface* link(void) { return _link; } void setName(const QString name); @@ -54,12 +53,6 @@ public: #ifdef QGC_ENABLE_BLUETOOTH TypeBluetooth, ///< Bluetooth Link #endif -#if 0 - // TODO Below is not yet implemented - TypeForwarding, ///< Forwarding Link - TypeXbee, ///< XBee Proprietary Link - TypeOpal, ///< Opal-RT Link -#endif #ifdef QT_DEBUG TypeMock, ///< Mock Link for Unitesting #endif @@ -190,4 +183,6 @@ private: bool _autoConnect; ///< This connection is started automatically at boot }; +typedef QSharedPointer SharedLinkConfigurationPointer; + #endif // LINKCONFIGURATION_H diff --git a/src/comm/LinkInterface.cc b/src/comm/LinkInterface.cc new file mode 100644 index 0000000000000000000000000000000000000000..a65d3fb3150000c7e08f0b4257f02a1cd6066b37 --- /dev/null +++ b/src/comm/LinkInterface.cc @@ -0,0 +1,157 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * QGroundControl is licensed according to the terms in the file + * COPYING.md in the root of the source code directory. + * + ****************************************************************************/ + +#include "LinkInterface.h" +#include "QGCApplication.h" + +/// mavlink channel to use for this link, as used by mavlink_parse_char. The mavlink channel is only +/// set into the link when it is added to LinkManager +uint8_t LinkInterface::mavlinkChannel(void) const +{ + if (!_mavlinkChannelSet) { + qWarning() << "Call to LinkInterface::mavlinkChannel with _mavlinkChannelSet == false"; + } + return _mavlinkChannel; +} +// Links are only created by LinkManager so constructor is not public +LinkInterface::LinkInterface(SharedLinkConfigurationPointer& config) + : QThread(0) + , _config(config) + , _mavlinkChannelSet(false) + , _active(false) + , _enableRateCollection(false) +{ + _config->setLink(this); + + // Initialize everything for the data rate calculation buffers. + _inDataIndex = 0; + _outDataIndex = 0; + + // Initialize our data rate buffers. + memset(_inDataWriteAmounts, 0, sizeof(_inDataWriteAmounts)); + memset(_inDataWriteTimes, 0, sizeof(_inDataWriteTimes)); + memset(_outDataWriteAmounts,0, sizeof(_outDataWriteAmounts)); + memset(_outDataWriteTimes, 0, sizeof(_outDataWriteTimes)); + + QObject::connect(this, &LinkInterface::_invokeWriteBytes, this, &LinkInterface::_writeBytes); + qRegisterMetaType("LinkInterface*"); +} + +/// This function logs the send times and amounts of datas for input. Data is used for calculating +/// the transmission rate. +/// @param byteCount Number of bytes received +/// @param time Time in ms send occurred +void LinkInterface::_logInputDataRate(quint64 byteCount, qint64 time) { + if(_enableRateCollection) + _logDataRateToBuffer(_inDataWriteAmounts, _inDataWriteTimes, &_inDataIndex, byteCount, time); +} + +/// This function logs the send times and amounts of datas for output. Data is used for calculating +/// the transmission rate. +/// @param byteCount Number of bytes sent +/// @param time Time in ms receive occurred +void LinkInterface::_logOutputDataRate(quint64 byteCount, qint64 time) { + if(_enableRateCollection) + _logDataRateToBuffer(_outDataWriteAmounts, _outDataWriteTimes, &_outDataIndex, byteCount, time); +} + +/** + * @brief logDataRateToBuffer Stores transmission times/amounts for statistics + * + * This function logs the send times and amounts of datas to the given circular buffers. + * This data is used for calculating the transmission rate. + * + * @param bytesBuffer[out] The buffer to write the bytes value into. + * @param timeBuffer[out] The buffer to write the time value into + * @param writeIndex[out] The write index used for this buffer. + * @param bytes The amount of bytes transmit. + * @param time The time (in ms) this transmission occurred. + */ +void LinkInterface::_logDataRateToBuffer(quint64 *bytesBuffer, qint64 *timeBuffer, int *writeIndex, quint64 bytes, qint64 time) +{ + QMutexLocker dataRateLocker(&_dataRateMutex); + + int i = *writeIndex; + + // Now write into the buffer, if there's no room, we just overwrite the first data point. + bytesBuffer[i] = bytes; + timeBuffer[i] = time; + + // Increment and wrap the write index + ++i; + if (i == _dataRateBufferSize) + { + i = 0; + } + *writeIndex = i; +} + +/** + * @brief getCurrentDataRate Get the current data rate given a data rate buffer. + * + * This function attempts to use the times and number of bytes transmit into a current data rate + * estimation. Since it needs to use timestamps to get the timeperiods over when the data was sent, + * this is effectively a global data rate over the last _dataRateBufferSize - 1 data points. Also note + * that data points older than NOW - dataRateCurrentTimespan are ignored. + * + * @param index The first valid sample in the data rate buffer. Refers to the oldest time sample. + * @param dataWriteTimes The time, in ms since epoch, that each data sample took place. + * @param dataWriteAmounts The amount of data (in bits) that was transferred. + * @return The bits per second of data transferrence of the interface over the last [-statsCurrentTimespan, 0] timespan. + */ +qint64 LinkInterface::_getCurrentDataRate(int index, const qint64 dataWriteTimes[], const quint64 dataWriteAmounts[]) const +{ + const qint64 now = QDateTime::currentMSecsSinceEpoch(); + + // Limit the time we calculate to the recent past + const qint64 cutoff = now - _dataRateCurrentTimespan; + + // Grab the mutex for working with the stats variables + QMutexLocker dataRateLocker(&_dataRateMutex); + + // Now iterate through the buffer of all received data packets adding up all values + // within now and our cutof. + qint64 totalBytes = 0; + qint64 totalTime = 0; + qint64 lastTime = 0; + int size = _dataRateBufferSize; + while (size-- > 0) + { + // If this data is within our cutoff time, include it in our calculations. + // This also accounts for when the buffer is empty and filled with 0-times. + if (dataWriteTimes[index] > cutoff && lastTime > 0) { + // Track the total time, using the previous time as our timeperiod. + totalTime += dataWriteTimes[index] - lastTime; + totalBytes += dataWriteAmounts[index]; + } + + // Track the last time sample for doing timespan calculations + lastTime = dataWriteTimes[index]; + + // Increment and wrap the index if necessary. + if (++index == _dataRateBufferSize) + { + index = 0; + } + } + + // Return the final calculated value in bits / s, converted from bytes/ms. + qint64 dataRate = (totalTime != 0)?(qint64)((float)totalBytes * 8.0f / ((float)totalTime / 1000.0f)):0; + + // Finally return our calculated data rate. + return dataRate; +} + +/// Sets the mavlink channel to use for this link +void LinkInterface::_setMavlinkChannel(uint8_t channel) +{ + Q_ASSERT(!_mavlinkChannelSet); + _mavlinkChannelSet = true; + _mavlinkChannel = channel; +} diff --git a/src/comm/LinkInterface.h b/src/comm/LinkInterface.h index ecb8947406e07b8ad0d8a2cdaaac0a14df26969e..63ce682571b03177e969e6d1cbd214e4e511f31d 100644 --- a/src/comm/LinkInterface.h +++ b/src/comm/LinkInterface.h @@ -19,9 +19,9 @@ #include #include "QGCMAVLink.h" +#include "LinkConfiguration.h" class LinkManager; -class LinkConfiguration; /** * The link interface defines the interface for all links used to communicate @@ -35,18 +35,16 @@ class LinkInterface : public QThread // Only LinkManager is allowed to create/delete or _connect/_disconnect a link friend class LinkManager; -public: +public: + ~LinkInterface() { _config->setLink(NULL); } + Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged) // Property accessors - bool active(void) { return _active; } - void setActive(bool active) { _active = active; emit activeChanged(active); } + bool active(void) { return _active; } + void setActive(bool active) { _active = active; emit activeChanged(active); } - /** - * @brief Get link configuration - * @return A pointer to the instance of LinkConfiguration - **/ - virtual LinkConfiguration* getLinkConfiguration() = 0; + LinkConfiguration* getLinkConfiguration(void) { return _config.data(); } /* Connection management */ @@ -116,13 +114,7 @@ public: /// mavlink channel to use for this link, as used by mavlink_parse_char. The mavlink channel is only /// set into the link when it is added to LinkManager - uint8_t mavlinkChannel(void) const - { - if (!_mavlinkChannelSet) { - qWarning() << "Call to LinkInterface::mavlinkChannel with _mavlinkChannelSet == false"; - } - return _mavlinkChannel; - } + uint8_t mavlinkChannel(void) const; // These are left unimplemented in order to cause linker errors which indicate incorrect usage of // connect/disconnect on link directly. All connect/disconnect calls should be made through LinkManager. @@ -192,43 +184,21 @@ signals: protected: // Links are only created by LinkManager so constructor is not public - LinkInterface() : - QThread(0) - , _mavlinkChannelSet(false) - , _active(false) - , _enableRateCollection(false) - { - // Initialize everything for the data rate calculation buffers. - _inDataIndex = 0; - _outDataIndex = 0; - - // Initialize our data rate buffers. - memset(_inDataWriteAmounts, 0, sizeof(_inDataWriteAmounts)); - memset(_inDataWriteTimes, 0, sizeof(_inDataWriteTimes)); - memset(_outDataWriteAmounts,0, sizeof(_outDataWriteAmounts)); - memset(_outDataWriteTimes, 0, sizeof(_outDataWriteTimes)); - - QObject::connect(this, &LinkInterface::_invokeWriteBytes, this, &LinkInterface::_writeBytes); - qRegisterMetaType("LinkInterface*"); - } + LinkInterface(SharedLinkConfigurationPointer& config); /// This function logs the send times and amounts of datas for input. Data is used for calculating /// the transmission rate. /// @param byteCount Number of bytes received /// @param time Time in ms send occurred - void _logInputDataRate(quint64 byteCount, qint64 time) { - if(_enableRateCollection) - _logDataRateToBuffer(_inDataWriteAmounts, _inDataWriteTimes, &_inDataIndex, byteCount, time); - } + void _logInputDataRate(quint64 byteCount, qint64 time); /// This function logs the send times and amounts of datas for output. Data is used for calculating /// the transmission rate. /// @param byteCount Number of bytes sent /// @param time Time in ms receive occurred - void _logOutputDataRate(quint64 byteCount, qint64 time) { - if(_enableRateCollection) - _logDataRateToBuffer(_outDataWriteAmounts, _outDataWriteTimes, &_outDataIndex, byteCount, time); - } + void _logOutputDataRate(quint64 byteCount, qint64 time); + + SharedLinkConfigurationPointer _config; private: /** @@ -243,24 +213,7 @@ private: * @param bytes The amount of bytes transmit. * @param time The time (in ms) this transmission occurred. */ - void _logDataRateToBuffer(quint64 *bytesBuffer, qint64 *timeBuffer, int *writeIndex, quint64 bytes, qint64 time) - { - QMutexLocker dataRateLocker(&_dataRateMutex); - - int i = *writeIndex; - - // Now write into the buffer, if there's no room, we just overwrite the first data point. - bytesBuffer[i] = bytes; - timeBuffer[i] = time; - - // Increment and wrap the write index - ++i; - if (i == _dataRateBufferSize) - { - i = 0; - } - *writeIndex = i; - } + void _logDataRateToBuffer(quint64 *bytesBuffer, qint64 *timeBuffer, int *writeIndex, quint64 bytes, qint64 time); /** * @brief getCurrentDataRate Get the current data rate given a data rate buffer. @@ -275,48 +228,7 @@ private: * @param dataWriteAmounts The amount of data (in bits) that was transferred. * @return The bits per second of data transferrence of the interface over the last [-statsCurrentTimespan, 0] timespan. */ - qint64 _getCurrentDataRate(int index, const qint64 dataWriteTimes[], const quint64 dataWriteAmounts[]) const - { - const qint64 now = QDateTime::currentMSecsSinceEpoch(); - - // Limit the time we calculate to the recent past - const qint64 cutoff = now - _dataRateCurrentTimespan; - - // Grab the mutex for working with the stats variables - QMutexLocker dataRateLocker(&_dataRateMutex); - - // Now iterate through the buffer of all received data packets adding up all values - // within now and our cutof. - qint64 totalBytes = 0; - qint64 totalTime = 0; - qint64 lastTime = 0; - int size = _dataRateBufferSize; - while (size-- > 0) - { - // If this data is within our cutoff time, include it in our calculations. - // This also accounts for when the buffer is empty and filled with 0-times. - if (dataWriteTimes[index] > cutoff && lastTime > 0) { - // Track the total time, using the previous time as our timeperiod. - totalTime += dataWriteTimes[index] - lastTime; - totalBytes += dataWriteAmounts[index]; - } - - // Track the last time sample for doing timespan calculations - lastTime = dataWriteTimes[index]; - - // Increment and wrap the index if necessary. - if (++index == _dataRateBufferSize) - { - index = 0; - } - } - - // Return the final calculated value in bits / s, converted from bytes/ms. - qint64 dataRate = (totalTime != 0)?(qint64)((float)totalBytes * 8.0f / ((float)totalTime / 1000.0f)):0; - - // Finally return our calculated data rate. - return dataRate; - } + qint64 _getCurrentDataRate(int index, const qint64 dataWriteTimes[], const quint64 dataWriteAmounts[]) const; /** * @brief Connect this interface logically @@ -328,7 +240,7 @@ private: virtual void _disconnect(void) = 0; /// Sets the mavlink channel to use for this link - void _setMavlinkChannel(uint8_t channel) { Q_ASSERT(!_mavlinkChannelSet); _mavlinkChannelSet = true; _mavlinkChannel = channel; } + void _setMavlinkChannel(uint8_t channel); bool _mavlinkChannelSet; ///< true: _mavlinkChannel has been set uint8_t _mavlinkChannel; ///< mavlink channel to use for this link, as used by mavlink_parse_char @@ -355,6 +267,6 @@ private: bool _enableRateCollection; }; -typedef QSharedPointer SharedLinkInterface; +typedef QSharedPointer SharedLinkInterfacePointer; #endif // _LINKINTERFACE_H_ diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index 8a400a95524849bfb6569d65559ce987a9d6340d..e014464d30c8f228eee59a8e923d4d30ad374818 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -7,15 +7,6 @@ * ****************************************************************************/ - -/** - * @file - * @brief Brief Description - * - * @author Lorenz Meier - * - */ - #include #include #include @@ -108,17 +99,21 @@ void LinkManager::setToolbox(QGCToolbox *toolbox) } -LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config) +LinkInterface* LinkManager::createConnectedLink(SharedLinkConfigurationPointer& config) { - Q_ASSERT(config); + if (!config) { + qWarning() << "LinkManager::createConnectedLink called with NULL config"; + return NULL; + } + LinkInterface* pLink = NULL; switch(config->type()) { #ifndef NO_SERIAL_LINK case LinkConfiguration::TypeSerial: { - SerialConfiguration* serialConfig = dynamic_cast(config); + SerialConfiguration* serialConfig = dynamic_cast(config.data()); if (serialConfig) { - pLink = new SerialLink(serialConfig); + pLink = new SerialLink(config); if (serialConfig->usbDirect()) { _activeLinkCheckList.append((SerialLink*)pLink); if (!_activeLinkCheckTimer.isActive()) { @@ -130,43 +125,45 @@ LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config) break; #endif case LinkConfiguration::TypeUdp: - pLink = new UDPLink(dynamic_cast(config)); + pLink = new UDPLink(config); break; case LinkConfiguration::TypeTcp: - pLink = new TCPLink(dynamic_cast(config)); + pLink = new TCPLink(config); break; #ifdef QGC_ENABLE_BLUETOOTH case LinkConfiguration::TypeBluetooth: - pLink = new BluetoothLink(dynamic_cast(config)); + pLink = new BluetoothLink(config); break; #endif #ifndef __mobile__ case LinkConfiguration::TypeLogReplay: - pLink = new LogReplayLink(dynamic_cast(config)); + pLink = new LogReplayLink(config); break; #endif #ifdef QT_DEBUG case LinkConfiguration::TypeMock: - pLink = new MockLink(dynamic_cast(config)); + pLink = new MockLink(config); break; #endif case LinkConfiguration::TypeLast: default: break; } - if(pLink) { + + if (pLink) { _addLink(pLink); connectLink(pLink); } + return pLink; } LinkInterface* LinkManager::createConnectedLink(const QString& name) { Q_ASSERT(name.isEmpty() == false); - for(int i = 0; i < _linkConfigurations.count(); i++) { - LinkConfiguration* conf = _linkConfigurations.value(i); - if(conf && conf->name() == name) + for(int i = 0; i < _sharedConfigurations.count(); i++) { + SharedLinkConfigurationPointer& conf = _sharedConfigurations[i]; + if (conf->name() == name) return createConnectedLink(conf); } return NULL; @@ -183,7 +180,7 @@ void LinkManager::_addLink(LinkInterface* link) return; } - if (!_links.contains(link)) { + if (!containsLink(link)) { bool channelSet = false; // Find a mavlink channel to use for this link, Channel 0 is reserved for internal use. @@ -205,7 +202,7 @@ void LinkManager::_addLink(LinkInterface* link) qWarning() << "Ran out of mavlink channels"; } - _links.append(link); + _sharedLinks.append(SharedLinkInterfacePointer(link)); emit newLink(link); } @@ -225,8 +222,8 @@ void LinkManager::_addLink(LinkInterface* link) void LinkManager::disconnectAll(void) { // Walk list in reverse order to preserve indices during delete - for (int i=_links.count()-1; i>=0; i--) { - disconnectLink(_links.value(i)); + for (int i=_sharedLinks.count()-1; i>=0; i--) { + disconnectLink(_sharedLinks[i].data()); } } @@ -243,23 +240,22 @@ bool LinkManager::connectLink(LinkInterface* link) void LinkManager::disconnectLink(LinkInterface* link) { - if (!link || !_links.contains(link)) { + if (!link || !containsLink(link)) { return; } link->_disconnect(); + LinkConfiguration* config = link->getLinkConfiguration(); - if (config) { - if (_autoconnectConfigurations.contains(config)) { - config->setLink(NULL); + for (int i=0; i<_sharedAutoconnectConfigurations.count(); i++) { + if (_sharedAutoconnectConfigurations[i].data() == config) { + qCDebug(LinkManagerLog) << "Removing disconnected autoconnect config" << config->name(); + _sharedAutoconnectConfigurations.removeAt(i); + break; } } + _deleteLink(link); - if (_autoconnectConfigurations.contains(config)) { - qCDebug(LinkManagerLog) << "Removing disconnected autoconnect config" << config->name(); - _autoconnectConfigurations.removeOne(config); - delete config; - } } void LinkManager::_deleteLink(LinkInterface* link) @@ -276,13 +272,29 @@ void LinkManager::_deleteLink(LinkInterface* link) // Free up the mavlink channel associated with this link _mavlinkChannelsUsedBitMask &= ~(1 << link->mavlinkChannel()); - _links.removeOne(link); - delete link; + for (int i=0; i<_sharedLinks.count(); i++) { + if (_sharedLinks[i].data() == link) { + _sharedLinks.removeAt(i); + break; + } + } // Emit removal of link emit linkDeleted(link); } +SharedLinkInterfacePointer LinkManager::sharedLinkInterfacePointerForLink(LinkInterface* link) +{ + for (int i=0; i<_sharedLinks.count(); i++) { + if (_sharedLinks[i].data() == link) { + return _sharedLinks[i]; + } + } + + qWarning() << "LinkManager::sharedLinkInterfaceForLink returning NULL"; + return SharedLinkInterfacePointer(NULL); +} + /// @brief If all new connections should be suspended a message is displayed to the user and true /// is returned; bool LinkManager::_connectionsSuspendedMsg(void) @@ -328,11 +340,10 @@ void LinkManager::saveLinkConfigurationList() QSettings settings; settings.remove(LinkConfiguration::settingsRoot()); int trueCount = 0; - for (int i = 0; i < _linkConfigurations.count(); i++) { - LinkConfiguration* linkConfig = _linkConfigurations.value(i); + for (int i = 0; i < _sharedConfigurations.count(); i++) { + SharedLinkConfigurationPointer linkConfig = _sharedConfigurations[i]; if (linkConfig) { - if(!linkConfig->isDynamic()) - { + if (!linkConfig->isDynamic()) { QString root = LinkConfiguration::settingsRoot(); root += QString("/Link%1").arg(trueCount++); settings.setValue(root + "/name", linkConfig->name()); @@ -404,7 +415,7 @@ void LinkManager::loadLinkConfigurationList() //-- Have the instance load its own values pLink->setAutoConnect(autoConnect); pLink->loadSettings(settings, root); - _linkConfigurations.append(pLink); + addConfiguration(pLink); linksChanged = true; } } else { @@ -434,12 +445,12 @@ SerialConfiguration* LinkManager::_autoconnectConfigurationsContainsPort(const Q { QString searchPort = portName.trimmed(); - for (int i=0; i<_autoconnectConfigurations.count(); i++) { - SerialConfiguration* linkConfig = _autoconnectConfigurations.value(i); + for (int i=0; i<_sharedAutoconnectConfigurations.count(); i++) { + SerialConfiguration* serialConfig = qobject_cast(_sharedAutoconnectConfigurations[i].data()); - if (linkConfig) { - if (linkConfig->portName() == searchPort) { - return linkConfig; + if (serialConfig) { + if (serialConfig->portName() == searchPort) { + return serialConfig; } } else { qWarning() << "Internal error"; @@ -457,8 +468,8 @@ void LinkManager::_updateAutoConnectLinks(void) // Re-add UDP if we need to bool foundUDP = false; - for (int i=0; i<_links.count(); i++) { - LinkConfiguration* linkConfig = _links.value(i)->getLinkConfiguration(); + for (int i=0; i<_sharedLinks.count(); i++) { + LinkConfiguration* linkConfig = _sharedLinks[i]->getLinkConfiguration(); if (linkConfig->type() == LinkConfiguration::TypeUdp && linkConfig->name() == _defaultUPDLinkName) { foundUDP = true; break; @@ -468,9 +479,9 @@ void LinkManager::_updateAutoConnectLinks(void) qCDebug(LinkManagerLog) << "New auto-connect UDP port added"; UDPConfiguration* udpConfig = new UDPConfiguration(_defaultUPDLinkName); udpConfig->setLocalPort(QGC_UDP_LOCAL_PORT); - udpConfig->setDynamic(true); - _linkConfigurations.append(udpConfig); - createConnectedLink(udpConfig); + udpConfig->setDynamic(true); + SharedLinkConfigurationPointer config = addConfiguration(udpConfig); + createConnectedLink(config); emit linkConfigurationsChanged(); } @@ -482,7 +493,7 @@ void LinkManager::_updateAutoConnectLinks(void) // Android builds only support a single serial connection. Repeatedly calling availablePorts after that one serial // port is connected leaks file handles due to a bug somewhere in android serial code. In order to work around that // bug after we connect the first serial port we stop probing for additional ports. - if (!_autoconnectConfigurations.count()) { + if (!_sharedAutoconnectConfigurations.count()) { portList = QGCSerialPortInfo::availablePorts(); } #else @@ -591,8 +602,8 @@ void LinkManager::_updateAutoConnectLinks(void) pSerialConfig->setBaud(boardType == QGCSerialPortInfo::BoardTypeSikRadio ? 57600 : 115200); pSerialConfig->setDynamic(true); pSerialConfig->setPortName(portInfo.systemLocation()); - _autoconnectConfigurations.append(pSerialConfig); - createConnectedLink(pSerialConfig); + _sharedAutoconnectConfigurations.append(SharedLinkConfigurationPointer(pSerialConfig)); + createConnectedLink(_sharedAutoconnectConfigurations.last()); } } } @@ -607,13 +618,13 @@ void LinkManager::_updateAutoConnectLinks(void) // Now we go through the current configuration list and make sure any dynamic config has gone away QList _confToDelete; - for (int i=0; i<_autoconnectConfigurations.count(); i++) { - SerialConfiguration* linkConfig = _autoconnectConfigurations.value(i); - if (linkConfig) { - if (!currentPorts.contains(linkConfig->portName())) { - if (linkConfig->link()) { - if (linkConfig->link()->isConnected()) { - if (linkConfig->link()->active()) { + for (int i=0; i<_sharedAutoconnectConfigurations.count(); i++) { + SerialConfiguration* serialConfig = qobject_cast(_sharedAutoconnectConfigurations[i].data()); + if (serialConfig) { + if (!currentPorts.contains(serialConfig->portName())) { + if (serialConfig->link()) { + if (serialConfig->link()->isConnected()) { + if (serialConfig->link()->active()) { // We don't remove links which are still connected which have been active with a vehicle on them // even though at this point the cable may have been pulled. Instead we wait for the user to // Disconnect. Once the user disconnects, the link will be removed. @@ -621,7 +632,7 @@ void LinkManager::_updateAutoConnectLinks(void) } } } - _confToDelete.append(linkConfig); + _confToDelete.append(serialConfig); } } else { qWarning() << "Internal error"; @@ -631,7 +642,12 @@ void LinkManager::_updateAutoConnectLinks(void) // Now remove all configs that are gone foreach (LinkConfiguration* pDeleteConfig, _confToDelete) { qCDebug(LinkManagerLog) << "Removing unused autoconnect config" << pDeleteConfig->name(); - _autoconnectConfigurations.removeOne(pDeleteConfig); + for (int i=0; i<_sharedAutoconnectConfigurations.count(); i++) { + if (_sharedAutoconnectConfigurations[i].data() == pDeleteConfig) { + _sharedAutoconnectConfigurations.removeAt(i); + break; + } + } if (pDeleteConfig->link()) { disconnectLink(pDeleteConfig->link()); } @@ -789,7 +805,7 @@ bool LinkManager::endCreateConfiguration(LinkConfiguration* config) { Q_ASSERT(config != NULL); _fixUnnamed(config); - _linkConfigurations.append(config); + addConfiguration(config); saveLinkConfigurationList(); return true; } @@ -883,16 +899,19 @@ void LinkManager::removeConfiguration(LinkConfiguration* config) if(iface) { disconnectLink(iface); } - // Remove configuration - _linkConfigurations.removeOne(config); - delete config; - // Save list + + _removeConfiguration(config); saveLinkConfigurationList(); } bool LinkManager::isAutoconnectLink(LinkInterface* link) { - return _autoconnectConfigurations.contains(link->getLinkConfiguration()); + for (int i=0; i<_sharedAutoconnectConfigurations.count(); i++) { + if (_sharedAutoconnectConfigurations[i].data() == link->getLinkConfiguration()) { + return true; + } + } + return false; } bool LinkManager::isBluetoothAvailable(void) @@ -908,7 +927,7 @@ void LinkManager::_activeLinkCheck(void) if (_activeLinkCheckList.count() != 0) { link = _activeLinkCheckList.takeFirst(); - if (_links.contains(link) && link->isConnected()) { + if (containsLink(link) && link->isConnected()) { // Make sure there is a vehicle on the link QmlObjectListModel* vehicles = _toolbox->multiVehicleManager()->vehicles(); for (int i=0; icount(); i++) { @@ -945,3 +964,45 @@ void LinkManager::_activeLinkCheck(void) } } #endif + +bool LinkManager::containsLink(LinkInterface* link) +{ + for (int i=0; i<_sharedLinks.count(); i++) { + if (_sharedLinks[i].data() == link) { + return true; + } + } + return false; +} + +SharedLinkConfigurationPointer LinkManager::addConfiguration(LinkConfiguration* config) +{ + _qmlConfigurations.append(config); + _sharedConfigurations.append(SharedLinkConfigurationPointer(config)); + return _sharedConfigurations.last(); +} + +void LinkManager::_removeConfiguration(LinkConfiguration* config) +{ + _qmlConfigurations.removeOne(config); + + for (int i=0; i<_sharedConfigurations.count(); i++) { + if (_sharedConfigurations[i].data() == config) { + _sharedConfigurations.removeAt(i); + return; + } + } + + qWarning() << "LinkManager::_removeConfiguration called with unknown config"; +} + +QList LinkManager::links(void) +{ + QList rawLinks; + + for (int i=0; i<_sharedLinks.count(); i++) { + rawLinks.append(_sharedLinks[i].data()); + } + + return rawLinks; +} diff --git a/src/comm/LinkManager.h b/src/comm/LinkManager.h index 23cddcbdf47a25e56bd5f7cd42df288ab4ec28e0..f75fc50f149cf3f0d74fcc5a4e0eed8c8e531b7f 100644 --- a/src/comm/LinkManager.h +++ b/src/comm/LinkManager.h @@ -67,19 +67,12 @@ public: Q_PROPERTY(bool autoconnectPX4Flow READ autoconnectPX4Flow WRITE setAutoconnectPX4Flow NOTIFY autoconnectPX4FlowChanged) Q_PROPERTY(bool autoconnectRTKGPS READ autoconnectRTKGPS WRITE setAutoconnectRTKGPS NOTIFY autoconnectRTKGPSChanged) Q_PROPERTY(bool autoconnectLibrePilot READ autoconnectLibrePilot WRITE setAutoconnectLibrePilot NOTIFY autoconnectLibrePilotChanged) - Q_PROPERTY(bool isBluetoothAvailable READ isBluetoothAvailable CONSTANT) - - /// LinkInterface Accessor - Q_PROPERTY(QmlObjectListModel* links READ links CONSTANT) - /// LinkConfiguration Accessor - Q_PROPERTY(QmlObjectListModel* linkConfigurations READ linkConfigurations NOTIFY linkConfigurationsChanged) - /// List of comm type strings - Q_PROPERTY(QStringList linkTypeStrings READ linkTypeStrings CONSTANT) - /// List of supported baud rates for serial links - Q_PROPERTY(QStringList serialBaudRates READ serialBaudRates CONSTANT) - /// List of comm ports display names + Q_PROPERTY(bool isBluetoothAvailable READ isBluetoothAvailable CONSTANT) + + Q_PROPERTY(QmlObjectListModel* linkConfigurations READ _qmlLinkConfigurations NOTIFY linkConfigurationsChanged) + Q_PROPERTY(QStringList linkTypeStrings READ linkTypeStrings CONSTANT) + Q_PROPERTY(QStringList serialBaudRates READ serialBaudRates CONSTANT) Q_PROPERTY(QStringList serialPortStrings READ serialPortStrings NOTIFY commPortStringsChanged) - /// List of comm ports Q_PROPERTY(QStringList serialPorts READ serialPorts NOTIFY commPortsChanged) // Create/Edit Link Configuration @@ -100,12 +93,11 @@ public: bool autoconnectLibrePilot (void) { return _autoconnectLibrePilot; } bool isBluetoothAvailable (void); - QmlObjectListModel* links (void) { return &_links; } - QmlObjectListModel* linkConfigurations (void) { return &_linkConfigurations; } - QStringList linkTypeStrings (void) const; - QStringList serialBaudRates (void); - QStringList serialPortStrings (void); - QStringList serialPorts (void); + QList links (void); + QStringList linkTypeStrings (void) const; + QStringList serialBaudRates (void); + QStringList serialPortStrings (void); + QStringList serialPorts (void); void setAutoconnectUDP (bool autoconnect); void setAutoconnectPixhawk (bool autoconnect); @@ -132,7 +124,7 @@ public: /// Creates, connects (and adds) a link based on the given configuration instance. /// Link takes ownership of config. - Q_INVOKABLE LinkInterface* createConnectedLink(LinkConfiguration* config); + Q_INVOKABLE LinkInterface* createConnectedLink(SharedLinkConfigurationPointer& config); /// Creates, connects (and adds) a link based on the given configuration name. LinkInterface* createConnectedLink(const QString& name); @@ -165,6 +157,17 @@ public: // Override from QGCTool virtual void setToolbox(QGCToolbox *toolbox); + /// @return This mavlink channel is never assigned to a vehicle. + uint8_t reservedMavlinkChannel(void) { return 0; } + + /// If you are going to hold a reference to a LinkInterface* in your object you must reference count it + /// by using this method to get access to the shared pointer. + SharedLinkInterfacePointer sharedLinkInterfacePointerForLink(LinkInterface* link); + + bool containsLink(LinkInterface* link); + + SharedLinkConfigurationPointer addConfiguration(LinkConfiguration* config); + signals: void autoconnectUDPChanged (bool autoconnect); void autoconnectPixhawkChanged (bool autoconnect); @@ -204,11 +207,13 @@ private slots: #endif private: + QmlObjectListModel* _qmlLinkConfigurations (void) { return &_qmlConfigurations; } bool _connectionsSuspendedMsg(void); void _updateAutoConnectLinks(void); void _updateSerialPorts(); void _fixUnnamed(LinkConfiguration* config); bool _setAutoconnectWorker(bool& currentAutoconnect, bool newAutoconnect, const char* autoconnectKey); + void _removeConfiguration(LinkConfiguration* config); #ifndef NO_SERIAL_LINK SerialConfiguration* _autoconnectConfigurationsContainsPort(const QString& portName); @@ -223,9 +228,11 @@ private: MAVLinkProtocol* _mavlinkProtocol; - QmlObjectListModel _links; - QmlObjectListModel _linkConfigurations; - QmlObjectListModel _autoconnectConfigurations; + + QList _sharedLinks; + QList _sharedConfigurations; + QList _sharedAutoconnectConfigurations; + QmlObjectListModel _qmlConfigurations; QMap _autoconnectWaitList; ///< key: QGCSerialPortInfo.systemLocation, value: wait count QStringList _commPortList; diff --git a/src/comm/LogReplayLink.cc b/src/comm/LogReplayLink.cc index 4a15dd8417a2038158390a5f108afe68f2c1f7e3..d6b818467c7fc1823d7fa9aa650260bc1dd42ffa 100644 --- a/src/comm/LogReplayLink.cc +++ b/src/comm/LogReplayLink.cc @@ -64,12 +64,13 @@ QString LogReplayLinkConfiguration::logFilenameShort(void) return fi.fileName(); } -LogReplayLink::LogReplayLink(LogReplayLinkConfiguration* config) : - _connected(false), - _replayAccelerationFactor(1.0f) +LogReplayLink::LogReplayLink(SharedLinkConfigurationPointer& config) + : LinkInterface(config) + , _logReplayConfig(qobject_cast(config.data())) + , _connected(false) + , _replayAccelerationFactor(1.0f) { - Q_ASSERT(config); - _config = config; + Q_ASSERT(_logReplayConfig); _readTickTimer.moveToThread(this); @@ -184,7 +185,7 @@ quint64 LogReplayLink::_seekToNextMavlinkMessage(mavlink_message_t* nextMsg) bool LogReplayLink::_loadLogFile(void) { QString errorMsg; - QString logFilename = _config->logFilename(); + QString logFilename = _logReplayConfig->logFilename(); QFileInfo logFileInfo; int logDurationSecondsTotal; diff --git a/src/comm/LogReplayLink.h b/src/comm/LogReplayLink.h index 923dfb6373cc6036645bd6f72048b7d162796ff0..2b78756266889b34b67e6c7fa7be7c94e39dec4e 100644 --- a/src/comm/LogReplayLink.h +++ b/src/comm/LogReplayLink.h @@ -57,8 +57,6 @@ class LogReplayLink : public LinkInterface friend class LinkManager; public: - virtual LinkConfiguration* getLinkConfiguration() { return _config; } - /// @return true: log is currently playing, false: log playback is paused bool isPlaying(void) { return _readTickTimer.isActive(); } @@ -111,7 +109,7 @@ private slots: private: // Links are only created/destroyed by LinkManager so constructor/destructor is not public - LogReplayLink(LogReplayLinkConfiguration* config); + LogReplayLink(SharedLinkConfigurationPointer& config); ~LogReplayLink(); void _replayError(const QString& errorMsg); @@ -129,7 +127,7 @@ private: // Virtuals from QThread virtual void run(void); - LogReplayLinkConfiguration* _config; + LogReplayLinkConfiguration* _logReplayConfig; bool _connected; QTimer _readTickTimer; ///< Timer which signals a read of next log record diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index 49c1a1a38e57110eae946dc9b8c940e32a830abb..4fee754823bece8ff6dab81441264a857508ca18 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -159,7 +159,7 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link, QByteArray b) // Since receiveBytes signals cross threads we can end up with signals in the queue // that come through after the link is disconnected. For these we just drop the data // since the link is closed. - if (!_linkMgr->links()->contains(link)) { + if (!_linkMgr->containsLink(link)) { return; } diff --git a/src/comm/MockLink.cc b/src/comm/MockLink.cc index 411287c4d15b6861e47b82b9fe034c63b6b07ba6..6b946f30f137c978f12f06dc260f54a57c86cd1b 100644 --- a/src/comm/MockLink.cc +++ b/src/comm/MockLink.cc @@ -44,8 +44,9 @@ const char* MockConfiguration::_vehicleTypeKey = "VehicleType"; const char* MockConfiguration::_sendStatusTextKey = "SendStatusText"; const char* MockConfiguration::_failureModeKey = "FailureMode"; -MockLink::MockLink(MockConfiguration* config) - : _missionItemHandler(this, qgcApp()->toolbox()->mavlinkProtocol()) +MockLink::MockLink(SharedLinkConfigurationPointer& config) + : LinkInterface(config) + , _missionItemHandler(this, qgcApp()->toolbox()->mavlinkProtocol()) , _name("MockLink") , _connected(false) , _vehicleSystemId(_nextVehicleSystemId++) @@ -67,14 +68,11 @@ MockLink::MockLink(MockConfiguration* config) , _logDownloadCurrentOffset(0) , _logDownloadBytesRemaining(0) { - _config = config; - if (_config) { - _firmwareType = config->firmwareType(); - _vehicleType = config->vehicleType(); - _sendStatusText = config->sendStatusText(); - _failureMode = config->failureMode(); - _config->setLink(this); - } + MockConfiguration* mockConfig = qobject_cast(_config.data()); + _firmwareType = mockConfig->firmwareType(); + _vehicleType = mockConfig->vehicleType(); + _sendStatusText = mockConfig->sendStatusText(); + _failureMode = mockConfig->failureMode(); union px4_custom_mode px4_cm; @@ -782,6 +780,9 @@ void MockLink::_handleFTP(const mavlink_message_t& msg) void MockLink::_handleCommandLong(const mavlink_message_t& msg) { + static bool firstCmdUser3 = true; + static bool firstCmdUser4 = true; + mavlink_command_long_t request; uint8_t commandResult = MAV_RESULT_UNSUPPORTED; @@ -817,7 +818,6 @@ void MockLink::_handleCommandLong(const mavlink_message_t& msg) break; case MAV_CMD_USER_3: // Test command which returns MAV_RESULT_ACCEPTED on second attempt - static bool firstCmdUser3 = true; if (firstCmdUser3) { firstCmdUser3 = false; return; @@ -828,7 +828,6 @@ void MockLink::_handleCommandLong(const mavlink_message_t& msg) break; case MAV_CMD_USER_4: // Test command which returns MAV_RESULT_FAILED on second attempt - static bool firstCmdUser4 = true; if (firstCmdUser4) { firstCmdUser4 = false; return; @@ -1041,12 +1040,12 @@ void MockConfiguration::updateSettings() MockLink* MockLink::_startMockLink(MockConfiguration* mockConfig) { - LinkManager* linkManager = qgcApp()->toolbox()->linkManager(); + LinkManager* linkMgr = qgcApp()->toolbox()->linkManager(); mockConfig->setDynamic(true); - linkManager->linkConfigurations()->append(mockConfig); + SharedLinkConfigurationPointer config = linkMgr->addConfiguration(mockConfig); - return qobject_cast(linkManager->createConnectedLink(mockConfig)); + return qobject_cast(linkMgr->createConnectedLink(config)); } MockLink* MockLink::startPX4MockLink(bool sendStatusText, MockConfiguration::FailureMode_t failureMode) diff --git a/src/comm/MockLink.h b/src/comm/MockLink.h index cdb25373f8f98e3e4bf340f5437190701c9a4264..15e8a5eebdff9b9e37ced799ab0185bf93c24379 100644 --- a/src/comm/MockLink.h +++ b/src/comm/MockLink.h @@ -90,8 +90,7 @@ class MockLink : public LinkInterface Q_OBJECT public: - // LinkConfiguration is optional for MockLink - MockLink(MockConfiguration* config = NULL); + MockLink(SharedLinkConfigurationPointer& config); ~MockLink(void); // MockLink methods @@ -126,8 +125,6 @@ public: bool connect(void); bool disconnect(void); - LinkConfiguration* getLinkConfiguration() { return _config; } - /// Sets a failure mode for unit testing /// @param failureMode Type of failure to simulate void setMissionItemFailureMode(MockLinkMissionItemHandler::FailureMode_t failureMode); @@ -216,7 +213,6 @@ private: uint32_t _mavCustomMode; uint8_t _mavState; - MockConfiguration* _config; MAV_AUTOPILOT _firmwareType; MAV_TYPE _vehicleType; diff --git a/src/comm/SerialLink.cc b/src/comm/SerialLink.cc index 3e345f682a23e24e83eedd5e42ef124f11221236..9e600db18d1256be835e7a0af4e8dba02d3b96f7 100644 --- a/src/comm/SerialLink.cc +++ b/src/comm/SerialLink.cc @@ -30,19 +30,19 @@ QGC_LOGGING_CATEGORY(SerialLinkLog, "SerialLinkLog") static QStringList kSupportedBaudRates; -SerialLink::SerialLink(SerialConfiguration* config) +SerialLink::SerialLink(SharedLinkConfigurationPointer& config) + : LinkInterface(config) + , _port(NULL) + , _bytesRead(0) + , _stopp(false) + , _reqReset(false) + , _serialConfig(qobject_cast(config.data())) { - _bytesRead = 0; - _port = Q_NULLPTR; - _stopp = false; - _reqReset = false; - Q_ASSERT(config != NULL); - _config = config; - _config->setLink(this); - - qCDebug(SerialLinkLog) << "Create SerialLink " << config->portName() << config->baud() << config->flowControl() - << config->parity() << config->dataBits() << config->stopBits(); - qCDebug(SerialLinkLog) << "portName: " << config->portName(); + Q_ASSERT(_serialConfig); + + qCDebug(SerialLinkLog) << "Create SerialLink " << _serialConfig->portName() << _serialConfig->baud() << _serialConfig->flowControl() + << _serialConfig->parity() << _serialConfig->dataBits() << _serialConfig->stopBits(); + qCDebug(SerialLinkLog) << "portName: " << _serialConfig->portName(); } void SerialLink::requestReset() @@ -53,10 +53,10 @@ void SerialLink::requestReset() SerialLink::~SerialLink() { - // Disconnect link from configuration - _config->setLink(NULL); _disconnect(); - if(_port) delete _port; + if (_port) { + delete _port; + } _port = NULL; } @@ -70,7 +70,7 @@ bool SerialLink::_isBootloader() { qCDebug(SerialLinkLog) << "PortName : " << info.portName() << "Description : " << info.description(); qCDebug(SerialLinkLog) << "Manufacturer: " << info.manufacturer(); - if (info.portName().trimmed() == _config->portName() && + if (info.portName().trimmed() == _serialConfig->portName() && (info.description().toLower().contains("bootloader") || info.description().toLower().contains("px4 bl") || info.description().toLower().contains("px4 fmu v1.6"))) { @@ -159,7 +159,7 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString& _port = NULL; } - qCDebug(SerialLinkLog) << "SerialLink: hardwareConnect to " << _config->portName(); + qCDebug(SerialLinkLog) << "SerialLink: hardwareConnect to " << _serialConfig->portName(); // If we are in the Pixhawk bootloader code wait for it to timeout if (_isBootloader()) { @@ -181,7 +181,7 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString& } } - _port = new QSerialPort(_config->portName()); + _port = new QSerialPort(_serialConfig->portName()); QObject::connect(_port, static_cast(&QSerialPort::error), this, &SerialLink::linkError); @@ -219,17 +219,17 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString& _port->setDataTerminalReady(true); qCDebug(SerialLinkLog) << "Configuring port"; - _port->setBaudRate (_config->baud()); - _port->setDataBits (static_cast (_config->dataBits())); - _port->setFlowControl (static_cast (_config->flowControl())); - _port->setStopBits (static_cast (_config->stopBits())); - _port->setParity (static_cast (_config->parity())); + _port->setBaudRate (_serialConfig->baud()); + _port->setDataBits (static_cast (_serialConfig->dataBits())); + _port->setFlowControl (static_cast (_serialConfig->flowControl())); + _port->setStopBits (static_cast (_serialConfig->stopBits())); + _port->setParity (static_cast (_serialConfig->parity())); emit communicationUpdate(getName(), "Opened port!"); emit connected(); - qCDebug(SerialLinkLog) << "Connection SeriaLink: " << "with settings" << _config->portName() - << _config->baud() << _config->dataBits() << _config->parity() << _config->stopBits(); + qCDebug(SerialLinkLog) << "Connection SeriaLink: " << "with settings" << _serialConfig->portName() + << _serialConfig->baud() << _serialConfig->dataBits() << _serialConfig->parity() << _serialConfig->stopBits(); return true; // successful connection } @@ -281,7 +281,7 @@ bool SerialLink::isConnected() const QString SerialLink::getName() const { - return _config->portName(); + return _serialConfig->portName(); } /** @@ -294,7 +294,7 @@ qint64 SerialLink::getConnectionSpeed() const if (_port) { baudRate = _port->baudRate(); } else { - baudRate = _config->baud(); + baudRate = _serialConfig->baud(); } qint64 dataRate; switch (baudRate) @@ -334,11 +334,11 @@ qint64 SerialLink::getConnectionSpeed() const void SerialLink::_resetConfiguration() { if (_port) { - _port->setBaudRate (_config->baud()); - _port->setDataBits (static_cast (_config->dataBits())); - _port->setFlowControl (static_cast (_config->flowControl())); - _port->setStopBits (static_cast (_config->stopBits())); - _port->setParity (static_cast (_config->parity())); + _port->setBaudRate (_serialConfig->baud()); + _port->setDataBits (static_cast (_serialConfig->dataBits())); + _port->setFlowControl (static_cast (_serialConfig->flowControl())); + _port->setStopBits (static_cast (_serialConfig->stopBits())); + _port->setParity (static_cast (_serialConfig->parity())); } } @@ -349,11 +349,6 @@ void SerialLink::_emitLinkError(const QString& errorMsg) emit communicationError(tr("Link Error"), msg.arg(getName()).arg(errorMsg)); } -LinkConfiguration* SerialLink::getLinkConfiguration() -{ - return _config; -} - //-------------------------------------------------------------------------- //-- SerialConfiguration diff --git a/src/comm/SerialLink.h b/src/comm/SerialLink.h index 82b0edee71352da494cf6881d9774fbb75e5e11d..be46a06e93661e5ef2e60f6fa84a045ab47dfac6 100644 --- a/src/comm/SerialLink.h +++ b/src/comm/SerialLink.h @@ -133,7 +133,6 @@ class SerialLink : public LinkInterface public: // LinkInterface - LinkConfiguration* getLinkConfiguration(); QString getName() const; void requestReset(); bool isConnected() const; @@ -168,7 +167,7 @@ private slots: private: // Links are only created/destroyed by LinkManager so constructor/destructor is not public - SerialLink(SerialConfiguration* config); + SerialLink(SharedLinkConfigurationPointer& config); ~SerialLink(); // From LinkInterface @@ -186,7 +185,7 @@ private: volatile bool _reqReset; QMutex _stoppMutex; // Mutex for accessing _stopp QByteArray _transmitBuffer; // An internal buffer for receiving data from member functions and actually transmitting them via the serial port. - SerialConfiguration* _config; + SerialConfiguration* _serialConfig; signals: void aboutToCloseFlag(); diff --git a/src/comm/TCPLink.cc b/src/comm/TCPLink.cc index a57cb61d87483aad406898c7d822383dbf407be1..d540f644496f86160585f1a941f531f695f8fa77 100644 --- a/src/comm/TCPLink.cc +++ b/src/comm/TCPLink.cc @@ -24,16 +24,14 @@ /// /// @author Don Gagne -TCPLink::TCPLink(TCPConfiguration *config) - : _config(config) +TCPLink::TCPLink(SharedLinkConfigurationPointer& config) + : LinkInterface(config) + , _tcpConfig(qobject_cast(config.data())) , _socket(NULL) , _socketIsConnected(false) { - Q_ASSERT(_config != NULL); - // We're doing it wrong - because the Qt folks got the API wrong: - // http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/ + Q_ASSERT(_tcpConfig); moveToThread(this); - //qDebug() << "TCP Created " << _config->name(); } TCPLink::~TCPLink() @@ -69,7 +67,7 @@ void TCPLink::_writeDebugBytes(const QByteArray data) ascii.append(219); } } - qDebug() << "Sent" << size << "bytes to" << _config->address().toString() << ":" << _config->port() << "data:"; + qDebug() << "Sent" << size << "bytes to" << _tcpConfig->address().toString() << ":" << _tcpConfig->port() << "data:"; qDebug() << bytes; qDebug() << "ASCII:" << ascii; } @@ -148,7 +146,7 @@ bool TCPLink::_hardwareConnect() _socket = new QTcpSocket(); QSignalSpy errorSpy(_socket, static_cast(&QTcpSocket::error)); - _socket->connectToHost(_config->address(), _config->port()); + _socket->connectToHost(_tcpConfig->address(), _tcpConfig->port()); QObject::connect(_socket, &QTcpSocket::readyRead, this, &TCPLink::readBytes); QObject::connect(_socket,static_cast(&QTcpSocket::error), @@ -189,7 +187,7 @@ bool TCPLink::isConnected() const QString TCPLink::getName() const { - return _config->name(); + return _tcpConfig->name(); } qint64 TCPLink::getConnectionSpeed() const diff --git a/src/comm/TCPLink.h b/src/comm/TCPLink.h index c67606f583420054e0243bada84fdc52a6b21cb5..9eb2827feb43a947f8ccec9e975e9dff23017050 100644 --- a/src/comm/TCPLink.h +++ b/src/comm/TCPLink.h @@ -121,7 +121,6 @@ class TCPLink : public LinkInterface public: QTcpSocket* getSocket(void) { return _socket; } - virtual LinkConfiguration* getLinkConfiguration() { return _config; } void signalBytesWritten(void); @@ -160,7 +159,7 @@ protected: private: // Links are only created/destroyed by LinkManager so constructor/destructor is not public - TCPLink(TCPConfiguration* config); + TCPLink(SharedLinkConfigurationPointer& config); ~TCPLink(); // From LinkInterface @@ -174,7 +173,7 @@ private: void _writeDebugBytes(const QByteArray data); #endif - TCPConfiguration* _config; + TCPConfiguration* _tcpConfig; QTcpSocket* _socket; bool _socketIsConnected; diff --git a/src/comm/UDPLink.cc b/src/comm/UDPLink.cc index 627c6d282a8ba295c3a2fda584d57841339ae362..51faba4ad34affa7f34a263a8ec69bdfe8d60502 100644 --- a/src/comm/UDPLink.cc +++ b/src/comm/UDPLink.cc @@ -65,27 +65,22 @@ static QString get_ip_address(const QString& address) return QString(""); } -UDPLink::UDPLink(UDPConfiguration* config) - : _socket(NULL) - , _connectState(false) - #if defined(QGC_ZEROCONF_ENABLED) +UDPLink::UDPLink(SharedLinkConfigurationPointer& config) + : LinkInterface(config) +#if defined(QGC_ZEROCONF_ENABLED) , _dnssServiceRef(NULL) - #endif +#endif , _running(false) + , _socket(NULL) + , _udpConfig(qobject_cast(config.data())) + , _connectState(false) { - Q_ASSERT(config != NULL); - _config = config; - _config->setLink(this); - - // We're doing it wrong - because the Qt folks got the API wrong: - // http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/ + Q_ASSERT(_udpConfig); moveToThread(this); } UDPLink::~UDPLink() { - // Disconnect link from configuration - _config->setLink(NULL); _disconnect(); // Tell the thread to exit _running = false; @@ -121,17 +116,17 @@ void UDPLink::_restartConnection() QString UDPLink::getName() const { - return _config->name(); + return _udpConfig->name(); } void UDPLink::addHost(const QString& host) { - _config->addHost(host); + _udpConfig->addHost(host); } void UDPLink::removeHost(const QString& host) { - _config->removeHost(host); + _udpConfig->removeHost(host); } void UDPLink::_writeBytes(const QByteArray data) @@ -143,7 +138,7 @@ void UDPLink::_writeBytes(const QByteArray data) // Send to all connected systems QString host; int port; - if(_config->firstHost(host, port)) { + if(_udpConfig->firstHost(host, port)) { do { QHostAddress currentHost(host); if(_socket->writeDatagram(data, currentHost, (quint16)port) < 0) { @@ -162,10 +157,10 @@ void UDPLink::_writeBytes(const QByteArray data) // unit sent by UDP. _logOutputDataRate(data.size(), QDateTime::currentMSecsSinceEpoch()); } - } while (_config->nextHost(host, port)); + } while (_udpConfig->nextHost(host, port)); //-- Remove hosts that are no longer there foreach (const QString& ghost, goneHosts) { - _config->removeHost(ghost); + _udpConfig->removeHost(ghost); } } } @@ -194,7 +189,7 @@ void UDPLink::readBytes() // added to the list and will start receiving datagrams from here. Even a port scanner // would trigger this. // Add host to broadcast list if not yet present, or update its port - _config->addHost(sender.toString(), (int)senderPort); + _udpConfig->addHost(sender.toString(), (int)senderPort); } //-- Send whatever is left if(databuffer.size()) { @@ -248,7 +243,7 @@ bool UDPLink::_hardwareConnect() QHostAddress host = QHostAddress::AnyIPv4; _socket = new QUdpSocket(); _socket->setProxy(QNetworkProxy::NoProxy); - _connectState = _socket->bind(host, _config->localPort(), QAbstractSocket::ReuseAddressHint | QUdpSocket::ShareAddress); + _connectState = _socket->bind(host, _udpConfig->localPort(), QAbstractSocket::ReuseAddressHint | QUdpSocket::ShareAddress); if (_connectState) { //-- Make sure we have a large enough IO buffers #ifdef __mobile__ @@ -258,7 +253,7 @@ bool UDPLink::_hardwareConnect() _socket->setSocketOption(QAbstractSocket::SendBufferSizeSocketOption, 256 * 1024); _socket->setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, 512 * 1024); #endif - _registerZeroconf(_config->localPort(), kZeroconfRegistration); + _registerZeroconf(_udpConfig->localPort(), kZeroconfRegistration); QObject::connect(_socket, &QUdpSocket::readyRead, this, &UDPLink::readBytes); emit connected(); } else { diff --git a/src/comm/UDPLink.h b/src/comm/UDPLink.h index 1c1c977a9080f3e8a269d8e8b0f38cfbdef8ca8e..df0c58e7360c025946dc74a3de4690aa5ef1440e 100644 --- a/src/comm/UDPLink.h +++ b/src/comm/UDPLink.h @@ -177,10 +177,7 @@ public: bool connect(void); bool disconnect(void); - LinkConfiguration* getLinkConfiguration() { return _config; } - public slots: - /*! @brief Add a new host to broadcast messages to */ void addHost (const QString& host); /*! @brief Remove a host from broadcasting messages to */ @@ -189,23 +186,11 @@ public slots: void readBytes(); private slots: - /*! - * @brief Write a number of bytes to the interface. - * - * @param data Pointer to the data byte array - * @param size The size of the bytes array - **/ void _writeBytes(const QByteArray data); -protected: - - QUdpSocket* _socket; - UDPConfiguration* _config; - bool _connectState; - private: // Links are only created/destroyed by LinkManager so constructor/destructor is not public - UDPLink(UDPConfiguration* config); + UDPLink(SharedLinkConfigurationPointer& config); ~UDPLink(); // From LinkInterface @@ -223,6 +208,9 @@ private: #endif bool _running; + QUdpSocket* _socket; + UDPConfiguration* _udpConfig; + bool _connectState; }; #endif // UDPLINK_H diff --git a/src/comm/XbeeLink.cpp b/src/comm/XbeeLink.cpp deleted file mode 100644 index c3a7b153790bfbc4da8e5453868b385e70f6df95..0000000000000000000000000000000000000000 --- a/src/comm/XbeeLink.cpp +++ /dev/null @@ -1,239 +0,0 @@ -#include -#include -#include -#include -#include -#include "XbeeLink.h" - -XbeeLink::XbeeLink(QString portName, int baudRate) : - m_xbeeCon(NULL), - m_portName(NULL), - m_portNameLength(0), - m_baudRate(baudRate), - m_connected(false), - m_addrHigh(0), - m_addrLow(0) -{ - - /* setup the xbee */ - this->setPortName(portName); -} - -XbeeLink::~XbeeLink() -{ - if(m_portName) - { - delete m_portName; - m_portName = NULL; - } - _disconnect(); -} - -QString XbeeLink::getPortName() const -{ - QString portName; - for(unsigned int i = 0;im_portNameLength;i++) - { - portName.append(this->m_portName[i]); - } - return portName; -} - -int XbeeLink::getBaudRate() const -{ - return this->m_baudRate; -} - -bool XbeeLink::setPortName(QString portName) -{ - bool reconnect(false); - if(this->m_connected) - { - _disconnect(); - reconnect = true; - } - if(m_portName) - { - delete m_portName; - m_portName = NULL; - } - QStringList list = portName.split(QRegExp("\\s+"),QString::SkipEmptyParts); - if(list.size()>0) - { - this->m_portNameLength = list[0].size()+1; - m_portName = new char[this->m_portNameLength]; - for(int i=0;im_portName[i]=list[0][i].toLatin1(); - } - this->m_portName[list[0].size()] = '\0'; - } - else - { - this->m_portNameLength = 1; - m_portName = new char[this->m_portNameLength]; - this->m_portName[0] = '\0'; - } - - bool retVal(true); - if(reconnect) - { - retVal = _connect(); - } - - return retVal; -} - -bool XbeeLink::setBaudRate(int rate) -{ - bool reconnect(false); - if(this->m_connected) - { - _disconnect(); - reconnect = true; - } - bool retVal(true); - this->m_baudRate = rate; - if(reconnect) - { - retVal = _connect(); - } - return retVal; -} - -QString XbeeLink::getName() const -{ - return this->m_name; -} - -bool XbeeLink::isConnected() const -{ - return this->m_connected; -} - -qint64 XbeeLink::getConnectionSpeed() const -{ - return this->m_baudRate; -} - -qint64 XbeeLink::getCurrentInDataRate() const -{ - return 0; -} - -qint64 XbeeLink::getCurrentOutDataRate() const -{ - return 0; -} - -bool XbeeLink::hardwareConnect() -{ - emit tryConnectBegin(true); - if(this->isConnected()) - { - _disconnect(); - } - if (*this->m_portName == '\0') - { - return false; - } - if (xbee_setupAPI(this->m_portName,this->m_baudRate,0x2B,0x3E8) == -1) - { - /* oh no... it failed */ - qDebug() <<"xbee_setup() failed...\n"; - emit tryConnectEnd(true); - return false; - } - this->m_xbeeCon = xbee_newcon('A',xbee2_data,0x13A200,0x403D0935); - emit tryConnectEnd(true); - this->m_connected = true; - emit connected(); - return true; -} - -bool XbeeLink::_connect(void) -{ - if (this->isRunning()) _disconnect(); - this->start(LowPriority); - return true; -} - -void XbeeLink::_disconnect(void) -{ - if(this->isRunning()) this->terminate(); //stop running the thread, restart it upon connect - - if(this->m_xbeeCon) - { - xbee_end(); - this->m_xbeeCon = NULL; - } - this->m_connected = false; - - emit disconnected(); -} - -void XbeeLink::_writeBytes(const QByteArray bytes) -{ - if(!xbee_nsenddata(this->m_xbeeCon,const_cast(bytes.data()),bytes.size())) // return value of 0 is successful written - { - _logOutputDataRate(bytes.size(), QDateTime::currentMSecsSinceEpoch()); - } - else - { - _disconnect(); - emit communicationError(tr("Link Error"), QString("Error on link: %1. Could not send data - link is disconnected!").arg(getName())); - } -} - -void XbeeLink::readBytes() -{ - xbee_pkt *xbeePkt; - xbeePkt = xbee_getpacketwait(this->m_xbeeCon); - if(!(NULL==xbeePkt)) - { - QByteArray data; - for(unsigned int i=0;i<=xbeePkt->datalen;i++) - { - data.push_back(xbeePkt->data[i]); - } - - _logInputDataRate(data.length(), QDateTime::currentMSecsSinceEpoch()); - emit bytesReceived(this, data); - } -} - -void XbeeLink::run() -{ - // Initialize the connection - if(this->hardwareConnect()) - { - // Qt way to make clear what a while(1) loop does - forever - { - this->readBytes(); - } - } -} - -bool XbeeLink::setRemoteAddressHigh(quint32 high) -{ - this->m_addrHigh = high; - return true; -} - -bool XbeeLink::setRemoteAddressLow(quint32 low) -{ - this->m_addrLow = low; - return true; -} - -/* -void CALLTYPE XbeeLink::portCallback(xbee_con *xbeeCon, xbee_pkt *XbeePkt) -{ - QByteArray buf; - for(quint8 i=0;idatalen;i++) - { - buf.push_back(XbeePkt->data[i]); - } - emit bytesReceived(this, buf); -}*/ diff --git a/src/comm/XbeeLink.h b/src/comm/XbeeLink.h deleted file mode 100644 index 02180dd254415dfa0043dbbba2e774c6afe7cdc2..0000000000000000000000000000000000000000 --- a/src/comm/XbeeLink.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef _XBEELINK_H_ -#define _XBEELINK_H_ - -#include -#include -#include -#include -#include -#include -#include "XbeeLinkInterface.h" -#include -#include "CallConv.h" - -class XbeeLink : public XbeeLinkInterface -{ - Q_OBJECT - -public: - XbeeLink(QString portName = "", int baudRate=57600); - ~XbeeLink(); - -public: // virtual functions from XbeeLinkInterface - QString getPortName() const; - void requestReset() { } - int getBaudRate() const; - - // These are left unimplemented in order to cause linker errors which indicate incorrect usage of - // connect/disconnect on link directly. All connect/disconnect calls should be made through LinkManager. - bool connect(void); - bool disconnect(void); - -public slots: // virtual functions from XbeeLinkInterface - bool setPortName(QString portName); - bool setBaudRate(int rate); - bool setRemoteAddressHigh(quint32 high); - bool setRemoteAddressLow(quint32 low); - -public: - // virtual functions from LinkInterface - QString getName() const; - bool isConnected() const; - - // Extensive statistics for scientific purposes - qint64 getConnectionSpeed() const; - qint64 getCurrentOutDataRate() const; - qint64 getCurrentInDataRate() const; - -private slots: // virtual functions from LinkInterface - void _writeBytes(const QByteArray bytes); - -protected slots: // virtual functions from LinkInterface - void readBytes(); - -public: - void run(); // initiating the thread - -protected: - xbee_con *m_xbeeCon; - char *m_portName; - unsigned int m_portNameLength; - int m_baudRate; - bool m_connected; - QString m_name; - quint32 m_addrHigh; - quint32 m_addrLow; - -private: - // From LinkInterface - virtual bool _connect(void); - virtual void _disconnect(void); - - bool hardwareConnect(); - //void CALLTYPE portCallback(xbee_con *XbeeCon, xbee_pkt *XbeePkt); -}; - - -#endif // _XBEELINK_H_ diff --git a/src/comm/XbeeLinkInterface.h b/src/comm/XbeeLinkInterface.h deleted file mode 100644 index d359f579d7a5ab64b58de534f8fd991eb031b448..0000000000000000000000000000000000000000 --- a/src/comm/XbeeLinkInterface.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef XBEELINKINTERFACE_H_ -#define XBEELINKINTERFACE_H_ - -#include -#include -#include - -class XbeeLinkInterface : public LinkInterface -{ - Q_OBJECT - -public: - virtual QString getPortName() const = 0; - virtual int getBaudRate() const = 0; - -public slots: - virtual bool setPortName(QString portName) = 0; - virtual bool setBaudRate(int rate) = 0; - virtual bool setRemoteAddressHigh(quint32 high) = 0; - virtual bool setRemoteAddressLow(quint32 low) = 0; - -signals: - void tryConnectBegin(bool toTrue); - void tryConnectEnd(bool toTrue); -}; - -#endif // XBEELINKINTERFACE_H_ diff --git a/src/qgcunittest/LinkManagerTest.cc b/src/qgcunittest/LinkManagerTest.cc index bc5af5bb3a30eacdb83c1a03275c09760805e4cc..77f4e8b3c5da883e6dca21698ab9da41994ea04b 100644 --- a/src/qgcunittest/LinkManagerTest.cc +++ b/src/qgcunittest/LinkManagerTest.cc @@ -57,29 +57,29 @@ void LinkManagerTest::cleanup(void) void LinkManagerTest::_add_test(void) { Q_ASSERT(_linkMgr); - Q_ASSERT(_linkMgr->links()->count() == 0); + Q_ASSERT(_linkMgr->links().count() == 0); _connectMockLink(); - QCOMPARE(_linkMgr->links()->count(), 1); - QCOMPARE(_linkMgr->links()->value(0), _mockLink); + QCOMPARE(_linkMgr->links().count(), 1); + QCOMPARE(_linkMgr->links().at(0), _mockLink); } void LinkManagerTest::_delete_test(void) { Q_ASSERT(_linkMgr); - Q_ASSERT(_linkMgr->links()->count() == 0); + Q_ASSERT(_linkMgr->links().count() == 0); _connectMockLink(); _disconnectMockLink(); - QCOMPARE(_linkMgr->links()->count(), 0); + QCOMPARE(_linkMgr->links().count(), 0); } void LinkManagerTest::_addSignals_test(void) { Q_ASSERT(_linkMgr); - Q_ASSERT(_linkMgr->links()->count() == 0); + Q_ASSERT(_linkMgr->links().count() == 0); Q_ASSERT(_multiSpy->checkNoSignals() == true); _connectMockLink(); @@ -99,7 +99,7 @@ void LinkManagerTest::_addSignals_test(void) void LinkManagerTest::_deleteSignals_test(void) { Q_ASSERT(_linkMgr); - Q_ASSERT(_linkMgr->links()->count() == 0); + Q_ASSERT(_linkMgr->links().count() == 0); Q_ASSERT(_multiSpy->checkNoSignals() == true); _connectMockLink(); diff --git a/src/qgcunittest/TCPLinkTest.cc b/src/qgcunittest/TCPLinkTest.cc index f1a1835ceffbf63833f1aae05ec7e0224f44a9fc..996951eaf4896760f0839d562227c6e3ecaf7c19 100644 --- a/src/qgcunittest/TCPLinkTest.cc +++ b/src/qgcunittest/TCPLinkTest.cc @@ -17,8 +17,7 @@ #include "TCPLoopBackServer.h" TCPLinkTest::TCPLinkTest(void) - : _config(NULL) - , _link(NULL) + : _link(NULL) , _multiSpy(NULL) { @@ -31,13 +30,12 @@ void TCPLinkTest::init(void) Q_ASSERT(_link == nullptr); Q_ASSERT(_multiSpy == nullptr); - Q_ASSERT(_config == nullptr); - _config = new TCPConfiguration("MockTCP"); - _config->setAddress(QHostAddress::LocalHost); - _config->setPort(5760); - _link = new TCPLink(_config); - Q_ASSERT(_link != NULL); + TCPConfiguration* tcpConfig = new TCPConfiguration("MockTCP"); + tcpConfig->setAddress(QHostAddress::LocalHost); + tcpConfig->setPort(5760); + _sharedConfig = SharedLinkConfigurationPointer(tcpConfig); + _link = new TCPLink(_sharedConfig); _rgSignals[bytesReceivedSignalIndex] = SIGNAL(bytesReceived(LinkInterface*, QByteArray)); _rgSignals[connectedSignalIndex] = SIGNAL(connected(void)); @@ -55,7 +53,6 @@ void TCPLinkTest::cleanup(void) { Q_ASSERT(_multiSpy); Q_ASSERT(_link); - Q_ASSERT(_config); delete _multiSpy; _multiSpy = nullptr; @@ -63,15 +60,13 @@ void TCPLinkTest::cleanup(void) delete _link; _link = nullptr; - delete _config; - _config = nullptr; + _sharedConfig.clear(); UnitTest::cleanup(); } void TCPLinkTest::_connectFail_test(void) { - Q_ASSERT(_config); Q_ASSERT(_link); Q_ASSERT(_multiSpy); Q_ASSERT(_multiSpy->checkNoSignals() == true); @@ -110,7 +105,8 @@ void TCPLinkTest::_connectSucceed_test(void) Q_ASSERT(_multiSpy->checkNoSignals() == true); // Start the server side - TCPLoopBackServer* server = new TCPLoopBackServer(_config->address(), _config->port()); + TCPConfiguration* tcpConfig = qobject_cast(_sharedConfig.data()); + TCPLoopBackServer* server = new TCPLoopBackServer(tcpConfig->address(), tcpConfig->port()); Q_CHECK_PTR(server); // Connect to the server diff --git a/src/qgcunittest/TCPLinkTest.h b/src/qgcunittest/TCPLinkTest.h index 196da6ef02839d9f35630ee500281ab3125c94d3..e34d993da7fe78ff4de0b361eeb02233d4938e8d 100644 --- a/src/qgcunittest/TCPLinkTest.h +++ b/src/qgcunittest/TCPLinkTest.h @@ -60,11 +60,11 @@ private: //deleteLinkSignalMask = 1 << deleteLinkSignalIndex, }; - TCPConfiguration* _config; - TCPLink* _link; - MultiSignalSpy* _multiSpy; - static const size_t _cSignals = maxSignalIndex; - const char* _rgSignals[_cSignals]; + SharedLinkConfigurationPointer _sharedConfig; + TCPLink* _link; + MultiSignalSpy* _multiSpy; + static const size_t _cSignals = maxSignalIndex; + const char* _rgSignals[_cSignals]; }; #endif diff --git a/src/ui/QGCMAVLinkLogPlayer.cc b/src/ui/QGCMAVLinkLogPlayer.cc index 22267f376ba0cf3f90a91f90221acefdb55f55f4..55f26ec585b6f1823b3af25fdc28fffb94071c9a 100644 --- a/src/ui/QGCMAVLinkLogPlayer.cc +++ b/src/ui/QGCMAVLinkLogPlayer.cc @@ -85,7 +85,10 @@ void QGCMAVLinkLogPlayer::_selectLogFileForPlayback(void) linkConfig->setLogFilename(logFilename); linkConfig->setName(linkConfig->logFilenameShort()); _ui->logFileNameLabel->setText(linkConfig->logFilenameShort()); - _replayLink = (LogReplayLink*)qgcApp()->toolbox()->linkManager()->createConnectedLink(linkConfig); + + LinkManager* linkMgr = qgcApp()->toolbox()->linkManager(); + SharedLinkConfigurationPointer sharedConfig = linkMgr->addConfiguration(linkConfig); + _replayLink = (LogReplayLink*)qgcApp()->toolbox()->linkManager()->createConnectedLink(sharedConfig); connect(_replayLink, &LogReplayLink::logFileStats, this, &QGCMAVLinkLogPlayer::_logFileStats); connect(_replayLink, &LogReplayLink::playbackStarted, this, &QGCMAVLinkLogPlayer::_playbackStarted); diff --git a/src/ui/XbeeConfigurationWindow.cpp b/src/ui/XbeeConfigurationWindow.cpp deleted file mode 100644 index 847ab8e93dd22c73cfcd2962f7f775015b022e5a..0000000000000000000000000000000000000000 --- a/src/ui/XbeeConfigurationWindow.cpp +++ /dev/null @@ -1,444 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 -//#include -#include -#endif - -#if defined (__APPLE__) && defined (__MACH__) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __MWERKS__ -#define __CF_USE_FRAMEWORK_INCLUDES__ -#endif - - -#include - -#include -#include -#if defined(MAC_OS_X_VERSION_10_3) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3) -#include -#endif -#include - -// Apple internal modems default to local echo being on. If your modem has local echo disabled, -// undefine the following macro. -#define LOCAL_ECHO - -#define kATCommandString "AT\r" - -#ifdef LOCAL_ECHO -#define kOKResponseString "AT\r\r\nOK\r\n" -#else -#define kOKResponseString "\r\nOK\r\n" -#endif -#endif - - -// Some helper functions for serial port enumeration -#if defined (__APPLE__) && defined (__MACH__) - -enum { - kNumRetries = 3 -}; - -// Function prototypes -static kern_return_t FindModems(io_iterator_t *matchingServices); -static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPath, CFIndex maxPathSize); - -// Returns an iterator across all known modems. Caller is responsible for -// releasing the iterator when iteration is complete. -static kern_return_t FindModems(io_iterator_t *matchingServices) -{ - kern_return_t kernResult; - CFMutableDictionaryRef classesToMatch; - - /*! @function IOServiceMatching - @abstract Create a matching dictionary that specifies an IOService class match. - @discussion A very common matching criteria for IOService is based on its class. IOServiceMatching will create a matching dictionary that specifies any IOService of a class, or its subclasses. The class is specified by C-string name. - @param name The class name, as a const C-string. Class matching is successful on IOService's of this class or any subclass. - @result The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. */ - - // Serial devices are instances of class IOSerialBSDClient - classesToMatch = IOServiceMatching(kIOSerialBSDServiceValue); - if (classesToMatch == NULL) { - printf("IOServiceMatching returned a NULL dictionary.\n"); - } else { - /*! - @function CFDictionarySetValue - Sets the value of the key in the dictionary. - @param theDict The dictionary to which the value is to be set. If this - parameter is not a valid mutable CFDictionary, the behavior is - undefined. If the dictionary is a fixed-capacity dictionary and - it is full before this operation, and the key does not exist in - the dictionary, the behavior is undefined. - @param key The key of the value to set into the dictionary. If a key - which matches this key is already present in the dictionary, only - the value is changed ("add if absent, replace if present"). If - no key matches the given key, the key-value pair is added to the - dictionary. If added, the key is retained by the dictionary, - using the retain callback provided - when the dictionary was created. If the key is not of the sort - expected by the key retain callback, the behavior is undefined. - @param value The value to add to or replace into the dictionary. The value - is retained by the dictionary using the retain callback provided - when the dictionary was created, and the previous value if any is - released. If the value is not of the sort expected by the - retain or release callbacks, the behavior is undefined. - */ - CFDictionarySetValue(classesToMatch, - CFSTR(kIOSerialBSDTypeKey), - CFSTR(kIOSerialBSDModemType)); - - // Each serial device object has a property with key - // kIOSerialBSDTypeKey and a value that is one of kIOSerialBSDAllTypes, - // kIOSerialBSDModemType, or kIOSerialBSDRS232Type. You can experiment with the - // matching by changing the last parameter in the above call to CFDictionarySetValue. - - // As shipped, this sample is only interested in modems, - // so add this property to the CFDictionary we're matching on. - // This will find devices that advertise themselves as modems, - // such as built-in and USB modems. However, this match won't find serial modems. - } - - /*! @function IOServiceGetMatchingServices - @abstract Look up registered IOService objects that match a matching dictionary. - @discussion This is the preferred method of finding IOService objects currently registered by IOKit. IOServiceAddNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up. - @param masterPort The master port obtained from IOMasterPort(). - @param matching A CF dictionary containing matching information, of which one reference is consumed by this function. IOKitLib can contruct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOOpenFirmwarePathMatching. - @param existing An iterator handle is returned on success, and should be released by the caller when the iteration is finished. - @result A kern_return_t error code. */ - - kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, classesToMatch, matchingServices); - if (KERN_SUCCESS != kernResult) { - printf("IOServiceGetMatchingServices returned %d\n", kernResult); - goto exit; - } - -exit: - return kernResult; -} - -/** Given an iterator across a set of modems, return the BSD path to the first one. - * If no modems are found the path name is set to an empty string. - */ -static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPath, CFIndex maxPathSize) -{ - io_object_t modemService; - kern_return_t kernResult = KERN_FAILURE; - Boolean modemFound = false; - - // Initialize the returned path - *bsdPath = '\0'; - - // Iterate across all modems found. In this example, we bail after finding the first modem. - - while ((modemService = IOIteratorNext(serialPortIterator)) && !modemFound) { - CFTypeRef bsdPathAsCFString; - - // Get the callout device's path (/dev/cu.xxxxx). The callout device should almost always be - // used: the dialin device (/dev/tty.xxxxx) would be used when monitoring a serial port for - // incoming calls, e.g. a fax listener. - - bsdPathAsCFString = IORegistryEntryCreateCFProperty(modemService, - CFSTR(kIOCalloutDeviceKey), - kCFAllocatorDefault, - 0); - if (bsdPathAsCFString) { - Boolean result; - - // Convert the path from a CFString to a C (NUL-terminated) string for use - // with the POSIX open() call. - - result = CFStringGetCString((CFStringRef)bsdPathAsCFString, - bsdPath, - maxPathSize, - kCFStringEncodingUTF8); - CFRelease(bsdPathAsCFString); - - if (result) { - //printf("Modem found with BSD path: %s", bsdPath); - modemFound = true; - kernResult = KERN_SUCCESS; - } - } - - printf("\n"); - - // Release the io_service_t now that we are done with it. - - (void) IOObjectRelease(modemService); - } - - return kernResult; -} -#endif - -XbeeConfigurationWindow::XbeeConfigurationWindow(LinkInterface* link, QWidget *parent, Qt::WindowFlags flags): QWidget(parent, flags), - userConfigured(false) -{ - XbeeLinkInterface *xbeeLink = dynamic_cast(link); - - if(xbeeLink != 0) - { - this->link = xbeeLink; - - baudLabel = new QLabel; - baudLabel->setText(tr("Baut Rate")); - baudBox = new QComboBox; - baudLabel->setBuddy(baudBox); - portLabel = new QLabel; - portLabel->setText(tr("SerialPort")); - portBox = new QComboBox; - portBox->setEditable(true); - portLabel->setBuddy(portBox); - highAddrLabel = new QLabel; - highAddrLabel->setText(tr("Remote hex Address &High")); - highAddr = new HexSpinBox(this); - highAddrLabel->setBuddy(highAddr); - lowAddrLabel = new QLabel; - lowAddrLabel->setText(tr("Remote hex Address &Low")); - lowAddr = new HexSpinBox(this); - lowAddrLabel->setBuddy(lowAddr); - actionLayout = new QGridLayout; - actionLayout->addWidget(baudLabel,1,1); - actionLayout->addWidget(baudBox,1,2); - actionLayout->addWidget(portLabel,2,1); - actionLayout->addWidget(portBox,2,2); - actionLayout->addWidget(highAddrLabel,3,1); - actionLayout->addWidget(highAddr,3,2); - actionLayout->addWidget(lowAddrLabel,4,1); - actionLayout->addWidget(lowAddr,4,2); - tmpLayout = new QVBoxLayout; - tmpLayout->addStretch(); - tmpLayout->addLayout(actionLayout); - xbeeLayout = new QHBoxLayout; - xbeeLayout->addStretch(); - xbeeLayout->addLayout(tmpLayout); - this->setLayout(xbeeLayout); - - //connect(portBox,SIGNAL(activated(QString)),this,SLOT(setPortName(QString))); - //connect(baudBox,SIGNAL(activated(QString)),this,SLOT(setBaudRateString(QString))); - connect(portBox,SIGNAL(currentIndexChanged(QString)),this,SLOT(setPortName(QString))); - connect(portBox,SIGNAL(editTextChanged(QString)),this,SLOT(setPortName(QString))); - connect(baudBox,SIGNAL(currentIndexChanged(QString)),this,SLOT(setBaudRateString(QString))); - connect(highAddr,SIGNAL(valueChanged(int)),this,SLOT(addrChangedHigh(int))); - connect(lowAddr,SIGNAL(valueChanged(int)),this,SLOT(addrChangedLow(int))); - connect(this,SIGNAL(addrHighChanged(quint32)),xbeeLink,SLOT(setRemoteAddressHigh(quint32))); - connect(this,SIGNAL(addrLowChanged(quint32)),xbeeLink,SLOT(setRemoteAddressLow(quint32))); - - baudBox->addItem("1200",1200); - baudBox->addItem("2400",2400); - baudBox->addItem("4800",4800); - baudBox->addItem("9600",9600); - baudBox->addItem("19200",19200); - baudBox->addItem("38400",38400); - baudBox->addItem("57600",57600); - baudBox->setCurrentIndex(6); - - // try to open xbeeConf file for last remote address - QFile in("Xbeeconf.txt"); - if(in.open(QIODevice::ReadOnly)) - { - QDataStream inStr(&in); - int tmpaddrHigh; - int tmpaddrLow; - inStr >> tmpaddrHigh; - inStr >> tmpaddrLow; - highAddr->setValue(tmpaddrHigh); - lowAddr->setValue(tmpaddrLow); - } - else - { - highAddr->setValue(0x13A200); - lowAddr->setValue(0x40DDDDDD); - } - - - - this->setupPortList(); - - portCheckTimer = new QTimer(this); - portCheckTimer->setInterval(1000); - connect(portCheckTimer, SIGNAL(timeout()), this, SLOT(setupPortList())); - - // Display the widget - this->window()->setWindowTitle(tr("Xbee Communication Settings")); - } - else - { - qDebug() << "This is not a Xbee Link"; - } -} - -XbeeConfigurationWindow::~XbeeConfigurationWindow() -{ - -} - -void XbeeConfigurationWindow::setupPortList() -{ - #ifdef __linux - - // TODO Linux has no standard way of enumerating serial ports - // However the device files are only present when the physical - // device is connected, therefore listing the files should be - // sufficient. - - QString devdir = "/dev"; - QDir dir(devdir); - dir.setFilter(QDir::System); - - QFileInfoList list = dir.entryInfoList(); - for (int i = 0; i < list.size(); ++i) { - QFileInfo fileInfo = list.at(i); - if (fileInfo.fileName().contains(QString("ttyUSB")) || fileInfo.fileName().contains(QString("ttyS"))) { - if (portBox->findText(fileInfo.canonicalFilePath()) == -1) { - portBox->addItem(fileInfo.canonicalFilePath()); - if (!userConfigured) portBox->setEditText(fileInfo.canonicalFilePath()); - } - } - } -#endif - -#if defined (__APPLE__) && defined (__MACH__) - - // Enumerate serial ports - //int fileDescriptor; - kern_return_t kernResult; // on PowerPC this is an int (4 bytes) - - io_iterator_t serialPortIterator; - char bsdPath[MAXPATHLEN]; - - kernResult = FindModems(&serialPortIterator); - - kernResult = GetModemPath(serialPortIterator, bsdPath, sizeof(bsdPath)); - - IOObjectRelease(serialPortIterator); // Release the iterator. - - // Add found modems - if (bsdPath[0]) { - if (portBox->findText(QString(bsdPath)) == -1) { - portBox->addItem(QString(bsdPath)); - if (!userConfigured) portBox->setEditText(QString(bsdPath)); - } - } - - // Add USB serial port adapters - // TODO Strangely usb serial port adapters are not enumerated, even when connected - QString devdir = "/dev"; - QDir dir(devdir); - dir.setFilter(QDir::System); - - QFileInfoList list = dir.entryInfoList(); - for (int i = list.size() - 1; i >= 0; i--) { - QFileInfo fileInfo = list.at(i); - if (fileInfo.fileName().contains(QString("ttyUSB")) || fileInfo.fileName().contains(QString("ttyS")) || fileInfo.fileName().contains(QString("tty.usbserial"))) { - if (portBox->findText(fileInfo.canonicalFilePath()) == -1) { - portBox->addItem(fileInfo.canonicalFilePath()); - if (!userConfigured) portBox->setEditText(fileInfo.canonicalFilePath()); - } - } - } - - -#endif - -#ifdef _WIN32 - // Get the ports available on this system - QList ports = QSerialPortInfo::availablePorts(); - //QList ports = QextSerialEnumerator::getPorts(); - - // Add the ports in reverse order, because we prepend them to the list - for (int i = ports.size() - 1; i >= 0; i--) { - QString portString = QString(ports.at(i).portName().toLocal8Bit().constData()); - // Prepend newly found port to the list - if (portBox->findText(portString) == -1) { - portBox->insertItem(0, portString); - if (!userConfigured) portBox->setEditText(portString); - } - } - - //printf("port name: %s\n", ports.at(i).portName.toLocal8Bit().constData()); - //printf("friendly name: %s\n", ports.at(i).friendName.toLocal8Bit().constData()); - //printf("physical name: %s\n", ports.at(i).physName.toLocal8Bit().constData()); - //printf("enumerator name: %s\n", ports.at(i).enumName.toLocal8Bit().constData()); - //printf("===================================\n\n"); -#endif -} - -void XbeeConfigurationWindow::showEvent(QShowEvent* event) -{ - Q_UNUSED(event); - portCheckTimer->start(); -} - -void XbeeConfigurationWindow::hideEvent(QHideEvent* event) -{ - Q_UNUSED(event); - portCheckTimer->stop(); -} - -void XbeeConfigurationWindow::configureCommunication() -{ - this->setupPortList(); - this->show(); -} - -void XbeeConfigurationWindow::setPortName(QString port) -{ - link->setPortName(port); -} - -void XbeeConfigurationWindow::setBaudRateString(QString baud) -{ - int rate = baud.toInt(); - this->link->setBaudRate(rate); -} - -void XbeeConfigurationWindow::addrChangedHigh(int addr) -{ - quint32 uaddr = static_cast(addr); - QFile out("Xbeeconf.txt"); - if(out.open(QIODevice::WriteOnly)) - { - QDataStream outStr(&out); - outStr << this->highAddr->value(); - outStr << this->lowAddr->value(); - } - emit addrHighChanged(uaddr); -} - -void XbeeConfigurationWindow::addrChangedLow(int addr) -{ - quint32 uaddr = static_cast(addr); - QFile out("Xbeeconf.txt"); - if(out.open(QIODevice::WriteOnly)) - { - QDataStream outStr(&out); - outStr << this->highAddr->value(); - outStr << this->lowAddr->value(); - } - emit addrLowChanged(uaddr); -} diff --git a/src/ui/XbeeConfigurationWindow.h b/src/ui/XbeeConfigurationWindow.h deleted file mode 100644 index 1a6f233fd03c3fd292590f0cb413360e672a15d8..0000000000000000000000000000000000000000 --- a/src/ui/XbeeConfigurationWindow.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef _XBEECONFIGURATIONWINDOW_H_ -#define _XBEECONFIGURATIONWINDOW_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include"XbeeLinkInterface.h" -#include "HexSpinBox.h" - - -class XbeeConfigurationWindow : public QWidget -{ - Q_OBJECT - -public: - XbeeConfigurationWindow(LinkInterface* link, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Sheet); - ~XbeeConfigurationWindow(); - -public slots: - void configureCommunication(); - void setPortName(QString port); - void setBaudRateString(QString baud); - void setupPortList(); - -private slots: - void addrChangedHigh(int addr); - void addrChangedLow(int addr); - -protected: - void showEvent(QShowEvent* event); - void hideEvent(QHideEvent* event); - bool userConfigured; ///< Switch to detect if current values are user-selected and shouldn't be overriden - -private: - QLabel *portLabel; - QLabel *baudLabel; - QComboBox *portBox; - QComboBox *baudBox; - QGridLayout *actionLayout; - QHBoxLayout *xbeeLayout; - QVBoxLayout *tmpLayout; - XbeeLinkInterface* link; - QTimer* portCheckTimer; - HexSpinBox* highAddr; - HexSpinBox* lowAddr; - QLabel* highAddrLabel; - QLabel* lowAddrLabel; - -signals: - void addrHighChanged(quint32 addrHigh); - void addrLowChanged(quint32 addrLow); -}; - - -#endif //_XBEECONFIGURATIONWINDOW_H_