Project import
diff --git a/arm-linux-a5s.cache b/arm-linux-a5s.cache new file mode 100644 index 0000000..633c969 --- /dev/null +++ b/arm-linux-a5s.cache
@@ -0,0 +1,4 @@ +glib_cv_stack_grows=no +glib_cv_uscore=no +ac_cv_func_posix_getpwuid_r=yes +ac_cv_func_posix_getgrgid_r=yes
diff --git a/bluez/AUTHORS b/bluez/AUTHORS new file mode 100644 index 0000000..4cb3d63 --- /dev/null +++ b/bluez/AUTHORS
@@ -0,0 +1,82 @@ +Maxim Krasnyansky <maxk@qualcomm.com> +Marcel Holtmann <marcel@holtmann.org> +Stephen Crane <steve.crane@rococosoft.com> +Jean Tourrilhes <jt@hpl.hp.com> +Jan Beutel <j.beutel@ieee.org> +Ilguiz Latypov <ilatypov@superbt.com> +Thomas Moser <thomas.moser@tmoser.ch> +Nils Faerber <nils@kernelconcepts.de> +Martin Leopold <martin@leopold.dk> +Wolfgang Heidrich <wolfgang.heidrich@esk.fhg.de> +Fabrizio Gennari <fabrizio.gennari@philips.com> +Brad Midgley <bmidgley@xmission.com> +Henryk Ploetz <henryk@ploetzli.ch> +Philip Blundell <pb@nexus.co.uk> +Johan Hedberg <johan.hedberg@intel.com> +Claudio Takahasi <claudio.takahasi@indt.org.br> +Eduardo Rocha <eduardo.rocha@indt.org.br> +Denis Kenzior <denis.kenzior@trolltech.com> +Frederic Dalleau <frederic.dalleau@access-company.com> +Frederic Danis <frederic.danis@access-company.com> +Luiz Augusto von Dentz <luiz.dentz@gmail.com> +Fabien Chevalier <fabchevalier@free.fr> +Ohad Ben-Cohen <ohad@bencohen.org> +Daniel Gollub <dgollub@suse.de> +Tom Patzig <tpatzig@suse.de> +Kai Vehmanen <kai.vehmanen@nokia.com> +Vinicius Gomes <vinicius.gomes@openbossa.org> +Alok Barsode <alok.barsode@azingo.com> +Bastien Nocera <hadess@hadess.net> +Albert Huang <albert@csail.mit.edu> +Glenn Durfee <gdurfee@google.com> +David Woodhouse <david.woodhouse@intel.com> +Christian Hoene <hoene@uni-tuebingen.de> +Pekka Pessi <pekka.pessi@nokia.com> +Siarhei Siamashka <siarhei.siamashka@nokia.com> +Nick Pelly <npelly@google.com> +Lennart Poettering <lennart@poettering.net> +Gustavo Padovan <gustavo@padovan.org> +Marc-Andre Lureau <marc-andre.lureau@nokia.com> +Bea Lam <bea.lam@nokia.com> +Zygo Blaxell <zygo.blaxell@xandros.com> +Forrest Zhao <forrest.zhao@intel.com> +Scott Talbot <psyc@stalbot.com> +Ilya Rubtsov <lusyaru@gmail.com> +Mario Limonciello <mario_limonciello@dell.com> +Filippo Giunchedi <filippo@esaurito.net> +Jaikumar Ganesh <jaikumar@google.com> +Elvis Pfutzenreuter <epx@signove.com> +Santiago Carot-Nemesio <scarot@libresoft.es> +José Antonio Santos Cadenas <jcaden@libresoft.es> +Francisco Alecrim <francisco.alecrim@openbossa.org> +Daniel Orstadius <daniel.orstadius@gmail.com> +Anderson Briglia <anderson.briglia@openbossa.org> +Anderson Lizardo <anderson.lizardo@openbossa.org> +Bruna Moreira <bruna.moreira@openbossa.org> +Brian Gix <bgix@codeaurora.org> +Andre Guedes <andre.guedes@openbossa.org> +Sheldon Demario <sheldon.demario@openbossa.org> +Lucas De Marchi <lucas.demarchi@profusion.mobi> +Szymon Janc <szymon.janc@tieto.com> +Syam Sidhardhan <s.syam@samsung.com> +Paulo Alcantara <pcacjr@gmail.com> +Jefferson Delfes <jefferson.delfes@openbossa.org> +Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> +Eder Ruiz Maria <eder.ruiz@openbossa.org> +Mikel Astiz <mikel.astiz@bmw-carit.de> +Chan-yeol Park <chanyeol.park@samsung.com> +João Paulo Rechi Vita <jprvita@gmail.com> +Larry Junior <larry.junior@openbossa.org> +Raymond Liu <raymond.liu@intel.com> +Radoslaw Jablonski <ext-jablonski.radoslaw@nokia.com> +Rafal Michalski <michalski.raf@gmail.com> +Dmitriy Paliy <dmitriy.paliy@nokia.com> +Bartosz Szatkowski <bulislaw@linux.com> +Lukasz Pawlik <lucas.pawlik@gmail.com> +Slawomir Bochenski <lkslawek@gmail.com> +Wayne Lee <waynelee@qualcomm.com> +Ricky Yuen <ryuen@qualcomm.com> +Takashi Sasai <sasai@sm.sony.co.jp> +Andre Dieb Martins <andre.dieb@signove.com> +Cristian Rodríguez <crrodriguez@opensuse.org> +Alex Deymo <deymo@chromium.org>
diff --git a/bluez/COPYING b/bluez/COPYING new file mode 100644 index 0000000..6d45519 --- /dev/null +++ b/bluez/COPYING
@@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE 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. + + 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 +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This 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 Library General +Public License instead of this License.
diff --git a/bluez/COPYING.LIB b/bluez/COPYING.LIB new file mode 100644 index 0000000..1f7c8cc --- /dev/null +++ b/bluez/COPYING.LIB
@@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + +
diff --git a/bluez/ChangeLog b/bluez/ChangeLog new file mode 100644 index 0000000..989c8a3 --- /dev/null +++ b/bluez/ChangeLog
@@ -0,0 +1,1907 @@ +ver 5.17: + Fix issue with not resetting OBEX SRM setup. + Fix issue with BR/EDR devices and auto-connect list. + Fix issue with bonding complete detection as peripheral. + Fix issue with not updating bearer timestamp of connections. + Fix issue with paired property for multiple bearers. + Add support for Android Bluetooth Handsfree interface. + Add support for Android Bluetooth Wideband speech. + +ver 5.16: + Fix issue with HID over GATT physical location. + Fix issue with HID over GATT unique identifier. + Fix issue with missing paired property notification. + Fix issue with endianess of long term key storage. + Add support for storing signature resolving keys. + Add support for Android Bluetooth AVRCP interface. + +ver 5.15: + Fix issue with LE enabling and background scanning. + Fix issue with HID over GATT input device name. + Fix issue with storage of slave long term keys. + Add support for handling identity resolving keys. + Add support for Android Bluetooth A2DP interface. + Add support for Android Bluetooth audio interface. + +ver 5.14: + Fix issue with marking PS3 controllers as trusted. + Fix issue with authorization of PS3 controllers. + Add support for DualShock 4 controller detection. + Add support for legacy pairing emulation. + Add support for secure simple pairing emulation. + Add support for automated pairing testing. + Add support for RFCOMM protocol testing. + Add support for HCI controller testing. + +ver 5.13: + Fix issue with PS3 controller detection. + Add support for data transfers to L2CAP testing tool. + Add support for delay reporting to AVDTP testing tool. + Add support for Android Bluetooth Core interface. + Add support for Android Bluetooth Socket interface. + Add support for Android Bluetooth HID Host interface. + Add support for Android Bluetooth PAN interface. + +ver 5.12: + Fix issue with missing reply to DisconnectProfile. + Fix issue with icon property and class of device changes. + Fix issue with HID devices when SDP record is not available. + Fix issue with handling auto-pairing of printers. + Fix issue with agent authorization handling. + Add support for PS3 controller setup and pairing. + Add support for LE L2CAP CoC test capabilities. + Add support for AVDTP qualification test cases. + Add support for SMP cryptographic test cases. + +ver 5.11: + Fix issue with connection attempt when not powered. + Fix issue with assigning player to AVRCP target role. + Fix issue with OBEX default cache directory. + Fix issue with SDP search error handling. + Fix issue with processing of SDP records. + Fix issue with HID to HCI switching utility. + Fix issue with mgmt end-to-end testing tool. + Fix issue with L2CAP end-to-end testing tool. + Add support for SMP end-to-end testing tool. + Add support for more Wii controllers. + +ver 5.10: + Fix issue with discoverable timeout handling. + Fix issue with MAP messages and record version. + Fix issue with MAP messages and status events. + Fix issue with MAP messages and relative folders. + Fix issue with MAP messages and type property signals. + Fix issue with transfer size for OBEX GET operations. + Fix issue with AVRCP service class identifier. + Fix issue with AVRCP tracking seeked signal. + Add support for OBEX command line client. + +ver 5.9: + Fix issue with network service and adapter removal. + Fix issue with misleading OBEX error messages. + Fix issue with OBEX transport reference handling. + Fix issue with memory leak with MAP event handler. + Fix issue with missing MAP property changed signal. + Fix issue with message type property values. + Fix issue with empty UUID list for devices. + Fix issue with profile agent cancel method. + Remove dependency on USB library. + +ver 5.8: + Fix issue with missing OBEX session properties. + Fix issue with missing SDP service refresh. + Fix issue with SDP attribute range check. + Fix issue with priority for SDP transactions. + Fix issue with service discovery after pairing. + Fix issue with race condition in service list. + Fix issue with input service state transition. + Fix issue with default authorization for profiles. + Fix issue with AVRCP browsing channel connections. + Add support for AVRCP role agnostic sessions. + +ver 5.7: + Fix issue with missing UUID discovery during pairing. + Fix issue with broken patch for SDP range check handling. + Fix issue with AVRCP usage of UID=0 for paused/stopped. + Add support MAP notification dispatching. + +ver 5.6: + Fix issue with incoming connections without SDP record. + Fix issue with canceling ongoing device connections. + Fix issue with handling failed connection attempts. + Fix issue with pending resume during A2DP open failures. + Fix issue with registering AVRCP unsupported notification. + Fix issue with listing available AVRCP target settings. + Fix issue with missing error for OBEX SetPath commands. + Fix issue with missing OBEX session command queue. + Fix issue with retrieving multiple MAP event reports. + Add support for command line player utility. + +ver 5.5: + Fix issue with race condition between SDP and properties. + Fix issue with handling storage of private device addresses. + Fix issue with NFC out-of-band pairing and power states. + Fix issue with short name during device update handling. + Fix issue with handling AVRCP without A2DP being present. + Add support for handling AVRCP pass-through operations. + Add support for automatically reconnecting HID devices. + Add support for automatically pairing of devices. + +ver 5.4: + Fix issue with invalid memory access and SDP service search. + Add support for available player changed event for controller. + Add support for UIDs changed event for AVRCP controller. + Add support for mandatory AVRCP pass-through operations. + Add support for Message Notification Service (MNS) server. + Add support for agent methods within command line client. + +ver 5.3: + Fix issue with registering invalid profiles. + Fix issue with inconsistent A2DP transport state. + Fix issue with A2DP resume while in configured state. + Fix issue with buffer overflow when processing SDP response. + Fix issue with missing range check for SDP attribute response. + Fix issue with missing validation of SDP data elements. + Fix issue with missing fallback to static hostname. + Fix issue with default adapter assignment. + +ver 5.2: + Fix issue with connection handling for Low Energy. + Fix issue with broken device discovery handling. + Fix issue with invalid memory access within A2DP. + Fix issue with handling empty path name of SetPath. + Fix issue with handling Message Access Profile filters. + Fix issue with handling network service unregistration. + Fix issue with not handling bogus device pairing results. + Fix issue with initial service discovery and profile manager. + Add support for AVRCP volume notifications. + Add support for AVRCP browsing commands. + +ver 5.1: + Fix issue with crash when removing OBEX session. + Fix issue with HID device disconnected from kernel. + Fix issue with buffer overflow when parsing HID SDP record. + Fix issue with SDP_TEXT_STR16 and SDP_URL_STR16 parsing. + Add support for integration with systemd's hostname daemon. + Add support for separate adapter alias property. + Add support for adapter and device modalias properties. + Add support for official BlueZ device information. + Add support for asynchronous management interface handling. + Add tool for testing management interface compliance. + Add tool for testing SDP qualification requirements. + Add tool for testing various EIR and AD data records. + +ver 5.0: + Introduce D-Bus Properties and ObjectManager interfaces. + Add support for generic profile interface. + Add support for global agent interface. + Add support for integrated OBEX daemon. + Add support for integrated hcidump utility. + Add support for Bluetooth tracing and monitor utility. + Add support for Bluetooth command line client utility. + Remove support for Handsfree gateway handling. + Remove support for GStreamer A2DP and SBC elements. + Disable default installation of Bluetooth library. + +ver 4.101: + Fix issue with missing BlueZ service file. + Fix issue with aborting A2DP setup during AVDTP start. + Fix issue with handling of multiple A2DP indication. + Fix issue with handling AVDTP abort with invalid SEID. + Fix issue with rejecting AVDTP abort commands. + Add support for handling AVDTP command collision. + +ver 4.100: + Fix issue with crashing when SCO connection fails. + Fix issue with HFP gateway failing on first GSM connection. + Fix issue with AVRCP and handling of vendor commands. + Fix issue with handling AVRCP subunit info command. + Fix issue with missing capability for AVRCP track reached end. + Fix issue with AVDTP signaling and GStreamer SBC NULL check. + Fix issue with AVDTP Reconfigure Reject message. + Fix issue with incorrect EIR length parsing. + Fix issue with SDP disconnect for HIDSDPDisable. + Fix issue with SDP interoperability with Mac OS X Lion. + Fix issue with reverse SDP discovery with some devices. + Fix issue with discovering state during power off operation. + Add support for AVRCP Volume Changed notifications. + Add support for AVRCP Set Absolute Volume handling. + Add support for display legacy PIN code agent method. + Add support for multiple media transports per endpoint. + Add support for discovering device information characteristics. + Add support for vendor source for Device ID setting. + Add support for immediate alert server. + Add support for link loss server. + + Notes: + This version requires D-Bus 1.4 or later. + This version requires GLib 2.28 or later. + +ver 4.99: + Fix issue with missing retries for BNEP connection setup. + Fix issue with not showing name if first EIR has no details. + Fix issue with running SDP discovery for LE devices. + Add support for GATT using 128-bit Bluetooth UUIDs. + Add support for retrieving key size information. + Add support for storing Long Term Keys. + Add support for Proximity Reporter API. + Add support for KeyboardDisplay IO capability. + Add support for version 1.0 of management API. + Add support for monitoring interface. + +ver 4.98: + Fix issue with adapter list upon initialization failure. + Fix issue with missing legacy property for Low Energy. + Fix issue with missing EIR information handling. + Fix issue with device address type tracking. + Fix issue with alert level characteristic. + Fix issue with headset shutdown handling. + Fix issue with Wiimote address handling. + Add support for advanced l2test options. + Add support for attribute protocol and multiple adapters. + +ver 4.97: + Update support for proximity profile. + Fix issue with SBC audio decoding quality. + Fix multiple issues with HFP support. + Fix multiple issues with A2DP support. + Fix multiple issues with AVDTP support. + Fix multiple issues with AVRCP support. + Add support for AVRCP meta-data transfer. + Add support for Bluetooth based thermometers. + +ver 4.96: + Fix issue with race condition in AVDTP stream start. + Fix issue with global adapter offline switching. + Fix issue with pairing and No Bonding devices. + Add support for Nintendo Wii Remote pairing. + +ver 4.95: + Fix issue with AVCTP replies with invalid PID. + Fix issue with AVRCP and unknown packet types. + Fix issue with AVRCP not using NOT_IMPLEMENTED correctly. + Fix issue with AVDTP discovery if all endpoints are in use. + Fix issue with invalid memory writes and media support. + Fix issue with not removing device alias and unbonding. + Fix issue with device disconnects and offline mode handling. + Add support for setting adapter name based on machine-info. + Add support for systemd service configuration. + +ver 4.94: + Fix issue with invalid read of memory in various modules. + Fix issue with buffer overflow when sending AVDTP commands. + Fix issue with response to vendor dependent AVRCP commands. + Fix issue with headset when not able to reply with ERROR. + Fix issue with crash when creating a device from storage. + Fix issue with handling non UTF-8 devices names. + Add support for improved discovery procedure. + +ver 4.93: + Fix issue with property type and Health Main channel. + Fix issue with crash when removing devices. + Add support for hid2hci and udev integration. + +ver 4.92: + Fix issue with handling of A2DP suspend response. + Fix issue with crashing when acquiring A2DP stream. + Fix issue with missing check for valid SCO before shutdown. + Fix issue with waiting for POLLERR when disconnecting SCO. + Fix issue with disconnect after primary service discovery. + Fix issue with attribute interface registration. + Add support for primary services over BR/EDR. + Add support for flushable packets of A2DP media. + +ver 4.91: + Fix issue with LMP version string and hciconfig. + Fix issue with missing discovery signal when scanning. + Fix issue with wrong state and canceling name resolving. + Fix issue with missing check during adapter initialization. + Fix issue with missing protocol not supported error and A2DP. + Fix issue with crash during driver unregistering and A2DP. + Fix issue with crash when receiving AVDTP close command. + Fix issue with remote SEP handling when A2DP codec changes. + Fix issue with SCO hangup handling and state changes. + Fix issue with security level and MCAP instances. + Fix issue with memory leak and HDP data channels. + Add support for discover characteristics by UUID to gatttool. + Add initial support for Out-of-Band association model. + Add initial support for SIM Access Profile. + +ver 4.90: + Fix issue with setting of global mode property. + Fix issue with handling of RequestSession responses. + Fix issue with TP_BNEP_CTRL_BV_01_C qualification test. + Fix issue with too short AVDTP request timeout. + Add support for SIM Access Profile manager. + Add support for new UUID utility functions. + Add support for attribute server notifications. + Add support for client characteristic configuration. + Update support for interactive GATT utility. + +ver 4.89: + Fix issue with name resolving when discovery is suspended. + Fix issue with parsing flags of advertising report. + Fix issue with SEP handling if interface is disabled. + Fix issue with device object creation on disconnect event. + Fix issue with indicators whenever the driver is initialized. + Fix issue with call indicator when parsing call info reply. + Fix issue with crash and allowed GATT MTU was too large. + Add support for SDP record of Primary GATT services. + Add support for interactive mode for GATT utility. + +ver 4.88: + Fix issue with HID channel reference count handling. + Fix issue with daemon exit on badly formatted AT+VTS. + Fix issue with crash while parsing of endpoint properties. + Fix issue with possible crash on AVDTP Suspend request timeout. + Fix issue with stopping inquiry before adapter is initialized. + Fix issue with creating device object when connection fails. + Fix issue with sending HCIDEVUP when adapter is already up. + Fix issue with handling bonding IO channel closing. + Fix agent cancellation in security mode 3 situations. + Update pairing code to support management interface. + +ver 4.87: + Fix issue with initialization when adapter is already up. + Fix issue with attribute server MTU and incoming connections. + Fix issue with duplicate characteristics after discovery. + +ver 4.86: + Revert wrong fix for SDP PDU size error response. + Fix various memory leaks in A2DP and AVDTP support. + Add Routing property to MediaTransport interface + Add proper tracking mechanism to NREC status. + Add READ_BLOB_REQUEST support to attribute server. + +ver 4.85: + Fix issue with event mask setting for older adapters. + Fix issue with device creation and pairing failures. + Add support for telephony support via oFono. + Add support for characteristic security level. + Update support for service registration. + +ver 4.84: + Fix issue with wrong parameters and device found signals. + Fix issue with leaking EIR data if RSSI does not change. + Fix issue with adapter initialization state. + Fix issue with closing of SDP server sockets. + +ver 4.83: + Fix issue with already connected HFP/HSP endpoints. + Fix missing reply when create device is canceled. + Fix memory leak within the attribute server. + Fix memory leak with unused extended inquiry name. + Fix setting paired state when device->authr is false. + Fix clearing authentication request for renewed keys. + Add support for storing link keys in runtime memory. + Update support for primary service discovery. + +ver 4.82: + Fix crash with mmap of files with multiples of page size. + Fix HFP response and hold (AT+BTRH) command response. + Fix device creation error response when powered off. + Fix device removal when connecting/browsing fails. + Add initial attribute permission implementation. + Add AVDTP SRC stream send buffer size verification. + Add support for setting link policy based on features. + +ver 4.81: + Fix issue with telephony driver initialization. + Fix issue with adapter services list initialization. + Fix crash after simultaneous authentication requests. + Add support for primary service search on device creation. + +ver 4.80: + Fix legacy link key storing for some buggy adapters. + Fix invalid memory access when EIR field length is zero. + Fix adapter initialization to wait for kernel HCI commands. + Fix initialization of adapters which are already up. + Fix possible race condition when initializing adapters. + Fix possible crashes when attempting to connect AVDTP. + Fix not aborting sink stream configuration on disconnect. + Fix not indicating disconnected state when connecting to AVDTP. + Fix not dropping AVDTP session when canceling stream setup. + Fix AVDTP abort not being send when the state is idle. + Fix regression with Low Energy and interleave discovery. + Add a new configuration option to disable Low Energy support. + Add iwmmxt optimization for SBC for ARM PXA series CPUs. + Update support for GATT Primary Service Discovery. + Update MCAP and HDP support. + +ver 4.79: + Fix issue with adapter initialization race condition. + Update new Bluetooth Management interface support. + +ver 4.78: + Fix various issues with AVDTP timer handling. + Fix various issues with handling of mode changes. + Fix issue with audio disconnect watch in connecting state. + Fix issue with handling call waiting indicators in telephony. + Fix issue with handling UUID parameter and RegisterEndpoint. + Add initial support for Bluetooth Management interface. + Add support for Application property to HealthChannel. + +ver 4.77: + Fix issue with device name and accessing already freed memory. + Fix issue with handling CHLD=0 command for handsfree. + Fix issue with manager properties and no adapters. + Fix issue with properties and broken service records. + Fix issue with A2DP playback and sample rate changes. + Update MCAP and HDP support. + +ver 4.76: + Fix issue in telephony driver with hanging up held call. + Fix issue in telephony driver with notifications when on hold. + Fix issue with blocking on setconf confirmation callback. + Fix issue with not always signaling new streams as sinks. + Fix issue with errors in case of endpoint request timeout. + Fix issue with HFP/HSP microphone and speaker gain values. + Add source if the device attempt to configure local sink stream. + Add PSM option for GATT/ATT over BR/EDR on gatttool. + Add support for GATT/ATT Attribute Write Request. + Update MCAP and HDP support. + +ver 4.75: + Fix use of uninitialized variable on legacy pairing. + Fix mismatch of attribute protocol opcode. + +ver 4.74: + Fix regression for Legacy Pairing. + Fix wrong PSM value for attribute protocol. + Fix issue with RSSI field in advertising reports. + Add support for Add BR/EDR and LE interleaved discovery. + Add support for GATT write characteristic value option. + Add support for specifying download address for AR300x. + +ver 4.73: + Fix problem with EIR data when setting the name. + Fix reading local name from command complete event. + Fix registering local endpoints with disabled socket interface. + Add support for more HCI operations using ops infrastructure. + Add support for GATT characteristic hierarchy. + Add support for GATT indications. + +ver 4.72: + Fix memory leak while connecting BTIO channels. + Fix crash with GStreamer plugin if SBC is not supported. + Fix issue with GATT server stop sending notifications. + Fix issue with GATT and dealing with the minimum MTU size. + Fix issue with file descriptor leak in GATT client. + Add support for UUID 128-bit handling in attribute client. + Add support for encoders/decoders for MTU Exchange. + Add support for the MTU Exchange procedure to the server. + Add support for a per channel MTU to the ATT server. + Add support for Characteristic interface. + Add support for new Media API and framework. + Add initial support for HDP plugin. + +ver 4.71: + Fix compilation when SBC support in not enabled. + Fix crash with RequestSession and application disconnects. + Fix memory leak and possible crash when removing audio device. + Fix issue with closing stream of locked sep when reconfiguring. + Fix issue where discovery could interfere with bonding. + Fix issue with Connected status when PS3 BD remote connects. + Fix issue with lifetime of fake input devices. + Add support for compile time option of oui.txt path. + Add support for printing IEEE1284 device ID for CUPS. + Add plugin for setting adapter class via DMI. + Add more features for attribute protocol and profile. + Add initial support for MCAP. + +ver 4.70: + Fix incoming call indication handling when in WAITING state. + Fix various SDP related qualification test case issues. + Fix logic to write EIR when SDP records are changed. + Fix UTF-8 validity check for remote names in EIR. + Add support for UUID-128 extended inquiry response. + Add service UUIDs from EIR to the DeviceFound signal. + Add fast connectable feature for Handsfree profile. + Add HCI command and event definitions for AMP support. + Add firmware download support for Qualcommh devices. + Add host level support for Atheros AR300x device. + Add initial support of ATT and GATT for basic rate. + +ver 4.69: + Fix issue with calling g_option_context_free() twice. + Fix inconsistencies with initial LE commands and events. + Add support for telephony ClearLastNumber method. + Add support for network server interface. + +ver 4.68: + Fix initialization of adapters in RAW mode. + Fix signal strength for HFP in Maemo's telephony support. + Add support for following the radio state via Maemo's MCE. + Add initial set of LE commands and events definitions. + Add mode option for L2CAP sockets to the BtIO API. + +ver 4.67: + Fix issue with authentication reply when bonding already completed. + Fix issue with not canceling authentication when bonding fails. + Fix issue with changed combination keys and temporary storage. + Fix issue with sdp_get_supp_feat library function. + Fix issue with missing unblock on device removal. + Fix issue with not waiting for mode change completion. + Add ARMv6 optimized version of analysis filter for SBC encoder. + +ver 4.66: + Fix regression with full debug enabling via SIGUSR2. + Fix redundant speaker/microphone gains being sent. + Fix not emitting PropertyChanged for SpeakerGain/MicrophoneGain. + Fix issue with storage usage when a record is not found in memory. + Fix issue with DiscoverServices not retrieving any records. + Fix audio profile disconnection order to match whitepaper. + Fix auto-accept confirmation when local agent has NoInputNoOutput. + Fix remote just-works SSP when MITM protection is required. + Fix performing dedicated bonding without MITM requirement. + Add support for storing debug link keys in runtime memory. + +ver 4.65: + Fix issues with general bonding being default setting now. + Fix driver removal upon device removal. + Add new "Blocked" property to device objects. + Add hciconfig support for blacklisting. + Add support for dynamic debug feature. + +ver 4.64: + Fix invalid memory access in headset_get_nrec function. + Fix issue with disconnect event on higher protocol layers. + Fix issue with list parsing in sdp_set_supp_features function. + Fix device object reference counting for SDP browse requests. + Add missing memory checks whenever memory is allocated for SDP. + Add support for exporting local services via D-Bus. + Add more L2CAP Enhanced Retransmission test options. + +ver 4.63: + Fix avdtp_abort not canceling pending requests. + Fix stale connection when abort gets rejected. + +ver 4.62: + Fix accidental symbol breakage with inquiry transmit power. + Fix using invalid data from previous headset connection. + Fix double free on AVDTP Abort response. + Fix possible crash while verifying AVDTP version. + Fix missing inuse flag when AVDTP stream is configured. + Add support for Bluetooth controller types. + +ver 4.61: + Fix issues with Read Inquiry Response Transmit Power Level. + Fix possible invalid read when removing a temporary device. + Fix mode restoration when remember_powered is false. + Fix conference call releasing in telephony-maemo. + Fix segmentation fault with authorization during headset disconnects. + Add support for handling unanswered AVDTP request on disconnect. + Add support for handling Inquiry Response Transmit Power Level. + Add support for caching of remote host features. + Add preliminary voice dialing support for HSP. + +ver 4.60: + Fix voice mailbox number reading from SIM. + Fix some races with D-Bus mainloop integration. + Add helpers for D-Bus signal watches. + +ver 4.59: + Add values for Bluetooth 4.0 specification. + Add SDP functions for HDP support. + Add test scripts for input and audio. + Fix missing close on BtIO create_io function. + Fix sending incorrect AVDTP commands after timeout occurs. + Fix timer removal when device disconnects unexpectedly. + Fix Extended Inquiry Response record for Device ID. + +ver 4.58: + Fix crash when adapter agent exists during authentication. + Fix CK-20W quirks for play and pause events. + +ver 4.57: + Fix unloading of drivers for uninitialized adapters. + Fix debug message to use requested and not opened SEID. + Fix codec selection for GStreamer plugin. + Fix deleting of SDP records during service updates. + Fix deleting of SDP records when a device is removed. + Fix handling when the SDP record is modified on remote device. + Fix potential buffer overflow by using snprintf instead of sprintf. + Fix const declarations for some storage function parameters. + +ver 4.56: + Add missing values from Bluetooth 3.0 specification. + Add proper tracking of device paired status. + Fix tracking of devices without permanently stored link key. + Fix issue with link key removal after connection failures. + Fix legacy pairing information based on remote host features. + Fix off-by-one issue with AVDTP capability parsing. + Fix AVRCP, AVCTP, AVDTP, A2DP and HFP version numbers. + Fix agent canceling before calling agent_destroy. + Fix service record parsing with an empty UUID list. + Fix various SDP related memory leaks. + +ver 4.55: + Add support for POSIX capabilities dropping. + Add special quirk for the Nokia CK-20W car kit. + Fix error code handling for AVDTP SetConfiguration response. + Fix updating out of range list when RSSI hasn't changed. + Fix various memory leaks and unnecessary error checks. + +ver 4.54: + Add introspection interface to output of introspection calls. + Fix stream handling when media transport disconnects prematurely. + Fix command timeout handling when there's no stream. + Fix headset_suspend_stream behavior for invalid states + Fix issue with AVDTP ABORTING state transition. + Fix issue with AVDTP suspend while closing. + +ver 4.53: + Fix issue with telephony connection state notifications. + Fix AVDTP stream leak for invalid media transport config. + Fix audio connection authorization handling with timeouts. + Fix race condition in authorizing audio connections. + Fix device authorized setting for AVRCP-only connections. + Fix duplicate attempts from device to connect signal channel. + +ver 4.52: + Add AVCTP support to test utility. + Fix AVDTP Abort when transport closes before response. + Fix authorization when the audio profiles are slow to connect. + Fix potential AVDTP reference leaks. + +ver 4.51: + Add utility for basic AVDTP testing. + Add support for configuring L2CAP FCS option. + Fix discovery mode for CUPS 1.4.x and later. + Fix global state tracking of audio service. + Fix last issues with the new build system. + +ver 4.50: + Fix issue with missing manual pages in distribution. + Fix issue with the configuration and state directories. + Fix issue with creating include directory. + Fix dependencies of include file generation. + +ver 4.49: + Add simple test program for basic GAP testing. + Add support for confirmation requests to agent example. + Add support for full non-recursive build. + Add five millisecond delay for Simple Pairing auto-accept. + Fix Class of Device setting when InitiallyPowered=false. + +ver 4.48: + Add library function for comparing UUID values. + Add support for creating all plugins as builtins. + Add support for async handling of service class changes. + Add support for source interface to audio IPC. + Fix device name settings when device is off or down. + Fix issue with enabled SCO server when not necessary. + Fix missing D-Bus access policy for CUPS backend. + Fix discovery results of CUPS backend. + Fix initialization handling of Maemo telephony. + +ver 4.47: + Add support for RFKILL unblock handling. + Add support for serial proxy configurations. + Add support for caching service class updates. + Fix issues with updating SDP service records. + Fix usage of limited discoverable mode. + Remove deprecated methods and signals for AudioSource. + +ver 4.46: + Add support for A2DP sink role. + Fix clearing svc_cache before the adapter is up. + Fix various pointer after free usages. + Fix various memory leaks. + +ver 4.45: + Fix UDEV_DATADIR fallback if pkg-config fails. + Fix adapter cleanup and setup prototypes. + Fix double-free with out-of-range devices. + Fix inband ring setting to be per-headset. + Fix handling of Maemo CSD startup. + +ver 4.44: + Add some missing manual pages. + Fix missing number prefix when installing udev rules. + Fix program prefix used in Bluetooth udev rules. + Fix three-way calling indicator order. + Fix downgrade/upgrade of callheld indicator. + Fix +CIEV sending when indicator value changes. + Fix signal handling for Maemo telephony driver. + Fix parsing issues with messages from Maemo CSD. + Fix issue with duplicate active calls. + +ver 4.43: + Add support for udev based on-demand startup. + Fix verbose error reporting of CUPS backend. + Fix various string length issues. + Fix issues with Maemo telephony driver. + Fix another device setup and temporary flag issue. + Fix and update example agent implementation. + +ver 4.42: + Add TI WL1271 to Texas Instruments chip list. + Add special udev mode to bluetoothd. + Fix regression when there is no agent registered. + Fix error return when bonding socket hang up. + Fix SCO server socket for HFP handsfree role. + Fix shutdown on SCO socket before closing. + Fix shutdown on A2DP audio stream channel before closing. + Fix issue with asserting on AVDTP reference count bugs. + Fix authorization denied issue with certain headsets. + Fix AVRCP UNITINFO and SUBUNIT INFO responses. + Fix discovery cancel issues in case SDP discovery fails. + +ver 4.41: + Fix pairing even if the ACL gets dropped before successful SDP. + Fix regression which caused device to be removed after pairing. + Fix HSP record fetching when remote device doesn't support it. + Fix SDP discovery canceling when clearing hs->pending. + Fix headset never connecting on the first attempt. + Fix headset state tracking if bt_search_service() fails. + Fix maximum headset connection count check. + Fix AVDTP Discover timeout handling. + Fix also UI_SET_KEYBIT for the new pause and play key codes. + +ver 4.40: + Add telephony driver for oFono telephony stack. + Add support for Dell specific HID proxy switching. + Add support for running hid2hci from udev. + Add mapping for AVRCP Play and Pause to dedicated key codes. + Fix AVRCP keycodes to better match existing X keymap support. + Fix various quoting issues within telephony support. + Fix memory allocation issue when generating PDUs for SDP. + Fix race condition on device removal. + Fix non-cancelable issue with CreateDevice method. + Fix non-working CancelDiscovery method call. + +ver 4.39: + Add workaround for dealing with unknown inquiry complete. + Fix discovering when using software scheduler. + Fix wrong NoInputNoOutput IO capability string. + Fix race condition with agent during pairing. + Fix agent cancellation for security mode 3 acceptor failure. + Fix temporary flag removal when device creation fails. + Fix hciattach to use ppoll instead of poll. + Fix service class update when adapter is down. + Fix service classes race condition during startup. + Fix release of audio client before freeing the device. + +ver 4.38: + Add support for builtin plugins. + Add framework for adapter operations. + Add constants for Enhanced Retransmission modes. + Fix HCI socket leak in device_remove_bonding. + Fix various format string issues. + Fix crashes with various free functions. + Fix issues with Headset and A2DP drivers to load again. + Fix sending AVRCP button released passthrough messages + Fix bug which prevent input devices to work after restart. + Fix issue with interpretation of UUID-128 as channel. + +ver 4.37: + Add version value for Bluetooth 3.0 devices. + Add additional L2CAP extended feature mask bits. + Add support for loading plugins in priority order. + Add support for more detailed usage of disconnect watches. + Add support for AVRCP volume control. + Add saturated clipping of SBC decoder output to 16-bit. + Fix potentially infinite recursion of adapter_up. + Fix SCO handling in the case of an incoming call. + Fix input service to use confirm callback. + Fix cleanup of temporary device entries from storage. + +ver 4.36: + Add proper tracking of AVCTP connect attempts. + Add support to channel pattern in Serial interface. + Fix A2DP sink crash if removing device while connecting. + Fix error handling if HFP indicators aren't initialized. + Fix segfault while handling an incoming SCO connection. + Fix Serial.Disconnect to abort connection attempt. + +ver 4.35: + Add support for Handsfree profile headset role. + Add additional checks for open SEIDs from clients. + Fix device removal while audio IPC client is connected. + Fix device removal when an authorization request is pending. + Fix incoming AVDTP connect while authorization in progress. + Fix disconnection timers for audio support. + Fix various potential NULL pointer deferences. + Fix callheld indicator value for multiple calls. + Fix voice number type usage. + Fix GDBus watch handling. + +ver 4.34: + Add support for version checks of plugins. + Add support for class property on adapter interface. + Add support for second SDP attempt after connection reset. + Add support for more detailed audio states. + Add support for HFP+A2DP auto connection feature. + Add support for new and improved audio IPC. + Add program for testing audio IPC interface. + Fix various AVDTP qualification related issues. + Fix broken SDP AttributeIdList parsing. + Fix invalid memory access of SDP URL handling. + Fix local class of device race conditions. + Fix issue with periodic inquiry on startup. + Fix missing temporary devices in some situations. + Fix SBC alignment issue for encoding with four subbands. + +ver 4.33: + Add Paired property to the DeviceFound signals. + Add support for Headset profile 1.2 version. + Fix broken network configuration when IPv6 is disabled. + Fix network regression that caused disconnection. + Fix SDP truncation of strings with NULL values. + Fix service discovery handling of CUPS helper. + +ver 4.32: + Fix broken SDP record handling. + Fix SDP data buffer parsing. + Fix more SDP memory leaks. + Fix read scan enable calls. + Fix A2DP stream handling. + +ver 4.31: + Add support for new BtIO helper library. + Fix AVDTP session close issue. + Fix SDP memory leaks. + Fix various uninitialized memory issues. + Fix duplicate signal emissions. + Fix property changes request handling. + Fix class of device storage handling. + +ver 4.30: + Add CID field to L2CAP socket address structure. + Fix reset of authentication requirements after bonding. + Fix storing of link keys when using dedicated bonding. + Fix storing of pre-Bluetooth 2.1 link keys. + Fix resetting trust settings on every reboot. + Fix handling of local name changes. + Fix memory leaks in hciconfig and hcitool + +ver 4.29: + Use AVRCP version 1.0 for now. + Decrease AVDTP idle timeout to one second. + Delay AVRCP connection when remote device connects A2DP. + Add workaround for AVDTP stream setup with broken headsets. + Add missing three-way calling feature bit for Handsfree. + Fix handsfree callheld indicator updating. + Fix parsing of all AT commands within the buffer. + Fix authentication replies when disconnected. + Fix handling of debug combination keys. + Fix handling of changed combination keys. + Fix handling of link keys when using no bonding. + Fix handling of invalid/unknown authentication requirements. + Fix closing of L2CAP raw socket used for dedicated bonding. + +ver 4.28: + Add AVDTP signal fragmentation support. + Add more SBC performance optimizations. + Add more SBC audio quality improvements. + Use native byte order for audio plugins. + Set the adapter alias only after checking the EIR data. + Fix auto-disconnect issue with explicit A2DP connections. + Fix invalid memory access of ALSA plugin. + Fix compilation with -Wsign-compare. + +ver 4.27: + Add more SBC optimization (MMX and ARM NEON). + Add BT_SECURITY and BT_DEFER_SETUP definitions. + Add support for deferred connection setup. + Add support for fragmentation of data packets. + Add option to trigger dedicated bonding. + Follow MITM requirements from remote device. + Require MITM for dedicated bonding if capabilities allow it. + Fix IO capabilities for non-pairing and pairing cases. + Fix no-bonding connections in non-bondable mode. + Fix new pairing detection with SSP. + Fix bonding with pre-2.1 devices and newer kernels. + Fix LIAC setting while toggling Pairable property. + Fix device creation for incoming security mode 3 connects. + Fix crash within A2DP with bogus pointer. + Fix issue with sdp_copy_record() function. + Fix crash with extract_des() if sdp_uuid_extract() fails. + +ver 4.26: + Use of constant shift in SBC quantization code. + Add possibility to analyze 4 blocks at once in encoder. + Fix correct handling of frame sizes in the encoder. + Fix for big endian problems in SBC codec. + Fix audio client socket to always be non-blocking. + Update telephony support for Maemo. + +ver 4.25: + Fix receiving data over the audio control socket. + Fix subbands selection for joint-stereo in SBC encoder. + Add new SBC analysis filter function. + +ver 4.24: + Fix signal emissions when removing adapters. + Fix missing adapter signals on exit. + Add support for bringing adapters down on exit. + Add support for RememberPowered option. + Add support for verbose compiler warnings. + Add more options to SBC encoder. + +ver 4.23: + Update audio IPC for better codec handling. + Fix bitstream optimization for SBC encoder. + Fix length header values of IPC messages. + Fix multiple coding style violations. + Fix FindDevice to handle temporary devices. + Add configuration option for DeviceID. + Add support for InitiallyPowered option. + Add missing signals for manager properties. + Add telephony support for Maemo. + +ver 4.22: + Add deny statements to D-Bus access policy. + Add support for LegacyPairing property. + Add support for global properties. + Add more commands to telephony testing script. + Add sender checks for serial and network interfaces. + Remove deprecated methods and signals from input interface. + Remove deprecated methods and signals from network interface. + Remove OffMode option and always use device down. + +ver 4.21: + Fix adapter initialization logic. + Fix adapter setup and start security manager early. + Fix usage issue with first_init variable. + +ver 4.20: + Cleanup session handling. + Cleanup mode setting handling. + Fix issue with concurrent audio clients. + Fix issue with HFP/HSP suspending. + Fix AT result code syntax handling. + Add Handsfree support for AT+NREC. + Add PairableTimeout adapter property. + +ver 4.19: + Fix installation of manual pages for old daemons. + Fix D-Bus signal emmissions for CreateDevice. + Fix issues with UUID probing. + Fix +BSRF syntax issue. + Add Pairable adapter property. + Add sdp_copy_record() library function. + +ver 4.18: + Fix release before close issue with RFCOMM TTYs. + Fix Connected property on input interface. + Fix DeviceFound signals during initial name resolving. + Fix service discovery handling. + Fix duplicate UUID detection. + Fix SBC gain mismatch and decoding handling. + Add more options to SBC encoder and decoder. + Add special any adapter object for service interface. + Add variable prefix to adapter and device object paths. + +ver 4.17: + Fix SBC encoder not writing last frame. + Fix missing timer for A2DP suspend. + Add more supported devices to hid2hci utility. + Add additional functionality to Handsfree support. + +ver 4.16: + Fix wrong parameter usage of watch callbacks. + Fix parameters for callback upon path removal. + Fix unloading of adapter drivers. + +ver 4.15: + Fix various A2DP state machine issues. + Fix some issues with the Handsfree error reporting. + Fix format string warnings with recent GCC versions. + Remove dependency on GModule. + +ver 4.14: + Fix types of property arrays. + Fix potential crash with input devices. + Fix PS3 BD remote input event generation. + Allow dynamic adapter driver registration. + Update udev rules. + +ver 4.13: + Fix service discovery and UUID handling. + Fix bonding issues with Simple Pairing. + Fix file descriptor misuse of SCO connections. + Fix various memory leaks in the device handling. + Fix AVCTP disconnect handling. + Fix GStreamer modes for MP3 encoding. + Add operator selection to Handsfree support. + +ver 4.12: + Fix crash with missing icon value. + Fix error checks of HAL plugin. + Fix SCO server socket cleanup on exit. + Fix memory leaks from DBusPendingCall. + Fix handling of pending authorization requests. + Fix missing protocol UUIDs in record pattern. + +ver 4.11: + Change SCO server socket into a generic one. + Add test script for dummy telephony plugin. + Fix uninitialized reply of multiple GetProperties methods. + +ver 4.10: + Fix memory leaks with HAL messages. + Add more advanced handsfree features. + Add properties to audio, input and network interfaces. + Stop device discovery timer on device removal. + +ver 4.9: + Fix signals for Powered and Discoverable properties. + Fix handling of Alias and Icon properties. + Fix duplicate entries for service UUIDs. + +ver 4.8: + Fix retrieving of formfactor value. + Fix retrieving of local and remote extended features. + Fix potential NULL pointer dereference during pairing. + Fix crash with browsing due to a remotely initated pairing. + +ver 4.7: + Fix pairing and service discovery logic. + Fix crashes during suspend and resume. + Fix race condition within devdown mode. + Add RequestSession and ReleaseSession methods. + Add Powered and Discoverable properties. + Add Devices property and deprecate ListDevices. + Add workaround for a broken carkit from Nokia. + +ver 4.6: + Fix Device ID record handling. + Fix service browsing and storage. + Fix authentication and encryption for input devices. + Fix adapter name initialization. + +ver 4.5: + Fix initialization issue with new adapters. + Send HID authentication request without blocking. + Hide the verbose SDP debug behind SDP_DEBUG. + Add extra UUIDs for service discovery. + Add SCO server socket listener. + Add authorization support to service plugin. + +ver 4.4: + Add temporary fix for the CUPS compile issue. + Add service-api.txt to distribution. + Mention the variable prefix of an object path + +ver 4.3: + Add dummy driver for telephony support. + Add support for discovery sessions. + Add service plugin for external services. + Various cleanups. + +ver 4.2: + Avoid memory copies in A2DP write routine. + Fix broken logic with Simple Pairing check and old kernels. + Allow non-bondable and outgoing SDP without agent. + Only remove the bonding for non-temporary devices. + Cleanup various unnecessary includes. + Make more unexported functions static. + Add basic infrastructure for gtk-doc support. + +ver 4.1: + Add 30 seconds timeout to BNEP connection setup phase. + Avoid memory copies in A2DP write routine for ALSA. + Make sure to include compat/sdp.h in the distribution. + +ver 4.0: + Initial public release. + +ver 3.36: + Add init routines for TI BRF chips. + Add extra attributes to the serial port record. + Add example record for headset audio gateway record. + Use Handsfree version 0x0105 for the gateway role. + Fix SDP record registration with specific record handles. + Fix BCSP sent/receive handling. + Fix various includes for cross-compilation. + Allow link mode settings for outgoing connections. + Allow bonding during periodic inquiry. + +ver 3.35: + Add two additional company identifiers. + Add UUID-128 support for service discovery. + Fix usage of friendly names for service discovery. + Fix authorization when experiemental is disabled. + Fix uninitialized variable in passkey request handling. + Enable output of timestamps for l2test and rctest. + +ver 3.34: + Replace various SDP functions with safe versions. + Add additional length validation for incoming SDP packets. + Use safe function versions for SDP client handling. + Fix issue with RemoveDevice during discovery procedure. + Fix collect for non-persistent service records. + +ver 3.33: + Add functions for reading and writing the link policy settings. + Add definition for authentication requirements. + Add support for handling Simple Pairing. + Add Simple Pairing support to Agent interface. + Add ReleaseMode method to Adapter interface. + Add DiscoverServices method to Device interface. + Remove obsolete code and cleanup the repository. + Move over to use the libgdbus API. + Enable PIE by default if supported. + +ver 3.32: + Add OCF constants for synchronous flow control enabling. + Add support for switching HID proxy devices from Dell. + Add more Bluetooth client/server helper functions. + Add support for input service idle timeout option. + Fix BNEP reconnection handling. + Fix return value for snd_pcm_hw_params() calls. + Use upper-case addresses for object paths. + Remove HAL support helpers. + Remove inotify support. + Remove service daemon activation handling. + Remove uneeded D-Bus API extension. + +ver 3.31: + Create device object for all pairing cases. + Convert authorization to internal function calls. + Add initial support for Headset Audio Gateway role. + Add generic Bluetooth helper functions for GLib. + Fix endiannes handling of connection handles. + Don't optimize when debug is enabled. + +ver 3.30: + Convert audio service into a plugin. + Convert input service into a plugin. + Convert serial service into a plugin. + Convert network service into a plugin. + Emit old device signals when a property is changed. + Fix missing DiscoverDevices and CancelDiscovery methods. + Add another company identifier. + Add basic support for Bluetooth sessions. + Add avinfo utility for AVDTP/A2DP classification. + Remove build option for deprecated sdpd binary. + +ver 3.29: + Introduce new D-Bus based API. + Add more SBC optimizations. + Add support for PS3 remote devices. + Fix alignment trap in SDP server. + Fix memory leak in sdp_get_uuidseq_attr function. + +ver 3.28: + Add support for MCAP UUIDs. + Add support for role switch for audio service. + Add disconnect timer for audio service. + Add disconnect detection to ALSA plugin. + Add more SBC optimizations. + Fix alignment issue of SDP server. + Remove support for SDP parsing via expat. + +ver 3.27: + Update uinput.h with extra key definitions. + Add support for input connect/disconnect callbacks. + Add ifdefs around some baud rate definitions. + Add another company identifier. + Add proper HFP service level connection handling. + Add basic headset automatic disconnect support. + Add support for new SBC API. + Fix SBC decoder noise at high bitpools. + Use 32-bit multipliers for further SBC optimization. + Check for RFCOMM connection state in SCO connect callback. + Make use of parameters selected in ALSA plugin. + +ver 3.26: + Fix compilation issues with UCHAR_MAX, USHRT_MAX and UINT_MAX. + Improve handling of different audio transports. + Enable services by default and keep old daemons disabled. + +ver 3.25: + Add limited support for Handsfree profile. + Add limited support for MPEG12/MP3 codec. + Add basic support for UNITINFO and SUBUNITINFO. + Add more SBC optimizations. + Fix external service (un)registration. + Allow GetInfo and GetAddress to fail. + +ver 3.24: + Add definitions for MDP. + Add TCP connection support for serial proxy. + Add fix for Logitech HID proxy switching. + Add missing macros, MIN, MAX, ABS and CLAMP. + Add more SBC encoder optimizations. + Add initial mechanism to handle headset commands. + Fix connecting to handsfree profile headsets. + Use proper function for checking signal name. + +ver 3.23: + Fix remote name request handling bug. + Fix key search function to honor the mmap area size. + Fix Avahi integration of network service. + Add new plugin communication for audio service. + Enable basic AVRCP support by default. + More optimizations to the SBC library. + Create common error definitions. + +ver 3.22: + Add missing include file from audio service. + Add SBC conformance test utility. + Add basic uinput support for AVRCP. + Fix L2CAP socket leak in audio service. + Fix buffer usage in GStreamer plugin. + Fix remote name request event handling. + +ver 3.21: + Add constant for Bluetooth socket options level. + Add initial AVRCP support. + Add A2DP sink support to GStreamer plugin. + Fix interoperability with A2DP suspend. + Fix sign error in 8-subband encoder. + Fix handling of service classes length size. + Store Extended Inquiry Response data information. + Publish device id information through EIR. + Support higher baud rates for Ericcson based chips. + +ver 3.20: + Fix GStreamer plugin file type detection. + Fix potential infinite loop in inotify support. + Fix D-Bus signatures for dict handling. + Fix issues with service activation. + Fix SDP failure handling of audio service. + Fix various memory leaks in input service. + Add secure device creation method to input service. + Add service information methods to serial service. + Add config file support to network service. + Add scripting capability to network service. + Add special on-mode handling. + Add optimization for SBC encoder. + Add tweaks for D-Bus 1.1.x libraries. + Add support for inquiry transmit power level. + +ver 3.19: + Limit range of bitpool announced while in ACP side. + Use poll instead of usleep to wait for worker thread. + Use default event mask from the specification. + Add L2CAP mode constants. + Add HID proxy support for Logitech diNovo Edge dongle. + Add refresh option to re-request device names. + Show correct connection link type. + +ver 3.18: + Don't allocate memory for the Bluetooth base UUID. + Implement proper locking for headsets. + Fix various A2DP SEP locking issues. + Fix and cleanup audio stream handling. + Fix stream starting if suspend request is pending. + Fix A2DP and AVDTP endianess problems. + Add network timeout and retransmission support. + Add more detailed decoding of EIR elements. + +ver 3.17: + Fix supported commands bit calculation. + Fix crashes in audio and network services. + Check PAN source and destination roles. + Only export the needed symbols for the plugins. + +ver 3.16: + Update company identifier list. + Add support for headsets with SCO audio over HCI. + Add support for auto-create through ALSA plugin. + Add support for ALSA plugin parameters. + Add GStreamer plugin with SBC decoder and encoder. + Fix network service NAP, GN and PANU servers. + Set EIR information from SDP database. + +ver 3.15: + Add A2DP support to the audio service. + Add proxy support to the serial service. + Extract main service class for later use. + Set service classes value from SDP database. + +ver 3.14: + Add missing signals for the adapter interface. + Add definitions and functions for Simple Pairing. + Add basic commands for Simple Pairing. + Add correct Simple Pairing and EIR interaction. + Add missing properties for remote information. + Add EPoX endian quirk to the input service. + Fix HID descriptor import and storage functions. + Fix handling of adapters in raw mode. + Fix remote device listing methods. + +ver 3.13: + Fix some issues with the headset support. + Fix concurrent pending connection attempts. + Fix usage of devname instead of netdev. + Add identifier for Nokia SyncML records. + Add command for reading the CSR chip revision. + Add generic CSR radio test support. + Update HCI command table. + +ver 3.12: + Add missing HCI command text descriptions + Add missing HCI commands structures. + Add missing HCI event structures. + Add common bachk() function. + Add support for limited discovery mode. + Add support for setting of event mask. + Add GetRemoteServiceIdentifiers method. + Add skeleton for local D-Bus server. + Add headset gain control methods. + Fix various headset implementation issues. + Fix various serial port service issues. + Fix various input service issues. + Let CUPS plugin discover printers in range. + Improve the BCM2035 UART init routine. + Ignore connection events for non-ACL links. + +ver 3.11: + Update API documentation. + Minimize SDP root records and browse groups. + Use same decoder for text and URL strings. + Fix URL data size handling. + Fix SDP pattern extraction for XML. + Fix network connection persistent state. + Add network connection helper methods. + Add initial version of serial port support. + Add class of device tracking. + +ver 3.10.1: + Add option to disable installation of manual pages. + Fix input service encryption setup. + Fix serial service methods. + Fix network service connection handling. + Provide a simple init script. + +ver 3.10: + Add initial version of network service. + Add initial version of serial service. + Add initial version of input service. + Add initial version of audio service. + Add authorization framework. + Add integer based SBC library. + Add version code for Bluetooth 2.1 specification. + Add ESCO_LINK connection type constant. + Export sdp_uuid32_to_uuid128() function. + +ver 3.9: + Add RemoteDeviceDisconnectRequested signal. + Add updated service framework. + Add embedded GLib library. + Add support for using system GLib library. + Create internal SDP server library. + +ver 3.8: + Sort discovered devices list based on their RSSI. + Send DiscoverableTimeoutChanged signal. + Fix local and remote name validity checking. + Add ListRemoteDevices and ListRecentRemoteDevices methods. + Add basic integration of confirmation concept. + Add support for service record description via XML. + Add support for external commands to the RFCOMM utility. + Add experimental service and authorization API. + Add functions for registering binary records. + +ver 3.7: + Fix class of device handling. + Fix error replies with pairing and security mode 3. + Fix disconnect method for RFCOMM connections. + Add match pattern for service searches. + Add support for prioritized watches. + Add additional PDU length checks. + Fix CSRC value for partial responses. + +ver 3.6.1: + Fix IO channel race conditions. + Fix pairing issues on big endian systems. + Fix pairing issues with page timeout errors. + Fix pairing state for security mode 3 requests. + Switch to user as default security manager mode. + +ver 3.6: + Update D-Bus based RFCOMM interface support. + Use L2CAP raw sockets for HCI connection creation. + Add periodic discovery support to the D-Bus interface. + Add initial support for device names via EIR. + Add proper UTF-8 validation of device names. + Add support for the J-Three keyboard. + Fix issues with the asynchronous API for SDP. + +ver 3.5: + Fix and cleanup watch functionality. + Add support for periodic inquiry mode. + Add support for asynchronous SDP requests. + Add more request owner tracking. + Add asynchronous API for SDP. + Document pageto and discovto options. + +ver 3.4: + Improve error reporting for failed HCI commands. + Improve handling of CancelBonding. + Fixed bonding reply message when disconnected. + Fix UUID128 string lookup handling. + Fix malloc() versus bt_malloc() usage. + +ver 3.3: + Don't change inquiry mode for Bluetooth 1.1 adapters. + Add udev rules for Bluetooth serial PCMCIA cards. + Add Cancel and Release methods for passkey agents. + Add GetRemoteClass method. + Convert to using ppoll() and pselect(). + Initialize allocated memory to zero. + Remove bcm203x firmware loader. + Remove kernel specific timeouts. + Add additional private data field for SDP sessions. + Add host controller to host flow control defines. + Add host number of completed packets defines. + Initialize various memory to zero before usage. + +ver 3.2: + Only check for the low-level D-Bus library. + Update possible device minor classes. + Fix timeout for pending reply. + Add more Inquiry with RSSI quirks. + Sleep only 100 msecs for device detection. + Don't send BondingCreated on link key renewal. + Allow storing of all UTF-8 remote device names. + Create storage filenames with a generic function. + Fix handling of SDP strings. + Add adapter type for SDIO cards. + Add features bit for link supervision timeout. + +ver 3.1: + Add missing placeholders for feature bits. + Fix handling of raw mode devices. + Fix busy loop in UUID extraction routine. + Remove inquiry mode setting. + Remove auth and encrypt settings. + +ver 3.0: + Implement the new BlueZ D-Bus API. + Fix broken behavior with EVT_CMD_STATUS. + Add features bit for pause encryption. + Add additional EIR error code. + Add more company identifiers. + Add another Phonebook Access identifier. + Update sniff subrating data structures. + +ver 2.25: + Use %jx instead of %llx for uint64_t and int64_t. + Allow null-terminated text strings. + Add UUID for N-Gage games. + Add UUID for Apple Macintosh Attributes. + Add Apple attributes and iSync records. + Add definitions for Apple Agent. + Add support for the Handsfree Audio Gateway service. + Add support for choosing a specific record handle. + Add support for dialup/telephone connections. + Add definitions for Apple Agent. + Add support for record handle on service registration. + +ver 2.24: + Fix display of SDP text and data strings. + Add support for device scan property. + Add support for additional access protocols. + Update the D-Bus policy configuration file. + +ver 2.23: + Update the new D-Bus interface. + Make dfutool ready for big endian architectures. + Add support for AVRCP specific service records. + Add support for writing complex BCCMD commands. + Add the new BCCMD interface utility. + Add MicroBCSP implementation from CSR. + Add constants and definitions for sniff subrating. + Add support for allocation of binary text elements. + Add HCI emulation tool. + Add fake HID support for old EPoX presenters. + Reject connections from unknown HID devices. + Fix service discovery deadlocks with Samsung D600 phones. + +ver 2.22: + Remove D-Bus 0.23 support. + Add initial version of the new D-Bus interface. + Add support for extended inquiry response commands. + Add support for the Logitech diNovo Media Desktop Laser. + Add compile time buffer checks (FORTIFY SOURCE). + Decode reserved LMP feature bits. + Fix errno overwrite problems. + Fix profile descriptor problem with Samsung phones. + +ver 2.21: + Move create_dirs() and create_file() into the textfile library. + Let textfile_put() also replace the last key value pair. + Fix memory leaks with textfile_get() usage. + Fix infinite loops and false positive matches. + Don't retrieve stored link keys for RAW devices. + Document the putkey and delkey commands. + Show supported commands also in clear text. + Support volatile changes of the BD_ADDR for CSR chips. + Add support for identification of supported commands. + Add missing OCF declarations for the security filter. + Add two new company identifiers. + +ver 2.20: + Add UUIDs for video distribution profile. + Add UUIDs for phonebook access profile. + Add attribute identifier for supported repositories. + Add definitions for extended inquiry response. + Add functions for extended inquiry response. + Add support for extended inquiry response. + Add support for HotSync service record. + Add support for ActiveSync service record. + Add ActiveSync networking support. + Fix D-Bus crashes with new API versions. + +ver 2.19: + Fix the GCC 4.0 warnings. + Fix the routing for dealing with raw devices. + Fix off by one memory allocation error. + Fix security problem with escape characters in device name. + Add per device service record functions. + Send D-Bus signals for inquiry results and remote name resolves. + Add support for device specific SDP records. + +ver 2.18: + Support D-Bus 0.23 and 0.33 API versions. + Support reading of complex BCCMD values. + Support minimum and maximum encryption key length. + Add support for reading and writing the inquiry scan type. + Add definitions for connection accept timeout and scan enable. + Add support for inquiry scan type. + Add tool for the CSR BCCMD interface. + Add first draft of the Audio/Video control utility. + Add disconnect timer support for the A2DP ALSA plugin. + Make SBC parameters configurable. + Replace non-printable characters in device names. + Remove hci_vhci.h header file. + Remove hci_uart.h header file. + +ver 2.17: + Set the storage directory through ${localstatedir}. + Add the textfile library for ASCII based file access. + Add support for return link keys event. + Add support for voice setting configuration. + Add support for page scan timeout configuration. + Add support for storing and deleting of stored link keys. + Add support for searching for services with UUID-128. + Add support for retrieving all possible service records. + Add support for a raw mode view of service records. + Add support for HID information caching in hidd. + Add support for authentication in pand and dund. + Add support for changing BD_ADDR of CSR chips. + Add pskey utility for changing CSR persistent storage values. + Add the firmware upgrade utility. + Add connection caching for the A2DP ALSA plugin. + Add functions for stored link keys. + Add definitions for PIN type and unit key. + Add SDP_WAIT_ON_CLOSE flag for sdp_connect(). + Include stdio.h in bluetooth.h header file. + Include sys/socket.h in the header files. + +ver 2.16: + Store link keys in ASCII based file format. + Support device name caching. + Support zero length data sizes in l2test. + Change default l2ping data size to 44 bytes. + Hide the server record and the public browse group root. + Read BD_ADDR if not set and if it is a raw device. + Add SDP language attributes. + Add support for browsing the L2CAP group. + Add support for stored pin codes for outgoing connections. + Add support for local commands and extended features. + Add support for reading CSR panic and fault codes. + Add config option for setting the inquiry mode. + Add OUI decoding support. + Use unlimited inquiry responses as default. + Use cached device names for PIN request. + Use the clock offset when getting the remote names. + Add function for reading local supported commands. + Add function for reading local extended features. + Add function for reading remote extended features. + Add function for getting the remote name with a clock offset. + Add function for extracting the OUI from a BD_ADDR. + Add inquiry info structure with RSSI and page scan mode. + Fix buffer allocation for features to string conversion. + Support inquiry with unlimited number of responses. + +ver 2.15: + Enable the RFCOMM service level security. + Add deprecated functions for reading the name. + Add command for reading the clock offset. + Add command for reading the clock. + Add function for reading the clock. + Add function for reading the local Bluetooth address. + Add function for reading the local supported features. + Don't configure raw devices. + Don't set inquiry scan or page scan on raw devices. + Don't show extended information for raw devices. + Support L2CAP signal sizes bigger than 2048 bytes. + Cleanup of the socket handling code of the test programs. + Use better way for unaligned access. + Remove sdp_internal.h and its usage. + +ver 2.14: + Make use of additional connection information. + Use library function for reading the RSSI. + Use library function for reading the link quality. + Use library function for reading the transmit power level. + Use library functions for the link supervision timeout. + Add tool for changing the device address. + Add function for reading the RSSI. + Add function for reading the link quality. + Add function for reading the transmit power level. + Add functions for the link supervision timeout. + Remove deprecated functions. + Update AM_PATH_BLUEZ macro. + +ver 2.13: + Use file permission 0600 for the link key file. + Add support for HID attribute descriptions. + Add support for Device ID attributes. + Add Device ID and HID attribute definitions. + Update the UUID constants and its translations. + Update L2CAP socket option definitions. + Update connection information definitions. + Various whitespace cleanups. + +ver 2.12: + Inherit the device specific options from the default. + Use --device for selecting the source device. + Add --nosdp option for devices with resource limitation. + Add support and parameter option for secure mode. + Add a lot of build ids and hardware revisions. + Add service classes and profile ids for WAP. + Add simple AM_PATH_BLUEZ macro. + Update UUID translation tables. + Correct kernel interface for CMTP and HIDP support. + +ver 2.11: + Initial support for the kernel security manager. + Various cleanups to avoid inclusion of kernel headers. + Fix output when the CUPS backend is called without arguments. + Fix problems with a 64 bit userland. + Use Bluetooth library functions if available. + Use standard numbering scheme of SDP record handles. + Use bit zero for vendor packets in the filter type bitmask. + Add SIM Access types for service discovery. + Add more audio/video profile translations. + Add another company identifier. + Add the missing HCI error codes. + Add RFCOMM socket options. + Add definition for the SECURE link mode. + Add functions for reading and writing the inquiry mode. + Add functions for AFH related settings and information. + Add version identifier for the Bluetooth 2.0 specification. + Add a master option to the hidd. + Add support for changing the link key of a connection. + Add support for requesting encryption on keyboards. + Add support for revision information of Digianswer devices. + Add support for the Zoom, IBM and TDK PCMCIA cards. + Add checks for the OpenOBEX and the ALSA libraries. + Add experimental mRouter support. + +ver 2.10: + Use a define for the configuration directory. + Fix string initialization for flags translation. + Fix and extend the unaligned access macros. + Make compiling with debug information optional. + Don't override CFLAGS from configure. + Check for usb_get_busses() and usb_interrupt_read(). + Add optional support for compiling with PIE. + Make installation of the init scripts optional. + Make compiling with debug information optional. + Don't override CFLAGS from configure. + +ver 2.9: + Retry SDP connect if busy in the CUPS backend. + Use packet type and allow role switch in hcitool. + Use the functions from the USB library for hid2hci. + Add Broadcom firmware loader. + Add EPoX endian quirk for buggy keyboards. + Add L2CAP info type and info result definitions. + Add value for L2CAP_CONF_RFC_MODE. + Change RSSI value to signed instead of unsigned. + Allow UUID32 values as protocol identifiers. + Update the autoconf/automake scripts. + +ver 2.8: + Use LIBS and LDADD instead of LDFLAGS. + Use HIDP subclass field for HID boot protocol. + Set olen before calling getsockopt() in pand. + Restore signals for dev-up script. + Add PID file support for pand. + Add size parameter to expand_name() in hcid. + Add support for audio source and audio sink SDP records. + Add support for HID virtual cable unplug. + Add support for AmbiCom BT2000C card. + Add defines and UUID's for audio/video profiles. + Add AVDTP protocol identifier. + Add HIDP subclass field. + Add PKGConfig support. + Fix the event code of inquiry with RSSI. + Remove dummy SDP library. + +ver 2.7: + Fix display of decoded LMP features. + Update company identifiers. + Add AFH related types. + Add first bits from EDR prototyping specification. + Add support for inquiry with RSSI. + Add HCRP related SDP functions. + Add HIDP header file. + Add support for getting the AFH channel map. + Add support for AFH mode. + Add support for inquiry mode. + Add Bluetooth backend for CUPS. + Add the hid2hci utility. + Add the hidd utility. + Add the pand utility. + Add the dund utility. + More endian bug fixes. + Give udev some time to create the RFCOMM device nodes. + Release the TTY if no device node is found. + New startup script for the Bluetooth subsystem. + Update to the autoconf stuff. + +ver 2.6: + Change default prefix to /usr. + Add manpages for hcid and hcid.conf. + Add the sdpd server daemon. + Add the sdptool utility. + Add the ciptool utility. + Add new company identifiers. + Add BNEP and CMTP header files. + Add the SDP library. + Use R2 for default value of pscan_rep_mode. + +ver 2.5: + Add decoding of Bluetooth 1.2 features. + Add link manager version parameter for Bluetooth 1.2. + Add new company identifiers. + Add D-Bus support for PIN request. + Support for transmit power level. + Support for park, sniff and hold mode. + Support for role switch. + Support for reading the clock offset. + Support for requesting authentication. + Support for setting connection encryption. + Show revision information for Broadcom devices. + Replace unprintable characters in device name. + Use R1 for default value of pscan_rep_mode. + Fix some 64-bit problems. + Fix some endian problems. + Report an error on PIN helper failure. + Update bluepin script for GTK2. + +ver 2.4: + Increase number of inquiry responses. + Support for transmit power level. + Display all 8 bytes of the features. + Add support for reading and writing of IAC. + Correct decoding class of device. + Use Ericsson revision command for ST Microelectronics devices. + Display AVM firmware version with 'revision' command. + New code for CSR specific revision information. + Support for ST Microelectronics specific initialization. + Support for 3Com card version 3.0. + Support for TDK, IBM and Socket cards. + Support for initial baud rate. + Update man pages. + Fixes for some memory leaks. + +ver 2.3: + Added const qualifiers to appropriate function arguments. + Minor fixes. + CSR firmware version is now displayed by 'revision' command. + Voice command is working properly on big endian machines. + Added support for Texas Bluetooth modules. + Added support for high UART baud rates on Ericsson modules. + BCSP initialization fixes. + Support for role switch command (hcitool). + RFCOMM config file parser fixes. + Update man pages. + Removed GLib dependency. + +ver 2.2: + Updated RFCOMM header file. + Additional HCI command and event defines. + Support for voice settings (hciconfig). + Minor hcitool fixes. + Improved configure script. + Added Headset testing tool. + Updated man pages. + RPM package. + +ver 2.1.1: + Resurrect hci_remote_name. + +ver 2.1: + Added hci_{read, write}_class_of_dev(). + Added hci_{read, write}_current_iac_lap(). + Added hci_write_local_name(). + Added RFCOMM header file. + Minor fixes. + Improved BCSP initialization (hciattach). + Support for displaying link quality (hcitool). + Support for changing link supervision timeout (hcitool). + New RFCOMM TTY configuration tool (rfcomm). + Minor fixes and updates. + +ver 2.0: + Additional company IDs. + BCSP initialization (hciattach). + Minor hciconfig fixes. + +ver 2.0-pr13: + Support for multiple pairing modes. + Link key database handling fixes. + +ver 2.0-pre12: + Removed max link key limit. Keys never expire. + Link key database is always updated. Reread PIN on SIGHUP (hcid). + Bluetooth script starts SDPd, if installed. + Other minor fixes. + +ver 2.0-pre11: + Improved link key management and more verbose logging (hcid). + Fixed scan command (hcitool). + +ver 2.0-pre10: + Fix hci_inquiry function to return errors and accept user buffers. + New functions hci_devba, hci_devid, hci_for_each_dev and hci_get_route. + Additional company IDs. + Makefile and other minor fixes. + Support for reading RSSI, remote name and changing + connection type (hcitool). + Device initialization fixes (hcid). + Other minor fixes and improvements. + Build environment cleanup and fixes. + +ver 2.0-pre9: + Improved bluepin. Working X authentication. + Improved hcitool. New flexible cmd syntax, additional commands. + Human readable display of the device features. + LMP features to string translation support. + Additional HCI command and event defines. + Extended hci_filter API. + +ver 2.0-pre8: + Additional HCI ioctls and defines. + All strings and buffers are allocated dynamically. + ba2str, str2ba automatically swap bdaddress. + Additional hciconfig commands. Support for ACL and SCO MTU ioctls. + Support for Inventel and COM1 UART based devices. + Minor hcitool fixes. + Improved l2test. New L2CAP test modes. + Minor fixes and cleanup. + +ver 2.0-pre7: + Bluetooth libraries and header files is now a separate package. + New build environment uses automake and libtool. + Massive header files cleanup. + Bluetooth utilities is now a separate package. + New build environment uses automake. + Moved all config files and security data to /etc/bluetooth. + Various cleanups. + +ver 2.0-pre6: + API cleanup and additions. + Improved hcitool. + l2test minor output fixes. + hciattach opt to display list of supported devices. + +ver 2.0-pre4: + HCI filter enhancements. + +ver 2.0-pre3: + Cleanup. + +ver 2.0-pre2: + Additional HCI library functions. + Improved CSR baud rate initialization. + PCMCIA scripts fixes and enhancements. + Documentation update. + +ver 2.0-pre1: + New UART initialization utility. + Hot plugging support for UART based PCMCIA devices. + SCO testing utility. + New authentication utility (bluepin). + Minor fixes and improvements.
diff --git a/bluez/INSTALL b/bluez/INSTALL new file mode 100644 index 0000000..56b077d --- /dev/null +++ b/bluez/INSTALL
@@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PREFIX', the package will +use PREFIX as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. +
diff --git a/bluez/Makefile.am b/bluez/Makefile.am new file mode 100644 index 0000000..f96c700 --- /dev/null +++ b/bluez/Makefile.am
@@ -0,0 +1,383 @@ + +AM_MAKEFLAGS = --no-print-directory + +lib_LTLIBRARIES = + +noinst_LIBRARIES = + +noinst_LTLIBRARIES = + +bin_PROGRAMS = + +noinst_PROGRAMS = + +dist_man_MANS = + +dist_noinst_MANS = + +CLEANFILES = + +EXTRA_DIST = + +libexecdir = @libexecdir@/bluetooth + +libexec_PROGRAMS = + +includedir = @includedir@/bluetooth + +include_HEADERS = + +AM_CFLAGS = $(WARNING_CFLAGS) $(MISC_CFLAGS) +AM_LDFLAGS = $(MISC_LDFLAGS) + +if DATAFILES +dbusdir = @DBUS_CONFDIR@/dbus-1/system.d +dbus_DATA = src/bluetooth.conf + +confdir = $(sysconfdir)/bluetooth +conf_DATA = + +statedir = $(localstatedir)/lib/bluetooth +state_DATA = +endif + +if SYSTEMD +systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@ +systemdsystemunit_DATA = src/bluetooth.service + +dbussystembusdir = @DBUS_SYSTEMBUSDIR@ +dbussystembus_DATA = src/org.bluez.service +endif + +EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service + +plugindir = $(libdir)/bluetooth/plugins + +if MAINTAINER_MODE +build_plugindir = $(abs_top_srcdir)/plugins/.libs +else +build_plugindir = $(plugindir) +endif + + +plugin_LTLIBRARIES = + +lib_sources = lib/bluetooth.c lib/hci.c lib/sdp.c +lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h \ + lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \ + lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h + +extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h +extra_sources = lib/uuid.c + +local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file))) + +BUILT_SOURCES = $(local_headers) src/builtin.h + +if LIBRARY +include_HEADERS += $(lib_headers) + +lib_LTLIBRARIES += lib/libbluetooth.la + +lib_libbluetooth_la_SOURCES = $(lib_headers) $(lib_sources) +lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 20:8:17 +lib_libbluetooth_la_DEPENDENCIES = $(local_headers) +endif + +noinst_LTLIBRARIES += lib/libbluetooth-internal.la + +lib_libbluetooth_internal_la_SOURCES = $(lib_headers) $(lib_sources) \ + $(extra_headers) $(extra_sources) + +noinst_LTLIBRARIES += gdbus/libgdbus-internal.la + +gdbus_libgdbus_internal_la_SOURCES = gdbus/gdbus.h \ + gdbus/mainloop.c gdbus/watch.c \ + gdbus/object.c gdbus/client.c gdbus/polkit.c + +attrib_sources = attrib/att.h attrib/att-database.h attrib/att.c \ + attrib/gatt.h attrib/gatt.c \ + attrib/gattrib.h attrib/gattrib.c \ + attrib/gatt-service.h attrib/gatt-service.c + +btio_sources = btio/btio.h btio/btio.c + +gobex_sources = gobex/gobex.h gobex/gobex.c \ + gobex/gobex-defs.h gobex/gobex-defs.c \ + gobex/gobex-packet.c gobex/gobex-packet.h \ + gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h + +builtin_modules = +builtin_sources = +builtin_nodist = + +include Makefile.plugins + +if MAINTAINER_MODE +plugin_LTLIBRARIES += plugins/external-dummy.la +plugins_external_dummy_la_SOURCES = plugins/external-dummy.c +plugins_external_dummy_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ + -no-undefined +plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden +endif + +libexec_PROGRAMS += src/bluetoothd + +src_bluetoothd_SOURCES = $(builtin_sources) \ + $(attrib_sources) $(btio_sources) \ + src/bluetooth.ver \ + src/main.c src/log.h src/log.c \ + src/systemd.h src/systemd.c \ + src/rfkill.c src/hcid.h src/sdpd.h \ + src/sdpd-server.c src/sdpd-request.c \ + src/sdpd-service.c src/sdpd-database.c \ + src/attrib-server.h src/attrib-server.c \ + src/sdp-xml.h src/sdp-xml.c \ + src/sdp-client.h src/sdp-client.c \ + src/textfile.h src/textfile.c \ + src/uuid-helper.h src/uuid-helper.c \ + src/uinput.h \ + src/plugin.h src/plugin.c \ + src/storage.h src/storage.c \ + src/agent.h src/agent.c \ + src/error.h src/error.c \ + src/adapter.h src/adapter.c \ + src/profile.h src/profile.c \ + src/service.h src/service.c \ + src/gatt-dbus.h src/gatt-dbus.c \ + src/gatt.h src/gatt.c \ + src/device.h src/device.c src/attio.h \ + src/dbus-common.c src/dbus-common.h \ + src/eir.h src/eir.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/timeout.h src/shared/timeout-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c +src_bluetoothd_LDADD = lib/libbluetooth-internal.la gdbus/libgdbus-internal.la \ + @GLIB_LIBS@ @DBUS_LIBS@ -ldl -lrt +src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \ + -Wl,--version-script=$(srcdir)/src/bluetooth.ver + +src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la src/bluetooth.service + +src_bluetoothd_CFLAGS = $(AM_CFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \ + -DPLUGINDIR=\""$(build_plugindir)"\" +src_bluetoothd_SHORTNAME = bluetoothd + +builtin_files = src/builtin.h $(builtin_nodist) + +nodist_src_bluetoothd_SOURCES = $(builtin_files) + +CLEANFILES += $(builtin_files) src/bluetooth.service + +man_MANS = src/bluetoothd.8 + +EXTRA_DIST += src/genbuiltin src/bluetooth.conf \ + src/main.conf profiles/network/network.conf \ + profiles/input/input.conf profiles/proximity/proximity.conf + +test_scripts = +unit_tests = + +include Makefile.tools +include Makefile.obexd +include android/Makefile.am + +if HID2HCI +rulesdir = @UDEV_DIR@/rules.d + +rules_DATA = tools/97-hid2hci.rules + +CLEANFILES += $(rules_DATA) +endif + +EXTRA_DIST += tools/hid2hci.rules + +if TEST +testdir = $(pkglibdir)/test +test_SCRIPTS = $(test_scripts) +endif + +EXTRA_DIST += $(test_scripts) + +EXTRA_DIST += doc/assigned-numbers.txt doc/supported-features.txt \ + doc/test-coverage.txt doc/settings-storage.txt + +EXTRA_DIST += doc/mgmt-api.txt \ + doc/adapter-api.txt doc/device-api.txt \ + doc/agent-api.txt doc/profile-api.txt \ + doc/network-api.txt doc/media-api.txt \ + doc/health-api.txt doc/sap-api.txt + +EXTRA_DIST += doc/alert-api.txt \ + doc/proximity-api.txt doc/heartrate-api.txt \ + doc/thermometer-api.txt doc/cyclingspeed-api.txt + +EXTRA_DIST += doc/obex-api.txt doc/obex-agent-api.txt + +EXTRA_DIST += tools/magic.btsnoop + +AM_CFLAGS += @DBUS_CFLAGS@ @GLIB_CFLAGS@ + +AM_CPPFLAGS = -I$(builddir)/lib -I$(srcdir)/gdbus + + +unit_tests += unit/test-eir unit/test-uuid unit/test-textfile unit/test-crc + +unit_test_eir_SOURCES = unit/test-eir.c src/eir.c src/uuid-helper.c +unit_test_eir_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +unit_test_uuid_SOURCES = unit/test-uuid.c +unit_test_uuid_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +unit_test_textfile_SOURCES = unit/test-textfile.c src/textfile.h src/textfile.c +unit_test_textfile_LDADD = @GLIB_LIBS@ + +unit_test_crc_SOURCES = unit/test-crc.c monitor/crc.h monitor/crc.c +unit_test_crc_LDADD = @GLIB_LIBS@ + +unit_tests += unit/test-ringbuf unit/test-queue + +unit_test_ringbuf_SOURCES = unit/test-ringbuf.c \ + src/shared/util.h src/shared/util.c \ + src/shared/ringbuf.h src/shared/ringbuf.c +unit_test_ringbuf_LDADD = @GLIB_LIBS@ + +unit_test_queue_SOURCES = unit/test-queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c +unit_test_queue_LDADD = @GLIB_LIBS@ + +unit_tests += unit/test-mgmt + +unit_test_mgmt_SOURCES = unit/test-mgmt.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c +unit_test_mgmt_LDADD = @GLIB_LIBS@ + +unit_tests += unit/test-sdp + +unit_test_sdp_SOURCES = unit/test-sdp.c \ + src/shared/util.h src/shared/util.c \ + src/sdpd.h src/sdpd-database.c \ + src/log.h src/log.c \ + src/sdpd-service.c src/sdpd-request.c +unit_test_sdp_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +unit_tests += unit/test-avdtp + +unit_test_avdtp_SOURCES = unit/test-avdtp.c \ + src/shared/util.h src/shared/util.c \ + src/log.h src/log.c \ + android/avdtp.c android/avdtp.h +unit_test_avdtp_LDADD = @GLIB_LIBS@ + +unit_tests += unit/test-avctp + +unit_test_avctp_SOURCES = unit/test-avctp.c \ + src/shared/util.h src/shared/util.c \ + src/log.h src/log.c \ + android/avctp.c android/avctp.h +unit_test_avctp_LDADD = @GLIB_LIBS@ + +unit_tests += unit/test-avrcp + +unit_test_avrcp_SOURCES = unit/test-avrcp.c \ + src/shared/util.h src/shared/util.c \ + src/log.h src/log.c \ + android/avctp.c android/avctp.h \ + android/avrcp-lib.c android/avrcp-lib.h +unit_test_avrcp_LDADD = @GLIB_LIBS@ lib/libbluetooth-internal.la + +unit_tests += unit/test-hfp + +unit_test_hfp_SOURCES = unit/test-hfp.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/ringbuf.h src/shared/ringbuf.c \ + src/shared/hfp.h src/shared/hfp.c + +unit_test_hfp_LDADD = @GLIB_LIBS@ + +unit_tests += unit/test-gdbus-client + +unit_test_gdbus_client_SOURCES = unit/test-gdbus-client.c +unit_test_gdbus_client_LDADD = gdbus/libgdbus-internal.la \ + @GLIB_LIBS@ @DBUS_LIBS@ + +unit_tests += unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \ + unit/test-gobex-transfer unit/test-gobex-apparam + +unit_test_gobex_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex.c +unit_test_gobex_LDADD = @GLIB_LIBS@ + +unit_test_gobex_packet_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-packet.c +unit_test_gobex_packet_LDADD = @GLIB_LIBS@ + +unit_test_gobex_header_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-header.c +unit_test_gobex_header_LDADD = @GLIB_LIBS@ + +unit_test_gobex_transfer_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-transfer.c +unit_test_gobex_transfer_LDADD = @GLIB_LIBS@ + +unit_test_gobex_apparam_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-apparam.c +unit_test_gobex_apparam_LDADD = @GLIB_LIBS@ + +unit_tests += unit/test-lib + +unit_test_lib_SOURCES = unit/test-lib.c +unit_test_lib_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +noinst_PROGRAMS += $(unit_tests) + +TESTS = $(unit_tests) + +pkgconfigdir = $(libdir)/pkgconfig + +if LIBRARY +pkgconfig_DATA = lib/bluez.pc +endif + +DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \ + --disable-systemd --disable-udev + +DISTCLEANFILES = $(pkgconfig_DATA) + +MAINTAINERCLEANFILES = Makefile.in \ + aclocal.m4 configure config.h.in config.sub config.guess \ + ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver + +SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \ + < $< > $@ + +%.service: %.service.in Makefile + $(SED_PROCESS) + +src/builtin.h: src/genbuiltin $(builtin_sources) + $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@ + +tools/%.rules: + $(AM_V_GEN)cp $(srcdir)/$(subst 97-,,$@) $@ + +$(lib_libbluetooth_la_OBJECTS): $(local_headers) + +lib/bluetooth/%.h: lib/%.h + $(AM_V_at)$(MKDIR_P) lib/bluetooth + $(AM_V_GEN)$(LN_S) -f "$(abs_top_builddir)"/$< $@ + +clean-local: + $(RM) -r lib/bluetooth
diff --git a/bluez/Makefile.in b/bluez/Makefile.in new file mode 100644 index 0000000..769804c --- /dev/null +++ b/bluez/Makefile.in
@@ -0,0 +1,8647 @@ +# Makefile.in generated by automake 1.13.3 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + + + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) +noinst_PROGRAMS = $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \ + $(am__EXEEXT_7) $(am__EXEEXT_9) +libexec_PROGRAMS = src/bluetoothd$(EXEEXT) obexd/src/obexd$(EXEEXT) +@LIBRARY_TRUE@am__append_1 = $(lib_headers) +@LIBRARY_TRUE@am__append_2 = lib/libbluetooth.la +DIST_COMMON = $(srcdir)/Makefile.plugins $(srcdir)/Makefile.tools \ + $(srcdir)/Makefile.obexd $(srcdir)/android/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in $(top_srcdir)/src/bluetoothd.8.in \ + $(top_srcdir)/lib/bluez.pc.in depcomp $(dist_man_MANS) \ + $(am__include_HEADERS_DIST) test-driver AUTHORS COPYING \ + COPYING.LIB ChangeLog INSTALL NEWS README TODO compile \ + config.guess config.sub install-sh missing ltmain.sh +@MAINTAINER_MODE_TRUE@am__append_3 = gatt_example +@MAINTAINER_MODE_TRUE@am__append_4 = plugins/gatt-example.c +@EXPERIMENTAL_TRUE@am__append_5 = neard sap +@EXPERIMENTAL_TRUE@am__append_6 = plugins/neard.c profiles/sap/main.c \ +@EXPERIMENTAL_TRUE@ profiles/sap/manager.h \ +@EXPERIMENTAL_TRUE@ profiles/sap/manager.c \ +@EXPERIMENTAL_TRUE@ profiles/sap/server.h profiles/sap/server.c \ +@EXPERIMENTAL_TRUE@ profiles/sap/sap.h profiles/sap/sap-dummy.c +@EXPERIMENTAL_TRUE@am__append_7 = profiles/sap/libsap.a +@EXPERIMENTAL_TRUE@am__append_8 = health +@EXPERIMENTAL_TRUE@am__append_9 = profiles/health/mcap_lib.h profiles/health/mcap_internal.h \ +@EXPERIMENTAL_TRUE@ profiles/health/mcap.h profiles/health/mcap.c \ +@EXPERIMENTAL_TRUE@ profiles/health/mcap_sync.c \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp_main.c profiles/health/hdp_types.h \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp_manager.h \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp_manager.c \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp.h profiles/health/hdp.c \ +@EXPERIMENTAL_TRUE@ profiles/health/hdp_util.h profiles/health/hdp_util.c + +@EXPERIMENTAL_TRUE@am__append_10 = alert time proximity thermometer \ +@EXPERIMENTAL_TRUE@ heartrate cyclingspeed +@EXPERIMENTAL_TRUE@am__append_11 = profiles/alert/server.c \ +@EXPERIMENTAL_TRUE@ profiles/time/server.c \ +@EXPERIMENTAL_TRUE@ profiles/proximity/main.c \ +@EXPERIMENTAL_TRUE@ profiles/proximity/manager.h \ +@EXPERIMENTAL_TRUE@ profiles/proximity/manager.c \ +@EXPERIMENTAL_TRUE@ profiles/proximity/monitor.h \ +@EXPERIMENTAL_TRUE@ profiles/proximity/monitor.c \ +@EXPERIMENTAL_TRUE@ profiles/proximity/reporter.h \ +@EXPERIMENTAL_TRUE@ profiles/proximity/reporter.c \ +@EXPERIMENTAL_TRUE@ profiles/proximity/linkloss.h \ +@EXPERIMENTAL_TRUE@ profiles/proximity/linkloss.c \ +@EXPERIMENTAL_TRUE@ profiles/proximity/immalert.h \ +@EXPERIMENTAL_TRUE@ profiles/proximity/immalert.c \ +@EXPERIMENTAL_TRUE@ profiles/thermometer/thermometer.c \ +@EXPERIMENTAL_TRUE@ profiles/heartrate/heartrate.c \ +@EXPERIMENTAL_TRUE@ profiles/cyclingspeed/cyclingspeed.c +@SIXAXIS_TRUE@am__append_12 = plugins/sixaxis.la +@MAINTAINER_MODE_TRUE@am__append_13 = plugins/external-dummy.la +@CLIENT_TRUE@am__append_14 = client/bluetoothctl +@MONITOR_TRUE@am__append_15 = monitor/btmon +@EXPERIMENTAL_TRUE@am__append_16 = emulator/btvirt emulator/b1ee \ +@EXPERIMENTAL_TRUE@ emulator/hfp tools/3dsp tools/mgmt-tester \ +@EXPERIMENTAL_TRUE@ tools/gap-tester tools/l2cap-tester \ +@EXPERIMENTAL_TRUE@ tools/sco-tester tools/smp-tester \ +@EXPERIMENTAL_TRUE@ tools/hci-tester tools/rfcomm-tester \ +@EXPERIMENTAL_TRUE@ tools/bdaddr tools/avinfo tools/avtest \ +@EXPERIMENTAL_TRUE@ tools/scotest tools/amptest tools/hwdb \ +@EXPERIMENTAL_TRUE@ tools/hcieventmask tools/hcisecfilter \ +@EXPERIMENTAL_TRUE@ tools/btmgmt tools/btinfo tools/btattach \ +@EXPERIMENTAL_TRUE@ tools/btsnoop tools/btproxy tools/btiotest \ +@EXPERIMENTAL_TRUE@ tools/mpris-player tools/cltest \ +@EXPERIMENTAL_TRUE@ tools/seq2bseq tools/ibeacon +@TOOLS_TRUE@am__append_17 = tools/hciattach tools/hciconfig tools/hcitool tools/hcidump \ +@TOOLS_TRUE@ tools/rfcomm tools/rctest tools/l2test tools/l2ping \ +@TOOLS_TRUE@ tools/sdptool tools/ciptool tools/bccmd tools/bluemoon + +@TOOLS_TRUE@am__append_18 = tools/hciattach.1 tools/hciconfig.1 \ +@TOOLS_TRUE@ tools/hcitool.1 tools/hcidump.1 \ +@TOOLS_TRUE@ tools/rfcomm.1 tools/rctest.1 tools/l2ping.1 \ +@TOOLS_TRUE@ tools/sdptool.1 tools/ciptool.1 tools/bccmd.1 + +@TOOLS_FALSE@am__append_19 = tools/hciattach.1 tools/hciconfig.1 \ +@TOOLS_FALSE@ tools/hcitool.1 tools/hcidump.1 \ +@TOOLS_FALSE@ tools/rfcomm.1 tools/rctest.1 tools/l2ping.1 \ +@TOOLS_FALSE@ tools/sdptool.1 tools/ciptool.1 tools/bccmd.1 + +@HID2HCI_TRUE@udev_PROGRAMS = tools/hid2hci$(EXEEXT) +@HID2HCI_TRUE@am__append_20 = tools/hid2hci.1 +@HID2HCI_FALSE@am__append_21 = tools/hid2hci.1 +@EXPERIMENTAL_TRUE@am__append_22 = tools/bdaddr.1 +@READLINE_TRUE@am__append_23 = attrib/gatttool \ +@READLINE_TRUE@ tools/obex-client-tool tools/obex-server-tool \ +@READLINE_TRUE@ tools/bluetooth-player tools/obexctl + +@EXPERIMENTAL_TRUE@am__append_24 = tools/gatt-service \ +@EXPERIMENTAL_TRUE@ profiles/iap/iapd +@CUPS_TRUE@cups_PROGRAMS = profiles/cups/bluetooth$(EXEEXT) +@EXPERIMENTAL_TRUE@am__append_25 = pcsuite +@EXPERIMENTAL_TRUE@am__append_26 = obexd/plugins/pcsuite.c +@OBEX_TRUE@am__append_27 = irmc pbap +@OBEX_TRUE@am__append_28 = obexd/plugins/irmc.c obexd/plugins/pbap.c \ +@OBEX_TRUE@ obexd/plugins/vcard.h obexd/plugins/vcard.c \ +@OBEX_TRUE@ obexd/plugins/phonebook.h \ +@OBEX_TRUE@ obexd/plugins/phonebook-dummy.c +@ANDROID_TRUE@am__append_29 = android/system-emulator \ +@ANDROID_TRUE@ android/bluetoothd-snoop android/bluetoothd \ +@ANDROID_TRUE@ android/haltest android/android-tester \ +@ANDROID_TRUE@ android/ipc-tester +@ANDROID_TRUE@am__append_30 = android/bluetooth.default.la \ +@ANDROID_TRUE@ android/audio.a2dp.default.la +@ANDROID_TRUE@am__append_31 = android/test-ipc +@HID2HCI_TRUE@am__append_32 = $(rules_DATA) +TESTS = $(am__EXEEXT_9) +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = src/bluetoothd.8 lib/bluez.pc +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +profiles_sap_libsap_a_AR = $(AR) $(ARFLAGS) +profiles_sap_libsap_a_LIBADD = +am__profiles_sap_libsap_a_SOURCES_DIST = profiles/sap/sap.h \ + profiles/sap/sap-u8500.c +am__dirstamp = $(am__leading_dot)dirstamp +@EXPERIMENTAL_TRUE@am_profiles_sap_libsap_a_OBJECTS = \ +@EXPERIMENTAL_TRUE@ profiles/sap/sap-u8500.$(OBJEXT) +profiles_sap_libsap_a_OBJECTS = $(am_profiles_sap_libsap_a_OBJECTS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" \ + "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsdir)" \ + "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(udevdir)" \ + "$(DESTDIR)$(testdir)" "$(DESTDIR)$(man1dir)" \ + "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confdir)" \ + "$(DESTDIR)$(dbusdir)" "$(DESTDIR)$(dbussessionbusdir)" \ + "$(DESTDIR)$(dbussystembusdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(rulesdir)" "$(DESTDIR)$(statedir)" \ + "$(DESTDIR)$(systemdsystemunitdir)" \ + "$(DESTDIR)$(systemduserunitdir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) \ + $(plugin_LTLIBRARIES) +android_audio_a2dp_default_la_DEPENDENCIES = +am__android_audio_a2dp_default_la_SOURCES_DIST = android/audio-msg.h \ + android/hal-msg.h android/hal-audio.c android/hardware/audio.h \ + android/hardware/audio_effect.h android/hardware/hardware.h \ + android/system/audio.h +@ANDROID_TRUE@am_android_audio_a2dp_default_la_OBJECTS = android/android_audio_a2dp_default_la-hal-audio.lo +android_audio_a2dp_default_la_OBJECTS = \ + $(am_android_audio_a2dp_default_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +android_audio_a2dp_default_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) \ + $(android_audio_a2dp_default_la_LDFLAGS) $(LDFLAGS) -o $@ +@ANDROID_TRUE@am_android_audio_a2dp_default_la_rpath = -rpath \ +@ANDROID_TRUE@ $(plugindir) +android_bluetooth_default_la_LIBADD = +am__android_bluetooth_default_la_SOURCES_DIST = android/hal.h \ + android/hal-bluetooth.c android/hal-socket.c \ + android/hal-hidhost.c android/hal-health.c android/hal-pan.c \ + android/hal-a2dp.c android/hal-avrcp.c android/hal-handsfree.c \ + android/hal-gatt.c android/hardware/bluetooth.h \ + android/hardware/bt_av.h android/hardware/bt_gatt.h \ + android/hardware/bt_gatt_client.h \ + android/hardware/bt_gatt_server.h \ + android/hardware/bt_gatt_types.h android/hardware/bt_hf.h \ + android/hardware/bt_hh.h android/hardware/bt_hl.h \ + android/hardware/bt_pan.h android/hardware/bt_rc.h \ + android/hardware/bt_sock.h android/hardware/hardware.h \ + android/cutils/properties.h android/ipc-common.h \ + android/hal-log.h android/hal-ipc.h android/hal-ipc.c \ + android/hal-utils.h android/hal-utils.c +@ANDROID_TRUE@am_android_bluetooth_default_la_OBJECTS = android/android_bluetooth_default_la-hal-bluetooth.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-socket.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-hidhost.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-health.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-pan.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-a2dp.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-avrcp.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-handsfree.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-gatt.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-ipc.lo \ +@ANDROID_TRUE@ android/android_bluetooth_default_la-hal-utils.lo +android_bluetooth_default_la_OBJECTS = \ + $(am_android_bluetooth_default_la_OBJECTS) +android_bluetooth_default_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) \ + $(android_bluetooth_default_la_LDFLAGS) $(LDFLAGS) -o $@ +@ANDROID_TRUE@am_android_bluetooth_default_la_rpath = -rpath \ +@ANDROID_TRUE@ $(plugindir) +gdbus_libgdbus_internal_la_LIBADD = +am_gdbus_libgdbus_internal_la_OBJECTS = gdbus/mainloop.lo \ + gdbus/watch.lo gdbus/object.lo gdbus/client.lo gdbus/polkit.lo +gdbus_libgdbus_internal_la_OBJECTS = \ + $(am_gdbus_libgdbus_internal_la_OBJECTS) +lib_libbluetooth_internal_la_LIBADD = +am__objects_1 = +am__objects_2 = lib/bluetooth.lo lib/hci.lo lib/sdp.lo +am__objects_3 = lib/uuid.lo +am_lib_libbluetooth_internal_la_OBJECTS = $(am__objects_1) \ + $(am__objects_2) $(am__objects_1) $(am__objects_3) +lib_libbluetooth_internal_la_OBJECTS = \ + $(am_lib_libbluetooth_internal_la_OBJECTS) +lib_libbluetooth_la_LIBADD = +am__lib_libbluetooth_la_SOURCES_DIST = lib/bluetooth.h lib/hci.h \ + lib/hci_lib.h lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \ + lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h lib/bluetooth.c \ + lib/hci.c lib/sdp.c +@LIBRARY_TRUE@am_lib_libbluetooth_la_OBJECTS = $(am__objects_1) \ +@LIBRARY_TRUE@ $(am__objects_2) +lib_libbluetooth_la_OBJECTS = $(am_lib_libbluetooth_la_OBJECTS) +lib_libbluetooth_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(lib_libbluetooth_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@LIBRARY_TRUE@am_lib_libbluetooth_la_rpath = -rpath $(libdir) +plugins_external_dummy_la_LIBADD = +am__plugins_external_dummy_la_SOURCES_DIST = plugins/external-dummy.c +@MAINTAINER_MODE_TRUE@am_plugins_external_dummy_la_OBJECTS = plugins/plugins_external_dummy_la-external-dummy.lo +plugins_external_dummy_la_OBJECTS = \ + $(am_plugins_external_dummy_la_OBJECTS) +plugins_external_dummy_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) \ + $(plugins_external_dummy_la_LDFLAGS) $(LDFLAGS) -o $@ +@MAINTAINER_MODE_TRUE@am_plugins_external_dummy_la_rpath = -rpath \ +@MAINTAINER_MODE_TRUE@ $(plugindir) +plugins_sixaxis_la_LIBADD = +am__plugins_sixaxis_la_SOURCES_DIST = plugins/sixaxis.c +@SIXAXIS_TRUE@am_plugins_sixaxis_la_OBJECTS = \ +@SIXAXIS_TRUE@ plugins/plugins_sixaxis_la-sixaxis.lo +plugins_sixaxis_la_OBJECTS = $(am_plugins_sixaxis_la_OBJECTS) +plugins_sixaxis_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) \ + $(plugins_sixaxis_la_LDFLAGS) $(LDFLAGS) -o $@ +@SIXAXIS_TRUE@am_plugins_sixaxis_la_rpath = -rpath $(plugindir) +@CLIENT_TRUE@am__EXEEXT_1 = client/bluetoothctl$(EXEEXT) +@MONITOR_TRUE@am__EXEEXT_2 = monitor/btmon$(EXEEXT) +@TOOLS_TRUE@am__EXEEXT_3 = tools/hciattach$(EXEEXT) \ +@TOOLS_TRUE@ tools/hciconfig$(EXEEXT) tools/hcitool$(EXEEXT) \ +@TOOLS_TRUE@ tools/hcidump$(EXEEXT) tools/rfcomm$(EXEEXT) \ +@TOOLS_TRUE@ tools/rctest$(EXEEXT) tools/l2test$(EXEEXT) \ +@TOOLS_TRUE@ tools/l2ping$(EXEEXT) tools/sdptool$(EXEEXT) \ +@TOOLS_TRUE@ tools/ciptool$(EXEEXT) tools/bccmd$(EXEEXT) \ +@TOOLS_TRUE@ tools/bluemoon$(EXEEXT) +@EXPERIMENTAL_TRUE@am__EXEEXT_4 = emulator/btvirt$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ emulator/b1ee$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ emulator/hfp$(EXEEXT) tools/3dsp$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/mgmt-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/gap-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/l2cap-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/sco-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/smp-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/hci-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/rfcomm-tester$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/bdaddr$(EXEEXT) tools/avinfo$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/avtest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/scotest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/amptest$(EXEEXT) tools/hwdb$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/hcieventmask$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/hcisecfilter$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btmgmt$(EXEEXT) tools/btinfo$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btattach$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btsnoop$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btproxy$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/btiotest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/mpris-player$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/cltest$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/seq2bseq$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ tools/ibeacon$(EXEEXT) +@READLINE_TRUE@am__EXEEXT_5 = attrib/gatttool$(EXEEXT) \ +@READLINE_TRUE@ tools/obex-client-tool$(EXEEXT) \ +@READLINE_TRUE@ tools/obex-server-tool$(EXEEXT) \ +@READLINE_TRUE@ tools/bluetooth-player$(EXEEXT) \ +@READLINE_TRUE@ tools/obexctl$(EXEEXT) +@EXPERIMENTAL_TRUE@am__EXEEXT_6 = tools/gatt-service$(EXEEXT) \ +@EXPERIMENTAL_TRUE@ profiles/iap/iapd$(EXEEXT) +@ANDROID_TRUE@am__EXEEXT_7 = android/system-emulator$(EXEEXT) \ +@ANDROID_TRUE@ android/bluetoothd-snoop$(EXEEXT) \ +@ANDROID_TRUE@ android/bluetoothd$(EXEEXT) \ +@ANDROID_TRUE@ android/haltest$(EXEEXT) \ +@ANDROID_TRUE@ android/android-tester$(EXEEXT) \ +@ANDROID_TRUE@ android/ipc-tester$(EXEEXT) +@ANDROID_TRUE@am__EXEEXT_8 = android/test-ipc$(EXEEXT) +am__EXEEXT_9 = $(am__EXEEXT_8) unit/test-eir$(EXEEXT) \ + unit/test-uuid$(EXEEXT) unit/test-textfile$(EXEEXT) \ + unit/test-crc$(EXEEXT) unit/test-ringbuf$(EXEEXT) \ + unit/test-queue$(EXEEXT) unit/test-mgmt$(EXEEXT) \ + unit/test-sdp$(EXEEXT) unit/test-avdtp$(EXEEXT) \ + unit/test-avctp$(EXEEXT) unit/test-avrcp$(EXEEXT) \ + unit/test-hfp$(EXEEXT) unit/test-gdbus-client$(EXEEXT) \ + unit/test-gobex-header$(EXEEXT) \ + unit/test-gobex-packet$(EXEEXT) unit/test-gobex$(EXEEXT) \ + unit/test-gobex-transfer$(EXEEXT) \ + unit/test-gobex-apparam$(EXEEXT) unit/test-lib$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) $(cups_PROGRAMS) $(libexec_PROGRAMS) \ + $(noinst_PROGRAMS) $(udev_PROGRAMS) +am__android_android_tester_SOURCES_DIST = emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c src/shared/queue.h \ + src/shared/queue.c src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c src/shared/hciemu.h \ + src/shared/hciemu.c src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c \ + monitor/rfcomm.h android/hardware/hardware.c \ + android/android-tester.c +@ANDROID_TRUE@am_android_android_tester_OBJECTS = \ +@ANDROID_TRUE@ emulator/android_android_tester-btdev.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_android_tester-bthost.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_android_tester-smp.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_android_tester-crypto.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_android_tester-io-glib.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_android_tester-queue.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_android_tester-util.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_android_tester-mgmt.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_android_tester-hciemu.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_android_tester-tester.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_android_tester-timeout-glib.$(OBJEXT) \ +@ANDROID_TRUE@ android/hardware/android_android_tester-hardware.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_android_tester-android-tester.$(OBJEXT) +android_android_tester_OBJECTS = $(am_android_android_tester_OBJECTS) +@ANDROID_TRUE@android_android_tester_DEPENDENCIES = \ +@ANDROID_TRUE@ lib/libbluetooth-internal.la +android_android_tester_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_android_tester_CFLAGS) $(CFLAGS) \ + $(android_android_tester_LDFLAGS) $(LDFLAGS) -o $@ +am__android_bluetoothd_SOURCES_DIST = android/main.c src/log.c \ + android/hal-msg.h android/audio-msg.h android/utils.h \ + src/sdpd-database.c src/sdpd-server.c src/sdpd-service.c \ + src/sdpd-request.c src/uuid-helper.h src/uuid-helper.c \ + src/eir.h src/eir.c src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c src/shared/util.h \ + src/shared/util.c src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/ringbuf.h src/shared/ringbuf.c src/shared/hfp.h \ + src/shared/hfp.c android/bluetooth.h android/bluetooth.c \ + android/hidhost.h android/hidhost.c android/ipc-common.h \ + android/ipc.h android/ipc.c android/avdtp.h android/avdtp.c \ + android/a2dp.h android/a2dp.c android/avctp.h android/avctp.c \ + android/avrcp.h android/avrcp.c android/avrcp-lib.h \ + android/avrcp-lib.c android/socket.h android/socket.c \ + android/pan.h android/pan.c android/handsfree.h \ + android/handsfree.c android/gatt.h android/gatt.c \ + android/health.h android/health.c attrib/att.c attrib/att.h \ + attrib/gatt.c attrib/gatt.h attrib/gattrib.c attrib/gattrib.h \ + btio/btio.h btio/btio.c src/sdp-client.h src/sdp-client.c \ + profiles/network/bnep.h profiles/network/bnep.c +@ANDROID_TRUE@am_android_bluetoothd_OBJECTS = android/main.$(OBJEXT) \ +@ANDROID_TRUE@ src/log.$(OBJEXT) src/sdpd-database.$(OBJEXT) \ +@ANDROID_TRUE@ src/sdpd-server.$(OBJEXT) \ +@ANDROID_TRUE@ src/sdpd-service.$(OBJEXT) \ +@ANDROID_TRUE@ src/sdpd-request.$(OBJEXT) \ +@ANDROID_TRUE@ src/uuid-helper.$(OBJEXT) src/eir.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/io-glib.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/queue.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/util.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/mgmt.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/ringbuf.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/hfp.$(OBJEXT) \ +@ANDROID_TRUE@ android/bluetooth.$(OBJEXT) \ +@ANDROID_TRUE@ android/hidhost.$(OBJEXT) android/ipc.$(OBJEXT) \ +@ANDROID_TRUE@ android/avdtp.$(OBJEXT) android/a2dp.$(OBJEXT) \ +@ANDROID_TRUE@ android/avctp.$(OBJEXT) android/avrcp.$(OBJEXT) \ +@ANDROID_TRUE@ android/avrcp-lib.$(OBJEXT) \ +@ANDROID_TRUE@ android/socket.$(OBJEXT) android/pan.$(OBJEXT) \ +@ANDROID_TRUE@ android/handsfree.$(OBJEXT) \ +@ANDROID_TRUE@ android/gatt.$(OBJEXT) android/health.$(OBJEXT) \ +@ANDROID_TRUE@ attrib/att.$(OBJEXT) attrib/gatt.$(OBJEXT) \ +@ANDROID_TRUE@ attrib/gattrib.$(OBJEXT) btio/btio.$(OBJEXT) \ +@ANDROID_TRUE@ src/sdp-client.$(OBJEXT) \ +@ANDROID_TRUE@ profiles/network/bnep.$(OBJEXT) +android_bluetoothd_OBJECTS = $(am_android_bluetoothd_OBJECTS) +@ANDROID_TRUE@android_bluetoothd_DEPENDENCIES = \ +@ANDROID_TRUE@ lib/libbluetooth-internal.la +am__android_bluetoothd_snoop_SOURCES_DIST = \ + android/bluetoothd-snoop.c monitor/mainloop.h \ + monitor/mainloop.c src/shared/btsnoop.h src/shared/btsnoop.c +@ANDROID_TRUE@am_android_bluetoothd_snoop_OBJECTS = \ +@ANDROID_TRUE@ android/bluetoothd-snoop.$(OBJEXT) \ +@ANDROID_TRUE@ monitor/mainloop.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/btsnoop.$(OBJEXT) +android_bluetoothd_snoop_OBJECTS = \ + $(am_android_bluetoothd_snoop_OBJECTS) +android_bluetoothd_snoop_LDADD = $(LDADD) +am__android_haltest_SOURCES_DIST = android/client/haltest.c \ + android/client/pollhandler.h android/client/pollhandler.c \ + android/client/terminal.h android/client/terminal.c \ + android/client/history.h android/client/history.c \ + android/client/tabcompletion.c android/client/if-main.h \ + android/client/if-av.c android/client/if-rc.c \ + android/client/if-bt.c android/client/if-gatt.c \ + android/client/if-hf.c android/client/if-hh.c \ + android/client/if-pan.c android/client/if-sock.c \ + android/client/if-audio.c android/hardware/hardware.c \ + android/hal-utils.h android/hal-utils.c +@ANDROID_TRUE@am_android_haltest_OBJECTS = android/client/android_haltest-haltest.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-pollhandler.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-terminal.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-history.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-tabcompletion.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-av.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-rc.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-bt.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-gatt.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-hf.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-hh.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-pan.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-sock.$(OBJEXT) \ +@ANDROID_TRUE@ android/client/android_haltest-if-audio.$(OBJEXT) \ +@ANDROID_TRUE@ android/hardware/android_haltest-hardware.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_haltest-hal-utils.$(OBJEXT) +android_haltest_OBJECTS = $(am_android_haltest_OBJECTS) +android_haltest_LDADD = $(LDADD) +android_haltest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_haltest_CFLAGS) $(CFLAGS) $(android_haltest_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__android_ipc_tester_SOURCES_DIST = emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c src/shared/queue.h \ + src/shared/queue.c src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c src/shared/hciemu.h \ + src/shared/hciemu.c src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c \ + android/hal-utils.h android/hal-utils.c android/ipc-common.h \ + android/ipc-tester.c +@ANDROID_TRUE@am_android_ipc_tester_OBJECTS = \ +@ANDROID_TRUE@ emulator/android_ipc_tester-btdev.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_ipc_tester-bthost.$(OBJEXT) \ +@ANDROID_TRUE@ emulator/android_ipc_tester-smp.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_ipc_tester-crypto.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_ipc_tester-io-glib.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_ipc_tester-queue.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_ipc_tester-util.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_ipc_tester-mgmt.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_ipc_tester-hciemu.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_ipc_tester-tester.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/android_ipc_tester-timeout-glib.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_ipc_tester-hal-utils.$(OBJEXT) \ +@ANDROID_TRUE@ android/android_ipc_tester-ipc-tester.$(OBJEXT) +android_ipc_tester_OBJECTS = $(am_android_ipc_tester_OBJECTS) +@ANDROID_TRUE@android_ipc_tester_DEPENDENCIES = \ +@ANDROID_TRUE@ lib/libbluetooth-internal.la +android_ipc_tester_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(android_ipc_tester_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__android_system_emulator_SOURCES_DIST = android/system-emulator.c \ + monitor/mainloop.h monitor/mainloop.c +@ANDROID_TRUE@am_android_system_emulator_OBJECTS = \ +@ANDROID_TRUE@ android/system-emulator.$(OBJEXT) \ +@ANDROID_TRUE@ monitor/mainloop.$(OBJEXT) +android_system_emulator_OBJECTS = \ + $(am_android_system_emulator_OBJECTS) +android_system_emulator_LDADD = $(LDADD) +am__android_test_ipc_SOURCES_DIST = android/test-ipc.c \ + src/shared/util.h src/shared/util.c src/log.h src/log.c \ + android/ipc-common.h android/ipc.c android/ipc.h +@ANDROID_TRUE@am_android_test_ipc_OBJECTS = \ +@ANDROID_TRUE@ android/test-ipc.$(OBJEXT) \ +@ANDROID_TRUE@ src/shared/util.$(OBJEXT) src/log.$(OBJEXT) \ +@ANDROID_TRUE@ android/ipc.$(OBJEXT) +android_test_ipc_OBJECTS = $(am_android_test_ipc_OBJECTS) +android_test_ipc_DEPENDENCIES = +am__attrib_gatttool_SOURCES_DIST = attrib/gatttool.c attrib/att.c \ + attrib/gatt.c attrib/gattrib.c btio/btio.c attrib/gatttool.h \ + attrib/interactive.c attrib/utils.c src/log.c client/display.c \ + client/display.h +@READLINE_TRUE@am_attrib_gatttool_OBJECTS = attrib/gatttool.$(OBJEXT) \ +@READLINE_TRUE@ attrib/att.$(OBJEXT) attrib/gatt.$(OBJEXT) \ +@READLINE_TRUE@ attrib/gattrib.$(OBJEXT) btio/btio.$(OBJEXT) \ +@READLINE_TRUE@ attrib/interactive.$(OBJEXT) \ +@READLINE_TRUE@ attrib/utils.$(OBJEXT) src/log.$(OBJEXT) \ +@READLINE_TRUE@ client/display.$(OBJEXT) +attrib_gatttool_OBJECTS = $(am_attrib_gatttool_OBJECTS) +@READLINE_TRUE@attrib_gatttool_DEPENDENCIES = \ +@READLINE_TRUE@ lib/libbluetooth-internal.la +am__client_bluetoothctl_SOURCES_DIST = client/main.c client/display.h \ + client/display.c client/agent.h client/agent.c monitor/uuid.h \ + monitor/uuid.c +@CLIENT_TRUE@am_client_bluetoothctl_OBJECTS = client/main.$(OBJEXT) \ +@CLIENT_TRUE@ client/display.$(OBJEXT) client/agent.$(OBJEXT) \ +@CLIENT_TRUE@ monitor/uuid.$(OBJEXT) +client_bluetoothctl_OBJECTS = $(am_client_bluetoothctl_OBJECTS) +@CLIENT_TRUE@client_bluetoothctl_DEPENDENCIES = \ +@CLIENT_TRUE@ gdbus/libgdbus-internal.la +am__emulator_b1ee_SOURCES_DIST = emulator/b1ee.c monitor/mainloop.h \ + monitor/mainloop.c +@EXPERIMENTAL_TRUE@am_emulator_b1ee_OBJECTS = emulator/b1ee.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) +emulator_b1ee_OBJECTS = $(am_emulator_b1ee_OBJECTS) +emulator_b1ee_LDADD = $(LDADD) +am__emulator_btvirt_SOURCES_DIST = emulator/main.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c src/shared/timeout.h \ + src/shared/timeout-mainloop.c src/shared/util.h \ + src/shared/util.c src/shared/crypto.h src/shared/crypto.c \ + emulator/server.h emulator/server.c emulator/vhci.h \ + emulator/vhci.c emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c emulator/smp.c \ + emulator/amp.h emulator/amp.c emulator/le.h emulator/le.c +@EXPERIMENTAL_TRUE@am_emulator_btvirt_OBJECTS = \ +@EXPERIMENTAL_TRUE@ emulator/main.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/server.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/vhci.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/amp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/le.$(OBJEXT) +emulator_btvirt_OBJECTS = $(am_emulator_btvirt_OBJECTS) +@EXPERIMENTAL_TRUE@emulator_btvirt_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__emulator_hfp_SOURCES_DIST = emulator/hfp.c monitor/mainloop.h \ + monitor/mainloop.c src/shared/io.h src/shared/io-mainloop.c \ + src/shared/util.h src/shared/util.c src/shared/queue.h \ + src/shared/queue.c src/shared/ringbuf.h src/shared/ringbuf.c \ + src/shared/hfp.h src/shared/hfp.c +@EXPERIMENTAL_TRUE@am_emulator_hfp_OBJECTS = emulator/hfp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/ringbuf.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hfp.$(OBJEXT) +emulator_hfp_OBJECTS = $(am_emulator_hfp_OBJECTS) +emulator_hfp_LDADD = $(LDADD) +am__monitor_btmon_SOURCES_DIST = monitor/main.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c monitor/display.h \ + monitor/display.c monitor/hcidump.h monitor/hcidump.c \ + monitor/ellisys.h monitor/ellisys.c monitor/control.h \ + monitor/control.c monitor/packet.h monitor/packet.c \ + monitor/vendor.h monitor/vendor.c monitor/lmp.h monitor/lmp.c \ + monitor/crc.h monitor/crc.c monitor/ll.h monitor/ll.c \ + monitor/l2cap.h monitor/l2cap.c monitor/sdp.h monitor/sdp.c \ + monitor/uuid.h monitor/uuid.c monitor/hwdb.h monitor/hwdb.c \ + monitor/keys.h monitor/keys.c monitor/analyze.h \ + monitor/analyze.c src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c src/shared/crypto.h \ + src/shared/crypto.c src/shared/btsnoop.h src/shared/btsnoop.c +@MONITOR_TRUE@am_monitor_btmon_OBJECTS = monitor/main.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/mainloop.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/display.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/hcidump.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/ellisys.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/control.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/packet.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/vendor.$(OBJEXT) monitor/lmp.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/crc.$(OBJEXT) monitor/ll.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/l2cap.$(OBJEXT) monitor/sdp.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/uuid.$(OBJEXT) monitor/hwdb.$(OBJEXT) \ +@MONITOR_TRUE@ monitor/keys.$(OBJEXT) monitor/analyze.$(OBJEXT) \ +@MONITOR_TRUE@ src/shared/util.$(OBJEXT) \ +@MONITOR_TRUE@ src/shared/queue.$(OBJEXT) \ +@MONITOR_TRUE@ src/shared/crypto.$(OBJEXT) \ +@MONITOR_TRUE@ src/shared/btsnoop.$(OBJEXT) +monitor_btmon_OBJECTS = $(am_monitor_btmon_OBJECTS) +@MONITOR_TRUE@monitor_btmon_DEPENDENCIES = \ +@MONITOR_TRUE@ lib/libbluetooth-internal.la +am__obexd_src_obexd_SOURCES_DIST = btio/btio.h btio/btio.c \ + gobex/gobex.h gobex/gobex.c gobex/gobex-defs.h \ + gobex/gobex-defs.c gobex/gobex-packet.c gobex/gobex-packet.h \ + gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h \ + obexd/plugins/filesystem.c obexd/plugins/filesystem.h \ + obexd/plugins/bluetooth.c obexd/plugins/pcsuite.c \ + obexd/plugins/opp.c obexd/plugins/ftp.c obexd/plugins/ftp.h \ + obexd/plugins/irmc.c obexd/plugins/pbap.c \ + obexd/plugins/vcard.h obexd/plugins/vcard.c \ + obexd/plugins/phonebook.h obexd/plugins/phonebook-dummy.c \ + obexd/plugins/mas.c obexd/src/map_ap.h \ + obexd/plugins/messages.h obexd/plugins/messages-dummy.c \ + obexd/client/mns.c obexd/client/map-event.h obexd/src/main.c \ + obexd/src/obexd.h obexd/src/plugin.h obexd/src/plugin.c \ + obexd/src/log.h obexd/src/log.c obexd/src/manager.h \ + obexd/src/manager.c obexd/src/obex.h obexd/src/obex.c \ + obexd/src/obex-priv.h obexd/src/mimetype.h \ + obexd/src/mimetype.c obexd/src/service.h obexd/src/service.c \ + obexd/src/transport.h obexd/src/transport.c obexd/src/server.h \ + obexd/src/server.c obexd/client/manager.h \ + obexd/client/manager.c obexd/client/session.h \ + obexd/client/session.c obexd/client/bluetooth.h \ + obexd/client/bluetooth.c obexd/client/sync.h \ + obexd/client/sync.c obexd/client/pbap.h obexd/client/pbap.c \ + obexd/client/ftp.h obexd/client/ftp.c obexd/client/opp.h \ + obexd/client/opp.c obexd/client/map.h obexd/client/map.c \ + obexd/client/map-event.c obexd/client/transfer.h \ + obexd/client/transfer.c obexd/client/transport.h \ + obexd/client/transport.c obexd/client/dbus.h \ + obexd/client/dbus.c obexd/client/driver.h \ + obexd/client/driver.c +am__objects_4 = btio/obexd-btio.$(OBJEXT) +am__objects_5 = gobex/obexd-gobex.$(OBJEXT) \ + gobex/obexd-gobex-defs.$(OBJEXT) \ + gobex/obexd-gobex-packet.$(OBJEXT) \ + gobex/obexd-gobex-header.$(OBJEXT) \ + gobex/obexd-gobex-transfer.$(OBJEXT) \ + gobex/obexd-gobex-apparam.$(OBJEXT) +@EXPERIMENTAL_TRUE@am__objects_6 = \ +@EXPERIMENTAL_TRUE@ obexd/plugins/obexd-pcsuite.$(OBJEXT) +@OBEX_TRUE@am__objects_7 = obexd/plugins/obexd-irmc.$(OBJEXT) \ +@OBEX_TRUE@ obexd/plugins/obexd-pbap.$(OBJEXT) \ +@OBEX_TRUE@ obexd/plugins/obexd-vcard.$(OBJEXT) \ +@OBEX_TRUE@ obexd/plugins/obexd-phonebook-dummy.$(OBJEXT) +am__objects_8 = obexd/plugins/obexd-filesystem.$(OBJEXT) \ + obexd/plugins/obexd-bluetooth.$(OBJEXT) $(am__objects_6) \ + obexd/plugins/obexd-opp.$(OBJEXT) \ + obexd/plugins/obexd-ftp.$(OBJEXT) $(am__objects_7) \ + obexd/plugins/obexd-mas.$(OBJEXT) \ + obexd/plugins/obexd-messages-dummy.$(OBJEXT) \ + obexd/client/obexd-mns.$(OBJEXT) +am_obexd_src_obexd_OBJECTS = $(am__objects_4) $(am__objects_5) \ + $(am__objects_8) obexd/src/obexd-main.$(OBJEXT) \ + obexd/src/obexd-plugin.$(OBJEXT) obexd/src/obexd-log.$(OBJEXT) \ + obexd/src/obexd-manager.$(OBJEXT) \ + obexd/src/obexd-obex.$(OBJEXT) \ + obexd/src/obexd-mimetype.$(OBJEXT) \ + obexd/src/obexd-service.$(OBJEXT) \ + obexd/src/obexd-transport.$(OBJEXT) \ + obexd/src/obexd-server.$(OBJEXT) \ + obexd/client/obexd-manager.$(OBJEXT) \ + obexd/client/obexd-session.$(OBJEXT) \ + obexd/client/obexd-bluetooth.$(OBJEXT) \ + obexd/client/obexd-sync.$(OBJEXT) \ + obexd/client/obexd-pbap.$(OBJEXT) \ + obexd/client/obexd-ftp.$(OBJEXT) \ + obexd/client/obexd-opp.$(OBJEXT) \ + obexd/client/obexd-map.$(OBJEXT) \ + obexd/client/obexd-map-event.$(OBJEXT) \ + obexd/client/obexd-transfer.$(OBJEXT) \ + obexd/client/obexd-transport.$(OBJEXT) \ + obexd/client/obexd-dbus.$(OBJEXT) \ + obexd/client/obexd-driver.$(OBJEXT) +am__objects_9 = $(am__objects_1) +nodist_obexd_src_obexd_OBJECTS = $(am__objects_9) +obexd_src_obexd_OBJECTS = $(am_obexd_src_obexd_OBJECTS) \ + $(nodist_obexd_src_obexd_OBJECTS) +obexd_src_obexd_DEPENDENCIES = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la +obexd_src_obexd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(obexd_src_obexd_CFLAGS) $(CFLAGS) $(obexd_src_obexd_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__profiles_cups_bluetooth_SOURCES_DIST = profiles/cups/main.c \ + profiles/cups/cups.h profiles/cups/sdp.c profiles/cups/spp.c \ + profiles/cups/hcrp.c +@CUPS_TRUE@am_profiles_cups_bluetooth_OBJECTS = \ +@CUPS_TRUE@ profiles/cups/main.$(OBJEXT) \ +@CUPS_TRUE@ profiles/cups/sdp.$(OBJEXT) \ +@CUPS_TRUE@ profiles/cups/spp.$(OBJEXT) \ +@CUPS_TRUE@ profiles/cups/hcrp.$(OBJEXT) +profiles_cups_bluetooth_OBJECTS = \ + $(am_profiles_cups_bluetooth_OBJECTS) +@CUPS_TRUE@profiles_cups_bluetooth_DEPENDENCIES = \ +@CUPS_TRUE@ lib/libbluetooth-internal.la \ +@CUPS_TRUE@ gdbus/libgdbus-internal.la +am__profiles_iap_iapd_SOURCES_DIST = profiles/iap/main.c +@EXPERIMENTAL_TRUE@am_profiles_iap_iapd_OBJECTS = \ +@EXPERIMENTAL_TRUE@ profiles/iap/main.$(OBJEXT) +profiles_iap_iapd_OBJECTS = $(am_profiles_iap_iapd_OBJECTS) +@EXPERIMENTAL_TRUE@profiles_iap_iapd_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la +am__src_bluetoothd_SOURCES_DIST = plugins/hostname.c plugins/wiimote.c \ + plugins/autopair.c plugins/dropcam.c plugins/policy.c \ + plugins/gatt-example.c plugins/neard.c profiles/sap/main.c \ + profiles/sap/manager.h profiles/sap/manager.c \ + profiles/sap/server.h profiles/sap/server.c profiles/sap/sap.h \ + profiles/sap/sap-dummy.c profiles/audio/source.h \ + profiles/audio/source.c profiles/audio/sink.h \ + profiles/audio/sink.c profiles/audio/a2dp.h \ + profiles/audio/a2dp.c profiles/audio/avdtp.h \ + profiles/audio/avdtp.c profiles/audio/media.h \ + profiles/audio/media.c profiles/audio/transport.h \ + profiles/audio/transport.c profiles/audio/a2dp-codecs.h \ + profiles/audio/control.h profiles/audio/control.c \ + profiles/audio/avctp.h profiles/audio/avctp.c \ + profiles/audio/avrcp.h profiles/audio/avrcp.c \ + profiles/audio/player.h profiles/audio/player.c \ + profiles/network/manager.c profiles/network/bnep.h \ + profiles/network/bnep.c profiles/network/server.h \ + profiles/network/server.c profiles/network/connection.h \ + profiles/network/connection.c profiles/input/manager.c \ + profiles/input/server.h profiles/input/server.c \ + profiles/input/device.h profiles/input/device.c \ + profiles/input/hog.c profiles/input/uhid_copy.h \ + profiles/input/suspend.h profiles/input/suspend-dummy.c \ + profiles/health/mcap_lib.h profiles/health/mcap_internal.h \ + profiles/health/mcap.h profiles/health/mcap.c \ + profiles/health/mcap_sync.c profiles/health/hdp_main.c \ + profiles/health/hdp_types.h profiles/health/hdp_manager.h \ + profiles/health/hdp_manager.c profiles/health/hdp.h \ + profiles/health/hdp.c profiles/health/hdp_util.h \ + profiles/health/hdp_util.c profiles/gatt/gas.c \ + profiles/scanparam/scan.c profiles/deviceinfo/deviceinfo.c \ + profiles/alert/server.c profiles/time/server.c \ + profiles/proximity/main.c profiles/proximity/manager.h \ + profiles/proximity/manager.c profiles/proximity/monitor.h \ + profiles/proximity/monitor.c profiles/proximity/reporter.h \ + profiles/proximity/reporter.c profiles/proximity/linkloss.h \ + profiles/proximity/linkloss.c profiles/proximity/immalert.h \ + profiles/proximity/immalert.c \ + profiles/thermometer/thermometer.c \ + profiles/heartrate/heartrate.c \ + profiles/cyclingspeed/cyclingspeed.c attrib/att.h \ + attrib/att-database.h attrib/att.c attrib/gatt.h attrib/gatt.c \ + attrib/gattrib.h attrib/gattrib.c attrib/gatt-service.h \ + attrib/gatt-service.c btio/btio.h btio/btio.c \ + src/bluetooth.ver src/main.c src/log.h src/log.c src/systemd.h \ + src/systemd.c src/rfkill.c src/hcid.h src/sdpd.h \ + src/sdpd-server.c src/sdpd-request.c src/sdpd-service.c \ + src/sdpd-database.c src/attrib-server.h src/attrib-server.c \ + src/sdp-xml.h src/sdp-xml.c src/sdp-client.h src/sdp-client.c \ + src/textfile.h src/textfile.c src/uuid-helper.h \ + src/uuid-helper.c src/uinput.h src/plugin.h src/plugin.c \ + src/storage.h src/storage.c src/agent.h src/agent.c \ + src/error.h src/error.c src/adapter.h src/adapter.c \ + src/profile.h src/profile.c src/service.h src/service.c \ + src/gatt-dbus.h src/gatt-dbus.c src/gatt.h src/gatt.c \ + src/device.h src/device.c src/attio.h src/dbus-common.c \ + src/dbus-common.h src/eir.h src/eir.c src/shared/io.h \ + src/shared/io-glib.c src/shared/timeout.h \ + src/shared/timeout-glib.c src/shared/queue.h \ + src/shared/queue.c src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c +@MAINTAINER_MODE_TRUE@am__objects_10 = plugins/bluetoothd-gatt-example.$(OBJEXT) +@EXPERIMENTAL_TRUE@am__objects_11 = \ +@EXPERIMENTAL_TRUE@ plugins/bluetoothd-neard.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/sap/bluetoothd-main.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/sap/bluetoothd-manager.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/sap/bluetoothd-server.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/sap/bluetoothd-sap-dummy.$(OBJEXT) +@EXPERIMENTAL_TRUE@am__objects_12 = \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-mcap.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-mcap_sync.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-hdp_main.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-hdp_manager.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-hdp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/health/bluetoothd-hdp_util.$(OBJEXT) +@EXPERIMENTAL_TRUE@am__objects_13 = \ +@EXPERIMENTAL_TRUE@ profiles/alert/bluetoothd-server.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/time/bluetoothd-server.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/proximity/bluetoothd-main.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/proximity/bluetoothd-manager.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/proximity/bluetoothd-monitor.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/proximity/bluetoothd-reporter.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/proximity/bluetoothd-linkloss.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/proximity/bluetoothd-immalert.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/thermometer/bluetoothd-thermometer.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/heartrate/bluetoothd-heartrate.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ profiles/cyclingspeed/bluetoothd-cyclingspeed.$(OBJEXT) +am__objects_14 = plugins/bluetoothd-hostname.$(OBJEXT) \ + plugins/bluetoothd-wiimote.$(OBJEXT) \ + plugins/bluetoothd-autopair.$(OBJEXT) \ + plugins/bluetoothd-dropcam.$(OBJEXT) \ + plugins/bluetoothd-policy.$(OBJEXT) $(am__objects_10) \ + $(am__objects_11) profiles/audio/bluetoothd-source.$(OBJEXT) \ + profiles/audio/bluetoothd-sink.$(OBJEXT) \ + profiles/audio/bluetoothd-a2dp.$(OBJEXT) \ + profiles/audio/bluetoothd-avdtp.$(OBJEXT) \ + profiles/audio/bluetoothd-media.$(OBJEXT) \ + profiles/audio/bluetoothd-transport.$(OBJEXT) \ + profiles/audio/bluetoothd-control.$(OBJEXT) \ + profiles/audio/bluetoothd-avctp.$(OBJEXT) \ + profiles/audio/bluetoothd-avrcp.$(OBJEXT) \ + profiles/audio/bluetoothd-player.$(OBJEXT) \ + profiles/network/bluetoothd-manager.$(OBJEXT) \ + profiles/network/bluetoothd-bnep.$(OBJEXT) \ + profiles/network/bluetoothd-server.$(OBJEXT) \ + profiles/network/bluetoothd-connection.$(OBJEXT) \ + profiles/input/bluetoothd-manager.$(OBJEXT) \ + profiles/input/bluetoothd-server.$(OBJEXT) \ + profiles/input/bluetoothd-device.$(OBJEXT) \ + profiles/input/bluetoothd-hog.$(OBJEXT) \ + profiles/input/bluetoothd-suspend-dummy.$(OBJEXT) \ + $(am__objects_12) profiles/gatt/bluetoothd-gas.$(OBJEXT) \ + profiles/scanparam/bluetoothd-scan.$(OBJEXT) \ + profiles/deviceinfo/bluetoothd-deviceinfo.$(OBJEXT) \ + $(am__objects_13) +am__objects_15 = attrib/bluetoothd-att.$(OBJEXT) \ + attrib/bluetoothd-gatt.$(OBJEXT) \ + attrib/bluetoothd-gattrib.$(OBJEXT) \ + attrib/bluetoothd-gatt-service.$(OBJEXT) +am__objects_16 = btio/bluetoothd-btio.$(OBJEXT) +am_src_bluetoothd_OBJECTS = $(am__objects_14) $(am__objects_15) \ + $(am__objects_16) src/bluetoothd-main.$(OBJEXT) \ + src/bluetoothd-log.$(OBJEXT) src/bluetoothd-systemd.$(OBJEXT) \ + src/bluetoothd-rfkill.$(OBJEXT) \ + src/bluetoothd-sdpd-server.$(OBJEXT) \ + src/bluetoothd-sdpd-request.$(OBJEXT) \ + src/bluetoothd-sdpd-service.$(OBJEXT) \ + src/bluetoothd-sdpd-database.$(OBJEXT) \ + src/bluetoothd-attrib-server.$(OBJEXT) \ + src/bluetoothd-sdp-xml.$(OBJEXT) \ + src/bluetoothd-sdp-client.$(OBJEXT) \ + src/bluetoothd-textfile.$(OBJEXT) \ + src/bluetoothd-uuid-helper.$(OBJEXT) \ + src/bluetoothd-plugin.$(OBJEXT) \ + src/bluetoothd-storage.$(OBJEXT) \ + src/bluetoothd-agent.$(OBJEXT) src/bluetoothd-error.$(OBJEXT) \ + src/bluetoothd-adapter.$(OBJEXT) \ + src/bluetoothd-profile.$(OBJEXT) \ + src/bluetoothd-service.$(OBJEXT) \ + src/bluetoothd-gatt-dbus.$(OBJEXT) \ + src/bluetoothd-gatt.$(OBJEXT) src/bluetoothd-device.$(OBJEXT) \ + src/bluetoothd-dbus-common.$(OBJEXT) \ + src/bluetoothd-eir.$(OBJEXT) \ + src/shared/bluetoothd-io-glib.$(OBJEXT) \ + src/shared/bluetoothd-timeout-glib.$(OBJEXT) \ + src/shared/bluetoothd-queue.$(OBJEXT) \ + src/shared/bluetoothd-util.$(OBJEXT) \ + src/shared/bluetoothd-mgmt.$(OBJEXT) +nodist_src_bluetoothd_OBJECTS = $(am__objects_9) +src_bluetoothd_OBJECTS = $(am_src_bluetoothd_OBJECTS) \ + $(nodist_src_bluetoothd_OBJECTS) +src_bluetoothd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(src_bluetoothd_CFLAGS) $(CFLAGS) $(src_bluetoothd_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__tools_3dsp_SOURCES_DIST = tools/3dsp.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c src/shared/io.h \ + src/shared/io-mainloop.c src/shared/timeout.h \ + src/shared/timeout-mainloop.c src/shared/hci.h \ + src/shared/hci.c src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c +@EXPERIMENTAL_TRUE@am_tools_3dsp_OBJECTS = tools/3dsp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hci.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) +tools_3dsp_OBJECTS = $(am_tools_3dsp_OBJECTS) +tools_3dsp_LDADD = $(LDADD) +tools_amptest_SOURCES = tools/amptest.c +tools_amptest_OBJECTS = tools/amptest.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_amptest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +tools_avinfo_SOURCES = tools/avinfo.c +tools_avinfo_OBJECTS = tools/avinfo.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_avinfo_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +tools_avtest_SOURCES = tools/avtest.c +tools_avtest_OBJECTS = tools/avtest.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_avtest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_bccmd_SOURCES_DIST = tools/bccmd.c tools/csr.h tools/csr.c \ + tools/csr_hci.c tools/csr_usb.c tools/csr_h4.c \ + tools/csr_3wire.c tools/csr_bcsp.c tools/ubcsp.h tools/ubcsp.c +@TOOLS_TRUE@am_tools_bccmd_OBJECTS = tools/bccmd.$(OBJEXT) \ +@TOOLS_TRUE@ tools/csr.$(OBJEXT) tools/csr_hci.$(OBJEXT) \ +@TOOLS_TRUE@ tools/csr_usb.$(OBJEXT) tools/csr_h4.$(OBJEXT) \ +@TOOLS_TRUE@ tools/csr_3wire.$(OBJEXT) tools/csr_bcsp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/ubcsp.$(OBJEXT) +tools_bccmd_OBJECTS = $(am_tools_bccmd_OBJECTS) +@TOOLS_TRUE@tools_bccmd_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_bdaddr_SOURCES_DIST = tools/bdaddr.c src/oui.h src/oui.c +@EXPERIMENTAL_TRUE@am_tools_bdaddr_OBJECTS = tools/bdaddr.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/oui.$(OBJEXT) +tools_bdaddr_OBJECTS = $(am_tools_bdaddr_OBJECTS) +@EXPERIMENTAL_TRUE@tools_bdaddr_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_bluemoon_SOURCES_DIST = tools/bluemoon.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c src/shared/io.h \ + src/shared/io-mainloop.c src/shared/hci.h src/shared/hci.c \ + src/shared/util.h src/shared/util.c src/shared/queue.h \ + src/shared/queue.c +@TOOLS_TRUE@am_tools_bluemoon_OBJECTS = tools/bluemoon.$(OBJEXT) \ +@TOOLS_TRUE@ monitor/mainloop.$(OBJEXT) \ +@TOOLS_TRUE@ src/shared/io-mainloop.$(OBJEXT) \ +@TOOLS_TRUE@ src/shared/hci.$(OBJEXT) src/shared/util.$(OBJEXT) \ +@TOOLS_TRUE@ src/shared/queue.$(OBJEXT) +tools_bluemoon_OBJECTS = $(am_tools_bluemoon_OBJECTS) +tools_bluemoon_LDADD = $(LDADD) +am__tools_bluetooth_player_SOURCES_DIST = tools/bluetooth-player.c \ + client/display.h client/display.c +@READLINE_TRUE@am_tools_bluetooth_player_OBJECTS = \ +@READLINE_TRUE@ tools/bluetooth-player.$(OBJEXT) \ +@READLINE_TRUE@ client/display.$(OBJEXT) +tools_bluetooth_player_OBJECTS = $(am_tools_bluetooth_player_OBJECTS) +@READLINE_TRUE@tools_bluetooth_player_DEPENDENCIES = \ +@READLINE_TRUE@ gdbus/libgdbus-internal.la +tools_btattach_SOURCES = tools/btattach.c +tools_btattach_OBJECTS = tools/btattach.$(OBJEXT) +tools_btattach_LDADD = $(LDADD) +am__tools_btinfo_SOURCES_DIST = tools/btinfo.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c src/shared/io.h \ + src/shared/io-mainloop.c src/shared/timeout.h \ + src/shared/timeout-mainloop.c src/shared/hci.h \ + src/shared/hci.c src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c +@EXPERIMENTAL_TRUE@am_tools_btinfo_OBJECTS = tools/btinfo.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hci.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) +tools_btinfo_OBJECTS = $(am_tools_btinfo_OBJECTS) +tools_btinfo_LDADD = $(LDADD) +am__tools_btiotest_SOURCES_DIST = tools/btiotest.c btio/btio.h \ + btio/btio.c +@EXPERIMENTAL_TRUE@am_tools_btiotest_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/btiotest.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ btio/btio.$(OBJEXT) +tools_btiotest_OBJECTS = $(am_tools_btiotest_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btiotest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_btmgmt_SOURCES_DIST = tools/btmgmt.c src/uuid-helper.c \ + monitor/mainloop.h monitor/mainloop.c src/shared/io.h \ + src/shared/io-mainloop.c src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c src/shared/mgmt.h \ + src/shared/mgmt.c +@EXPERIMENTAL_TRUE@am_tools_btmgmt_OBJECTS = tools/btmgmt.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/uuid-helper.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.$(OBJEXT) +tools_btmgmt_OBJECTS = $(am_tools_btmgmt_OBJECTS) +@EXPERIMENTAL_TRUE@tools_btmgmt_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_btproxy_SOURCES_DIST = tools/btproxy.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c src/shared/util.h \ + src/shared/util.c +@EXPERIMENTAL_TRUE@am_tools_btproxy_OBJECTS = tools/btproxy.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) +tools_btproxy_OBJECTS = $(am_tools_btproxy_OBJECTS) +tools_btproxy_LDADD = $(LDADD) +am__tools_btsnoop_SOURCES_DIST = tools/btsnoop.c src/shared/pcap.h \ + src/shared/pcap.c src/shared/btsnoop.h src/shared/btsnoop.c +@EXPERIMENTAL_TRUE@am_tools_btsnoop_OBJECTS = tools/btsnoop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/pcap.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/btsnoop.$(OBJEXT) +tools_btsnoop_OBJECTS = $(am_tools_btsnoop_OBJECTS) +tools_btsnoop_LDADD = $(LDADD) +tools_ciptool_SOURCES = tools/ciptool.c +tools_ciptool_OBJECTS = tools/ciptool.$(OBJEXT) +@TOOLS_TRUE@tools_ciptool_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_cltest_SOURCES_DIST = tools/cltest.c monitor/mainloop.h \ + monitor/mainloop.c +@EXPERIMENTAL_TRUE@am_tools_cltest_OBJECTS = tools/cltest.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) +tools_cltest_OBJECTS = $(am_tools_cltest_OBJECTS) +@EXPERIMENTAL_TRUE@tools_cltest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_gap_tester_SOURCES_DIST = tools/gap-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c src/shared/crypto.h \ + src/shared/crypto.c src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c src/shared/hciemu.h \ + src/shared/hciemu.c src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c +@EXPERIMENTAL_TRUE@am_tools_gap_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/gap-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-glib.$(OBJEXT) +tools_gap_tester_OBJECTS = $(am_tools_gap_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_gap_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la +am__tools_gatt_service_SOURCES_DIST = tools/gatt-service.c +@EXPERIMENTAL_TRUE@am_tools_gatt_service_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/gatt-service.$(OBJEXT) +tools_gatt_service_OBJECTS = $(am_tools_gatt_service_OBJECTS) +@EXPERIMENTAL_TRUE@tools_gatt_service_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la +am__tools_hci_tester_SOURCES_DIST = tools/hci-tester.c monitor/bt.h \ + src/shared/io.h src/shared/io-glib.c src/shared/hci.h \ + src/shared/hci.c src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c src/shared/tester.h \ + src/shared/tester.c +@EXPERIMENTAL_TRUE@am_tools_hci_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/hci-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-glib.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hci.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/tester.$(OBJEXT) +tools_hci_tester_OBJECTS = $(am_tools_hci_tester_OBJECTS) +tools_hci_tester_DEPENDENCIES = +am__tools_hciattach_SOURCES_DIST = tools/hciattach.c tools/hciattach.h \ + tools/hciattach_st.c tools/hciattach_ti.c \ + tools/hciattach_tialt.c tools/hciattach_ath3k.c \ + tools/hciattach_qualcomm.c tools/hciattach_intel.c +@TOOLS_TRUE@am_tools_hciattach_OBJECTS = tools/hciattach.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_st.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_ti.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_tialt.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_ath3k.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_qualcomm.$(OBJEXT) \ +@TOOLS_TRUE@ tools/hciattach_intel.$(OBJEXT) +tools_hciattach_OBJECTS = $(am_tools_hciattach_OBJECTS) +@TOOLS_TRUE@tools_hciattach_DEPENDENCIES = \ +@TOOLS_TRUE@ lib/libbluetooth-internal.la +am__tools_hciconfig_SOURCES_DIST = tools/hciconfig.c tools/csr.h \ + tools/csr.c +@TOOLS_TRUE@am_tools_hciconfig_OBJECTS = tools/hciconfig.$(OBJEXT) \ +@TOOLS_TRUE@ tools/csr.$(OBJEXT) +tools_hciconfig_OBJECTS = $(am_tools_hciconfig_OBJECTS) +@TOOLS_TRUE@tools_hciconfig_DEPENDENCIES = \ +@TOOLS_TRUE@ lib/libbluetooth-internal.la +am__tools_hcidump_SOURCES_DIST = tools/hcidump.c tools/parser/parser.h \ + tools/parser/parser.c tools/parser/lmp.c tools/parser/hci.c \ + tools/parser/l2cap.h tools/parser/l2cap.c tools/parser/amp.c \ + tools/parser/smp.c tools/parser/att.c tools/parser/sdp.h \ + tools/parser/sdp.c tools/parser/rfcomm.h tools/parser/rfcomm.c \ + tools/parser/bnep.c tools/parser/cmtp.c tools/parser/hidp.c \ + tools/parser/hcrp.c tools/parser/avdtp.c tools/parser/avctp.c \ + tools/parser/avrcp.c tools/parser/sap.c tools/parser/obex.c \ + tools/parser/capi.c tools/parser/ppp.c tools/parser/tcpip.c \ + tools/parser/ericsson.c tools/parser/csr.c tools/parser/bpa.c +@TOOLS_TRUE@am_tools_hcidump_OBJECTS = tools/hcidump.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/parser.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/lmp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/hci.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/l2cap.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/amp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/smp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/att.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/sdp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/rfcomm.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/bnep.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/cmtp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/hidp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/hcrp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/avdtp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/avctp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/avrcp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/sap.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/obex.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/capi.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/ppp.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/tcpip.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/ericsson.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/csr.$(OBJEXT) \ +@TOOLS_TRUE@ tools/parser/bpa.$(OBJEXT) +tools_hcidump_OBJECTS = $(am_tools_hcidump_OBJECTS) +@TOOLS_TRUE@tools_hcidump_DEPENDENCIES = lib/libbluetooth-internal.la +tools_hcieventmask_SOURCES = tools/hcieventmask.c +tools_hcieventmask_OBJECTS = tools/hcieventmask.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_hcieventmask_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +tools_hcisecfilter_SOURCES = tools/hcisecfilter.c +tools_hcisecfilter_OBJECTS = tools/hcisecfilter.$(OBJEXT) +tools_hcisecfilter_LDADD = $(LDADD) +am__tools_hcitool_SOURCES_DIST = tools/hcitool.c src/oui.h src/oui.c +@TOOLS_TRUE@am_tools_hcitool_OBJECTS = tools/hcitool.$(OBJEXT) \ +@TOOLS_TRUE@ src/oui.$(OBJEXT) +tools_hcitool_OBJECTS = $(am_tools_hcitool_OBJECTS) +@TOOLS_TRUE@tools_hcitool_DEPENDENCIES = lib/libbluetooth-internal.la +tools_hid2hci_SOURCES = tools/hid2hci.c +tools_hid2hci_OBJECTS = tools/hid2hci.$(OBJEXT) +tools_hid2hci_DEPENDENCIES = +tools_hwdb_SOURCES = tools/hwdb.c +tools_hwdb_OBJECTS = tools/hwdb.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_hwdb_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_ibeacon_SOURCES_DIST = tools/ibeacon.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c src/shared/io.h \ + src/shared/io-mainloop.c src/shared/timeout.h \ + src/shared/timeout-mainloop.c src/shared/hci.h \ + src/shared/hci.c src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c +@EXPERIMENTAL_TRUE@am_tools_ibeacon_OBJECTS = tools/ibeacon.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-mainloop.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hci.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) +tools_ibeacon_OBJECTS = $(am_tools_ibeacon_OBJECTS) +tools_ibeacon_LDADD = $(LDADD) +am__tools_l2cap_tester_SOURCES_DIST = tools/l2cap-tester.c \ + monitor/bt.h emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c src/shared/io.h \ + src/shared/io-glib.c src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c src/shared/mgmt.h \ + src/shared/mgmt.c src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c src/shared/timeout.h \ + src/shared/timeout-glib.c +@EXPERIMENTAL_TRUE@am_tools_l2cap_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/l2cap-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-glib.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-glib.$(OBJEXT) +tools_l2cap_tester_OBJECTS = $(am_tools_l2cap_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_l2cap_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +tools_l2ping_SOURCES = tools/l2ping.c +tools_l2ping_OBJECTS = tools/l2ping.$(OBJEXT) +@TOOLS_TRUE@tools_l2ping_DEPENDENCIES = lib/libbluetooth-internal.la +tools_l2test_SOURCES = tools/l2test.c +tools_l2test_OBJECTS = tools/l2test.$(OBJEXT) +@TOOLS_TRUE@tools_l2test_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_mgmt_tester_SOURCES_DIST = tools/mgmt-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c src/shared/crypto.h \ + src/shared/crypto.c src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c src/shared/util.h \ + src/shared/util.c src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c src/shared/tester.h \ + src/shared/tester.c src/shared/timeout.h \ + src/shared/timeout-glib.c +@EXPERIMENTAL_TRUE@am_tools_mgmt_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/mgmt-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-glib.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-glib.$(OBJEXT) +tools_mgmt_tester_OBJECTS = $(am_tools_mgmt_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_mgmt_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_mpris_player_SOURCES_DIST = tools/mpris-player.c +@EXPERIMENTAL_TRUE@am_tools_mpris_player_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/mpris-player.$(OBJEXT) +tools_mpris_player_OBJECTS = $(am_tools_mpris_player_OBJECTS) +@EXPERIMENTAL_TRUE@tools_mpris_player_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la +am__tools_obex_client_tool_SOURCES_DIST = gobex/gobex.h gobex/gobex.c \ + gobex/gobex-defs.h gobex/gobex-defs.c gobex/gobex-packet.c \ + gobex/gobex-packet.h gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h btio/btio.h \ + btio/btio.c tools/obex-client-tool.c +am__objects_17 = gobex/gobex.$(OBJEXT) gobex/gobex-defs.$(OBJEXT) \ + gobex/gobex-packet.$(OBJEXT) gobex/gobex-header.$(OBJEXT) \ + gobex/gobex-transfer.$(OBJEXT) gobex/gobex-apparam.$(OBJEXT) +am__objects_18 = btio/btio.$(OBJEXT) +@READLINE_TRUE@am_tools_obex_client_tool_OBJECTS = $(am__objects_17) \ +@READLINE_TRUE@ $(am__objects_18) \ +@READLINE_TRUE@ tools/obex-client-tool.$(OBJEXT) +tools_obex_client_tool_OBJECTS = $(am_tools_obex_client_tool_OBJECTS) +@READLINE_TRUE@tools_obex_client_tool_DEPENDENCIES = \ +@READLINE_TRUE@ lib/libbluetooth-internal.la +am__tools_obex_server_tool_SOURCES_DIST = gobex/gobex.h gobex/gobex.c \ + gobex/gobex-defs.h gobex/gobex-defs.c gobex/gobex-packet.c \ + gobex/gobex-packet.h gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h btio/btio.h \ + btio/btio.c tools/obex-server-tool.c +@READLINE_TRUE@am_tools_obex_server_tool_OBJECTS = $(am__objects_17) \ +@READLINE_TRUE@ $(am__objects_18) \ +@READLINE_TRUE@ tools/obex-server-tool.$(OBJEXT) +tools_obex_server_tool_OBJECTS = $(am_tools_obex_server_tool_OBJECTS) +@READLINE_TRUE@tools_obex_server_tool_DEPENDENCIES = \ +@READLINE_TRUE@ lib/libbluetooth-internal.la +am__tools_obexctl_SOURCES_DIST = tools/obexctl.c client/display.h \ + client/display.c +@READLINE_TRUE@am_tools_obexctl_OBJECTS = tools/obexctl.$(OBJEXT) \ +@READLINE_TRUE@ client/display.$(OBJEXT) +tools_obexctl_OBJECTS = $(am_tools_obexctl_OBJECTS) +@READLINE_TRUE@tools_obexctl_DEPENDENCIES = \ +@READLINE_TRUE@ gdbus/libgdbus-internal.la +tools_rctest_SOURCES = tools/rctest.c +tools_rctest_OBJECTS = tools/rctest.$(OBJEXT) +@TOOLS_TRUE@tools_rctest_DEPENDENCIES = lib/libbluetooth-internal.la +tools_rfcomm_SOURCES = tools/rfcomm.c +tools_rfcomm_OBJECTS = tools/rfcomm.$(OBJEXT) +@TOOLS_TRUE@tools_rfcomm_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_rfcomm_tester_SOURCES_DIST = tools/rfcomm-tester.c \ + monitor/bt.h emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c src/shared/io.h \ + src/shared/io-glib.c src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c src/shared/mgmt.h \ + src/shared/mgmt.c src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c src/shared/timeout.h \ + src/shared/timeout-glib.c +@EXPERIMENTAL_TRUE@am_tools_rfcomm_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/rfcomm-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-glib.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-glib.$(OBJEXT) +tools_rfcomm_tester_OBJECTS = $(am_tools_rfcomm_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_rfcomm_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_sco_tester_SOURCES_DIST = tools/sco-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c src/shared/crypto.h \ + src/shared/crypto.c src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c src/shared/util.h \ + src/shared/util.c src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c src/shared/tester.h \ + src/shared/tester.c src/shared/timeout.h \ + src/shared/timeout-glib.c +@EXPERIMENTAL_TRUE@am_tools_sco_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/sco-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-glib.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-glib.$(OBJEXT) +tools_sco_tester_OBJECTS = $(am_tools_sco_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_sco_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +tools_scotest_SOURCES = tools/scotest.c +tools_scotest_OBJECTS = tools/scotest.$(OBJEXT) +@EXPERIMENTAL_TRUE@tools_scotest_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am__tools_sdptool_SOURCES_DIST = tools/sdptool.c src/sdp-xml.h \ + src/sdp-xml.c +@TOOLS_TRUE@am_tools_sdptool_OBJECTS = tools/sdptool.$(OBJEXT) \ +@TOOLS_TRUE@ src/sdp-xml.$(OBJEXT) +tools_sdptool_OBJECTS = $(am_tools_sdptool_OBJECTS) +@TOOLS_TRUE@tools_sdptool_DEPENDENCIES = lib/libbluetooth-internal.la +am__tools_seq2bseq_SOURCES_DIST = tools/seq2bseq.c +@EXPERIMENTAL_TRUE@am_tools_seq2bseq_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/seq2bseq.$(OBJEXT) +tools_seq2bseq_OBJECTS = $(am_tools_seq2bseq_OBJECTS) +tools_seq2bseq_LDADD = $(LDADD) +am__tools_smp_tester_SOURCES_DIST = tools/smp-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c src/shared/crypto.h \ + src/shared/crypto.c src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c src/shared/util.h \ + src/shared/util.c src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c src/shared/tester.h \ + src/shared/tester.c src/shared/timeout.h \ + src/shared/timeout-glib.c +@EXPERIMENTAL_TRUE@am_tools_smp_tester_OBJECTS = \ +@EXPERIMENTAL_TRUE@ tools/smp-tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/btdev.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/bthost.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ emulator/smp.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/io-glib.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/queue.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/util.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/tester.$(OBJEXT) \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-glib.$(OBJEXT) +tools_smp_tester_OBJECTS = $(am_tools_smp_tester_OBJECTS) +@EXPERIMENTAL_TRUE@tools_smp_tester_DEPENDENCIES = \ +@EXPERIMENTAL_TRUE@ lib/libbluetooth-internal.la +am_unit_test_avctp_OBJECTS = unit/test-avctp.$(OBJEXT) \ + src/shared/util.$(OBJEXT) src/log.$(OBJEXT) \ + android/avctp.$(OBJEXT) +unit_test_avctp_OBJECTS = $(am_unit_test_avctp_OBJECTS) +unit_test_avctp_DEPENDENCIES = +am_unit_test_avdtp_OBJECTS = unit/test-avdtp.$(OBJEXT) \ + src/shared/util.$(OBJEXT) src/log.$(OBJEXT) \ + android/avdtp.$(OBJEXT) +unit_test_avdtp_OBJECTS = $(am_unit_test_avdtp_OBJECTS) +unit_test_avdtp_DEPENDENCIES = +am_unit_test_avrcp_OBJECTS = unit/test-avrcp.$(OBJEXT) \ + src/shared/util.$(OBJEXT) src/log.$(OBJEXT) \ + android/avctp.$(OBJEXT) android/avrcp-lib.$(OBJEXT) +unit_test_avrcp_OBJECTS = $(am_unit_test_avrcp_OBJECTS) +unit_test_avrcp_DEPENDENCIES = lib/libbluetooth-internal.la +am_unit_test_crc_OBJECTS = unit/test-crc.$(OBJEXT) \ + monitor/crc.$(OBJEXT) +unit_test_crc_OBJECTS = $(am_unit_test_crc_OBJECTS) +unit_test_crc_DEPENDENCIES = +am_unit_test_eir_OBJECTS = unit/test-eir.$(OBJEXT) src/eir.$(OBJEXT) \ + src/uuid-helper.$(OBJEXT) +unit_test_eir_OBJECTS = $(am_unit_test_eir_OBJECTS) +unit_test_eir_DEPENDENCIES = lib/libbluetooth-internal.la +am_unit_test_gdbus_client_OBJECTS = unit/test-gdbus-client.$(OBJEXT) +unit_test_gdbus_client_OBJECTS = $(am_unit_test_gdbus_client_OBJECTS) +unit_test_gdbus_client_DEPENDENCIES = gdbus/libgdbus-internal.la +am_unit_test_gobex_OBJECTS = $(am__objects_17) unit/util.$(OBJEXT) \ + unit/test-gobex.$(OBJEXT) +unit_test_gobex_OBJECTS = $(am_unit_test_gobex_OBJECTS) +unit_test_gobex_DEPENDENCIES = +am_unit_test_gobex_apparam_OBJECTS = $(am__objects_17) \ + unit/util.$(OBJEXT) unit/test-gobex-apparam.$(OBJEXT) +unit_test_gobex_apparam_OBJECTS = \ + $(am_unit_test_gobex_apparam_OBJECTS) +unit_test_gobex_apparam_DEPENDENCIES = +am_unit_test_gobex_header_OBJECTS = $(am__objects_17) \ + unit/util.$(OBJEXT) unit/test-gobex-header.$(OBJEXT) +unit_test_gobex_header_OBJECTS = $(am_unit_test_gobex_header_OBJECTS) +unit_test_gobex_header_DEPENDENCIES = +am_unit_test_gobex_packet_OBJECTS = $(am__objects_17) \ + unit/util.$(OBJEXT) unit/test-gobex-packet.$(OBJEXT) +unit_test_gobex_packet_OBJECTS = $(am_unit_test_gobex_packet_OBJECTS) +unit_test_gobex_packet_DEPENDENCIES = +am_unit_test_gobex_transfer_OBJECTS = $(am__objects_17) \ + unit/util.$(OBJEXT) unit/test-gobex-transfer.$(OBJEXT) +unit_test_gobex_transfer_OBJECTS = \ + $(am_unit_test_gobex_transfer_OBJECTS) +unit_test_gobex_transfer_DEPENDENCIES = +am_unit_test_hfp_OBJECTS = unit/test-hfp.$(OBJEXT) \ + src/shared/io-glib.$(OBJEXT) src/shared/queue.$(OBJEXT) \ + src/shared/util.$(OBJEXT) src/shared/mgmt.$(OBJEXT) \ + src/shared/ringbuf.$(OBJEXT) src/shared/hfp.$(OBJEXT) +unit_test_hfp_OBJECTS = $(am_unit_test_hfp_OBJECTS) +unit_test_hfp_DEPENDENCIES = +am_unit_test_lib_OBJECTS = unit/test-lib.$(OBJEXT) +unit_test_lib_OBJECTS = $(am_unit_test_lib_OBJECTS) +unit_test_lib_DEPENDENCIES = lib/libbluetooth-internal.la +am_unit_test_mgmt_OBJECTS = unit/test-mgmt.$(OBJEXT) \ + src/shared/io-glib.$(OBJEXT) src/shared/queue.$(OBJEXT) \ + src/shared/util.$(OBJEXT) src/shared/mgmt.$(OBJEXT) +unit_test_mgmt_OBJECTS = $(am_unit_test_mgmt_OBJECTS) +unit_test_mgmt_DEPENDENCIES = +am_unit_test_queue_OBJECTS = unit/test-queue.$(OBJEXT) \ + src/shared/util.$(OBJEXT) src/shared/queue.$(OBJEXT) +unit_test_queue_OBJECTS = $(am_unit_test_queue_OBJECTS) +unit_test_queue_DEPENDENCIES = +am_unit_test_ringbuf_OBJECTS = unit/test-ringbuf.$(OBJEXT) \ + src/shared/util.$(OBJEXT) src/shared/ringbuf.$(OBJEXT) +unit_test_ringbuf_OBJECTS = $(am_unit_test_ringbuf_OBJECTS) +unit_test_ringbuf_DEPENDENCIES = +am_unit_test_sdp_OBJECTS = unit/test-sdp.$(OBJEXT) \ + src/shared/util.$(OBJEXT) src/sdpd-database.$(OBJEXT) \ + src/log.$(OBJEXT) src/sdpd-service.$(OBJEXT) \ + src/sdpd-request.$(OBJEXT) +unit_test_sdp_OBJECTS = $(am_unit_test_sdp_OBJECTS) +unit_test_sdp_DEPENDENCIES = lib/libbluetooth-internal.la +am_unit_test_textfile_OBJECTS = unit/test-textfile.$(OBJEXT) \ + src/textfile.$(OBJEXT) +unit_test_textfile_OBJECTS = $(am_unit_test_textfile_OBJECTS) +unit_test_textfile_DEPENDENCIES = +am_unit_test_uuid_OBJECTS = unit/test-uuid.$(OBJEXT) +unit_test_uuid_OBJECTS = $(am_unit_test_uuid_OBJECTS) +unit_test_uuid_DEPENDENCIES = lib/libbluetooth-internal.la +SCRIPTS = $(test_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(profiles_sap_libsap_a_SOURCES) \ + $(android_audio_a2dp_default_la_SOURCES) \ + $(android_bluetooth_default_la_SOURCES) \ + $(gdbus_libgdbus_internal_la_SOURCES) \ + $(lib_libbluetooth_internal_la_SOURCES) \ + $(lib_libbluetooth_la_SOURCES) \ + $(plugins_external_dummy_la_SOURCES) \ + $(plugins_sixaxis_la_SOURCES) \ + $(android_android_tester_SOURCES) \ + $(android_bluetoothd_SOURCES) \ + $(android_bluetoothd_snoop_SOURCES) $(android_haltest_SOURCES) \ + $(android_ipc_tester_SOURCES) \ + $(android_system_emulator_SOURCES) $(android_test_ipc_SOURCES) \ + $(attrib_gatttool_SOURCES) $(client_bluetoothctl_SOURCES) \ + $(emulator_b1ee_SOURCES) $(emulator_btvirt_SOURCES) \ + $(emulator_hfp_SOURCES) $(monitor_btmon_SOURCES) \ + $(obexd_src_obexd_SOURCES) $(nodist_obexd_src_obexd_SOURCES) \ + $(profiles_cups_bluetooth_SOURCES) \ + $(profiles_iap_iapd_SOURCES) $(src_bluetoothd_SOURCES) \ + $(nodist_src_bluetoothd_SOURCES) $(tools_3dsp_SOURCES) \ + tools/amptest.c tools/avinfo.c tools/avtest.c \ + $(tools_bccmd_SOURCES) $(tools_bdaddr_SOURCES) \ + $(tools_bluemoon_SOURCES) $(tools_bluetooth_player_SOURCES) \ + tools/btattach.c $(tools_btinfo_SOURCES) \ + $(tools_btiotest_SOURCES) $(tools_btmgmt_SOURCES) \ + $(tools_btproxy_SOURCES) $(tools_btsnoop_SOURCES) \ + tools/ciptool.c $(tools_cltest_SOURCES) \ + $(tools_gap_tester_SOURCES) $(tools_gatt_service_SOURCES) \ + $(tools_hci_tester_SOURCES) $(tools_hciattach_SOURCES) \ + $(tools_hciconfig_SOURCES) $(tools_hcidump_SOURCES) \ + tools/hcieventmask.c tools/hcisecfilter.c \ + $(tools_hcitool_SOURCES) tools/hid2hci.c tools/hwdb.c \ + $(tools_ibeacon_SOURCES) $(tools_l2cap_tester_SOURCES) \ + tools/l2ping.c tools/l2test.c $(tools_mgmt_tester_SOURCES) \ + $(tools_mpris_player_SOURCES) \ + $(tools_obex_client_tool_SOURCES) \ + $(tools_obex_server_tool_SOURCES) $(tools_obexctl_SOURCES) \ + tools/rctest.c tools/rfcomm.c $(tools_rfcomm_tester_SOURCES) \ + $(tools_sco_tester_SOURCES) tools/scotest.c \ + $(tools_sdptool_SOURCES) $(tools_seq2bseq_SOURCES) \ + $(tools_smp_tester_SOURCES) $(unit_test_avctp_SOURCES) \ + $(unit_test_avdtp_SOURCES) $(unit_test_avrcp_SOURCES) \ + $(unit_test_crc_SOURCES) $(unit_test_eir_SOURCES) \ + $(unit_test_gdbus_client_SOURCES) $(unit_test_gobex_SOURCES) \ + $(unit_test_gobex_apparam_SOURCES) \ + $(unit_test_gobex_header_SOURCES) \ + $(unit_test_gobex_packet_SOURCES) \ + $(unit_test_gobex_transfer_SOURCES) $(unit_test_hfp_SOURCES) \ + $(unit_test_lib_SOURCES) $(unit_test_mgmt_SOURCES) \ + $(unit_test_queue_SOURCES) $(unit_test_ringbuf_SOURCES) \ + $(unit_test_sdp_SOURCES) $(unit_test_textfile_SOURCES) \ + $(unit_test_uuid_SOURCES) +DIST_SOURCES = $(am__profiles_sap_libsap_a_SOURCES_DIST) \ + $(am__android_audio_a2dp_default_la_SOURCES_DIST) \ + $(am__android_bluetooth_default_la_SOURCES_DIST) \ + $(gdbus_libgdbus_internal_la_SOURCES) \ + $(lib_libbluetooth_internal_la_SOURCES) \ + $(am__lib_libbluetooth_la_SOURCES_DIST) \ + $(am__plugins_external_dummy_la_SOURCES_DIST) \ + $(am__plugins_sixaxis_la_SOURCES_DIST) \ + $(am__android_android_tester_SOURCES_DIST) \ + $(am__android_bluetoothd_SOURCES_DIST) \ + $(am__android_bluetoothd_snoop_SOURCES_DIST) \ + $(am__android_haltest_SOURCES_DIST) \ + $(am__android_ipc_tester_SOURCES_DIST) \ + $(am__android_system_emulator_SOURCES_DIST) \ + $(am__android_test_ipc_SOURCES_DIST) \ + $(am__attrib_gatttool_SOURCES_DIST) \ + $(am__client_bluetoothctl_SOURCES_DIST) \ + $(am__emulator_b1ee_SOURCES_DIST) \ + $(am__emulator_btvirt_SOURCES_DIST) \ + $(am__emulator_hfp_SOURCES_DIST) \ + $(am__monitor_btmon_SOURCES_DIST) \ + $(am__obexd_src_obexd_SOURCES_DIST) \ + $(am__profiles_cups_bluetooth_SOURCES_DIST) \ + $(am__profiles_iap_iapd_SOURCES_DIST) \ + $(am__src_bluetoothd_SOURCES_DIST) \ + $(am__tools_3dsp_SOURCES_DIST) tools/amptest.c tools/avinfo.c \ + tools/avtest.c $(am__tools_bccmd_SOURCES_DIST) \ + $(am__tools_bdaddr_SOURCES_DIST) \ + $(am__tools_bluemoon_SOURCES_DIST) \ + $(am__tools_bluetooth_player_SOURCES_DIST) tools/btattach.c \ + $(am__tools_btinfo_SOURCES_DIST) \ + $(am__tools_btiotest_SOURCES_DIST) \ + $(am__tools_btmgmt_SOURCES_DIST) \ + $(am__tools_btproxy_SOURCES_DIST) \ + $(am__tools_btsnoop_SOURCES_DIST) tools/ciptool.c \ + $(am__tools_cltest_SOURCES_DIST) \ + $(am__tools_gap_tester_SOURCES_DIST) \ + $(am__tools_gatt_service_SOURCES_DIST) \ + $(am__tools_hci_tester_SOURCES_DIST) \ + $(am__tools_hciattach_SOURCES_DIST) \ + $(am__tools_hciconfig_SOURCES_DIST) \ + $(am__tools_hcidump_SOURCES_DIST) tools/hcieventmask.c \ + tools/hcisecfilter.c $(am__tools_hcitool_SOURCES_DIST) \ + tools/hid2hci.c tools/hwdb.c $(am__tools_ibeacon_SOURCES_DIST) \ + $(am__tools_l2cap_tester_SOURCES_DIST) tools/l2ping.c \ + tools/l2test.c $(am__tools_mgmt_tester_SOURCES_DIST) \ + $(am__tools_mpris_player_SOURCES_DIST) \ + $(am__tools_obex_client_tool_SOURCES_DIST) \ + $(am__tools_obex_server_tool_SOURCES_DIST) \ + $(am__tools_obexctl_SOURCES_DIST) tools/rctest.c \ + tools/rfcomm.c $(am__tools_rfcomm_tester_SOURCES_DIST) \ + $(am__tools_sco_tester_SOURCES_DIST) tools/scotest.c \ + $(am__tools_sdptool_SOURCES_DIST) \ + $(am__tools_seq2bseq_SOURCES_DIST) \ + $(am__tools_smp_tester_SOURCES_DIST) \ + $(unit_test_avctp_SOURCES) $(unit_test_avdtp_SOURCES) \ + $(unit_test_avrcp_SOURCES) $(unit_test_crc_SOURCES) \ + $(unit_test_eir_SOURCES) $(unit_test_gdbus_client_SOURCES) \ + $(unit_test_gobex_SOURCES) $(unit_test_gobex_apparam_SOURCES) \ + $(unit_test_gobex_header_SOURCES) \ + $(unit_test_gobex_packet_SOURCES) \ + $(unit_test_gobex_transfer_SOURCES) $(unit_test_hfp_SOURCES) \ + $(unit_test_lib_SOURCES) $(unit_test_mgmt_SOURCES) \ + $(unit_test_queue_SOURCES) $(unit_test_ringbuf_SOURCES) \ + $(unit_test_sdp_SOURCES) $(unit_test_textfile_SOURCES) \ + $(unit_test_uuid_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man1dir = $(mandir)/man1 +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(dist_man_MANS) $(man_MANS) +DATA = $(conf_DATA) $(dbus_DATA) $(dbussessionbus_DATA) \ + $(dbussystembus_DATA) $(pkgconfig_DATA) $(rules_DATA) \ + $(state_DATA) $(systemdsystemunit_DATA) \ + $(systemduserunit_DATA) +am__include_HEADERS_DIST = lib/bluetooth.h lib/hci.h lib/hci_lib.h \ + lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h lib/rfcomm.h \ + lib/bnep.h lib/cmtp.h lib/hidp.h +HEADERS = $(include_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +AM_RECURSIVE_TARGETS = cscope check recheck +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red='[0;31m'; \ + grn='[0;32m'; \ + lgn='[1;32m'; \ + blu='[1;34m'; \ + mgn='[0;35m'; \ + brg='[1m'; \ + std='[m'; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +GZIP_ENV = --best +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CONFIGDIR = @CONFIGDIR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_CONFDIR = @DBUS_CONFDIR@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SESSIONBUSDIR = @DBUS_SESSIONBUSDIR@ +DBUS_SYSTEMBUSDIR = @DBUS_SYSTEMBUSDIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GREP = @GREP@ +GTHREAD_CFLAGS = @GTHREAD_CFLAGS@ +GTHREAD_LIBS = @GTHREAD_LIBS@ +ICAL_CFLAGS = @ICAL_CFLAGS@ +ICAL_LIBS = @ICAL_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MISC_CFLAGS = @MISC_CFLAGS@ +MISC_LDFLAGS = @MISC_LDFLAGS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SBC_CFLAGS = @SBC_CFLAGS@ +SBC_LIBS = @SBC_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_SYSTEMUNITDIR = @SYSTEMD_SYSTEMUNITDIR@ +SYSTEMD_USERUNITDIR = @SYSTEMD_USERUNITDIR@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_DIR = @UDEV_DIR@ +UDEV_LIBS = @UDEV_LIBS@ +VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@/bluetooth +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@/bluetooth +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_MAKEFLAGS = --no-print-directory +lib_LTLIBRARIES = $(am__append_2) +noinst_LIBRARIES = $(am__append_7) +noinst_LTLIBRARIES = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la +dist_man_MANS = $(am__append_18) $(am__append_20) +dist_noinst_MANS = +CLEANFILES = $(builtin_files) src/bluetooth.service \ + obexd/src/builtin.h $(builtin_files) obexd/src/obex.service \ + $(am__append_32) +EXTRA_DIST = src/bluetooth.service.in src/org.bluez.service \ + src/genbuiltin src/bluetooth.conf src/main.conf \ + profiles/network/network.conf profiles/input/input.conf \ + profiles/proximity/proximity.conf $(am__append_19) \ + $(am__append_21) $(am__append_22) obexd/src/obex.service.in \ + obexd/src/org.bluez.obex.service obexd/src/genbuiltin \ + android/Android.mk android/README android/init.bluetooth.rc \ + android/hal-ipc-api.txt android/audio-ipc-api.txt \ + android/pics-l2cap.txt android/pics-gap.txt \ + android/pics-did.txt android/pics-hid.txt android/pics-pan.txt \ + android/pics-opp.txt android/pics-map.txt \ + android/pics-pbap.txt android/pics-a2dp.txt \ + android/pics-avctp.txt android/pics-avrcp.txt \ + android/pics-hsp.txt android/pics-hfp.txt \ + android/pics-gatt.txt android/pixit-l2cap.txt \ + android/pixit-gap.txt android/pixit-did.txt \ + android/pixit-hid.txt android/pixit-pan.txt \ + android/pixit-opp.txt android/pixit-map.txt \ + android/pixit-pbap.txt android/pixit-a2dp.txt \ + android/pixit-avctp.txt android/pixit-avrcp.txt \ + android/pixit-hsp.txt android/pixit-hfp.txt \ + android/pixit-gatt.txt android/pts-l2cap.txt \ + android/pts-gap.txt android/pts-did.txt android/pts-hid.txt \ + android/pts-pan.txt android/pts-opp.txt android/pts-map.txt \ + android/pts-a2dp.txt android/pts-avrcp.txt \ + android/pts-avctp.txt android/pts-pbap.txt android/pts-hfp.txt \ + android/pts-hsp.txt tools/hid2hci.rules $(test_scripts) \ + doc/assigned-numbers.txt doc/supported-features.txt \ + doc/test-coverage.txt doc/settings-storage.txt \ + doc/mgmt-api.txt doc/adapter-api.txt doc/device-api.txt \ + doc/agent-api.txt doc/profile-api.txt doc/network-api.txt \ + doc/media-api.txt doc/health-api.txt doc/sap-api.txt \ + doc/alert-api.txt doc/proximity-api.txt doc/heartrate-api.txt \ + doc/thermometer-api.txt doc/cyclingspeed-api.txt \ + doc/obex-api.txt doc/obex-agent-api.txt tools/magic.btsnoop +include_HEADERS = $(am__append_1) +AM_CFLAGS = $(WARNING_CFLAGS) $(MISC_CFLAGS) @DBUS_CFLAGS@ \ + @GLIB_CFLAGS@ $(am__empty) +AM_LDFLAGS = $(MISC_LDFLAGS) +@DATAFILES_TRUE@dbusdir = @DBUS_CONFDIR@/dbus-1/system.d +@DATAFILES_TRUE@dbus_DATA = src/bluetooth.conf +@DATAFILES_TRUE@confdir = $(sysconfdir)/bluetooth +@DATAFILES_TRUE@conf_DATA = +@DATAFILES_TRUE@statedir = $(localstatedir)/lib/bluetooth +@DATAFILES_TRUE@state_DATA = +@SYSTEMD_TRUE@systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@ +@SYSTEMD_TRUE@systemdsystemunit_DATA = src/bluetooth.service +@SYSTEMD_TRUE@dbussystembusdir = @DBUS_SYSTEMBUSDIR@ +@SYSTEMD_TRUE@dbussystembus_DATA = src/org.bluez.service +plugindir = $(libdir)/bluetooth/plugins +@MAINTAINER_MODE_FALSE@build_plugindir = $(plugindir) +@MAINTAINER_MODE_TRUE@build_plugindir = $(abs_top_srcdir)/plugins/.libs +plugin_LTLIBRARIES = $(am__append_12) $(am__append_13) \ + $(am__append_30) +lib_sources = lib/bluetooth.c lib/hci.c lib/sdp.c +lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h \ + lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \ + lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h + +extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h +extra_sources = lib/uuid.c +local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file))) +BUILT_SOURCES = $(local_headers) src/builtin.h obexd/src/builtin.h +@LIBRARY_TRUE@lib_libbluetooth_la_SOURCES = $(lib_headers) $(lib_sources) +@LIBRARY_TRUE@lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 20:8:17 +@LIBRARY_TRUE@lib_libbluetooth_la_DEPENDENCIES = $(local_headers) +lib_libbluetooth_internal_la_SOURCES = $(lib_headers) $(lib_sources) \ + $(extra_headers) $(extra_sources) + +gdbus_libgdbus_internal_la_SOURCES = gdbus/gdbus.h \ + gdbus/mainloop.c gdbus/watch.c \ + gdbus/object.c gdbus/client.c gdbus/polkit.c + +attrib_sources = attrib/att.h attrib/att-database.h attrib/att.c \ + attrib/gatt.h attrib/gatt.c \ + attrib/gattrib.h attrib/gattrib.c \ + attrib/gatt-service.h attrib/gatt-service.c + +btio_sources = btio/btio.h btio/btio.c +gobex_sources = gobex/gobex.h gobex/gobex.c \ + gobex/gobex-defs.h gobex/gobex-defs.c \ + gobex/gobex-packet.c gobex/gobex-packet.h \ + gobex/gobex-header.c gobex/gobex-header.h \ + gobex/gobex-transfer.c gobex/gobex-debug.h \ + gobex/gobex-apparam.c gobex/gobex-apparam.h + +builtin_modules = hostname wiimote autopair dropcam policy \ + $(am__append_3) $(am__append_5) a2dp avrcp network input hog \ + $(am__append_8) gatt scanparam deviceinfo $(am__append_10) +builtin_sources = plugins/hostname.c plugins/wiimote.c \ + plugins/autopair.c plugins/dropcam.c plugins/policy.c \ + $(am__append_4) $(am__append_6) profiles/audio/source.h \ + profiles/audio/source.c profiles/audio/sink.h \ + profiles/audio/sink.c profiles/audio/a2dp.h \ + profiles/audio/a2dp.c profiles/audio/avdtp.h \ + profiles/audio/avdtp.c profiles/audio/media.h \ + profiles/audio/media.c profiles/audio/transport.h \ + profiles/audio/transport.c profiles/audio/a2dp-codecs.h \ + profiles/audio/control.h profiles/audio/control.c \ + profiles/audio/avctp.h profiles/audio/avctp.c \ + profiles/audio/avrcp.h profiles/audio/avrcp.c \ + profiles/audio/player.h profiles/audio/player.c \ + profiles/network/manager.c profiles/network/bnep.h \ + profiles/network/bnep.c profiles/network/server.h \ + profiles/network/server.c profiles/network/connection.h \ + profiles/network/connection.c profiles/input/manager.c \ + profiles/input/server.h profiles/input/server.c \ + profiles/input/device.h profiles/input/device.c \ + profiles/input/hog.c profiles/input/uhid_copy.h \ + profiles/input/suspend.h profiles/input/suspend-dummy.c \ + $(am__append_9) profiles/gatt/gas.c profiles/scanparam/scan.c \ + profiles/deviceinfo/deviceinfo.c $(am__append_11) +builtin_nodist = +@EXPERIMENTAL_TRUE@profiles_sap_libsap_a_SOURCES = profiles/sap/sap.h profiles/sap/sap-u8500.c +@SIXAXIS_TRUE@plugins_sixaxis_la_SOURCES = plugins/sixaxis.c +@SIXAXIS_TRUE@plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@SIXAXIS_TRUE@ -no-undefined @UDEV_LIBS@ + +@SIXAXIS_TRUE@plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @UDEV_CFLAGS@ +@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_SOURCES = plugins/external-dummy.c +@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@MAINTAINER_MODE_TRUE@ -no-undefined + +@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden +src_bluetoothd_SOURCES = $(builtin_sources) \ + $(attrib_sources) $(btio_sources) \ + src/bluetooth.ver \ + src/main.c src/log.h src/log.c \ + src/systemd.h src/systemd.c \ + src/rfkill.c src/hcid.h src/sdpd.h \ + src/sdpd-server.c src/sdpd-request.c \ + src/sdpd-service.c src/sdpd-database.c \ + src/attrib-server.h src/attrib-server.c \ + src/sdp-xml.h src/sdp-xml.c \ + src/sdp-client.h src/sdp-client.c \ + src/textfile.h src/textfile.c \ + src/uuid-helper.h src/uuid-helper.c \ + src/uinput.h \ + src/plugin.h src/plugin.c \ + src/storage.h src/storage.c \ + src/agent.h src/agent.c \ + src/error.h src/error.c \ + src/adapter.h src/adapter.c \ + src/profile.h src/profile.c \ + src/service.h src/service.c \ + src/gatt-dbus.h src/gatt-dbus.c \ + src/gatt.h src/gatt.c \ + src/device.h src/device.c src/attio.h \ + src/dbus-common.c src/dbus-common.h \ + src/eir.h src/eir.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/timeout.h src/shared/timeout-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c + +src_bluetoothd_LDADD = lib/libbluetooth-internal.la gdbus/libgdbus-internal.la \ + @GLIB_LIBS@ @DBUS_LIBS@ -ldl -lrt + +src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \ + -Wl,--version-script=$(srcdir)/src/bluetooth.ver + +src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la src/bluetooth.service + +src_bluetoothd_CFLAGS = $(AM_CFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \ + -DPLUGINDIR=\""$(build_plugindir)"\" + +src_bluetoothd_SHORTNAME = bluetoothd +builtin_files = src/builtin.h $(builtin_nodist) +nodist_src_bluetoothd_SOURCES = $(builtin_files) +man_MANS = src/bluetoothd.8 +test_scripts = test/sap_client.py test/bluezutils.py test/dbusdef.py \ + test/monitor-bluetooth test/list-devices test/test-discovery \ + test/test-manager test/test-adapter test/test-device \ + test/simple-agent test/simple-service test/simple-endpoint \ + test/test-sap-server test/test-proximity test/test-network \ + test/test-thermometer test/test-profile test/test-health \ + test/test-health-sink test/service-record.dtd \ + test/service-did.xml test/service-spp.xml test/service-opp.xml \ + test/service-ftp.xml test/simple-player test/test-nap \ + test/test-heartrate test/test-alert test/test-hfp \ + test/test-cyclingspeed test/opp-client test/ftp-client \ + test/pbap-client test/map-client +unit_tests = $(am__append_31) unit/test-eir unit/test-uuid \ + unit/test-textfile unit/test-crc unit/test-ringbuf \ + unit/test-queue unit/test-mgmt unit/test-sdp unit/test-avdtp \ + unit/test-avctp unit/test-avrcp unit/test-hfp \ + unit/test-gdbus-client unit/test-gobex-header \ + unit/test-gobex-packet unit/test-gobex \ + unit/test-gobex-transfer unit/test-gobex-apparam unit/test-lib +@CLIENT_TRUE@client_bluetoothctl_SOURCES = client/main.c \ +@CLIENT_TRUE@ client/display.h client/display.c \ +@CLIENT_TRUE@ client/agent.h client/agent.c \ +@CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c + +@CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ +@CLIENT_TRUE@ -lreadline + +@MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ +@MONITOR_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@MONITOR_TRUE@ monitor/display.h monitor/display.c \ +@MONITOR_TRUE@ monitor/hcidump.h monitor/hcidump.c \ +@MONITOR_TRUE@ monitor/ellisys.h monitor/ellisys.c \ +@MONITOR_TRUE@ monitor/control.h monitor/control.c \ +@MONITOR_TRUE@ monitor/packet.h monitor/packet.c \ +@MONITOR_TRUE@ monitor/vendor.h monitor/vendor.c \ +@MONITOR_TRUE@ monitor/lmp.h monitor/lmp.c \ +@MONITOR_TRUE@ monitor/crc.h monitor/crc.c \ +@MONITOR_TRUE@ monitor/ll.h monitor/ll.c \ +@MONITOR_TRUE@ monitor/l2cap.h monitor/l2cap.c \ +@MONITOR_TRUE@ monitor/sdp.h monitor/sdp.c \ +@MONITOR_TRUE@ monitor/uuid.h monitor/uuid.c \ +@MONITOR_TRUE@ monitor/hwdb.h monitor/hwdb.c \ +@MONITOR_TRUE@ monitor/keys.h monitor/keys.c \ +@MONITOR_TRUE@ monitor/analyze.h monitor/analyze.c \ +@MONITOR_TRUE@ src/shared/util.h src/shared/util.c \ +@MONITOR_TRUE@ src/shared/queue.h src/shared/queue.c \ +@MONITOR_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@MONITOR_TRUE@ src/shared/btsnoop.h src/shared/btsnoop.c + +@MONITOR_TRUE@monitor_btmon_LDADD = lib/libbluetooth-internal.la @UDEV_LIBS@ +@EXPERIMENTAL_TRUE@emulator_btvirt_SOURCES = emulator/main.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@EXPERIMENTAL_TRUE@ emulator/server.h emulator/server.c \ +@EXPERIMENTAL_TRUE@ emulator/vhci.h emulator/vhci.c \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c \ +@EXPERIMENTAL_TRUE@ emulator/amp.h emulator/amp.c \ +@EXPERIMENTAL_TRUE@ emulator/le.h emulator/le.c + +@EXPERIMENTAL_TRUE@emulator_btvirt_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@emulator_b1ee_SOURCES = emulator/b1ee.c monitor/mainloop.h monitor/mainloop.c +@EXPERIMENTAL_TRUE@emulator_hfp_SOURCES = emulator/hfp.c \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/ringbuf.h src/shared/ringbuf.c \ +@EXPERIMENTAL_TRUE@ src/shared/hfp.h src/shared/hfp.c + +@EXPERIMENTAL_TRUE@tools_3dsp_SOURCES = tools/3dsp.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/hci.h src/shared/hci.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c + +@EXPERIMENTAL_TRUE@tools_mgmt_tester_SOURCES = tools/mgmt-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.h src/shared/mgmt.c \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.h src/shared/hciemu.c \ +@EXPERIMENTAL_TRUE@ src/shared/tester.h src/shared/tester.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h src/shared/timeout-glib.c + +@EXPERIMENTAL_TRUE@tools_mgmt_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_l2cap_tester_SOURCES = tools/l2cap-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.h src/shared/mgmt.c \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.h src/shared/hciemu.c \ +@EXPERIMENTAL_TRUE@ src/shared/tester.h src/shared/tester.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h src/shared/timeout-glib.c + +@EXPERIMENTAL_TRUE@tools_l2cap_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_rfcomm_tester_SOURCES = tools/rfcomm-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.h src/shared/mgmt.c \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.h src/shared/hciemu.c \ +@EXPERIMENTAL_TRUE@ src/shared/tester.h src/shared/tester.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h src/shared/timeout-glib.c + +@EXPERIMENTAL_TRUE@tools_rfcomm_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_smp_tester_SOURCES = tools/smp-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.h src/shared/mgmt.c \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.h src/shared/hciemu.c \ +@EXPERIMENTAL_TRUE@ src/shared/tester.h src/shared/tester.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h src/shared/timeout-glib.c + +@EXPERIMENTAL_TRUE@tools_smp_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_gap_tester_SOURCES = tools/gap-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.h src/shared/hciemu.c \ +@EXPERIMENTAL_TRUE@ src/shared/tester.h src/shared/tester.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h src/shared/timeout-glib.c + +@EXPERIMENTAL_TRUE@tools_gap_tester_LDADD = lib/libbluetooth-internal.la \ +@EXPERIMENTAL_TRUE@ gdbus/libgdbus-internal.la \ +@EXPERIMENTAL_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ + +@EXPERIMENTAL_TRUE@tools_sco_tester_SOURCES = tools/sco-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ emulator/btdev.h emulator/btdev.c \ +@EXPERIMENTAL_TRUE@ emulator/bthost.h emulator/bthost.c \ +@EXPERIMENTAL_TRUE@ emulator/smp.c \ +@EXPERIMENTAL_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.h src/shared/mgmt.c \ +@EXPERIMENTAL_TRUE@ src/shared/hciemu.h src/shared/hciemu.c \ +@EXPERIMENTAL_TRUE@ src/shared/tester.h src/shared/tester.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h src/shared/timeout-glib.c + +@EXPERIMENTAL_TRUE@tools_sco_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_hci_tester_SOURCES = tools/hci-tester.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@EXPERIMENTAL_TRUE@ src/shared/hci.h src/shared/hci.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/tester.h src/shared/tester.c + +@EXPERIMENTAL_TRUE@tools_hci_tester_LDADD = @GLIB_LIBS@ +@TOOLS_TRUE@tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \ +@TOOLS_TRUE@ tools/hciattach_st.c \ +@TOOLS_TRUE@ tools/hciattach_ti.c \ +@TOOLS_TRUE@ tools/hciattach_tialt.c \ +@TOOLS_TRUE@ tools/hciattach_ath3k.c \ +@TOOLS_TRUE@ tools/hciattach_qualcomm.c \ +@TOOLS_TRUE@ tools/hciattach_intel.c + +@TOOLS_TRUE@tools_hciattach_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_hciconfig_SOURCES = tools/hciconfig.c tools/csr.h tools/csr.c +@TOOLS_TRUE@tools_hciconfig_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_hcitool_SOURCES = tools/hcitool.c src/oui.h src/oui.c +@TOOLS_TRUE@tools_hcitool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ @UDEV_LIBS@ +@TOOLS_TRUE@tools_hcidump_SOURCES = tools/hcidump.c \ +@TOOLS_TRUE@ tools/parser/parser.h tools/parser/parser.c \ +@TOOLS_TRUE@ tools/parser/lmp.c \ +@TOOLS_TRUE@ tools/parser/hci.c \ +@TOOLS_TRUE@ tools/parser/l2cap.h tools/parser/l2cap.c \ +@TOOLS_TRUE@ tools/parser/amp.c \ +@TOOLS_TRUE@ tools/parser/smp.c \ +@TOOLS_TRUE@ tools/parser/att.c \ +@TOOLS_TRUE@ tools/parser/sdp.h tools/parser/sdp.c \ +@TOOLS_TRUE@ tools/parser/rfcomm.h tools/parser/rfcomm.c \ +@TOOLS_TRUE@ tools/parser/bnep.c \ +@TOOLS_TRUE@ tools/parser/cmtp.c \ +@TOOLS_TRUE@ tools/parser/hidp.c \ +@TOOLS_TRUE@ tools/parser/hcrp.c \ +@TOOLS_TRUE@ tools/parser/avdtp.c \ +@TOOLS_TRUE@ tools/parser/avctp.c \ +@TOOLS_TRUE@ tools/parser/avrcp.c \ +@TOOLS_TRUE@ tools/parser/sap.c \ +@TOOLS_TRUE@ tools/parser/obex.c \ +@TOOLS_TRUE@ tools/parser/capi.c \ +@TOOLS_TRUE@ tools/parser/ppp.c \ +@TOOLS_TRUE@ tools/parser/tcpip.c \ +@TOOLS_TRUE@ tools/parser/ericsson.c \ +@TOOLS_TRUE@ tools/parser/csr.c \ +@TOOLS_TRUE@ tools/parser/bpa.c + +@TOOLS_TRUE@tools_hcidump_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_rfcomm_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_rctest_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_l2test_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_l2ping_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_sdptool_SOURCES = tools/sdptool.c src/sdp-xml.h src/sdp-xml.c +@TOOLS_TRUE@tools_sdptool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@TOOLS_TRUE@tools_ciptool_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_bccmd_SOURCES = tools/bccmd.c tools/csr.h tools/csr.c \ +@TOOLS_TRUE@ tools/csr_hci.c tools/csr_usb.c \ +@TOOLS_TRUE@ tools/csr_h4.c tools/csr_3wire.c \ +@TOOLS_TRUE@ tools/csr_bcsp.c tools/ubcsp.h tools/ubcsp.c + +@TOOLS_TRUE@tools_bccmd_LDADD = lib/libbluetooth-internal.la +@TOOLS_TRUE@tools_bluemoon_SOURCES = tools/bluemoon.c monitor/bt.h \ +@TOOLS_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@TOOLS_TRUE@ src/shared/io.h src/shared/io-mainloop.c \ +@TOOLS_TRUE@ src/shared/hci.h src/shared/hci.c \ +@TOOLS_TRUE@ src/shared/util.h src/shared/util.c \ +@TOOLS_TRUE@ src/shared/queue.h src/shared/queue.c + +@HID2HCI_TRUE@udevdir = @UDEV_DIR@ +@HID2HCI_TRUE@tools_hid2hci_LDADD = @UDEV_LIBS@ +@EXPERIMENTAL_TRUE@tools_bdaddr_SOURCES = tools/bdaddr.c src/oui.h src/oui.c +@EXPERIMENTAL_TRUE@tools_bdaddr_LDADD = lib/libbluetooth-internal.la @UDEV_LIBS@ +@EXPERIMENTAL_TRUE@tools_avinfo_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_avtest_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_scotest_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_amptest_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_hwdb_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_hcieventmask_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/mgmt.h src/shared/mgmt.c + +@EXPERIMENTAL_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/hci.h src/shared/hci.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c + +@EXPERIMENTAL_TRUE@tools_btsnoop_SOURCES = tools/btsnoop.c \ +@EXPERIMENTAL_TRUE@ src/shared/pcap.h src/shared/pcap.c \ +@EXPERIMENTAL_TRUE@ src/shared/btsnoop.h src/shared/btsnoop.c + +@EXPERIMENTAL_TRUE@tools_btproxy_SOURCES = tools/btproxy.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c + +@EXPERIMENTAL_TRUE@tools_btiotest_SOURCES = tools/btiotest.c btio/btio.h btio/btio.c +@EXPERIMENTAL_TRUE@tools_btiotest_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@EXPERIMENTAL_TRUE@tools_mpris_player_SOURCES = tools/mpris-player.c +@EXPERIMENTAL_TRUE@tools_mpris_player_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ +@EXPERIMENTAL_TRUE@tools_cltest_SOURCES = tools/cltest.c monitor/mainloop.h monitor/mainloop.c +@EXPERIMENTAL_TRUE@tools_cltest_LDADD = lib/libbluetooth-internal.la +@EXPERIMENTAL_TRUE@tools_seq2bseq_SOURCES = tools/seq2bseq.c +@EXPERIMENTAL_TRUE@tools_ibeacon_SOURCES = tools/ibeacon.c monitor/bt.h \ +@EXPERIMENTAL_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/io.h src/shared/io-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/timeout.h \ +@EXPERIMENTAL_TRUE@ src/shared/timeout-mainloop.c \ +@EXPERIMENTAL_TRUE@ src/shared/hci.h src/shared/hci.c \ +@EXPERIMENTAL_TRUE@ src/shared/util.h src/shared/util.c \ +@EXPERIMENTAL_TRUE@ src/shared/queue.h src/shared/queue.c + +@READLINE_TRUE@attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \ +@READLINE_TRUE@ attrib/gattrib.c btio/btio.c \ +@READLINE_TRUE@ attrib/gatttool.h attrib/interactive.c \ +@READLINE_TRUE@ attrib/utils.c src/log.c client/display.c \ +@READLINE_TRUE@ client/display.h + +@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ -lreadline +@READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \ +@READLINE_TRUE@ tools/obex-client-tool.c + +@READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \ +@READLINE_TRUE@ @GLIB_LIBS@ -lreadline + +@READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ +@READLINE_TRUE@ tools/obex-server-tool.c + +@READLINE_TRUE@tools_obex_server_tool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@READLINE_TRUE@tools_bluetooth_player_SOURCES = tools/bluetooth-player.c \ +@READLINE_TRUE@ client/display.h client/display.c + +@READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ +@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline + +@READLINE_TRUE@tools_obexctl_SOURCES = tools/obexctl.c \ +@READLINE_TRUE@ client/display.h client/display.c + +@READLINE_TRUE@tools_obexctl_LDADD = gdbus/libgdbus-internal.la \ +@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline + +@EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c +@EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la +@EXPERIMENTAL_TRUE@profiles_iap_iapd_SOURCES = profiles/iap/main.c +@EXPERIMENTAL_TRUE@profiles_iap_iapd_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ +@CUPS_TRUE@cupsdir = $(libdir)/cups/backend +@CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \ +@CUPS_TRUE@ profiles/cups/cups.h \ +@CUPS_TRUE@ profiles/cups/sdp.c \ +@CUPS_TRUE@ profiles/cups/spp.c \ +@CUPS_TRUE@ profiles/cups/hcrp.c + +@CUPS_TRUE@profiles_cups_bluetooth_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ \ +@CUPS_TRUE@ lib/libbluetooth-internal.la \ +@CUPS_TRUE@ gdbus/libgdbus-internal.la + +@SYSTEMD_TRUE@systemduserunitdir = @SYSTEMD_USERUNITDIR@ +@SYSTEMD_TRUE@systemduserunit_DATA = obexd/src/obex.service +@SYSTEMD_TRUE@dbussessionbusdir = @DBUS_SESSIONBUSDIR@ +@SYSTEMD_TRUE@dbussessionbus_DATA = obexd/src/org.bluez.obex.service +obex_plugindir = $(libdir)/obex/plugins +obexd_builtin_modules = filesystem bluetooth $(am__append_25) opp ftp \ + $(am__append_27) mas mns +obexd_builtin_sources = obexd/plugins/filesystem.c \ + obexd/plugins/filesystem.h obexd/plugins/bluetooth.c \ + $(am__append_26) obexd/plugins/opp.c obexd/plugins/ftp.c \ + obexd/plugins/ftp.h $(am__append_28) obexd/plugins/mas.c \ + obexd/src/map_ap.h obexd/plugins/messages.h \ + obexd/plugins/messages-dummy.c obexd/client/mns.c \ + obexd/src/map_ap.h obexd/client/map-event.h +obexd_builtin_nodist = +obexd_src_obexd_SOURCES = $(btio_sources) $(gobex_sources) \ + $(obexd_builtin_sources) \ + obexd/src/main.c obexd/src/obexd.h \ + obexd/src/plugin.h obexd/src/plugin.c \ + obexd/src/log.h obexd/src/log.c \ + obexd/src/manager.h obexd/src/manager.c \ + obexd/src/obex.h obexd/src/obex.c obexd/src/obex-priv.h \ + obexd/src/mimetype.h obexd/src/mimetype.c \ + obexd/src/service.h obexd/src/service.c \ + obexd/src/transport.h obexd/src/transport.c \ + obexd/src/server.h obexd/src/server.c \ + obexd/client/manager.h obexd/client/manager.c \ + obexd/client/session.h obexd/client/session.c \ + obexd/client/bluetooth.h obexd/client/bluetooth.c \ + obexd/client/sync.h obexd/client/sync.c \ + obexd/client/pbap.h obexd/client/pbap.c \ + obexd/client/ftp.h obexd/client/ftp.c \ + obexd/client/opp.h obexd/client/opp.c \ + obexd/client/map.h obexd/client/map.c \ + obexd/client/map-event.h obexd/client/map-event.c \ + obexd/client/transfer.h obexd/client/transfer.c \ + obexd/client/transport.h obexd/client/transport.c \ + obexd/client/dbus.h obexd/client/dbus.c \ + obexd/client/driver.h obexd/client/driver.c \ + obexd/src/map_ap.h + +obexd_src_obexd_LDADD = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la \ + @ICAL_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ -ldl + +obexd_src_obexd_LDFLAGS = -Wl,--export-dynamic +obexd_src_obexd_CFLAGS = $(AM_CFLAGS) @GLIB_CFLAGS@ @DBUS_CFLAGS@ \ + @ICAL_CFLAGS@ -DOBEX_PLUGIN_BUILTIN \ + -DPLUGINDIR=\""$(obex_plugindir)"\" \ + -fPIC -D_FILE_OFFSET_BITS=64 + +obexd_src_obexd_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/obexd/src \ + -I$(srcdir)/obexd/src -I$(srcdir)/btio \ + -I$(srcdir)/gobex -I$(srcdir)/gdbus + +obexd_src_obexd_SHORTNAME = obexd +obexd_builtin_files = obexd/src/builtin.h $(obexd_builtin_nodist) +nodist_obexd_src_obexd_SOURCES = $(obexd_builtin_files) +@ANDROID_TRUE@android_plugindir = $(abs_top_srcdir)/android/.libs +@ANDROID_TRUE@android_system_emulator_SOURCES = android/system-emulator.c \ +@ANDROID_TRUE@ monitor/mainloop.h monitor/mainloop.c + +@ANDROID_TRUE@android_bluetoothd_snoop_SOURCES = android/bluetoothd-snoop.c \ +@ANDROID_TRUE@ monitor/mainloop.h monitor/mainloop.c \ +@ANDROID_TRUE@ src/shared/btsnoop.h src/shared/btsnoop.c + +@ANDROID_TRUE@android_bluetoothd_SOURCES = android/main.c \ +@ANDROID_TRUE@ src/log.c \ +@ANDROID_TRUE@ android/hal-msg.h \ +@ANDROID_TRUE@ android/audio-msg.h \ +@ANDROID_TRUE@ android/utils.h \ +@ANDROID_TRUE@ src/sdpd-database.c src/sdpd-server.c \ +@ANDROID_TRUE@ src/sdpd-service.c src/sdpd-request.c \ +@ANDROID_TRUE@ src/uuid-helper.h src/uuid-helper.c \ +@ANDROID_TRUE@ src/eir.h src/eir.c \ +@ANDROID_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@ANDROID_TRUE@ src/shared/queue.h src/shared/queue.c \ +@ANDROID_TRUE@ src/shared/util.h src/shared/util.c \ +@ANDROID_TRUE@ src/shared/mgmt.h src/shared/mgmt.c \ +@ANDROID_TRUE@ src/shared/ringbuf.h src/shared/ringbuf.c \ +@ANDROID_TRUE@ src/shared/hfp.h src/shared/hfp.c \ +@ANDROID_TRUE@ android/bluetooth.h android/bluetooth.c \ +@ANDROID_TRUE@ android/hidhost.h android/hidhost.c \ +@ANDROID_TRUE@ android/ipc-common.h \ +@ANDROID_TRUE@ android/ipc.h android/ipc.c \ +@ANDROID_TRUE@ android/avdtp.h android/avdtp.c \ +@ANDROID_TRUE@ android/a2dp.h android/a2dp.c \ +@ANDROID_TRUE@ android/avctp.h android/avctp.c \ +@ANDROID_TRUE@ android/avrcp.h android/avrcp.c \ +@ANDROID_TRUE@ android/avrcp-lib.h android/avrcp-lib.c \ +@ANDROID_TRUE@ android/socket.h android/socket.c \ +@ANDROID_TRUE@ android/pan.h android/pan.c \ +@ANDROID_TRUE@ android/handsfree.h android/handsfree.c \ +@ANDROID_TRUE@ android/gatt.h android/gatt.c \ +@ANDROID_TRUE@ android/health.h android/health.c \ +@ANDROID_TRUE@ attrib/att.c attrib/att.h \ +@ANDROID_TRUE@ attrib/gatt.c attrib/gatt.h \ +@ANDROID_TRUE@ attrib/gattrib.c attrib/gattrib.h \ +@ANDROID_TRUE@ btio/btio.h btio/btio.c \ +@ANDROID_TRUE@ src/sdp-client.h src/sdp-client.c \ +@ANDROID_TRUE@ profiles/network/bnep.h profiles/network/bnep.c + +@ANDROID_TRUE@android_bluetoothd_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@ANDROID_TRUE@android_bluetooth_default_la_SOURCES = android/hal.h android/hal-bluetooth.c \ +@ANDROID_TRUE@ android/hal-socket.c \ +@ANDROID_TRUE@ android/hal-hidhost.c \ +@ANDROID_TRUE@ android/hal-health.c \ +@ANDROID_TRUE@ android/hal-pan.c \ +@ANDROID_TRUE@ android/hal-a2dp.c \ +@ANDROID_TRUE@ android/hal-avrcp.c \ +@ANDROID_TRUE@ android/hal-handsfree.c \ +@ANDROID_TRUE@ android/hal-gatt.c \ +@ANDROID_TRUE@ android/hardware/bluetooth.h \ +@ANDROID_TRUE@ android/hardware/bt_av.h \ +@ANDROID_TRUE@ android/hardware/bt_gatt.h \ +@ANDROID_TRUE@ android/hardware/bt_gatt_client.h \ +@ANDROID_TRUE@ android/hardware/bt_gatt_server.h \ +@ANDROID_TRUE@ android/hardware/bt_gatt_types.h \ +@ANDROID_TRUE@ android/hardware/bt_hf.h \ +@ANDROID_TRUE@ android/hardware/bt_hh.h \ +@ANDROID_TRUE@ android/hardware/bt_hl.h \ +@ANDROID_TRUE@ android/hardware/bt_pan.h \ +@ANDROID_TRUE@ android/hardware/bt_rc.h \ +@ANDROID_TRUE@ android/hardware/bt_sock.h \ +@ANDROID_TRUE@ android/hardware/hardware.h \ +@ANDROID_TRUE@ android/cutils/properties.h \ +@ANDROID_TRUE@ android/ipc-common.h \ +@ANDROID_TRUE@ android/hal-log.h \ +@ANDROID_TRUE@ android/hal-ipc.h android/hal-ipc.c \ +@ANDROID_TRUE@ android/hal-utils.h android/hal-utils.c + +@ANDROID_TRUE@android_bluetooth_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android +@ANDROID_TRUE@android_bluetooth_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@ANDROID_TRUE@ -no-undefined + +@ANDROID_TRUE@android_haltest_SOURCES = android/client/haltest.c \ +@ANDROID_TRUE@ android/client/pollhandler.h \ +@ANDROID_TRUE@ android/client/pollhandler.c \ +@ANDROID_TRUE@ android/client/terminal.h \ +@ANDROID_TRUE@ android/client/terminal.c \ +@ANDROID_TRUE@ android/client/history.h \ +@ANDROID_TRUE@ android/client/history.c \ +@ANDROID_TRUE@ android/client/tabcompletion.c \ +@ANDROID_TRUE@ android/client/if-main.h \ +@ANDROID_TRUE@ android/client/if-av.c \ +@ANDROID_TRUE@ android/client/if-rc.c \ +@ANDROID_TRUE@ android/client/if-bt.c \ +@ANDROID_TRUE@ android/client/if-gatt.c \ +@ANDROID_TRUE@ android/client/if-hf.c \ +@ANDROID_TRUE@ android/client/if-hh.c \ +@ANDROID_TRUE@ android/client/if-pan.c \ +@ANDROID_TRUE@ android/client/if-sock.c \ +@ANDROID_TRUE@ android/client/if-audio.c \ +@ANDROID_TRUE@ android/hardware/hardware.c \ +@ANDROID_TRUE@ android/hal-utils.h android/hal-utils.c + +@ANDROID_TRUE@android_haltest_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \ +@ANDROID_TRUE@ -DPLUGINDIR=\""$(android_plugindir)"\" + +@ANDROID_TRUE@android_haltest_LDFLAGS = -pthread -ldl -lm +@ANDROID_TRUE@android_android_tester_SOURCES = emulator/btdev.h emulator/btdev.c \ +@ANDROID_TRUE@ emulator/bthost.h emulator/bthost.c \ +@ANDROID_TRUE@ emulator/smp.c \ +@ANDROID_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@ANDROID_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@ANDROID_TRUE@ src/shared/queue.h src/shared/queue.c \ +@ANDROID_TRUE@ src/shared/util.h src/shared/util.c \ +@ANDROID_TRUE@ src/shared/mgmt.h src/shared/mgmt.c \ +@ANDROID_TRUE@ src/shared/hciemu.h src/shared/hciemu.c \ +@ANDROID_TRUE@ src/shared/tester.h src/shared/tester.c \ +@ANDROID_TRUE@ src/shared/timeout.h src/shared/timeout-glib.c \ +@ANDROID_TRUE@ monitor/rfcomm.h \ +@ANDROID_TRUE@ android/hardware/hardware.c \ +@ANDROID_TRUE@ android/android-tester.c + +@ANDROID_TRUE@android_android_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \ +@ANDROID_TRUE@ -DPLUGINDIR=\""$(android_plugindir)"\" + +@ANDROID_TRUE@android_android_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@ANDROID_TRUE@android_android_tester_LDFLAGS = -pthread -ldl +@ANDROID_TRUE@android_ipc_tester_SOURCES = emulator/btdev.h emulator/btdev.c \ +@ANDROID_TRUE@ emulator/bthost.h emulator/bthost.c \ +@ANDROID_TRUE@ emulator/smp.c \ +@ANDROID_TRUE@ src/shared/crypto.h src/shared/crypto.c \ +@ANDROID_TRUE@ src/shared/io.h src/shared/io-glib.c \ +@ANDROID_TRUE@ src/shared/queue.h src/shared/queue.c \ +@ANDROID_TRUE@ src/shared/util.h src/shared/util.c \ +@ANDROID_TRUE@ src/shared/mgmt.h src/shared/mgmt.c \ +@ANDROID_TRUE@ src/shared/hciemu.h src/shared/hciemu.c \ +@ANDROID_TRUE@ src/shared/tester.h src/shared/tester.c \ +@ANDROID_TRUE@ src/shared/timeout.h src/shared/timeout-glib.c \ +@ANDROID_TRUE@ android/hal-utils.h android/hal-utils.c \ +@ANDROID_TRUE@ android/ipc-common.h android/ipc-tester.c + +@ANDROID_TRUE@android_ipc_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android +@ANDROID_TRUE@android_ipc_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +@ANDROID_TRUE@android_audio_a2dp_default_la_SOURCES = android/audio-msg.h \ +@ANDROID_TRUE@ android/hal-msg.h \ +@ANDROID_TRUE@ android/hal-audio.c \ +@ANDROID_TRUE@ android/hardware/audio.h \ +@ANDROID_TRUE@ android/hardware/audio_effect.h \ +@ANDROID_TRUE@ android/hardware/hardware.h \ +@ANDROID_TRUE@ android/system/audio.h + +@ANDROID_TRUE@android_test_ipc_SOURCES = android/test-ipc.c \ +@ANDROID_TRUE@ src/shared/util.h src/shared/util.c \ +@ANDROID_TRUE@ src/log.h src/log.c \ +@ANDROID_TRUE@ android/ipc-common.h \ +@ANDROID_TRUE@ android/ipc.c android/ipc.h + +@ANDROID_TRUE@android_test_ipc_LDADD = @GLIB_LIBS@ +@ANDROID_TRUE@android_audio_a2dp_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android +@ANDROID_TRUE@android_audio_a2dp_default_la_LIBADD = @SBC_LIBS@ +@ANDROID_TRUE@android_audio_a2dp_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ +@ANDROID_TRUE@ -no-undefined -pthread -lrt + +@HID2HCI_TRUE@rulesdir = @UDEV_DIR@/rules.d +@HID2HCI_TRUE@rules_DATA = tools/97-hid2hci.rules +@TEST_TRUE@testdir = $(pkglibdir)/test +@TEST_TRUE@test_SCRIPTS = $(test_scripts) +AM_CPPFLAGS = -I$(builddir)/lib -I$(srcdir)/gdbus +unit_test_eir_SOURCES = unit/test-eir.c src/eir.c src/uuid-helper.c +unit_test_eir_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +unit_test_uuid_SOURCES = unit/test-uuid.c +unit_test_uuid_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +unit_test_textfile_SOURCES = unit/test-textfile.c src/textfile.h src/textfile.c +unit_test_textfile_LDADD = @GLIB_LIBS@ +unit_test_crc_SOURCES = unit/test-crc.c monitor/crc.h monitor/crc.c +unit_test_crc_LDADD = @GLIB_LIBS@ +unit_test_ringbuf_SOURCES = unit/test-ringbuf.c \ + src/shared/util.h src/shared/util.c \ + src/shared/ringbuf.h src/shared/ringbuf.c + +unit_test_ringbuf_LDADD = @GLIB_LIBS@ +unit_test_queue_SOURCES = unit/test-queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c + +unit_test_queue_LDADD = @GLIB_LIBS@ +unit_test_mgmt_SOURCES = unit/test-mgmt.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c + +unit_test_mgmt_LDADD = @GLIB_LIBS@ +unit_test_sdp_SOURCES = unit/test-sdp.c \ + src/shared/util.h src/shared/util.c \ + src/sdpd.h src/sdpd-database.c \ + src/log.h src/log.c \ + src/sdpd-service.c src/sdpd-request.c + +unit_test_sdp_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +unit_test_avdtp_SOURCES = unit/test-avdtp.c \ + src/shared/util.h src/shared/util.c \ + src/log.h src/log.c \ + android/avdtp.c android/avdtp.h + +unit_test_avdtp_LDADD = @GLIB_LIBS@ +unit_test_avctp_SOURCES = unit/test-avctp.c \ + src/shared/util.h src/shared/util.c \ + src/log.h src/log.c \ + android/avctp.c android/avctp.h + +unit_test_avctp_LDADD = @GLIB_LIBS@ +unit_test_avrcp_SOURCES = unit/test-avrcp.c \ + src/shared/util.h src/shared/util.c \ + src/log.h src/log.c \ + android/avctp.c android/avctp.h \ + android/avrcp-lib.c android/avrcp-lib.h + +unit_test_avrcp_LDADD = @GLIB_LIBS@ lib/libbluetooth-internal.la +unit_test_hfp_SOURCES = unit/test-hfp.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/ringbuf.h src/shared/ringbuf.c \ + src/shared/hfp.h src/shared/hfp.c + +unit_test_hfp_LDADD = @GLIB_LIBS@ +unit_test_gdbus_client_SOURCES = unit/test-gdbus-client.c +unit_test_gdbus_client_LDADD = gdbus/libgdbus-internal.la \ + @GLIB_LIBS@ @DBUS_LIBS@ + +unit_test_gobex_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex.c + +unit_test_gobex_LDADD = @GLIB_LIBS@ +unit_test_gobex_packet_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-packet.c + +unit_test_gobex_packet_LDADD = @GLIB_LIBS@ +unit_test_gobex_header_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-header.c + +unit_test_gobex_header_LDADD = @GLIB_LIBS@ +unit_test_gobex_transfer_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-transfer.c + +unit_test_gobex_transfer_LDADD = @GLIB_LIBS@ +unit_test_gobex_apparam_SOURCES = $(gobex_sources) unit/util.c unit/util.h \ + unit/test-gobex-apparam.c + +unit_test_gobex_apparam_LDADD = @GLIB_LIBS@ +unit_test_lib_SOURCES = unit/test-lib.c +unit_test_lib_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ +pkgconfigdir = $(libdir)/pkgconfig +@LIBRARY_TRUE@pkgconfig_DATA = lib/bluez.pc +DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \ + --disable-systemd --disable-udev + +DISTCLEANFILES = $(pkgconfig_DATA) +MAINTAINERCLEANFILES = Makefile.in \ + aclocal.m4 configure config.h.in config.sub config.guess \ + ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver + +SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ + $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \ + < $< > $@ + +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/Makefile.plugins $(srcdir)/Makefile.tools $(srcdir)/Makefile.obexd $(srcdir)/android/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; +$(srcdir)/Makefile.plugins $(srcdir)/Makefile.tools $(srcdir)/Makefile.obexd $(srcdir)/android/Makefile.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +src/bluetoothd.8: $(top_builddir)/config.status $(top_srcdir)/src/bluetoothd.8.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +lib/bluez.pc: $(top_builddir)/config.status $(top_srcdir)/lib/bluez.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +profiles/sap/$(am__dirstamp): + @$(MKDIR_P) profiles/sap + @: > profiles/sap/$(am__dirstamp) +profiles/sap/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/sap/$(DEPDIR) + @: > profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/sap/sap-u8500.$(OBJEXT): profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) + +profiles/sap/libsap.a: $(profiles_sap_libsap_a_OBJECTS) $(profiles_sap_libsap_a_DEPENDENCIES) $(EXTRA_profiles_sap_libsap_a_DEPENDENCIES) profiles/sap/$(am__dirstamp) + $(AM_V_at)-rm -f profiles/sap/libsap.a + $(AM_V_AR)$(profiles_sap_libsap_a_AR) profiles/sap/libsap.a $(profiles_sap_libsap_a_OBJECTS) $(profiles_sap_libsap_a_LIBADD) + $(AM_V_at)$(RANLIB) profiles/sap/libsap.a + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ + } + +uninstall-pluginLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ + done + +clean-pluginLTLIBRARIES: + -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) + @list='$(plugin_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +android/$(am__dirstamp): + @$(MKDIR_P) android + @: > android/$(am__dirstamp) +android/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) android/$(DEPDIR) + @: > android/$(DEPDIR)/$(am__dirstamp) +android/android_audio_a2dp_default_la-hal-audio.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) + +android/audio.a2dp.default.la: $(android_audio_a2dp_default_la_OBJECTS) $(android_audio_a2dp_default_la_DEPENDENCIES) $(EXTRA_android_audio_a2dp_default_la_DEPENDENCIES) android/$(am__dirstamp) + $(AM_V_CCLD)$(android_audio_a2dp_default_la_LINK) $(am_android_audio_a2dp_default_la_rpath) $(android_audio_a2dp_default_la_OBJECTS) $(android_audio_a2dp_default_la_LIBADD) $(LIBS) +android/android_bluetooth_default_la-hal-bluetooth.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-socket.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-hidhost.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-health.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-pan.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-a2dp.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-avrcp.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-handsfree.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-gatt.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-ipc.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_bluetooth_default_la-hal-utils.lo: \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) + +android/bluetooth.default.la: $(android_bluetooth_default_la_OBJECTS) $(android_bluetooth_default_la_DEPENDENCIES) $(EXTRA_android_bluetooth_default_la_DEPENDENCIES) android/$(am__dirstamp) + $(AM_V_CCLD)$(android_bluetooth_default_la_LINK) $(am_android_bluetooth_default_la_rpath) $(android_bluetooth_default_la_OBJECTS) $(android_bluetooth_default_la_LIBADD) $(LIBS) +gdbus/$(am__dirstamp): + @$(MKDIR_P) gdbus + @: > gdbus/$(am__dirstamp) +gdbus/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gdbus/$(DEPDIR) + @: > gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/mainloop.lo: gdbus/$(am__dirstamp) \ + gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/watch.lo: gdbus/$(am__dirstamp) gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/object.lo: gdbus/$(am__dirstamp) gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/client.lo: gdbus/$(am__dirstamp) gdbus/$(DEPDIR)/$(am__dirstamp) +gdbus/polkit.lo: gdbus/$(am__dirstamp) gdbus/$(DEPDIR)/$(am__dirstamp) + +gdbus/libgdbus-internal.la: $(gdbus_libgdbus_internal_la_OBJECTS) $(gdbus_libgdbus_internal_la_DEPENDENCIES) $(EXTRA_gdbus_libgdbus_internal_la_DEPENDENCIES) gdbus/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(gdbus_libgdbus_internal_la_OBJECTS) $(gdbus_libgdbus_internal_la_LIBADD) $(LIBS) +lib/$(am__dirstamp): + @$(MKDIR_P) lib + @: > lib/$(am__dirstamp) +lib/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/$(DEPDIR) + @: > lib/$(DEPDIR)/$(am__dirstamp) +lib/bluetooth.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/hci.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/sdp.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/uuid.lo: lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) + +lib/libbluetooth-internal.la: $(lib_libbluetooth_internal_la_OBJECTS) $(lib_libbluetooth_internal_la_DEPENDENCIES) $(EXTRA_lib_libbluetooth_internal_la_DEPENDENCIES) lib/$(am__dirstamp) + $(AM_V_CCLD)$(LINK) $(lib_libbluetooth_internal_la_OBJECTS) $(lib_libbluetooth_internal_la_LIBADD) $(LIBS) + +lib/libbluetooth.la: $(lib_libbluetooth_la_OBJECTS) $(lib_libbluetooth_la_DEPENDENCIES) $(EXTRA_lib_libbluetooth_la_DEPENDENCIES) lib/$(am__dirstamp) + $(AM_V_CCLD)$(lib_libbluetooth_la_LINK) $(am_lib_libbluetooth_la_rpath) $(lib_libbluetooth_la_OBJECTS) $(lib_libbluetooth_la_LIBADD) $(LIBS) +plugins/$(am__dirstamp): + @$(MKDIR_P) plugins + @: > plugins/$(am__dirstamp) +plugins/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) plugins/$(DEPDIR) + @: > plugins/$(DEPDIR)/$(am__dirstamp) +plugins/plugins_external_dummy_la-external-dummy.lo: \ + plugins/$(am__dirstamp) plugins/$(DEPDIR)/$(am__dirstamp) + +plugins/external-dummy.la: $(plugins_external_dummy_la_OBJECTS) $(plugins_external_dummy_la_DEPENDENCIES) $(EXTRA_plugins_external_dummy_la_DEPENDENCIES) plugins/$(am__dirstamp) + $(AM_V_CCLD)$(plugins_external_dummy_la_LINK) $(am_plugins_external_dummy_la_rpath) $(plugins_external_dummy_la_OBJECTS) $(plugins_external_dummy_la_LIBADD) $(LIBS) +plugins/plugins_sixaxis_la-sixaxis.lo: plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) + +plugins/sixaxis.la: $(plugins_sixaxis_la_OBJECTS) $(plugins_sixaxis_la_DEPENDENCIES) $(EXTRA_plugins_sixaxis_la_DEPENDENCIES) plugins/$(am__dirstamp) + $(AM_V_CCLD)$(plugins_sixaxis_la_LINK) $(am_plugins_sixaxis_la_rpath) $(plugins_sixaxis_la_OBJECTS) $(plugins_sixaxis_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-cupsPROGRAMS: $(cups_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(cups_PROGRAMS)'; test -n "$(cupsdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cupsdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cupsdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(cupsdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(cupsdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-cupsPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(cups_PROGRAMS)'; test -n "$(cupsdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(cupsdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(cupsdir)" && rm -f $$files + +clean-cupsPROGRAMS: + @list='$(cups_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libexecdir)" && rm -f $$files + +clean-libexecPROGRAMS: + @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +install-udevPROGRAMS: $(udev_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(udev_PROGRAMS)'; test -n "$(udevdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(udevdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(udevdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(udevdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(udevdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-udevPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(udev_PROGRAMS)'; test -n "$(udevdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(udevdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(udevdir)" && rm -f $$files + +clean-udevPROGRAMS: + @list='$(udev_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +emulator/$(am__dirstamp): + @$(MKDIR_P) emulator + @: > emulator/$(am__dirstamp) +emulator/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) emulator/$(DEPDIR) + @: > emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_android_tester-btdev.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_android_tester-bthost.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_android_tester-smp.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +src/shared/$(am__dirstamp): + @$(MKDIR_P) src/shared + @: > src/shared/$(am__dirstamp) +src/shared/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/shared/$(DEPDIR) + @: > src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_android_tester-crypto.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_android_tester-io-glib.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_android_tester-queue.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_android_tester-util.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_android_tester-mgmt.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_android_tester-hciemu.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_android_tester-tester.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_android_tester-timeout-glib.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +android/hardware/$(am__dirstamp): + @$(MKDIR_P) android/hardware + @: > android/hardware/$(am__dirstamp) +android/hardware/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) android/hardware/$(DEPDIR) + @: > android/hardware/$(DEPDIR)/$(am__dirstamp) +android/hardware/android_android_tester-hardware.$(OBJEXT): \ + android/hardware/$(am__dirstamp) \ + android/hardware/$(DEPDIR)/$(am__dirstamp) +android/android_android_tester-android-tester.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) + +android/android-tester$(EXEEXT): $(android_android_tester_OBJECTS) $(android_android_tester_DEPENDENCIES) $(EXTRA_android_android_tester_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/android-tester$(EXEEXT) + $(AM_V_CCLD)$(android_android_tester_LINK) $(android_android_tester_OBJECTS) $(android_android_tester_LDADD) $(LIBS) +android/main.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +src/$(am__dirstamp): + @$(MKDIR_P) src + @: > src/$(am__dirstamp) +src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/$(DEPDIR) + @: > src/$(DEPDIR)/$(am__dirstamp) +src/log.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/sdpd-database.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/sdpd-server.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/sdpd-service.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/sdpd-request.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/uuid-helper.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/eir.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/shared/io-glib.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/queue.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/util.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/mgmt.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/ringbuf.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/hfp.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +android/bluetooth.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/hidhost.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/ipc.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/avdtp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/a2dp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/avctp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/avrcp.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/avrcp-lib.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/socket.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/pan.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/handsfree.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/gatt.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +android/health.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +attrib/$(am__dirstamp): + @$(MKDIR_P) attrib + @: > attrib/$(am__dirstamp) +attrib/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) attrib/$(DEPDIR) + @: > attrib/$(DEPDIR)/$(am__dirstamp) +attrib/att.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/gatt.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/gattrib.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +btio/$(am__dirstamp): + @$(MKDIR_P) btio + @: > btio/$(am__dirstamp) +btio/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) btio/$(DEPDIR) + @: > btio/$(DEPDIR)/$(am__dirstamp) +btio/btio.$(OBJEXT): btio/$(am__dirstamp) \ + btio/$(DEPDIR)/$(am__dirstamp) +src/sdp-client.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +profiles/network/$(am__dirstamp): + @$(MKDIR_P) profiles/network + @: > profiles/network/$(am__dirstamp) +profiles/network/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/network/$(DEPDIR) + @: > profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/network/bnep.$(OBJEXT): profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) + +android/bluetoothd$(EXEEXT): $(android_bluetoothd_OBJECTS) $(android_bluetoothd_DEPENDENCIES) $(EXTRA_android_bluetoothd_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/bluetoothd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(android_bluetoothd_OBJECTS) $(android_bluetoothd_LDADD) $(LIBS) +android/bluetoothd-snoop.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) +monitor/$(am__dirstamp): + @$(MKDIR_P) monitor + @: > monitor/$(am__dirstamp) +monitor/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) monitor/$(DEPDIR) + @: > monitor/$(DEPDIR)/$(am__dirstamp) +monitor/mainloop.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +src/shared/btsnoop.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + +android/bluetoothd-snoop$(EXEEXT): $(android_bluetoothd_snoop_OBJECTS) $(android_bluetoothd_snoop_DEPENDENCIES) $(EXTRA_android_bluetoothd_snoop_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/bluetoothd-snoop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(android_bluetoothd_snoop_OBJECTS) $(android_bluetoothd_snoop_LDADD) $(LIBS) +android/client/$(am__dirstamp): + @$(MKDIR_P) android/client + @: > android/client/$(am__dirstamp) +android/client/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) android/client/$(DEPDIR) + @: > android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-haltest.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-pollhandler.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-terminal.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-history.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-tabcompletion.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-av.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-rc.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-bt.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-gatt.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-hf.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-hh.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-pan.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-sock.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/client/android_haltest-if-audio.$(OBJEXT): \ + android/client/$(am__dirstamp) \ + android/client/$(DEPDIR)/$(am__dirstamp) +android/hardware/android_haltest-hardware.$(OBJEXT): \ + android/hardware/$(am__dirstamp) \ + android/hardware/$(DEPDIR)/$(am__dirstamp) +android/android_haltest-hal-utils.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) + +android/haltest$(EXEEXT): $(android_haltest_OBJECTS) $(android_haltest_DEPENDENCIES) $(EXTRA_android_haltest_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/haltest$(EXEEXT) + $(AM_V_CCLD)$(android_haltest_LINK) $(android_haltest_OBJECTS) $(android_haltest_LDADD) $(LIBS) +emulator/android_ipc_tester-btdev.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_ipc_tester-bthost.$(OBJEXT): \ + emulator/$(am__dirstamp) emulator/$(DEPDIR)/$(am__dirstamp) +emulator/android_ipc_tester-smp.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +src/shared/android_ipc_tester-crypto.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_ipc_tester-io-glib.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_ipc_tester-queue.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_ipc_tester-util.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_ipc_tester-mgmt.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_ipc_tester-hciemu.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_ipc_tester-tester.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/android_ipc_tester-timeout-glib.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +android/android_ipc_tester-hal-utils.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) +android/android_ipc_tester-ipc-tester.$(OBJEXT): \ + android/$(am__dirstamp) android/$(DEPDIR)/$(am__dirstamp) + +android/ipc-tester$(EXEEXT): $(android_ipc_tester_OBJECTS) $(android_ipc_tester_DEPENDENCIES) $(EXTRA_android_ipc_tester_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/ipc-tester$(EXEEXT) + $(AM_V_CCLD)$(android_ipc_tester_LINK) $(android_ipc_tester_OBJECTS) $(android_ipc_tester_LDADD) $(LIBS) +android/system-emulator.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) + +android/system-emulator$(EXEEXT): $(android_system_emulator_OBJECTS) $(android_system_emulator_DEPENDENCIES) $(EXTRA_android_system_emulator_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/system-emulator$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(android_system_emulator_OBJECTS) $(android_system_emulator_LDADD) $(LIBS) +android/test-ipc.$(OBJEXT): android/$(am__dirstamp) \ + android/$(DEPDIR)/$(am__dirstamp) + +android/test-ipc$(EXEEXT): $(android_test_ipc_OBJECTS) $(android_test_ipc_DEPENDENCIES) $(EXTRA_android_test_ipc_DEPENDENCIES) android/$(am__dirstamp) + @rm -f android/test-ipc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(android_test_ipc_OBJECTS) $(android_test_ipc_LDADD) $(LIBS) +attrib/gatttool.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/interactive.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/utils.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +client/$(am__dirstamp): + @$(MKDIR_P) client + @: > client/$(am__dirstamp) +client/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) client/$(DEPDIR) + @: > client/$(DEPDIR)/$(am__dirstamp) +client/display.$(OBJEXT): client/$(am__dirstamp) \ + client/$(DEPDIR)/$(am__dirstamp) + +attrib/gatttool$(EXEEXT): $(attrib_gatttool_OBJECTS) $(attrib_gatttool_DEPENDENCIES) $(EXTRA_attrib_gatttool_DEPENDENCIES) attrib/$(am__dirstamp) + @rm -f attrib/gatttool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(attrib_gatttool_OBJECTS) $(attrib_gatttool_LDADD) $(LIBS) +client/main.$(OBJEXT): client/$(am__dirstamp) \ + client/$(DEPDIR)/$(am__dirstamp) +client/agent.$(OBJEXT): client/$(am__dirstamp) \ + client/$(DEPDIR)/$(am__dirstamp) +monitor/uuid.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) + +client/bluetoothctl$(EXEEXT): $(client_bluetoothctl_OBJECTS) $(client_bluetoothctl_DEPENDENCIES) $(EXTRA_client_bluetoothctl_DEPENDENCIES) client/$(am__dirstamp) + @rm -f client/bluetoothctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(client_bluetoothctl_OBJECTS) $(client_bluetoothctl_LDADD) $(LIBS) +emulator/b1ee.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) + +emulator/b1ee$(EXEEXT): $(emulator_b1ee_OBJECTS) $(emulator_b1ee_DEPENDENCIES) $(EXTRA_emulator_b1ee_DEPENDENCIES) emulator/$(am__dirstamp) + @rm -f emulator/b1ee$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(emulator_b1ee_OBJECTS) $(emulator_b1ee_LDADD) $(LIBS) +emulator/main.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +src/shared/timeout-mainloop.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/crypto.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +emulator/server.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/vhci.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/btdev.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/bthost.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/smp.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/amp.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +emulator/le.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) + +emulator/btvirt$(EXEEXT): $(emulator_btvirt_OBJECTS) $(emulator_btvirt_DEPENDENCIES) $(EXTRA_emulator_btvirt_DEPENDENCIES) emulator/$(am__dirstamp) + @rm -f emulator/btvirt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(emulator_btvirt_OBJECTS) $(emulator_btvirt_LDADD) $(LIBS) +emulator/hfp.$(OBJEXT): emulator/$(am__dirstamp) \ + emulator/$(DEPDIR)/$(am__dirstamp) +src/shared/io-mainloop.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + +emulator/hfp$(EXEEXT): $(emulator_hfp_OBJECTS) $(emulator_hfp_DEPENDENCIES) $(EXTRA_emulator_hfp_DEPENDENCIES) emulator/$(am__dirstamp) + @rm -f emulator/hfp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(emulator_hfp_OBJECTS) $(emulator_hfp_LDADD) $(LIBS) +monitor/main.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/display.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/hcidump.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/ellisys.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/control.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/packet.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/vendor.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/lmp.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/crc.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/ll.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/l2cap.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/sdp.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/hwdb.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/keys.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) +monitor/analyze.$(OBJEXT): monitor/$(am__dirstamp) \ + monitor/$(DEPDIR)/$(am__dirstamp) + +monitor/btmon$(EXEEXT): $(monitor_btmon_OBJECTS) $(monitor_btmon_DEPENDENCIES) $(EXTRA_monitor_btmon_DEPENDENCIES) monitor/$(am__dirstamp) + @rm -f monitor/btmon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(monitor_btmon_OBJECTS) $(monitor_btmon_LDADD) $(LIBS) +btio/obexd-btio.$(OBJEXT): btio/$(am__dirstamp) \ + btio/$(DEPDIR)/$(am__dirstamp) +gobex/$(am__dirstamp): + @$(MKDIR_P) gobex + @: > gobex/$(am__dirstamp) +gobex/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) gobex/$(DEPDIR) + @: > gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-defs.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-packet.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-header.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-transfer.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/obexd-gobex-apparam.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/$(am__dirstamp): + @$(MKDIR_P) obexd/plugins + @: > obexd/plugins/$(am__dirstamp) +obexd/plugins/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) obexd/plugins/$(DEPDIR) + @: > obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-filesystem.$(OBJEXT): \ + obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-bluetooth.$(OBJEXT): \ + obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-pcsuite.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-opp.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-ftp.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-irmc.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-pbap.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-vcard.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-phonebook-dummy.$(OBJEXT): \ + obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-mas.$(OBJEXT): obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/plugins/obexd-messages-dummy.$(OBJEXT): \ + obexd/plugins/$(am__dirstamp) \ + obexd/plugins/$(DEPDIR)/$(am__dirstamp) +obexd/client/$(am__dirstamp): + @$(MKDIR_P) obexd/client + @: > obexd/client/$(am__dirstamp) +obexd/client/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) obexd/client/$(DEPDIR) + @: > obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-mns.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/src/$(am__dirstamp): + @$(MKDIR_P) obexd/src + @: > obexd/src/$(am__dirstamp) +obexd/src/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) obexd/src/$(DEPDIR) + @: > obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-main.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-plugin.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-log.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-manager.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-obex.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-mimetype.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-service.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-transport.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/src/obexd-server.$(OBJEXT): obexd/src/$(am__dirstamp) \ + obexd/src/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-manager.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-session.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-bluetooth.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-sync.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-pbap.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-ftp.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-opp.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-map.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-map-event.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-transfer.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-transport.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-dbus.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) +obexd/client/obexd-driver.$(OBJEXT): obexd/client/$(am__dirstamp) \ + obexd/client/$(DEPDIR)/$(am__dirstamp) + +obexd/src/obexd$(EXEEXT): $(obexd_src_obexd_OBJECTS) $(obexd_src_obexd_DEPENDENCIES) $(EXTRA_obexd_src_obexd_DEPENDENCIES) obexd/src/$(am__dirstamp) + @rm -f obexd/src/obexd$(EXEEXT) + $(AM_V_CCLD)$(obexd_src_obexd_LINK) $(obexd_src_obexd_OBJECTS) $(obexd_src_obexd_LDADD) $(LIBS) +profiles/cups/$(am__dirstamp): + @$(MKDIR_P) profiles/cups + @: > profiles/cups/$(am__dirstamp) +profiles/cups/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/cups/$(DEPDIR) + @: > profiles/cups/$(DEPDIR)/$(am__dirstamp) +profiles/cups/main.$(OBJEXT): profiles/cups/$(am__dirstamp) \ + profiles/cups/$(DEPDIR)/$(am__dirstamp) +profiles/cups/sdp.$(OBJEXT): profiles/cups/$(am__dirstamp) \ + profiles/cups/$(DEPDIR)/$(am__dirstamp) +profiles/cups/spp.$(OBJEXT): profiles/cups/$(am__dirstamp) \ + profiles/cups/$(DEPDIR)/$(am__dirstamp) +profiles/cups/hcrp.$(OBJEXT): profiles/cups/$(am__dirstamp) \ + profiles/cups/$(DEPDIR)/$(am__dirstamp) + +profiles/cups/bluetooth$(EXEEXT): $(profiles_cups_bluetooth_OBJECTS) $(profiles_cups_bluetooth_DEPENDENCIES) $(EXTRA_profiles_cups_bluetooth_DEPENDENCIES) profiles/cups/$(am__dirstamp) + @rm -f profiles/cups/bluetooth$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(profiles_cups_bluetooth_OBJECTS) $(profiles_cups_bluetooth_LDADD) $(LIBS) +profiles/iap/$(am__dirstamp): + @$(MKDIR_P) profiles/iap + @: > profiles/iap/$(am__dirstamp) +profiles/iap/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/iap/$(DEPDIR) + @: > profiles/iap/$(DEPDIR)/$(am__dirstamp) +profiles/iap/main.$(OBJEXT): profiles/iap/$(am__dirstamp) \ + profiles/iap/$(DEPDIR)/$(am__dirstamp) + +profiles/iap/iapd$(EXEEXT): $(profiles_iap_iapd_OBJECTS) $(profiles_iap_iapd_DEPENDENCIES) $(EXTRA_profiles_iap_iapd_DEPENDENCIES) profiles/iap/$(am__dirstamp) + @rm -f profiles/iap/iapd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(profiles_iap_iapd_OBJECTS) $(profiles_iap_iapd_LDADD) $(LIBS) +plugins/bluetoothd-hostname.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-wiimote.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-autopair.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-dropcam.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-policy.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-gatt-example.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-neard.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) +profiles/sap/bluetoothd-main.$(OBJEXT): profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/sap/bluetoothd-manager.$(OBJEXT): \ + profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/sap/bluetoothd-server.$(OBJEXT): \ + profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/sap/bluetoothd-sap-dummy.$(OBJEXT): \ + profiles/sap/$(am__dirstamp) \ + profiles/sap/$(DEPDIR)/$(am__dirstamp) +profiles/audio/$(am__dirstamp): + @$(MKDIR_P) profiles/audio + @: > profiles/audio/$(am__dirstamp) +profiles/audio/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/audio/$(DEPDIR) + @: > profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-source.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-sink.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-a2dp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-avdtp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-media.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-transport.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-control.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-avctp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-avrcp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-player.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/network/bluetoothd-manager.$(OBJEXT): \ + profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/network/bluetoothd-bnep.$(OBJEXT): \ + profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/network/bluetoothd-server.$(OBJEXT): \ + profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/network/bluetoothd-connection.$(OBJEXT): \ + profiles/network/$(am__dirstamp) \ + profiles/network/$(DEPDIR)/$(am__dirstamp) +profiles/input/$(am__dirstamp): + @$(MKDIR_P) profiles/input + @: > profiles/input/$(am__dirstamp) +profiles/input/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/input/$(DEPDIR) + @: > profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-manager.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-server.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-device.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-hog.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/input/bluetoothd-suspend-dummy.$(OBJEXT): \ + profiles/input/$(am__dirstamp) \ + profiles/input/$(DEPDIR)/$(am__dirstamp) +profiles/health/$(am__dirstamp): + @$(MKDIR_P) profiles/health + @: > profiles/health/$(am__dirstamp) +profiles/health/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/health/$(DEPDIR) + @: > profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-mcap.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-mcap_sync.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-hdp_main.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-hdp_manager.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-hdp.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/health/bluetoothd-hdp_util.$(OBJEXT): \ + profiles/health/$(am__dirstamp) \ + profiles/health/$(DEPDIR)/$(am__dirstamp) +profiles/gatt/$(am__dirstamp): + @$(MKDIR_P) profiles/gatt + @: > profiles/gatt/$(am__dirstamp) +profiles/gatt/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/gatt/$(DEPDIR) + @: > profiles/gatt/$(DEPDIR)/$(am__dirstamp) +profiles/gatt/bluetoothd-gas.$(OBJEXT): profiles/gatt/$(am__dirstamp) \ + profiles/gatt/$(DEPDIR)/$(am__dirstamp) +profiles/scanparam/$(am__dirstamp): + @$(MKDIR_P) profiles/scanparam + @: > profiles/scanparam/$(am__dirstamp) +profiles/scanparam/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/scanparam/$(DEPDIR) + @: > profiles/scanparam/$(DEPDIR)/$(am__dirstamp) +profiles/scanparam/bluetoothd-scan.$(OBJEXT): \ + profiles/scanparam/$(am__dirstamp) \ + profiles/scanparam/$(DEPDIR)/$(am__dirstamp) +profiles/deviceinfo/$(am__dirstamp): + @$(MKDIR_P) profiles/deviceinfo + @: > profiles/deviceinfo/$(am__dirstamp) +profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/deviceinfo/$(DEPDIR) + @: > profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp) +profiles/deviceinfo/bluetoothd-deviceinfo.$(OBJEXT): \ + profiles/deviceinfo/$(am__dirstamp) \ + profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp) +profiles/alert/$(am__dirstamp): + @$(MKDIR_P) profiles/alert + @: > profiles/alert/$(am__dirstamp) +profiles/alert/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/alert/$(DEPDIR) + @: > profiles/alert/$(DEPDIR)/$(am__dirstamp) +profiles/alert/bluetoothd-server.$(OBJEXT): \ + profiles/alert/$(am__dirstamp) \ + profiles/alert/$(DEPDIR)/$(am__dirstamp) +profiles/time/$(am__dirstamp): + @$(MKDIR_P) profiles/time + @: > profiles/time/$(am__dirstamp) +profiles/time/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/time/$(DEPDIR) + @: > profiles/time/$(DEPDIR)/$(am__dirstamp) +profiles/time/bluetoothd-server.$(OBJEXT): \ + profiles/time/$(am__dirstamp) \ + profiles/time/$(DEPDIR)/$(am__dirstamp) +profiles/proximity/$(am__dirstamp): + @$(MKDIR_P) profiles/proximity + @: > profiles/proximity/$(am__dirstamp) +profiles/proximity/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/proximity/$(DEPDIR) + @: > profiles/proximity/$(DEPDIR)/$(am__dirstamp) +profiles/proximity/bluetoothd-main.$(OBJEXT): \ + profiles/proximity/$(am__dirstamp) \ + profiles/proximity/$(DEPDIR)/$(am__dirstamp) +profiles/proximity/bluetoothd-manager.$(OBJEXT): \ + profiles/proximity/$(am__dirstamp) \ + profiles/proximity/$(DEPDIR)/$(am__dirstamp) +profiles/proximity/bluetoothd-monitor.$(OBJEXT): \ + profiles/proximity/$(am__dirstamp) \ + profiles/proximity/$(DEPDIR)/$(am__dirstamp) +profiles/proximity/bluetoothd-reporter.$(OBJEXT): \ + profiles/proximity/$(am__dirstamp) \ + profiles/proximity/$(DEPDIR)/$(am__dirstamp) +profiles/proximity/bluetoothd-linkloss.$(OBJEXT): \ + profiles/proximity/$(am__dirstamp) \ + profiles/proximity/$(DEPDIR)/$(am__dirstamp) +profiles/proximity/bluetoothd-immalert.$(OBJEXT): \ + profiles/proximity/$(am__dirstamp) \ + profiles/proximity/$(DEPDIR)/$(am__dirstamp) +profiles/thermometer/$(am__dirstamp): + @$(MKDIR_P) profiles/thermometer + @: > profiles/thermometer/$(am__dirstamp) +profiles/thermometer/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/thermometer/$(DEPDIR) + @: > profiles/thermometer/$(DEPDIR)/$(am__dirstamp) +profiles/thermometer/bluetoothd-thermometer.$(OBJEXT): \ + profiles/thermometer/$(am__dirstamp) \ + profiles/thermometer/$(DEPDIR)/$(am__dirstamp) +profiles/heartrate/$(am__dirstamp): + @$(MKDIR_P) profiles/heartrate + @: > profiles/heartrate/$(am__dirstamp) +profiles/heartrate/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/heartrate/$(DEPDIR) + @: > profiles/heartrate/$(DEPDIR)/$(am__dirstamp) +profiles/heartrate/bluetoothd-heartrate.$(OBJEXT): \ + profiles/heartrate/$(am__dirstamp) \ + profiles/heartrate/$(DEPDIR)/$(am__dirstamp) +profiles/cyclingspeed/$(am__dirstamp): + @$(MKDIR_P) profiles/cyclingspeed + @: > profiles/cyclingspeed/$(am__dirstamp) +profiles/cyclingspeed/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) profiles/cyclingspeed/$(DEPDIR) + @: > profiles/cyclingspeed/$(DEPDIR)/$(am__dirstamp) +profiles/cyclingspeed/bluetoothd-cyclingspeed.$(OBJEXT): \ + profiles/cyclingspeed/$(am__dirstamp) \ + profiles/cyclingspeed/$(DEPDIR)/$(am__dirstamp) +attrib/bluetoothd-att.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/bluetoothd-gatt.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/bluetoothd-gattrib.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +attrib/bluetoothd-gatt-service.$(OBJEXT): attrib/$(am__dirstamp) \ + attrib/$(DEPDIR)/$(am__dirstamp) +btio/bluetoothd-btio.$(OBJEXT): btio/$(am__dirstamp) \ + btio/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-main.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-log.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-systemd.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-rfkill.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdpd-server.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdpd-request.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdpd-service.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdpd-database.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-attrib-server.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdp-xml.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-sdp-client.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-textfile.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-uuid-helper.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-plugin.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-storage.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-agent.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-error.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-adapter.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-profile.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-service.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-gatt-dbus.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-gatt.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-device.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-dbus-common.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/bluetoothd-eir.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/shared/bluetoothd-io-glib.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/bluetoothd-timeout-glib.$(OBJEXT): \ + src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/bluetoothd-queue.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/bluetoothd-util.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/bluetoothd-mgmt.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + +src/bluetoothd$(EXEEXT): $(src_bluetoothd_OBJECTS) $(src_bluetoothd_DEPENDENCIES) $(EXTRA_src_bluetoothd_DEPENDENCIES) src/$(am__dirstamp) + @rm -f src/bluetoothd$(EXEEXT) + $(AM_V_CCLD)$(src_bluetoothd_LINK) $(src_bluetoothd_OBJECTS) $(src_bluetoothd_LDADD) $(LIBS) +tools/$(am__dirstamp): + @$(MKDIR_P) tools + @: > tools/$(am__dirstamp) +tools/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) tools/$(DEPDIR) + @: > tools/$(DEPDIR)/$(am__dirstamp) +tools/3dsp.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +src/shared/hci.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + +tools/3dsp$(EXEEXT): $(tools_3dsp_OBJECTS) $(tools_3dsp_DEPENDENCIES) $(EXTRA_tools_3dsp_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/3dsp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_3dsp_OBJECTS) $(tools_3dsp_LDADD) $(LIBS) +tools/amptest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/amptest$(EXEEXT): $(tools_amptest_OBJECTS) $(tools_amptest_DEPENDENCIES) $(EXTRA_tools_amptest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/amptest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_amptest_OBJECTS) $(tools_amptest_LDADD) $(LIBS) +tools/avinfo.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/avinfo$(EXEEXT): $(tools_avinfo_OBJECTS) $(tools_avinfo_DEPENDENCIES) $(EXTRA_tools_avinfo_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/avinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_avinfo_OBJECTS) $(tools_avinfo_LDADD) $(LIBS) +tools/avtest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/avtest$(EXEEXT): $(tools_avtest_OBJECTS) $(tools_avtest_DEPENDENCIES) $(EXTRA_tools_avtest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/avtest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_avtest_OBJECTS) $(tools_avtest_LDADD) $(LIBS) +tools/bccmd.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_hci.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_usb.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_h4.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_3wire.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/csr_bcsp.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/ubcsp.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/bccmd$(EXEEXT): $(tools_bccmd_OBJECTS) $(tools_bccmd_DEPENDENCIES) $(EXTRA_tools_bccmd_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bccmd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bccmd_OBJECTS) $(tools_bccmd_LDADD) $(LIBS) +tools/bdaddr.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +src/oui.$(OBJEXT): src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) + +tools/bdaddr$(EXEEXT): $(tools_bdaddr_OBJECTS) $(tools_bdaddr_DEPENDENCIES) $(EXTRA_tools_bdaddr_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bdaddr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bdaddr_OBJECTS) $(tools_bdaddr_LDADD) $(LIBS) +tools/bluemoon.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/bluemoon$(EXEEXT): $(tools_bluemoon_OBJECTS) $(tools_bluemoon_DEPENDENCIES) $(EXTRA_tools_bluemoon_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bluemoon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bluemoon_OBJECTS) $(tools_bluemoon_LDADD) $(LIBS) +tools/bluetooth-player.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/bluetooth-player$(EXEEXT): $(tools_bluetooth_player_OBJECTS) $(tools_bluetooth_player_DEPENDENCIES) $(EXTRA_tools_bluetooth_player_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/bluetooth-player$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_bluetooth_player_OBJECTS) $(tools_bluetooth_player_LDADD) $(LIBS) +tools/btattach.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btattach$(EXEEXT): $(tools_btattach_OBJECTS) $(tools_btattach_DEPENDENCIES) $(EXTRA_tools_btattach_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btattach$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btattach_OBJECTS) $(tools_btattach_LDADD) $(LIBS) +tools/btinfo.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btinfo$(EXEEXT): $(tools_btinfo_OBJECTS) $(tools_btinfo_DEPENDENCIES) $(EXTRA_tools_btinfo_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btinfo_OBJECTS) $(tools_btinfo_LDADD) $(LIBS) +tools/btiotest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btiotest$(EXEEXT): $(tools_btiotest_OBJECTS) $(tools_btiotest_DEPENDENCIES) $(EXTRA_tools_btiotest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btiotest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btiotest_OBJECTS) $(tools_btiotest_LDADD) $(LIBS) +tools/btmgmt.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btmgmt$(EXEEXT): $(tools_btmgmt_OBJECTS) $(tools_btmgmt_DEPENDENCIES) $(EXTRA_tools_btmgmt_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btmgmt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btmgmt_OBJECTS) $(tools_btmgmt_LDADD) $(LIBS) +tools/btproxy.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/btproxy$(EXEEXT): $(tools_btproxy_OBJECTS) $(tools_btproxy_DEPENDENCIES) $(EXTRA_tools_btproxy_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btproxy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btproxy_OBJECTS) $(tools_btproxy_LDADD) $(LIBS) +tools/btsnoop.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +src/shared/pcap.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + +tools/btsnoop$(EXEEXT): $(tools_btsnoop_OBJECTS) $(tools_btsnoop_DEPENDENCIES) $(EXTRA_tools_btsnoop_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/btsnoop$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_btsnoop_OBJECTS) $(tools_btsnoop_LDADD) $(LIBS) +tools/ciptool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/ciptool$(EXEEXT): $(tools_ciptool_OBJECTS) $(tools_ciptool_DEPENDENCIES) $(EXTRA_tools_ciptool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/ciptool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_ciptool_OBJECTS) $(tools_ciptool_LDADD) $(LIBS) +tools/cltest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/cltest$(EXEEXT): $(tools_cltest_OBJECTS) $(tools_cltest_DEPENDENCIES) $(EXTRA_tools_cltest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/cltest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_cltest_OBJECTS) $(tools_cltest_LDADD) $(LIBS) +tools/gap-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +src/shared/hciemu.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/tester.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/timeout-glib.$(OBJEXT): src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + +tools/gap-tester$(EXEEXT): $(tools_gap_tester_OBJECTS) $(tools_gap_tester_DEPENDENCIES) $(EXTRA_tools_gap_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/gap-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_gap_tester_OBJECTS) $(tools_gap_tester_LDADD) $(LIBS) +tools/gatt-service.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/gatt-service$(EXEEXT): $(tools_gatt_service_OBJECTS) $(tools_gatt_service_DEPENDENCIES) $(EXTRA_tools_gatt_service_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/gatt-service$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_gatt_service_OBJECTS) $(tools_gatt_service_LDADD) $(LIBS) +tools/hci-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hci-tester$(EXEEXT): $(tools_hci_tester_OBJECTS) $(tools_hci_tester_DEPENDENCIES) $(EXTRA_tools_hci_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hci-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hci_tester_OBJECTS) $(tools_hci_tester_LDADD) $(LIBS) +tools/hciattach.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_st.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_ti.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_tialt.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_ath3k.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_qualcomm.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/hciattach_intel.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hciattach$(EXEEXT): $(tools_hciattach_OBJECTS) $(tools_hciattach_DEPENDENCIES) $(EXTRA_tools_hciattach_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hciattach$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hciattach_OBJECTS) $(tools_hciattach_LDADD) $(LIBS) +tools/hciconfig.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hciconfig$(EXEEXT): $(tools_hciconfig_OBJECTS) $(tools_hciconfig_DEPENDENCIES) $(EXTRA_tools_hciconfig_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hciconfig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hciconfig_OBJECTS) $(tools_hciconfig_LDADD) $(LIBS) +tools/hcidump.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +tools/parser/$(am__dirstamp): + @$(MKDIR_P) tools/parser + @: > tools/parser/$(am__dirstamp) +tools/parser/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) tools/parser/$(DEPDIR) + @: > tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/parser.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/lmp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/hci.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/l2cap.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/amp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/smp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/att.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/sdp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/rfcomm.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/bnep.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/cmtp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/hidp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/hcrp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/avdtp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/avctp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/avrcp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/sap.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/obex.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/capi.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/ppp.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/tcpip.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/ericsson.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/csr.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) +tools/parser/bpa.$(OBJEXT): tools/parser/$(am__dirstamp) \ + tools/parser/$(DEPDIR)/$(am__dirstamp) + +tools/hcidump$(EXEEXT): $(tools_hcidump_OBJECTS) $(tools_hcidump_DEPENDENCIES) $(EXTRA_tools_hcidump_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hcidump$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hcidump_OBJECTS) $(tools_hcidump_LDADD) $(LIBS) +tools/hcieventmask.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hcieventmask$(EXEEXT): $(tools_hcieventmask_OBJECTS) $(tools_hcieventmask_DEPENDENCIES) $(EXTRA_tools_hcieventmask_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hcieventmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hcieventmask_OBJECTS) $(tools_hcieventmask_LDADD) $(LIBS) +tools/hcisecfilter.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hcisecfilter$(EXEEXT): $(tools_hcisecfilter_OBJECTS) $(tools_hcisecfilter_DEPENDENCIES) $(EXTRA_tools_hcisecfilter_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hcisecfilter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hcisecfilter_OBJECTS) $(tools_hcisecfilter_LDADD) $(LIBS) +tools/hcitool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hcitool$(EXEEXT): $(tools_hcitool_OBJECTS) $(tools_hcitool_DEPENDENCIES) $(EXTRA_tools_hcitool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hcitool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hcitool_OBJECTS) $(tools_hcitool_LDADD) $(LIBS) +tools/hid2hci.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hid2hci$(EXEEXT): $(tools_hid2hci_OBJECTS) $(tools_hid2hci_DEPENDENCIES) $(EXTRA_tools_hid2hci_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hid2hci$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hid2hci_OBJECTS) $(tools_hid2hci_LDADD) $(LIBS) +tools/hwdb.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/hwdb$(EXEEXT): $(tools_hwdb_OBJECTS) $(tools_hwdb_DEPENDENCIES) $(EXTRA_tools_hwdb_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/hwdb$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_hwdb_OBJECTS) $(tools_hwdb_LDADD) $(LIBS) +tools/ibeacon.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/ibeacon$(EXEEXT): $(tools_ibeacon_OBJECTS) $(tools_ibeacon_DEPENDENCIES) $(EXTRA_tools_ibeacon_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/ibeacon$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_ibeacon_OBJECTS) $(tools_ibeacon_LDADD) $(LIBS) +tools/l2cap-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/l2cap-tester$(EXEEXT): $(tools_l2cap_tester_OBJECTS) $(tools_l2cap_tester_DEPENDENCIES) $(EXTRA_tools_l2cap_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/l2cap-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_l2cap_tester_OBJECTS) $(tools_l2cap_tester_LDADD) $(LIBS) +tools/l2ping.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/l2ping$(EXEEXT): $(tools_l2ping_OBJECTS) $(tools_l2ping_DEPENDENCIES) $(EXTRA_tools_l2ping_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/l2ping$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_l2ping_OBJECTS) $(tools_l2ping_LDADD) $(LIBS) +tools/l2test.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/l2test$(EXEEXT): $(tools_l2test_OBJECTS) $(tools_l2test_DEPENDENCIES) $(EXTRA_tools_l2test_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/l2test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_l2test_OBJECTS) $(tools_l2test_LDADD) $(LIBS) +tools/mgmt-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/mgmt-tester$(EXEEXT): $(tools_mgmt_tester_OBJECTS) $(tools_mgmt_tester_DEPENDENCIES) $(EXTRA_tools_mgmt_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/mgmt-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_mgmt_tester_OBJECTS) $(tools_mgmt_tester_LDADD) $(LIBS) +tools/mpris-player.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/mpris-player$(EXEEXT): $(tools_mpris_player_OBJECTS) $(tools_mpris_player_DEPENDENCIES) $(EXTRA_tools_mpris_player_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/mpris-player$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_mpris_player_OBJECTS) $(tools_mpris_player_LDADD) $(LIBS) +gobex/gobex.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-defs.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-packet.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-header.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-transfer.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +gobex/gobex-apparam.$(OBJEXT): gobex/$(am__dirstamp) \ + gobex/$(DEPDIR)/$(am__dirstamp) +tools/obex-client-tool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/obex-client-tool$(EXEEXT): $(tools_obex_client_tool_OBJECTS) $(tools_obex_client_tool_DEPENDENCIES) $(EXTRA_tools_obex_client_tool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/obex-client-tool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_obex_client_tool_OBJECTS) $(tools_obex_client_tool_LDADD) $(LIBS) +tools/obex-server-tool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/obex-server-tool$(EXEEXT): $(tools_obex_server_tool_OBJECTS) $(tools_obex_server_tool_DEPENDENCIES) $(EXTRA_tools_obex_server_tool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/obex-server-tool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_obex_server_tool_OBJECTS) $(tools_obex_server_tool_LDADD) $(LIBS) +tools/obexctl.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/obexctl$(EXEEXT): $(tools_obexctl_OBJECTS) $(tools_obexctl_DEPENDENCIES) $(EXTRA_tools_obexctl_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/obexctl$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_obexctl_OBJECTS) $(tools_obexctl_LDADD) $(LIBS) +tools/rctest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/rctest$(EXEEXT): $(tools_rctest_OBJECTS) $(tools_rctest_DEPENDENCIES) $(EXTRA_tools_rctest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/rctest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_rctest_OBJECTS) $(tools_rctest_LDADD) $(LIBS) +tools/rfcomm.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/rfcomm$(EXEEXT): $(tools_rfcomm_OBJECTS) $(tools_rfcomm_DEPENDENCIES) $(EXTRA_tools_rfcomm_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/rfcomm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_rfcomm_OBJECTS) $(tools_rfcomm_LDADD) $(LIBS) +tools/rfcomm-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/rfcomm-tester$(EXEEXT): $(tools_rfcomm_tester_OBJECTS) $(tools_rfcomm_tester_DEPENDENCIES) $(EXTRA_tools_rfcomm_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/rfcomm-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_rfcomm_tester_OBJECTS) $(tools_rfcomm_tester_LDADD) $(LIBS) +tools/sco-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/sco-tester$(EXEEXT): $(tools_sco_tester_OBJECTS) $(tools_sco_tester_DEPENDENCIES) $(EXTRA_tools_sco_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/sco-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_sco_tester_OBJECTS) $(tools_sco_tester_LDADD) $(LIBS) +tools/scotest.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/scotest$(EXEEXT): $(tools_scotest_OBJECTS) $(tools_scotest_DEPENDENCIES) $(EXTRA_tools_scotest_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/scotest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_scotest_OBJECTS) $(tools_scotest_LDADD) $(LIBS) +tools/sdptool.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) +src/sdp-xml.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +tools/sdptool$(EXEEXT): $(tools_sdptool_OBJECTS) $(tools_sdptool_DEPENDENCIES) $(EXTRA_tools_sdptool_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/sdptool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_sdptool_OBJECTS) $(tools_sdptool_LDADD) $(LIBS) +tools/seq2bseq.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/seq2bseq$(EXEEXT): $(tools_seq2bseq_OBJECTS) $(tools_seq2bseq_DEPENDENCIES) $(EXTRA_tools_seq2bseq_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/seq2bseq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_seq2bseq_OBJECTS) $(tools_seq2bseq_LDADD) $(LIBS) +tools/smp-tester.$(OBJEXT): tools/$(am__dirstamp) \ + tools/$(DEPDIR)/$(am__dirstamp) + +tools/smp-tester$(EXEEXT): $(tools_smp_tester_OBJECTS) $(tools_smp_tester_DEPENDENCIES) $(EXTRA_tools_smp_tester_DEPENDENCIES) tools/$(am__dirstamp) + @rm -f tools/smp-tester$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(tools_smp_tester_OBJECTS) $(tools_smp_tester_LDADD) $(LIBS) +unit/$(am__dirstamp): + @$(MKDIR_P) unit + @: > unit/$(am__dirstamp) +unit/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) unit/$(DEPDIR) + @: > unit/$(DEPDIR)/$(am__dirstamp) +unit/test-avctp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-avctp$(EXEEXT): $(unit_test_avctp_OBJECTS) $(unit_test_avctp_DEPENDENCIES) $(EXTRA_unit_test_avctp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-avctp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_avctp_OBJECTS) $(unit_test_avctp_LDADD) $(LIBS) +unit/test-avdtp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-avdtp$(EXEEXT): $(unit_test_avdtp_OBJECTS) $(unit_test_avdtp_DEPENDENCIES) $(EXTRA_unit_test_avdtp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-avdtp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_avdtp_OBJECTS) $(unit_test_avdtp_LDADD) $(LIBS) +unit/test-avrcp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-avrcp$(EXEEXT): $(unit_test_avrcp_OBJECTS) $(unit_test_avrcp_DEPENDENCIES) $(EXTRA_unit_test_avrcp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-avrcp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_avrcp_OBJECTS) $(unit_test_avrcp_LDADD) $(LIBS) +unit/test-crc.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-crc$(EXEEXT): $(unit_test_crc_OBJECTS) $(unit_test_crc_DEPENDENCIES) $(EXTRA_unit_test_crc_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-crc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_crc_OBJECTS) $(unit_test_crc_LDADD) $(LIBS) +unit/test-eir.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-eir$(EXEEXT): $(unit_test_eir_OBJECTS) $(unit_test_eir_DEPENDENCIES) $(EXTRA_unit_test_eir_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-eir$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_eir_OBJECTS) $(unit_test_eir_LDADD) $(LIBS) +unit/test-gdbus-client.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gdbus-client$(EXEEXT): $(unit_test_gdbus_client_OBJECTS) $(unit_test_gdbus_client_DEPENDENCIES) $(EXTRA_unit_test_gdbus_client_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gdbus-client$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gdbus_client_OBJECTS) $(unit_test_gdbus_client_LDADD) $(LIBS) +unit/util.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) +unit/test-gobex.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex$(EXEEXT): $(unit_test_gobex_OBJECTS) $(unit_test_gobex_DEPENDENCIES) $(EXTRA_unit_test_gobex_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_OBJECTS) $(unit_test_gobex_LDADD) $(LIBS) +unit/test-gobex-apparam.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex-apparam$(EXEEXT): $(unit_test_gobex_apparam_OBJECTS) $(unit_test_gobex_apparam_DEPENDENCIES) $(EXTRA_unit_test_gobex_apparam_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex-apparam$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_apparam_OBJECTS) $(unit_test_gobex_apparam_LDADD) $(LIBS) +unit/test-gobex-header.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex-header$(EXEEXT): $(unit_test_gobex_header_OBJECTS) $(unit_test_gobex_header_DEPENDENCIES) $(EXTRA_unit_test_gobex_header_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex-header$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_header_OBJECTS) $(unit_test_gobex_header_LDADD) $(LIBS) +unit/test-gobex-packet.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex-packet$(EXEEXT): $(unit_test_gobex_packet_OBJECTS) $(unit_test_gobex_packet_DEPENDENCIES) $(EXTRA_unit_test_gobex_packet_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex-packet$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_packet_OBJECTS) $(unit_test_gobex_packet_LDADD) $(LIBS) +unit/test-gobex-transfer.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-gobex-transfer$(EXEEXT): $(unit_test_gobex_transfer_OBJECTS) $(unit_test_gobex_transfer_DEPENDENCIES) $(EXTRA_unit_test_gobex_transfer_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-gobex-transfer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_gobex_transfer_OBJECTS) $(unit_test_gobex_transfer_LDADD) $(LIBS) +unit/test-hfp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-hfp$(EXEEXT): $(unit_test_hfp_OBJECTS) $(unit_test_hfp_DEPENDENCIES) $(EXTRA_unit_test_hfp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-hfp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_hfp_OBJECTS) $(unit_test_hfp_LDADD) $(LIBS) +unit/test-lib.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-lib$(EXEEXT): $(unit_test_lib_OBJECTS) $(unit_test_lib_DEPENDENCIES) $(EXTRA_unit_test_lib_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-lib$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_lib_OBJECTS) $(unit_test_lib_LDADD) $(LIBS) +unit/test-mgmt.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-mgmt$(EXEEXT): $(unit_test_mgmt_OBJECTS) $(unit_test_mgmt_DEPENDENCIES) $(EXTRA_unit_test_mgmt_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-mgmt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_mgmt_OBJECTS) $(unit_test_mgmt_LDADD) $(LIBS) +unit/test-queue.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-queue$(EXEEXT): $(unit_test_queue_OBJECTS) $(unit_test_queue_DEPENDENCIES) $(EXTRA_unit_test_queue_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-queue$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_queue_OBJECTS) $(unit_test_queue_LDADD) $(LIBS) +unit/test-ringbuf.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-ringbuf$(EXEEXT): $(unit_test_ringbuf_OBJECTS) $(unit_test_ringbuf_DEPENDENCIES) $(EXTRA_unit_test_ringbuf_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-ringbuf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_ringbuf_OBJECTS) $(unit_test_ringbuf_LDADD) $(LIBS) +unit/test-sdp.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-sdp$(EXEEXT): $(unit_test_sdp_OBJECTS) $(unit_test_sdp_DEPENDENCIES) $(EXTRA_unit_test_sdp_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-sdp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_sdp_OBJECTS) $(unit_test_sdp_LDADD) $(LIBS) +unit/test-textfile.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) +src/textfile.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + +unit/test-textfile$(EXEEXT): $(unit_test_textfile_OBJECTS) $(unit_test_textfile_DEPENDENCIES) $(EXTRA_unit_test_textfile_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-textfile$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_textfile_OBJECTS) $(unit_test_textfile_LDADD) $(LIBS) +unit/test-uuid.$(OBJEXT): unit/$(am__dirstamp) \ + unit/$(DEPDIR)/$(am__dirstamp) + +unit/test-uuid$(EXEEXT): $(unit_test_uuid_OBJECTS) $(unit_test_uuid_DEPENDENCIES) $(EXTRA_unit_test_uuid_DEPENDENCIES) unit/$(am__dirstamp) + @rm -f unit/test-uuid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unit_test_uuid_OBJECTS) $(unit_test_uuid_LDADD) $(LIBS) +install-testSCRIPTS: $(test_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(test_SCRIPTS)'; test -n "$(testdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(testdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(testdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(testdir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(testdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-testSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(test_SCRIPTS)'; test -n "$(testdir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(testdir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f android/*.$(OBJEXT) + -rm -f android/*.lo + -rm -f android/client/*.$(OBJEXT) + -rm -f android/hardware/*.$(OBJEXT) + -rm -f attrib/*.$(OBJEXT) + -rm -f btio/*.$(OBJEXT) + -rm -f client/*.$(OBJEXT) + -rm -f emulator/*.$(OBJEXT) + -rm -f gdbus/*.$(OBJEXT) + -rm -f gdbus/*.lo + -rm -f gobex/*.$(OBJEXT) + -rm -f lib/*.$(OBJEXT) + -rm -f lib/*.lo + -rm -f monitor/*.$(OBJEXT) + -rm -f obexd/client/*.$(OBJEXT) + -rm -f obexd/plugins/*.$(OBJEXT) + -rm -f obexd/src/*.$(OBJEXT) + -rm -f plugins/*.$(OBJEXT) + -rm -f plugins/*.lo + -rm -f profiles/alert/*.$(OBJEXT) + -rm -f profiles/audio/*.$(OBJEXT) + -rm -f profiles/cups/*.$(OBJEXT) + -rm -f profiles/cyclingspeed/*.$(OBJEXT) + -rm -f profiles/deviceinfo/*.$(OBJEXT) + -rm -f profiles/gatt/*.$(OBJEXT) + -rm -f profiles/health/*.$(OBJEXT) + -rm -f profiles/heartrate/*.$(OBJEXT) + -rm -f profiles/iap/*.$(OBJEXT) + -rm -f profiles/input/*.$(OBJEXT) + -rm -f profiles/network/*.$(OBJEXT) + -rm -f profiles/proximity/*.$(OBJEXT) + -rm -f profiles/sap/*.$(OBJEXT) + -rm -f profiles/scanparam/*.$(OBJEXT) + -rm -f profiles/thermometer/*.$(OBJEXT) + -rm -f profiles/time/*.$(OBJEXT) + -rm -f src/*.$(OBJEXT) + -rm -f src/shared/*.$(OBJEXT) + -rm -f tools/*.$(OBJEXT) + -rm -f tools/parser/*.$(OBJEXT) + -rm -f unit/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/a2dp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_android_tester-android-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-bluetooth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-gatt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-health.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-hidhost.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-ipc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-pan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-socket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_bluetooth_default_la-hal-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_haltest-hal-utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_ipc_tester-hal-utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/android_ipc_tester-ipc-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/avrcp-lib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/bluetooth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/bluetoothd-snoop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/handsfree.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/health.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/hidhost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/pan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/socket.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/system-emulator.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/$(DEPDIR)/test-ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-haltest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-history.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-audio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-av.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-bt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-hf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-hh.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-pan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-rc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-if-sock.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-pollhandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-tabcompletion.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/client/$(DEPDIR)/android_haltest-terminal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/hardware/$(DEPDIR)/android_android_tester-hardware.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@android/hardware/$(DEPDIR)/android_haltest-hardware.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/att.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/bluetoothd-att.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/bluetoothd-gatt-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/bluetoothd-gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/bluetoothd-gattrib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/gattrib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/gatttool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/interactive.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@attrib/$(DEPDIR)/utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@btio/$(DEPDIR)/bluetoothd-btio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@btio/$(DEPDIR)/btio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@btio/$(DEPDIR)/obexd-btio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/agent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/display.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@client/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/amp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_android_tester-btdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_android_tester-bthost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_android_tester-smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_ipc_tester-btdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_ipc_tester-bthost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/android_ipc_tester-smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/b1ee.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/btdev.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/bthost.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/hfp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/le.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@emulator/$(DEPDIR)/vhci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/mainloop.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/object.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/polkit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gdbus/$(DEPDIR)/watch.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-apparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-defs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-header.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex-transfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/gobex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-apparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-defs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-header.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex-transfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@gobex/$(DEPDIR)/obexd-gobex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bluetooth.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hci.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sdp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/uuid.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/analyze.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/crc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/display.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/ellisys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/hcidump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/hwdb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/keys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/l2cap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/ll.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/lmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/mainloop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/uuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@monitor/$(DEPDIR)/vendor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-bluetooth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-dbus.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-driver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-ftp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-map-event.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-map.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-mns.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-opp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-pbap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-session.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-sync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-transfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/client/$(DEPDIR)/obexd-transport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-bluetooth.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-filesystem.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-ftp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-irmc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-mas.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-opp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-pbap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-pcsuite.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/plugins/$(DEPDIR)/obexd-vcard.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-mimetype.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-obex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-plugin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@obexd/src/$(DEPDIR)/obexd-transport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-autopair.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-dropcam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-gatt-example.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-hostname.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-neard.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-policy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-wiimote.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/plugins_external_dummy_la-external-dummy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/plugins_sixaxis_la-sixaxis.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/alert/$(DEPDIR)/bluetoothd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-media.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-player.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-sink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-source.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-transport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cups/$(DEPDIR)/hcrp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cups/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cups/$(DEPDIR)/sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cups/$(DEPDIR)/spp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/cyclingspeed/$(DEPDIR)/bluetoothd-cyclingspeed.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/gatt/$(DEPDIR)/bluetoothd-gas.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-hdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-mcap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/health/$(DEPDIR)/bluetoothd-mcap_sync.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/heartrate/$(DEPDIR)/bluetoothd-heartrate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/iap/$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-hog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/input/$(DEPDIR)/bluetoothd-suspend-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bluetoothd-bnep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bluetoothd-connection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bluetoothd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bluetoothd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/network/$(DEPDIR)/bnep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/proximity/$(DEPDIR)/bluetoothd-immalert.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/proximity/$(DEPDIR)/bluetoothd-linkloss.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/proximity/$(DEPDIR)/bluetoothd-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/proximity/$(DEPDIR)/bluetoothd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/proximity/$(DEPDIR)/bluetoothd-monitor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/proximity/$(DEPDIR)/bluetoothd-reporter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/bluetoothd-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/bluetoothd-manager.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/bluetoothd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/sap/$(DEPDIR)/sap-u8500.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/thermometer/$(DEPDIR)/bluetoothd-thermometer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@profiles/time/$(DEPDIR)/bluetoothd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-adapter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-agent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-attrib-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-dbus-common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-device.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-eir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-gatt-dbus.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-gatt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-plugin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-profile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-rfkill.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdp-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdp-xml.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdpd-database.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdpd-request.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdpd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-sdpd-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-storage.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-systemd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-textfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bluetoothd-uuid-helper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/eir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/oui.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdp-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdp-xml.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdpd-database.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdpd-request.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdpd-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/sdpd-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/textfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/uuid-helper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_android_tester-crypto.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_android_tester-hciemu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_android_tester-io-glib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_android_tester-mgmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_android_tester-queue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_android_tester-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_android_tester-timeout-glib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_android_tester-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_ipc_tester-crypto.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_ipc_tester-hciemu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_ipc_tester-io-glib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_ipc_tester-mgmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_ipc_tester-queue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_ipc_tester-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_ipc_tester-timeout-glib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_ipc_tester-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/bluetoothd-io-glib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/bluetoothd-mgmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/bluetoothd-queue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/bluetoothd-timeout-glib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/bluetoothd-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/btsnoop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/crypto.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/hci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/hciemu.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/hfp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/io-glib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/io-mainloop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/mgmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/pcap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/queue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/ringbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/timeout-glib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/timeout-mainloop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/3dsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/amptest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/avinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/avtest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bccmd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bdaddr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bluemoon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/bluetooth-player.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btattach.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btinfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btiotest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btmgmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btproxy.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/btsnoop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/ciptool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/cltest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_3wire.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_bcsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_h4.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_hci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/csr_usb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/gap-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/gatt-service.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hci-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_ath3k.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_intel.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_qualcomm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_st.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_ti.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciattach_tialt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hciconfig.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hcidump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hcieventmask.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hcisecfilter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hcitool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hid2hci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hwdb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/ibeacon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/l2cap-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/l2ping.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/l2test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/mgmt-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/mpris-player.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/obex-client-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/obex-server-tool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/obexctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/rctest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/rfcomm-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/rfcomm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/sco-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/scotest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/sdptool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/seq2bseq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/smp-tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/ubcsp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/amp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/att.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/bnep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/bpa.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/capi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/cmtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/csr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/ericsson.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/hci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/hcrp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/hidp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/l2cap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/lmp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/obex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/parser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/ppp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/rfcomm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/sap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/smp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@tools/parser/$(DEPDIR)/tcpip.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-avctp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-avdtp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-avrcp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-crc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-eir.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gdbus-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex-apparam.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex-header.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex-packet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex-transfer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-gobex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-hfp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-lib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-mgmt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-queue.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-ringbuf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-sdp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-textfile.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/test-uuid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@unit/$(DEPDIR)/util.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +android/android_audio_a2dp_default_la-hal-audio.lo: android/hal-audio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -MT android/android_audio_a2dp_default_la-hal-audio.lo -MD -MP -MF android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio.Tpo -c -o android/android_audio_a2dp_default_la-hal-audio.lo `test -f 'android/hal-audio.c' || echo '$(srcdir)/'`android/hal-audio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio.Tpo android/$(DEPDIR)/android_audio_a2dp_default_la-hal-audio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-audio.c' object='android/android_audio_a2dp_default_la-hal-audio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -c -o android/android_audio_a2dp_default_la-hal-audio.lo `test -f 'android/hal-audio.c' || echo '$(srcdir)/'`android/hal-audio.c + +android/android_bluetooth_default_la-hal-bluetooth.lo: android/hal-bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-bluetooth.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-bluetooth.Tpo -c -o android/android_bluetooth_default_la-hal-bluetooth.lo `test -f 'android/hal-bluetooth.c' || echo '$(srcdir)/'`android/hal-bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-bluetooth.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-bluetooth.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-bluetooth.c' object='android/android_bluetooth_default_la-hal-bluetooth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-bluetooth.lo `test -f 'android/hal-bluetooth.c' || echo '$(srcdir)/'`android/hal-bluetooth.c + +android/android_bluetooth_default_la-hal-socket.lo: android/hal-socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-socket.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-socket.Tpo -c -o android/android_bluetooth_default_la-hal-socket.lo `test -f 'android/hal-socket.c' || echo '$(srcdir)/'`android/hal-socket.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-socket.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-socket.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-socket.c' object='android/android_bluetooth_default_la-hal-socket.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-socket.lo `test -f 'android/hal-socket.c' || echo '$(srcdir)/'`android/hal-socket.c + +android/android_bluetooth_default_la-hal-hidhost.lo: android/hal-hidhost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-hidhost.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-hidhost.Tpo -c -o android/android_bluetooth_default_la-hal-hidhost.lo `test -f 'android/hal-hidhost.c' || echo '$(srcdir)/'`android/hal-hidhost.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-hidhost.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-hidhost.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-hidhost.c' object='android/android_bluetooth_default_la-hal-hidhost.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-hidhost.lo `test -f 'android/hal-hidhost.c' || echo '$(srcdir)/'`android/hal-hidhost.c + +android/android_bluetooth_default_la-hal-health.lo: android/hal-health.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-health.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-health.Tpo -c -o android/android_bluetooth_default_la-hal-health.lo `test -f 'android/hal-health.c' || echo '$(srcdir)/'`android/hal-health.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-health.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-health.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-health.c' object='android/android_bluetooth_default_la-hal-health.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-health.lo `test -f 'android/hal-health.c' || echo '$(srcdir)/'`android/hal-health.c + +android/android_bluetooth_default_la-hal-pan.lo: android/hal-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-pan.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-pan.Tpo -c -o android/android_bluetooth_default_la-hal-pan.lo `test -f 'android/hal-pan.c' || echo '$(srcdir)/'`android/hal-pan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-pan.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-pan.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-pan.c' object='android/android_bluetooth_default_la-hal-pan.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-pan.lo `test -f 'android/hal-pan.c' || echo '$(srcdir)/'`android/hal-pan.c + +android/android_bluetooth_default_la-hal-a2dp.lo: android/hal-a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-a2dp.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp.Tpo -c -o android/android_bluetooth_default_la-hal-a2dp.lo `test -f 'android/hal-a2dp.c' || echo '$(srcdir)/'`android/hal-a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-a2dp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-a2dp.c' object='android/android_bluetooth_default_la-hal-a2dp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-a2dp.lo `test -f 'android/hal-a2dp.c' || echo '$(srcdir)/'`android/hal-a2dp.c + +android/android_bluetooth_default_la-hal-avrcp.lo: android/hal-avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-avrcp.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp.Tpo -c -o android/android_bluetooth_default_la-hal-avrcp.lo `test -f 'android/hal-avrcp.c' || echo '$(srcdir)/'`android/hal-avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-avrcp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-avrcp.c' object='android/android_bluetooth_default_la-hal-avrcp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-avrcp.lo `test -f 'android/hal-avrcp.c' || echo '$(srcdir)/'`android/hal-avrcp.c + +android/android_bluetooth_default_la-hal-handsfree.lo: android/hal-handsfree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-handsfree.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree.Tpo -c -o android/android_bluetooth_default_la-hal-handsfree.lo `test -f 'android/hal-handsfree.c' || echo '$(srcdir)/'`android/hal-handsfree.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-handsfree.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-handsfree.c' object='android/android_bluetooth_default_la-hal-handsfree.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-handsfree.lo `test -f 'android/hal-handsfree.c' || echo '$(srcdir)/'`android/hal-handsfree.c + +android/android_bluetooth_default_la-hal-gatt.lo: android/hal-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-gatt.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-gatt.Tpo -c -o android/android_bluetooth_default_la-hal-gatt.lo `test -f 'android/hal-gatt.c' || echo '$(srcdir)/'`android/hal-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-gatt.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-gatt.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-gatt.c' object='android/android_bluetooth_default_la-hal-gatt.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-gatt.lo `test -f 'android/hal-gatt.c' || echo '$(srcdir)/'`android/hal-gatt.c + +android/android_bluetooth_default_la-hal-ipc.lo: android/hal-ipc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-ipc.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-ipc.Tpo -c -o android/android_bluetooth_default_la-hal-ipc.lo `test -f 'android/hal-ipc.c' || echo '$(srcdir)/'`android/hal-ipc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-ipc.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-ipc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-ipc.c' object='android/android_bluetooth_default_la-hal-ipc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-ipc.lo `test -f 'android/hal-ipc.c' || echo '$(srcdir)/'`android/hal-ipc.c + +android/android_bluetooth_default_la-hal-utils.lo: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/android_bluetooth_default_la-hal-utils.lo -MD -MP -MF android/$(DEPDIR)/android_bluetooth_default_la-hal-utils.Tpo -c -o android/android_bluetooth_default_la-hal-utils.lo `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_bluetooth_default_la-hal-utils.Tpo android/$(DEPDIR)/android_bluetooth_default_la-hal-utils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_bluetooth_default_la-hal-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/android_bluetooth_default_la-hal-utils.lo `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c + +plugins/plugins_external_dummy_la-external-dummy.lo: plugins/external-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) -MT plugins/plugins_external_dummy_la-external-dummy.lo -MD -MP -MF plugins/$(DEPDIR)/plugins_external_dummy_la-external-dummy.Tpo -c -o plugins/plugins_external_dummy_la-external-dummy.lo `test -f 'plugins/external-dummy.c' || echo '$(srcdir)/'`plugins/external-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/plugins_external_dummy_la-external-dummy.Tpo plugins/$(DEPDIR)/plugins_external_dummy_la-external-dummy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/external-dummy.c' object='plugins/plugins_external_dummy_la-external-dummy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) -c -o plugins/plugins_external_dummy_la-external-dummy.lo `test -f 'plugins/external-dummy.c' || echo '$(srcdir)/'`plugins/external-dummy.c + +plugins/plugins_sixaxis_la-sixaxis.lo: plugins/sixaxis.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) -MT plugins/plugins_sixaxis_la-sixaxis.lo -MD -MP -MF plugins/$(DEPDIR)/plugins_sixaxis_la-sixaxis.Tpo -c -o plugins/plugins_sixaxis_la-sixaxis.lo `test -f 'plugins/sixaxis.c' || echo '$(srcdir)/'`plugins/sixaxis.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/plugins_sixaxis_la-sixaxis.Tpo plugins/$(DEPDIR)/plugins_sixaxis_la-sixaxis.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/sixaxis.c' object='plugins/plugins_sixaxis_la-sixaxis.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) -c -o plugins/plugins_sixaxis_la-sixaxis.lo `test -f 'plugins/sixaxis.c' || echo '$(srcdir)/'`plugins/sixaxis.c + +emulator/android_android_tester-btdev.o: emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-btdev.o -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-btdev.Tpo -c -o emulator/android_android_tester-btdev.o `test -f 'emulator/btdev.c' || echo '$(srcdir)/'`emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-btdev.Tpo emulator/$(DEPDIR)/android_android_tester-btdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/btdev.c' object='emulator/android_android_tester-btdev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-btdev.o `test -f 'emulator/btdev.c' || echo '$(srcdir)/'`emulator/btdev.c + +emulator/android_android_tester-btdev.obj: emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-btdev.obj -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-btdev.Tpo -c -o emulator/android_android_tester-btdev.obj `if test -f 'emulator/btdev.c'; then $(CYGPATH_W) 'emulator/btdev.c'; else $(CYGPATH_W) '$(srcdir)/emulator/btdev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-btdev.Tpo emulator/$(DEPDIR)/android_android_tester-btdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/btdev.c' object='emulator/android_android_tester-btdev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-btdev.obj `if test -f 'emulator/btdev.c'; then $(CYGPATH_W) 'emulator/btdev.c'; else $(CYGPATH_W) '$(srcdir)/emulator/btdev.c'; fi` + +emulator/android_android_tester-bthost.o: emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-bthost.o -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-bthost.Tpo -c -o emulator/android_android_tester-bthost.o `test -f 'emulator/bthost.c' || echo '$(srcdir)/'`emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-bthost.Tpo emulator/$(DEPDIR)/android_android_tester-bthost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/bthost.c' object='emulator/android_android_tester-bthost.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-bthost.o `test -f 'emulator/bthost.c' || echo '$(srcdir)/'`emulator/bthost.c + +emulator/android_android_tester-bthost.obj: emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-bthost.obj -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-bthost.Tpo -c -o emulator/android_android_tester-bthost.obj `if test -f 'emulator/bthost.c'; then $(CYGPATH_W) 'emulator/bthost.c'; else $(CYGPATH_W) '$(srcdir)/emulator/bthost.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-bthost.Tpo emulator/$(DEPDIR)/android_android_tester-bthost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/bthost.c' object='emulator/android_android_tester-bthost.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-bthost.obj `if test -f 'emulator/bthost.c'; then $(CYGPATH_W) 'emulator/bthost.c'; else $(CYGPATH_W) '$(srcdir)/emulator/bthost.c'; fi` + +emulator/android_android_tester-smp.o: emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-smp.o -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-smp.Tpo -c -o emulator/android_android_tester-smp.o `test -f 'emulator/smp.c' || echo '$(srcdir)/'`emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-smp.Tpo emulator/$(DEPDIR)/android_android_tester-smp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/smp.c' object='emulator/android_android_tester-smp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-smp.o `test -f 'emulator/smp.c' || echo '$(srcdir)/'`emulator/smp.c + +emulator/android_android_tester-smp.obj: emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT emulator/android_android_tester-smp.obj -MD -MP -MF emulator/$(DEPDIR)/android_android_tester-smp.Tpo -c -o emulator/android_android_tester-smp.obj `if test -f 'emulator/smp.c'; then $(CYGPATH_W) 'emulator/smp.c'; else $(CYGPATH_W) '$(srcdir)/emulator/smp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_android_tester-smp.Tpo emulator/$(DEPDIR)/android_android_tester-smp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/smp.c' object='emulator/android_android_tester-smp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_android_tester-smp.obj `if test -f 'emulator/smp.c'; then $(CYGPATH_W) 'emulator/smp.c'; else $(CYGPATH_W) '$(srcdir)/emulator/smp.c'; fi` + +src/shared/android_android_tester-crypto.o: src/shared/crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-crypto.o -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-crypto.Tpo -c -o src/shared/android_android_tester-crypto.o `test -f 'src/shared/crypto.c' || echo '$(srcdir)/'`src/shared/crypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-crypto.Tpo src/shared/$(DEPDIR)/android_android_tester-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/crypto.c' object='src/shared/android_android_tester-crypto.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-crypto.o `test -f 'src/shared/crypto.c' || echo '$(srcdir)/'`src/shared/crypto.c + +src/shared/android_android_tester-crypto.obj: src/shared/crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-crypto.obj -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-crypto.Tpo -c -o src/shared/android_android_tester-crypto.obj `if test -f 'src/shared/crypto.c'; then $(CYGPATH_W) 'src/shared/crypto.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/crypto.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-crypto.Tpo src/shared/$(DEPDIR)/android_android_tester-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/crypto.c' object='src/shared/android_android_tester-crypto.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-crypto.obj `if test -f 'src/shared/crypto.c'; then $(CYGPATH_W) 'src/shared/crypto.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/crypto.c'; fi` + +src/shared/android_android_tester-io-glib.o: src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-io-glib.o -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-io-glib.Tpo -c -o src/shared/android_android_tester-io-glib.o `test -f 'src/shared/io-glib.c' || echo '$(srcdir)/'`src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-io-glib.Tpo src/shared/$(DEPDIR)/android_android_tester-io-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/io-glib.c' object='src/shared/android_android_tester-io-glib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-io-glib.o `test -f 'src/shared/io-glib.c' || echo '$(srcdir)/'`src/shared/io-glib.c + +src/shared/android_android_tester-io-glib.obj: src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-io-glib.obj -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-io-glib.Tpo -c -o src/shared/android_android_tester-io-glib.obj `if test -f 'src/shared/io-glib.c'; then $(CYGPATH_W) 'src/shared/io-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/io-glib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-io-glib.Tpo src/shared/$(DEPDIR)/android_android_tester-io-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/io-glib.c' object='src/shared/android_android_tester-io-glib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-io-glib.obj `if test -f 'src/shared/io-glib.c'; then $(CYGPATH_W) 'src/shared/io-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/io-glib.c'; fi` + +src/shared/android_android_tester-queue.o: src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-queue.o -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-queue.Tpo -c -o src/shared/android_android_tester-queue.o `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-queue.Tpo src/shared/$(DEPDIR)/android_android_tester-queue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/queue.c' object='src/shared/android_android_tester-queue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-queue.o `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c + +src/shared/android_android_tester-queue.obj: src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-queue.obj -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-queue.Tpo -c -o src/shared/android_android_tester-queue.obj `if test -f 'src/shared/queue.c'; then $(CYGPATH_W) 'src/shared/queue.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/queue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-queue.Tpo src/shared/$(DEPDIR)/android_android_tester-queue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/queue.c' object='src/shared/android_android_tester-queue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-queue.obj `if test -f 'src/shared/queue.c'; then $(CYGPATH_W) 'src/shared/queue.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/queue.c'; fi` + +src/shared/android_android_tester-util.o: src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-util.o -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-util.Tpo -c -o src/shared/android_android_tester-util.o `test -f 'src/shared/util.c' || echo '$(srcdir)/'`src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-util.Tpo src/shared/$(DEPDIR)/android_android_tester-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/util.c' object='src/shared/android_android_tester-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-util.o `test -f 'src/shared/util.c' || echo '$(srcdir)/'`src/shared/util.c + +src/shared/android_android_tester-util.obj: src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-util.obj -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-util.Tpo -c -o src/shared/android_android_tester-util.obj `if test -f 'src/shared/util.c'; then $(CYGPATH_W) 'src/shared/util.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-util.Tpo src/shared/$(DEPDIR)/android_android_tester-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/util.c' object='src/shared/android_android_tester-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-util.obj `if test -f 'src/shared/util.c'; then $(CYGPATH_W) 'src/shared/util.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/util.c'; fi` + +src/shared/android_android_tester-mgmt.o: src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-mgmt.o -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-mgmt.Tpo -c -o src/shared/android_android_tester-mgmt.o `test -f 'src/shared/mgmt.c' || echo '$(srcdir)/'`src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-mgmt.Tpo src/shared/$(DEPDIR)/android_android_tester-mgmt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/mgmt.c' object='src/shared/android_android_tester-mgmt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-mgmt.o `test -f 'src/shared/mgmt.c' || echo '$(srcdir)/'`src/shared/mgmt.c + +src/shared/android_android_tester-mgmt.obj: src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-mgmt.obj -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-mgmt.Tpo -c -o src/shared/android_android_tester-mgmt.obj `if test -f 'src/shared/mgmt.c'; then $(CYGPATH_W) 'src/shared/mgmt.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/mgmt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-mgmt.Tpo src/shared/$(DEPDIR)/android_android_tester-mgmt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/mgmt.c' object='src/shared/android_android_tester-mgmt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-mgmt.obj `if test -f 'src/shared/mgmt.c'; then $(CYGPATH_W) 'src/shared/mgmt.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/mgmt.c'; fi` + +src/shared/android_android_tester-hciemu.o: src/shared/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-hciemu.o -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-hciemu.Tpo -c -o src/shared/android_android_tester-hciemu.o `test -f 'src/shared/hciemu.c' || echo '$(srcdir)/'`src/shared/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-hciemu.Tpo src/shared/$(DEPDIR)/android_android_tester-hciemu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/hciemu.c' object='src/shared/android_android_tester-hciemu.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-hciemu.o `test -f 'src/shared/hciemu.c' || echo '$(srcdir)/'`src/shared/hciemu.c + +src/shared/android_android_tester-hciemu.obj: src/shared/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-hciemu.obj -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-hciemu.Tpo -c -o src/shared/android_android_tester-hciemu.obj `if test -f 'src/shared/hciemu.c'; then $(CYGPATH_W) 'src/shared/hciemu.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/hciemu.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-hciemu.Tpo src/shared/$(DEPDIR)/android_android_tester-hciemu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/hciemu.c' object='src/shared/android_android_tester-hciemu.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-hciemu.obj `if test -f 'src/shared/hciemu.c'; then $(CYGPATH_W) 'src/shared/hciemu.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/hciemu.c'; fi` + +src/shared/android_android_tester-tester.o: src/shared/tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-tester.o -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-tester.Tpo -c -o src/shared/android_android_tester-tester.o `test -f 'src/shared/tester.c' || echo '$(srcdir)/'`src/shared/tester.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-tester.Tpo src/shared/$(DEPDIR)/android_android_tester-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/tester.c' object='src/shared/android_android_tester-tester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-tester.o `test -f 'src/shared/tester.c' || echo '$(srcdir)/'`src/shared/tester.c + +src/shared/android_android_tester-tester.obj: src/shared/tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-tester.obj -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-tester.Tpo -c -o src/shared/android_android_tester-tester.obj `if test -f 'src/shared/tester.c'; then $(CYGPATH_W) 'src/shared/tester.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/tester.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-tester.Tpo src/shared/$(DEPDIR)/android_android_tester-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/tester.c' object='src/shared/android_android_tester-tester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-tester.obj `if test -f 'src/shared/tester.c'; then $(CYGPATH_W) 'src/shared/tester.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/tester.c'; fi` + +src/shared/android_android_tester-timeout-glib.o: src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-timeout-glib.o -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-timeout-glib.Tpo -c -o src/shared/android_android_tester-timeout-glib.o `test -f 'src/shared/timeout-glib.c' || echo '$(srcdir)/'`src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-timeout-glib.Tpo src/shared/$(DEPDIR)/android_android_tester-timeout-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/timeout-glib.c' object='src/shared/android_android_tester-timeout-glib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-timeout-glib.o `test -f 'src/shared/timeout-glib.c' || echo '$(srcdir)/'`src/shared/timeout-glib.c + +src/shared/android_android_tester-timeout-glib.obj: src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_android_tester-timeout-glib.obj -MD -MP -MF src/shared/$(DEPDIR)/android_android_tester-timeout-glib.Tpo -c -o src/shared/android_android_tester-timeout-glib.obj `if test -f 'src/shared/timeout-glib.c'; then $(CYGPATH_W) 'src/shared/timeout-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/timeout-glib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_android_tester-timeout-glib.Tpo src/shared/$(DEPDIR)/android_android_tester-timeout-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/timeout-glib.c' object='src/shared/android_android_tester-timeout-glib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_android_tester-timeout-glib.obj `if test -f 'src/shared/timeout-glib.c'; then $(CYGPATH_W) 'src/shared/timeout-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/timeout-glib.c'; fi` + +android/hardware/android_android_tester-hardware.o: android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/hardware/android_android_tester-hardware.o -MD -MP -MF android/hardware/$(DEPDIR)/android_android_tester-hardware.Tpo -c -o android/hardware/android_android_tester-hardware.o `test -f 'android/hardware/hardware.c' || echo '$(srcdir)/'`android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/hardware/$(DEPDIR)/android_android_tester-hardware.Tpo android/hardware/$(DEPDIR)/android_android_tester-hardware.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hardware/hardware.c' object='android/hardware/android_android_tester-hardware.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/hardware/android_android_tester-hardware.o `test -f 'android/hardware/hardware.c' || echo '$(srcdir)/'`android/hardware/hardware.c + +android/hardware/android_android_tester-hardware.obj: android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/hardware/android_android_tester-hardware.obj -MD -MP -MF android/hardware/$(DEPDIR)/android_android_tester-hardware.Tpo -c -o android/hardware/android_android_tester-hardware.obj `if test -f 'android/hardware/hardware.c'; then $(CYGPATH_W) 'android/hardware/hardware.c'; else $(CYGPATH_W) '$(srcdir)/android/hardware/hardware.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/hardware/$(DEPDIR)/android_android_tester-hardware.Tpo android/hardware/$(DEPDIR)/android_android_tester-hardware.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hardware/hardware.c' object='android/hardware/android_android_tester-hardware.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/hardware/android_android_tester-hardware.obj `if test -f 'android/hardware/hardware.c'; then $(CYGPATH_W) 'android/hardware/hardware.c'; else $(CYGPATH_W) '$(srcdir)/android/hardware/hardware.c'; fi` + +android/android_android_tester-android-tester.o: android/android-tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-android-tester.o -MD -MP -MF android/$(DEPDIR)/android_android_tester-android-tester.Tpo -c -o android/android_android_tester-android-tester.o `test -f 'android/android-tester.c' || echo '$(srcdir)/'`android/android-tester.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-android-tester.Tpo android/$(DEPDIR)/android_android_tester-android-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/android-tester.c' object='android/android_android_tester-android-tester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-android-tester.o `test -f 'android/android-tester.c' || echo '$(srcdir)/'`android/android-tester.c + +android/android_android_tester-android-tester.obj: android/android-tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -MT android/android_android_tester-android-tester.obj -MD -MP -MF android/$(DEPDIR)/android_android_tester-android-tester.Tpo -c -o android/android_android_tester-android-tester.obj `if test -f 'android/android-tester.c'; then $(CYGPATH_W) 'android/android-tester.c'; else $(CYGPATH_W) '$(srcdir)/android/android-tester.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_android_tester-android-tester.Tpo android/$(DEPDIR)/android_android_tester-android-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/android-tester.c' object='android/android_android_tester-android-tester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_android_tester_CFLAGS) $(CFLAGS) -c -o android/android_android_tester-android-tester.obj `if test -f 'android/android-tester.c'; then $(CYGPATH_W) 'android/android-tester.c'; else $(CYGPATH_W) '$(srcdir)/android/android-tester.c'; fi` + +android/client/android_haltest-haltest.o: android/client/haltest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-haltest.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-haltest.Tpo -c -o android/client/android_haltest-haltest.o `test -f 'android/client/haltest.c' || echo '$(srcdir)/'`android/client/haltest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-haltest.Tpo android/client/$(DEPDIR)/android_haltest-haltest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/haltest.c' object='android/client/android_haltest-haltest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-haltest.o `test -f 'android/client/haltest.c' || echo '$(srcdir)/'`android/client/haltest.c + +android/client/android_haltest-haltest.obj: android/client/haltest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-haltest.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-haltest.Tpo -c -o android/client/android_haltest-haltest.obj `if test -f 'android/client/haltest.c'; then $(CYGPATH_W) 'android/client/haltest.c'; else $(CYGPATH_W) '$(srcdir)/android/client/haltest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-haltest.Tpo android/client/$(DEPDIR)/android_haltest-haltest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/haltest.c' object='android/client/android_haltest-haltest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-haltest.obj `if test -f 'android/client/haltest.c'; then $(CYGPATH_W) 'android/client/haltest.c'; else $(CYGPATH_W) '$(srcdir)/android/client/haltest.c'; fi` + +android/client/android_haltest-pollhandler.o: android/client/pollhandler.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-pollhandler.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-pollhandler.Tpo -c -o android/client/android_haltest-pollhandler.o `test -f 'android/client/pollhandler.c' || echo '$(srcdir)/'`android/client/pollhandler.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-pollhandler.Tpo android/client/$(DEPDIR)/android_haltest-pollhandler.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/pollhandler.c' object='android/client/android_haltest-pollhandler.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-pollhandler.o `test -f 'android/client/pollhandler.c' || echo '$(srcdir)/'`android/client/pollhandler.c + +android/client/android_haltest-pollhandler.obj: android/client/pollhandler.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-pollhandler.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-pollhandler.Tpo -c -o android/client/android_haltest-pollhandler.obj `if test -f 'android/client/pollhandler.c'; then $(CYGPATH_W) 'android/client/pollhandler.c'; else $(CYGPATH_W) '$(srcdir)/android/client/pollhandler.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-pollhandler.Tpo android/client/$(DEPDIR)/android_haltest-pollhandler.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/pollhandler.c' object='android/client/android_haltest-pollhandler.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-pollhandler.obj `if test -f 'android/client/pollhandler.c'; then $(CYGPATH_W) 'android/client/pollhandler.c'; else $(CYGPATH_W) '$(srcdir)/android/client/pollhandler.c'; fi` + +android/client/android_haltest-terminal.o: android/client/terminal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-terminal.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-terminal.Tpo -c -o android/client/android_haltest-terminal.o `test -f 'android/client/terminal.c' || echo '$(srcdir)/'`android/client/terminal.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-terminal.Tpo android/client/$(DEPDIR)/android_haltest-terminal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/terminal.c' object='android/client/android_haltest-terminal.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-terminal.o `test -f 'android/client/terminal.c' || echo '$(srcdir)/'`android/client/terminal.c + +android/client/android_haltest-terminal.obj: android/client/terminal.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-terminal.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-terminal.Tpo -c -o android/client/android_haltest-terminal.obj `if test -f 'android/client/terminal.c'; then $(CYGPATH_W) 'android/client/terminal.c'; else $(CYGPATH_W) '$(srcdir)/android/client/terminal.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-terminal.Tpo android/client/$(DEPDIR)/android_haltest-terminal.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/terminal.c' object='android/client/android_haltest-terminal.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-terminal.obj `if test -f 'android/client/terminal.c'; then $(CYGPATH_W) 'android/client/terminal.c'; else $(CYGPATH_W) '$(srcdir)/android/client/terminal.c'; fi` + +android/client/android_haltest-history.o: android/client/history.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-history.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-history.Tpo -c -o android/client/android_haltest-history.o `test -f 'android/client/history.c' || echo '$(srcdir)/'`android/client/history.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-history.Tpo android/client/$(DEPDIR)/android_haltest-history.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/history.c' object='android/client/android_haltest-history.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-history.o `test -f 'android/client/history.c' || echo '$(srcdir)/'`android/client/history.c + +android/client/android_haltest-history.obj: android/client/history.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-history.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-history.Tpo -c -o android/client/android_haltest-history.obj `if test -f 'android/client/history.c'; then $(CYGPATH_W) 'android/client/history.c'; else $(CYGPATH_W) '$(srcdir)/android/client/history.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-history.Tpo android/client/$(DEPDIR)/android_haltest-history.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/history.c' object='android/client/android_haltest-history.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-history.obj `if test -f 'android/client/history.c'; then $(CYGPATH_W) 'android/client/history.c'; else $(CYGPATH_W) '$(srcdir)/android/client/history.c'; fi` + +android/client/android_haltest-tabcompletion.o: android/client/tabcompletion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-tabcompletion.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-tabcompletion.Tpo -c -o android/client/android_haltest-tabcompletion.o `test -f 'android/client/tabcompletion.c' || echo '$(srcdir)/'`android/client/tabcompletion.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-tabcompletion.Tpo android/client/$(DEPDIR)/android_haltest-tabcompletion.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/tabcompletion.c' object='android/client/android_haltest-tabcompletion.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-tabcompletion.o `test -f 'android/client/tabcompletion.c' || echo '$(srcdir)/'`android/client/tabcompletion.c + +android/client/android_haltest-tabcompletion.obj: android/client/tabcompletion.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-tabcompletion.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-tabcompletion.Tpo -c -o android/client/android_haltest-tabcompletion.obj `if test -f 'android/client/tabcompletion.c'; then $(CYGPATH_W) 'android/client/tabcompletion.c'; else $(CYGPATH_W) '$(srcdir)/android/client/tabcompletion.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-tabcompletion.Tpo android/client/$(DEPDIR)/android_haltest-tabcompletion.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/tabcompletion.c' object='android/client/android_haltest-tabcompletion.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-tabcompletion.obj `if test -f 'android/client/tabcompletion.c'; then $(CYGPATH_W) 'android/client/tabcompletion.c'; else $(CYGPATH_W) '$(srcdir)/android/client/tabcompletion.c'; fi` + +android/client/android_haltest-if-av.o: android/client/if-av.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-av.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-av.Tpo -c -o android/client/android_haltest-if-av.o `test -f 'android/client/if-av.c' || echo '$(srcdir)/'`android/client/if-av.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-av.Tpo android/client/$(DEPDIR)/android_haltest-if-av.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-av.c' object='android/client/android_haltest-if-av.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-av.o `test -f 'android/client/if-av.c' || echo '$(srcdir)/'`android/client/if-av.c + +android/client/android_haltest-if-av.obj: android/client/if-av.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-av.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-av.Tpo -c -o android/client/android_haltest-if-av.obj `if test -f 'android/client/if-av.c'; then $(CYGPATH_W) 'android/client/if-av.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-av.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-av.Tpo android/client/$(DEPDIR)/android_haltest-if-av.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-av.c' object='android/client/android_haltest-if-av.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-av.obj `if test -f 'android/client/if-av.c'; then $(CYGPATH_W) 'android/client/if-av.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-av.c'; fi` + +android/client/android_haltest-if-rc.o: android/client/if-rc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-rc.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-rc.Tpo -c -o android/client/android_haltest-if-rc.o `test -f 'android/client/if-rc.c' || echo '$(srcdir)/'`android/client/if-rc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-rc.Tpo android/client/$(DEPDIR)/android_haltest-if-rc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-rc.c' object='android/client/android_haltest-if-rc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-rc.o `test -f 'android/client/if-rc.c' || echo '$(srcdir)/'`android/client/if-rc.c + +android/client/android_haltest-if-rc.obj: android/client/if-rc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-rc.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-rc.Tpo -c -o android/client/android_haltest-if-rc.obj `if test -f 'android/client/if-rc.c'; then $(CYGPATH_W) 'android/client/if-rc.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-rc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-rc.Tpo android/client/$(DEPDIR)/android_haltest-if-rc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-rc.c' object='android/client/android_haltest-if-rc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-rc.obj `if test -f 'android/client/if-rc.c'; then $(CYGPATH_W) 'android/client/if-rc.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-rc.c'; fi` + +android/client/android_haltest-if-bt.o: android/client/if-bt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-bt.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-bt.Tpo -c -o android/client/android_haltest-if-bt.o `test -f 'android/client/if-bt.c' || echo '$(srcdir)/'`android/client/if-bt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-bt.Tpo android/client/$(DEPDIR)/android_haltest-if-bt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-bt.c' object='android/client/android_haltest-if-bt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-bt.o `test -f 'android/client/if-bt.c' || echo '$(srcdir)/'`android/client/if-bt.c + +android/client/android_haltest-if-bt.obj: android/client/if-bt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-bt.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-bt.Tpo -c -o android/client/android_haltest-if-bt.obj `if test -f 'android/client/if-bt.c'; then $(CYGPATH_W) 'android/client/if-bt.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-bt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-bt.Tpo android/client/$(DEPDIR)/android_haltest-if-bt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-bt.c' object='android/client/android_haltest-if-bt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-bt.obj `if test -f 'android/client/if-bt.c'; then $(CYGPATH_W) 'android/client/if-bt.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-bt.c'; fi` + +android/client/android_haltest-if-gatt.o: android/client/if-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-gatt.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-gatt.Tpo -c -o android/client/android_haltest-if-gatt.o `test -f 'android/client/if-gatt.c' || echo '$(srcdir)/'`android/client/if-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-gatt.Tpo android/client/$(DEPDIR)/android_haltest-if-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-gatt.c' object='android/client/android_haltest-if-gatt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-gatt.o `test -f 'android/client/if-gatt.c' || echo '$(srcdir)/'`android/client/if-gatt.c + +android/client/android_haltest-if-gatt.obj: android/client/if-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-gatt.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-gatt.Tpo -c -o android/client/android_haltest-if-gatt.obj `if test -f 'android/client/if-gatt.c'; then $(CYGPATH_W) 'android/client/if-gatt.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-gatt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-gatt.Tpo android/client/$(DEPDIR)/android_haltest-if-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-gatt.c' object='android/client/android_haltest-if-gatt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-gatt.obj `if test -f 'android/client/if-gatt.c'; then $(CYGPATH_W) 'android/client/if-gatt.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-gatt.c'; fi` + +android/client/android_haltest-if-hf.o: android/client/if-hf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hf.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hf.Tpo -c -o android/client/android_haltest-if-hf.o `test -f 'android/client/if-hf.c' || echo '$(srcdir)/'`android/client/if-hf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hf.Tpo android/client/$(DEPDIR)/android_haltest-if-hf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hf.c' object='android/client/android_haltest-if-hf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hf.o `test -f 'android/client/if-hf.c' || echo '$(srcdir)/'`android/client/if-hf.c + +android/client/android_haltest-if-hf.obj: android/client/if-hf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hf.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hf.Tpo -c -o android/client/android_haltest-if-hf.obj `if test -f 'android/client/if-hf.c'; then $(CYGPATH_W) 'android/client/if-hf.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hf.Tpo android/client/$(DEPDIR)/android_haltest-if-hf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hf.c' object='android/client/android_haltest-if-hf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hf.obj `if test -f 'android/client/if-hf.c'; then $(CYGPATH_W) 'android/client/if-hf.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hf.c'; fi` + +android/client/android_haltest-if-hh.o: android/client/if-hh.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hh.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hh.Tpo -c -o android/client/android_haltest-if-hh.o `test -f 'android/client/if-hh.c' || echo '$(srcdir)/'`android/client/if-hh.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hh.Tpo android/client/$(DEPDIR)/android_haltest-if-hh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hh.c' object='android/client/android_haltest-if-hh.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hh.o `test -f 'android/client/if-hh.c' || echo '$(srcdir)/'`android/client/if-hh.c + +android/client/android_haltest-if-hh.obj: android/client/if-hh.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-hh.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-hh.Tpo -c -o android/client/android_haltest-if-hh.obj `if test -f 'android/client/if-hh.c'; then $(CYGPATH_W) 'android/client/if-hh.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hh.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-hh.Tpo android/client/$(DEPDIR)/android_haltest-if-hh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-hh.c' object='android/client/android_haltest-if-hh.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-hh.obj `if test -f 'android/client/if-hh.c'; then $(CYGPATH_W) 'android/client/if-hh.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-hh.c'; fi` + +android/client/android_haltest-if-pan.o: android/client/if-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-pan.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-pan.Tpo -c -o android/client/android_haltest-if-pan.o `test -f 'android/client/if-pan.c' || echo '$(srcdir)/'`android/client/if-pan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-pan.Tpo android/client/$(DEPDIR)/android_haltest-if-pan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-pan.c' object='android/client/android_haltest-if-pan.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-pan.o `test -f 'android/client/if-pan.c' || echo '$(srcdir)/'`android/client/if-pan.c + +android/client/android_haltest-if-pan.obj: android/client/if-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-pan.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-pan.Tpo -c -o android/client/android_haltest-if-pan.obj `if test -f 'android/client/if-pan.c'; then $(CYGPATH_W) 'android/client/if-pan.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-pan.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-pan.Tpo android/client/$(DEPDIR)/android_haltest-if-pan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-pan.c' object='android/client/android_haltest-if-pan.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-pan.obj `if test -f 'android/client/if-pan.c'; then $(CYGPATH_W) 'android/client/if-pan.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-pan.c'; fi` + +android/client/android_haltest-if-sock.o: android/client/if-sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-sock.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-sock.Tpo -c -o android/client/android_haltest-if-sock.o `test -f 'android/client/if-sock.c' || echo '$(srcdir)/'`android/client/if-sock.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-sock.Tpo android/client/$(DEPDIR)/android_haltest-if-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-sock.c' object='android/client/android_haltest-if-sock.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-sock.o `test -f 'android/client/if-sock.c' || echo '$(srcdir)/'`android/client/if-sock.c + +android/client/android_haltest-if-sock.obj: android/client/if-sock.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-sock.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-sock.Tpo -c -o android/client/android_haltest-if-sock.obj `if test -f 'android/client/if-sock.c'; then $(CYGPATH_W) 'android/client/if-sock.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-sock.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-sock.Tpo android/client/$(DEPDIR)/android_haltest-if-sock.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-sock.c' object='android/client/android_haltest-if-sock.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-sock.obj `if test -f 'android/client/if-sock.c'; then $(CYGPATH_W) 'android/client/if-sock.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-sock.c'; fi` + +android/client/android_haltest-if-audio.o: android/client/if-audio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-audio.o -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-audio.Tpo -c -o android/client/android_haltest-if-audio.o `test -f 'android/client/if-audio.c' || echo '$(srcdir)/'`android/client/if-audio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-audio.Tpo android/client/$(DEPDIR)/android_haltest-if-audio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-audio.c' object='android/client/android_haltest-if-audio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-audio.o `test -f 'android/client/if-audio.c' || echo '$(srcdir)/'`android/client/if-audio.c + +android/client/android_haltest-if-audio.obj: android/client/if-audio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/client/android_haltest-if-audio.obj -MD -MP -MF android/client/$(DEPDIR)/android_haltest-if-audio.Tpo -c -o android/client/android_haltest-if-audio.obj `if test -f 'android/client/if-audio.c'; then $(CYGPATH_W) 'android/client/if-audio.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-audio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/client/$(DEPDIR)/android_haltest-if-audio.Tpo android/client/$(DEPDIR)/android_haltest-if-audio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/client/if-audio.c' object='android/client/android_haltest-if-audio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/client/android_haltest-if-audio.obj `if test -f 'android/client/if-audio.c'; then $(CYGPATH_W) 'android/client/if-audio.c'; else $(CYGPATH_W) '$(srcdir)/android/client/if-audio.c'; fi` + +android/hardware/android_haltest-hardware.o: android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/hardware/android_haltest-hardware.o -MD -MP -MF android/hardware/$(DEPDIR)/android_haltest-hardware.Tpo -c -o android/hardware/android_haltest-hardware.o `test -f 'android/hardware/hardware.c' || echo '$(srcdir)/'`android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/hardware/$(DEPDIR)/android_haltest-hardware.Tpo android/hardware/$(DEPDIR)/android_haltest-hardware.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hardware/hardware.c' object='android/hardware/android_haltest-hardware.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/hardware/android_haltest-hardware.o `test -f 'android/hardware/hardware.c' || echo '$(srcdir)/'`android/hardware/hardware.c + +android/hardware/android_haltest-hardware.obj: android/hardware/hardware.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/hardware/android_haltest-hardware.obj -MD -MP -MF android/hardware/$(DEPDIR)/android_haltest-hardware.Tpo -c -o android/hardware/android_haltest-hardware.obj `if test -f 'android/hardware/hardware.c'; then $(CYGPATH_W) 'android/hardware/hardware.c'; else $(CYGPATH_W) '$(srcdir)/android/hardware/hardware.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/hardware/$(DEPDIR)/android_haltest-hardware.Tpo android/hardware/$(DEPDIR)/android_haltest-hardware.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hardware/hardware.c' object='android/hardware/android_haltest-hardware.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/hardware/android_haltest-hardware.obj `if test -f 'android/hardware/hardware.c'; then $(CYGPATH_W) 'android/hardware/hardware.c'; else $(CYGPATH_W) '$(srcdir)/android/hardware/hardware.c'; fi` + +android/android_haltest-hal-utils.o: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/android_haltest-hal-utils.o -MD -MP -MF android/$(DEPDIR)/android_haltest-hal-utils.Tpo -c -o android/android_haltest-hal-utils.o `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_haltest-hal-utils.Tpo android/$(DEPDIR)/android_haltest-hal-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_haltest-hal-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/android_haltest-hal-utils.o `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c + +android/android_haltest-hal-utils.obj: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -MT android/android_haltest-hal-utils.obj -MD -MP -MF android/$(DEPDIR)/android_haltest-hal-utils.Tpo -c -o android/android_haltest-hal-utils.obj `if test -f 'android/hal-utils.c'; then $(CYGPATH_W) 'android/hal-utils.c'; else $(CYGPATH_W) '$(srcdir)/android/hal-utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_haltest-hal-utils.Tpo android/$(DEPDIR)/android_haltest-hal-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_haltest-hal-utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_haltest_CFLAGS) $(CFLAGS) -c -o android/android_haltest-hal-utils.obj `if test -f 'android/hal-utils.c'; then $(CYGPATH_W) 'android/hal-utils.c'; else $(CYGPATH_W) '$(srcdir)/android/hal-utils.c'; fi` + +emulator/android_ipc_tester-btdev.o: emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-btdev.o -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-btdev.Tpo -c -o emulator/android_ipc_tester-btdev.o `test -f 'emulator/btdev.c' || echo '$(srcdir)/'`emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-btdev.Tpo emulator/$(DEPDIR)/android_ipc_tester-btdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/btdev.c' object='emulator/android_ipc_tester-btdev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-btdev.o `test -f 'emulator/btdev.c' || echo '$(srcdir)/'`emulator/btdev.c + +emulator/android_ipc_tester-btdev.obj: emulator/btdev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-btdev.obj -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-btdev.Tpo -c -o emulator/android_ipc_tester-btdev.obj `if test -f 'emulator/btdev.c'; then $(CYGPATH_W) 'emulator/btdev.c'; else $(CYGPATH_W) '$(srcdir)/emulator/btdev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-btdev.Tpo emulator/$(DEPDIR)/android_ipc_tester-btdev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/btdev.c' object='emulator/android_ipc_tester-btdev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-btdev.obj `if test -f 'emulator/btdev.c'; then $(CYGPATH_W) 'emulator/btdev.c'; else $(CYGPATH_W) '$(srcdir)/emulator/btdev.c'; fi` + +emulator/android_ipc_tester-bthost.o: emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-bthost.o -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-bthost.Tpo -c -o emulator/android_ipc_tester-bthost.o `test -f 'emulator/bthost.c' || echo '$(srcdir)/'`emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-bthost.Tpo emulator/$(DEPDIR)/android_ipc_tester-bthost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/bthost.c' object='emulator/android_ipc_tester-bthost.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-bthost.o `test -f 'emulator/bthost.c' || echo '$(srcdir)/'`emulator/bthost.c + +emulator/android_ipc_tester-bthost.obj: emulator/bthost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-bthost.obj -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-bthost.Tpo -c -o emulator/android_ipc_tester-bthost.obj `if test -f 'emulator/bthost.c'; then $(CYGPATH_W) 'emulator/bthost.c'; else $(CYGPATH_W) '$(srcdir)/emulator/bthost.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-bthost.Tpo emulator/$(DEPDIR)/android_ipc_tester-bthost.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/bthost.c' object='emulator/android_ipc_tester-bthost.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-bthost.obj `if test -f 'emulator/bthost.c'; then $(CYGPATH_W) 'emulator/bthost.c'; else $(CYGPATH_W) '$(srcdir)/emulator/bthost.c'; fi` + +emulator/android_ipc_tester-smp.o: emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-smp.o -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-smp.Tpo -c -o emulator/android_ipc_tester-smp.o `test -f 'emulator/smp.c' || echo '$(srcdir)/'`emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-smp.Tpo emulator/$(DEPDIR)/android_ipc_tester-smp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/smp.c' object='emulator/android_ipc_tester-smp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-smp.o `test -f 'emulator/smp.c' || echo '$(srcdir)/'`emulator/smp.c + +emulator/android_ipc_tester-smp.obj: emulator/smp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT emulator/android_ipc_tester-smp.obj -MD -MP -MF emulator/$(DEPDIR)/android_ipc_tester-smp.Tpo -c -o emulator/android_ipc_tester-smp.obj `if test -f 'emulator/smp.c'; then $(CYGPATH_W) 'emulator/smp.c'; else $(CYGPATH_W) '$(srcdir)/emulator/smp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) emulator/$(DEPDIR)/android_ipc_tester-smp.Tpo emulator/$(DEPDIR)/android_ipc_tester-smp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='emulator/smp.c' object='emulator/android_ipc_tester-smp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o emulator/android_ipc_tester-smp.obj `if test -f 'emulator/smp.c'; then $(CYGPATH_W) 'emulator/smp.c'; else $(CYGPATH_W) '$(srcdir)/emulator/smp.c'; fi` + +src/shared/android_ipc_tester-crypto.o: src/shared/crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-crypto.o -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-crypto.Tpo -c -o src/shared/android_ipc_tester-crypto.o `test -f 'src/shared/crypto.c' || echo '$(srcdir)/'`src/shared/crypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-crypto.Tpo src/shared/$(DEPDIR)/android_ipc_tester-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/crypto.c' object='src/shared/android_ipc_tester-crypto.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-crypto.o `test -f 'src/shared/crypto.c' || echo '$(srcdir)/'`src/shared/crypto.c + +src/shared/android_ipc_tester-crypto.obj: src/shared/crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-crypto.obj -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-crypto.Tpo -c -o src/shared/android_ipc_tester-crypto.obj `if test -f 'src/shared/crypto.c'; then $(CYGPATH_W) 'src/shared/crypto.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/crypto.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-crypto.Tpo src/shared/$(DEPDIR)/android_ipc_tester-crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/crypto.c' object='src/shared/android_ipc_tester-crypto.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-crypto.obj `if test -f 'src/shared/crypto.c'; then $(CYGPATH_W) 'src/shared/crypto.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/crypto.c'; fi` + +src/shared/android_ipc_tester-io-glib.o: src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-io-glib.o -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-io-glib.Tpo -c -o src/shared/android_ipc_tester-io-glib.o `test -f 'src/shared/io-glib.c' || echo '$(srcdir)/'`src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-io-glib.Tpo src/shared/$(DEPDIR)/android_ipc_tester-io-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/io-glib.c' object='src/shared/android_ipc_tester-io-glib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-io-glib.o `test -f 'src/shared/io-glib.c' || echo '$(srcdir)/'`src/shared/io-glib.c + +src/shared/android_ipc_tester-io-glib.obj: src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-io-glib.obj -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-io-glib.Tpo -c -o src/shared/android_ipc_tester-io-glib.obj `if test -f 'src/shared/io-glib.c'; then $(CYGPATH_W) 'src/shared/io-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/io-glib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-io-glib.Tpo src/shared/$(DEPDIR)/android_ipc_tester-io-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/io-glib.c' object='src/shared/android_ipc_tester-io-glib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-io-glib.obj `if test -f 'src/shared/io-glib.c'; then $(CYGPATH_W) 'src/shared/io-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/io-glib.c'; fi` + +src/shared/android_ipc_tester-queue.o: src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-queue.o -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-queue.Tpo -c -o src/shared/android_ipc_tester-queue.o `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-queue.Tpo src/shared/$(DEPDIR)/android_ipc_tester-queue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/queue.c' object='src/shared/android_ipc_tester-queue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-queue.o `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c + +src/shared/android_ipc_tester-queue.obj: src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-queue.obj -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-queue.Tpo -c -o src/shared/android_ipc_tester-queue.obj `if test -f 'src/shared/queue.c'; then $(CYGPATH_W) 'src/shared/queue.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/queue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-queue.Tpo src/shared/$(DEPDIR)/android_ipc_tester-queue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/queue.c' object='src/shared/android_ipc_tester-queue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-queue.obj `if test -f 'src/shared/queue.c'; then $(CYGPATH_W) 'src/shared/queue.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/queue.c'; fi` + +src/shared/android_ipc_tester-util.o: src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-util.o -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-util.Tpo -c -o src/shared/android_ipc_tester-util.o `test -f 'src/shared/util.c' || echo '$(srcdir)/'`src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-util.Tpo src/shared/$(DEPDIR)/android_ipc_tester-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/util.c' object='src/shared/android_ipc_tester-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-util.o `test -f 'src/shared/util.c' || echo '$(srcdir)/'`src/shared/util.c + +src/shared/android_ipc_tester-util.obj: src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-util.obj -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-util.Tpo -c -o src/shared/android_ipc_tester-util.obj `if test -f 'src/shared/util.c'; then $(CYGPATH_W) 'src/shared/util.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-util.Tpo src/shared/$(DEPDIR)/android_ipc_tester-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/util.c' object='src/shared/android_ipc_tester-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-util.obj `if test -f 'src/shared/util.c'; then $(CYGPATH_W) 'src/shared/util.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/util.c'; fi` + +src/shared/android_ipc_tester-mgmt.o: src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-mgmt.o -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-mgmt.Tpo -c -o src/shared/android_ipc_tester-mgmt.o `test -f 'src/shared/mgmt.c' || echo '$(srcdir)/'`src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-mgmt.Tpo src/shared/$(DEPDIR)/android_ipc_tester-mgmt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/mgmt.c' object='src/shared/android_ipc_tester-mgmt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-mgmt.o `test -f 'src/shared/mgmt.c' || echo '$(srcdir)/'`src/shared/mgmt.c + +src/shared/android_ipc_tester-mgmt.obj: src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-mgmt.obj -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-mgmt.Tpo -c -o src/shared/android_ipc_tester-mgmt.obj `if test -f 'src/shared/mgmt.c'; then $(CYGPATH_W) 'src/shared/mgmt.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/mgmt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-mgmt.Tpo src/shared/$(DEPDIR)/android_ipc_tester-mgmt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/mgmt.c' object='src/shared/android_ipc_tester-mgmt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-mgmt.obj `if test -f 'src/shared/mgmt.c'; then $(CYGPATH_W) 'src/shared/mgmt.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/mgmt.c'; fi` + +src/shared/android_ipc_tester-hciemu.o: src/shared/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-hciemu.o -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-hciemu.Tpo -c -o src/shared/android_ipc_tester-hciemu.o `test -f 'src/shared/hciemu.c' || echo '$(srcdir)/'`src/shared/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-hciemu.Tpo src/shared/$(DEPDIR)/android_ipc_tester-hciemu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/hciemu.c' object='src/shared/android_ipc_tester-hciemu.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-hciemu.o `test -f 'src/shared/hciemu.c' || echo '$(srcdir)/'`src/shared/hciemu.c + +src/shared/android_ipc_tester-hciemu.obj: src/shared/hciemu.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-hciemu.obj -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-hciemu.Tpo -c -o src/shared/android_ipc_tester-hciemu.obj `if test -f 'src/shared/hciemu.c'; then $(CYGPATH_W) 'src/shared/hciemu.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/hciemu.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-hciemu.Tpo src/shared/$(DEPDIR)/android_ipc_tester-hciemu.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/hciemu.c' object='src/shared/android_ipc_tester-hciemu.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-hciemu.obj `if test -f 'src/shared/hciemu.c'; then $(CYGPATH_W) 'src/shared/hciemu.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/hciemu.c'; fi` + +src/shared/android_ipc_tester-tester.o: src/shared/tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-tester.o -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-tester.Tpo -c -o src/shared/android_ipc_tester-tester.o `test -f 'src/shared/tester.c' || echo '$(srcdir)/'`src/shared/tester.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-tester.Tpo src/shared/$(DEPDIR)/android_ipc_tester-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/tester.c' object='src/shared/android_ipc_tester-tester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-tester.o `test -f 'src/shared/tester.c' || echo '$(srcdir)/'`src/shared/tester.c + +src/shared/android_ipc_tester-tester.obj: src/shared/tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-tester.obj -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-tester.Tpo -c -o src/shared/android_ipc_tester-tester.obj `if test -f 'src/shared/tester.c'; then $(CYGPATH_W) 'src/shared/tester.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/tester.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-tester.Tpo src/shared/$(DEPDIR)/android_ipc_tester-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/tester.c' object='src/shared/android_ipc_tester-tester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-tester.obj `if test -f 'src/shared/tester.c'; then $(CYGPATH_W) 'src/shared/tester.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/tester.c'; fi` + +src/shared/android_ipc_tester-timeout-glib.o: src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-timeout-glib.o -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-timeout-glib.Tpo -c -o src/shared/android_ipc_tester-timeout-glib.o `test -f 'src/shared/timeout-glib.c' || echo '$(srcdir)/'`src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-timeout-glib.Tpo src/shared/$(DEPDIR)/android_ipc_tester-timeout-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/timeout-glib.c' object='src/shared/android_ipc_tester-timeout-glib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-timeout-glib.o `test -f 'src/shared/timeout-glib.c' || echo '$(srcdir)/'`src/shared/timeout-glib.c + +src/shared/android_ipc_tester-timeout-glib.obj: src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT src/shared/android_ipc_tester-timeout-glib.obj -MD -MP -MF src/shared/$(DEPDIR)/android_ipc_tester-timeout-glib.Tpo -c -o src/shared/android_ipc_tester-timeout-glib.obj `if test -f 'src/shared/timeout-glib.c'; then $(CYGPATH_W) 'src/shared/timeout-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/timeout-glib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/android_ipc_tester-timeout-glib.Tpo src/shared/$(DEPDIR)/android_ipc_tester-timeout-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/timeout-glib.c' object='src/shared/android_ipc_tester-timeout-glib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o src/shared/android_ipc_tester-timeout-glib.obj `if test -f 'src/shared/timeout-glib.c'; then $(CYGPATH_W) 'src/shared/timeout-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/timeout-glib.c'; fi` + +android/android_ipc_tester-hal-utils.o: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT android/android_ipc_tester-hal-utils.o -MD -MP -MF android/$(DEPDIR)/android_ipc_tester-hal-utils.Tpo -c -o android/android_ipc_tester-hal-utils.o `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_ipc_tester-hal-utils.Tpo android/$(DEPDIR)/android_ipc_tester-hal-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_ipc_tester-hal-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o android/android_ipc_tester-hal-utils.o `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c + +android/android_ipc_tester-hal-utils.obj: android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT android/android_ipc_tester-hal-utils.obj -MD -MP -MF android/$(DEPDIR)/android_ipc_tester-hal-utils.Tpo -c -o android/android_ipc_tester-hal-utils.obj `if test -f 'android/hal-utils.c'; then $(CYGPATH_W) 'android/hal-utils.c'; else $(CYGPATH_W) '$(srcdir)/android/hal-utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_ipc_tester-hal-utils.Tpo android/$(DEPDIR)/android_ipc_tester-hal-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/android_ipc_tester-hal-utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o android/android_ipc_tester-hal-utils.obj `if test -f 'android/hal-utils.c'; then $(CYGPATH_W) 'android/hal-utils.c'; else $(CYGPATH_W) '$(srcdir)/android/hal-utils.c'; fi` + +android/android_ipc_tester-ipc-tester.o: android/ipc-tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT android/android_ipc_tester-ipc-tester.o -MD -MP -MF android/$(DEPDIR)/android_ipc_tester-ipc-tester.Tpo -c -o android/android_ipc_tester-ipc-tester.o `test -f 'android/ipc-tester.c' || echo '$(srcdir)/'`android/ipc-tester.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_ipc_tester-ipc-tester.Tpo android/$(DEPDIR)/android_ipc_tester-ipc-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/ipc-tester.c' object='android/android_ipc_tester-ipc-tester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o android/android_ipc_tester-ipc-tester.o `test -f 'android/ipc-tester.c' || echo '$(srcdir)/'`android/ipc-tester.c + +android/android_ipc_tester-ipc-tester.obj: android/ipc-tester.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -MT android/android_ipc_tester-ipc-tester.obj -MD -MP -MF android/$(DEPDIR)/android_ipc_tester-ipc-tester.Tpo -c -o android/android_ipc_tester-ipc-tester.obj `if test -f 'android/ipc-tester.c'; then $(CYGPATH_W) 'android/ipc-tester.c'; else $(CYGPATH_W) '$(srcdir)/android/ipc-tester.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/android_ipc_tester-ipc-tester.Tpo android/$(DEPDIR)/android_ipc_tester-ipc-tester.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/ipc-tester.c' object='android/android_ipc_tester-ipc-tester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(android_ipc_tester_CFLAGS) $(CFLAGS) -c -o android/android_ipc_tester-ipc-tester.obj `if test -f 'android/ipc-tester.c'; then $(CYGPATH_W) 'android/ipc-tester.c'; else $(CYGPATH_W) '$(srcdir)/android/ipc-tester.c'; fi` + +btio/obexd-btio.o: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT btio/obexd-btio.o -MD -MP -MF btio/$(DEPDIR)/obexd-btio.Tpo -c -o btio/obexd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/obexd-btio.Tpo btio/$(DEPDIR)/obexd-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/obexd-btio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o btio/obexd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c + +btio/obexd-btio.obj: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT btio/obexd-btio.obj -MD -MP -MF btio/$(DEPDIR)/obexd-btio.Tpo -c -o btio/obexd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/obexd-btio.Tpo btio/$(DEPDIR)/obexd-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/obexd-btio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o btio/obexd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` + +gobex/obexd-gobex.o: gobex/gobex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex.Tpo -c -o gobex/obexd-gobex.o `test -f 'gobex/gobex.c' || echo '$(srcdir)/'`gobex/gobex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex.Tpo gobex/$(DEPDIR)/obexd-gobex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex.c' object='gobex/obexd-gobex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex.o `test -f 'gobex/gobex.c' || echo '$(srcdir)/'`gobex/gobex.c + +gobex/obexd-gobex.obj: gobex/gobex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex.Tpo -c -o gobex/obexd-gobex.obj `if test -f 'gobex/gobex.c'; then $(CYGPATH_W) 'gobex/gobex.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex.Tpo gobex/$(DEPDIR)/obexd-gobex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex.c' object='gobex/obexd-gobex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex.obj `if test -f 'gobex/gobex.c'; then $(CYGPATH_W) 'gobex/gobex.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex.c'; fi` + +gobex/obexd-gobex-defs.o: gobex/gobex-defs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-defs.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-defs.Tpo -c -o gobex/obexd-gobex-defs.o `test -f 'gobex/gobex-defs.c' || echo '$(srcdir)/'`gobex/gobex-defs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-defs.Tpo gobex/$(DEPDIR)/obexd-gobex-defs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-defs.c' object='gobex/obexd-gobex-defs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-defs.o `test -f 'gobex/gobex-defs.c' || echo '$(srcdir)/'`gobex/gobex-defs.c + +gobex/obexd-gobex-defs.obj: gobex/gobex-defs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-defs.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-defs.Tpo -c -o gobex/obexd-gobex-defs.obj `if test -f 'gobex/gobex-defs.c'; then $(CYGPATH_W) 'gobex/gobex-defs.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-defs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-defs.Tpo gobex/$(DEPDIR)/obexd-gobex-defs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-defs.c' object='gobex/obexd-gobex-defs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-defs.obj `if test -f 'gobex/gobex-defs.c'; then $(CYGPATH_W) 'gobex/gobex-defs.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-defs.c'; fi` + +gobex/obexd-gobex-packet.o: gobex/gobex-packet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-packet.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-packet.Tpo -c -o gobex/obexd-gobex-packet.o `test -f 'gobex/gobex-packet.c' || echo '$(srcdir)/'`gobex/gobex-packet.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-packet.Tpo gobex/$(DEPDIR)/obexd-gobex-packet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-packet.c' object='gobex/obexd-gobex-packet.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-packet.o `test -f 'gobex/gobex-packet.c' || echo '$(srcdir)/'`gobex/gobex-packet.c + +gobex/obexd-gobex-packet.obj: gobex/gobex-packet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-packet.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-packet.Tpo -c -o gobex/obexd-gobex-packet.obj `if test -f 'gobex/gobex-packet.c'; then $(CYGPATH_W) 'gobex/gobex-packet.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-packet.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-packet.Tpo gobex/$(DEPDIR)/obexd-gobex-packet.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-packet.c' object='gobex/obexd-gobex-packet.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-packet.obj `if test -f 'gobex/gobex-packet.c'; then $(CYGPATH_W) 'gobex/gobex-packet.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-packet.c'; fi` + +gobex/obexd-gobex-header.o: gobex/gobex-header.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-header.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-header.Tpo -c -o gobex/obexd-gobex-header.o `test -f 'gobex/gobex-header.c' || echo '$(srcdir)/'`gobex/gobex-header.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-header.Tpo gobex/$(DEPDIR)/obexd-gobex-header.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-header.c' object='gobex/obexd-gobex-header.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-header.o `test -f 'gobex/gobex-header.c' || echo '$(srcdir)/'`gobex/gobex-header.c + +gobex/obexd-gobex-header.obj: gobex/gobex-header.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-header.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-header.Tpo -c -o gobex/obexd-gobex-header.obj `if test -f 'gobex/gobex-header.c'; then $(CYGPATH_W) 'gobex/gobex-header.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-header.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-header.Tpo gobex/$(DEPDIR)/obexd-gobex-header.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-header.c' object='gobex/obexd-gobex-header.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-header.obj `if test -f 'gobex/gobex-header.c'; then $(CYGPATH_W) 'gobex/gobex-header.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-header.c'; fi` + +gobex/obexd-gobex-transfer.o: gobex/gobex-transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-transfer.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo -c -o gobex/obexd-gobex-transfer.o `test -f 'gobex/gobex-transfer.c' || echo '$(srcdir)/'`gobex/gobex-transfer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo gobex/$(DEPDIR)/obexd-gobex-transfer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-transfer.c' object='gobex/obexd-gobex-transfer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-transfer.o `test -f 'gobex/gobex-transfer.c' || echo '$(srcdir)/'`gobex/gobex-transfer.c + +gobex/obexd-gobex-transfer.obj: gobex/gobex-transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-transfer.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo -c -o gobex/obexd-gobex-transfer.obj `if test -f 'gobex/gobex-transfer.c'; then $(CYGPATH_W) 'gobex/gobex-transfer.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-transfer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo gobex/$(DEPDIR)/obexd-gobex-transfer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-transfer.c' object='gobex/obexd-gobex-transfer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-transfer.obj `if test -f 'gobex/gobex-transfer.c'; then $(CYGPATH_W) 'gobex/gobex-transfer.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-transfer.c'; fi` + +gobex/obexd-gobex-apparam.o: gobex/gobex-apparam.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-apparam.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo -c -o gobex/obexd-gobex-apparam.o `test -f 'gobex/gobex-apparam.c' || echo '$(srcdir)/'`gobex/gobex-apparam.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo gobex/$(DEPDIR)/obexd-gobex-apparam.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-apparam.c' object='gobex/obexd-gobex-apparam.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-apparam.o `test -f 'gobex/gobex-apparam.c' || echo '$(srcdir)/'`gobex/gobex-apparam.c + +gobex/obexd-gobex-apparam.obj: gobex/gobex-apparam.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-apparam.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo -c -o gobex/obexd-gobex-apparam.obj `if test -f 'gobex/gobex-apparam.c'; then $(CYGPATH_W) 'gobex/gobex-apparam.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-apparam.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo gobex/$(DEPDIR)/obexd-gobex-apparam.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-apparam.c' object='gobex/obexd-gobex-apparam.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-apparam.obj `if test -f 'gobex/gobex-apparam.c'; then $(CYGPATH_W) 'gobex/gobex-apparam.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-apparam.c'; fi` + +obexd/plugins/obexd-filesystem.o: obexd/plugins/filesystem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-filesystem.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo -c -o obexd/plugins/obexd-filesystem.o `test -f 'obexd/plugins/filesystem.c' || echo '$(srcdir)/'`obexd/plugins/filesystem.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo obexd/plugins/$(DEPDIR)/obexd-filesystem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/filesystem.c' object='obexd/plugins/obexd-filesystem.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-filesystem.o `test -f 'obexd/plugins/filesystem.c' || echo '$(srcdir)/'`obexd/plugins/filesystem.c + +obexd/plugins/obexd-filesystem.obj: obexd/plugins/filesystem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-filesystem.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo -c -o obexd/plugins/obexd-filesystem.obj `if test -f 'obexd/plugins/filesystem.c'; then $(CYGPATH_W) 'obexd/plugins/filesystem.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/filesystem.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo obexd/plugins/$(DEPDIR)/obexd-filesystem.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/filesystem.c' object='obexd/plugins/obexd-filesystem.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-filesystem.obj `if test -f 'obexd/plugins/filesystem.c'; then $(CYGPATH_W) 'obexd/plugins/filesystem.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/filesystem.c'; fi` + +obexd/plugins/obexd-bluetooth.o: obexd/plugins/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-bluetooth.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/plugins/obexd-bluetooth.o `test -f 'obexd/plugins/bluetooth.c' || echo '$(srcdir)/'`obexd/plugins/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo obexd/plugins/$(DEPDIR)/obexd-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/bluetooth.c' object='obexd/plugins/obexd-bluetooth.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-bluetooth.o `test -f 'obexd/plugins/bluetooth.c' || echo '$(srcdir)/'`obexd/plugins/bluetooth.c + +obexd/plugins/obexd-bluetooth.obj: obexd/plugins/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-bluetooth.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/plugins/obexd-bluetooth.obj `if test -f 'obexd/plugins/bluetooth.c'; then $(CYGPATH_W) 'obexd/plugins/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/bluetooth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo obexd/plugins/$(DEPDIR)/obexd-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/bluetooth.c' object='obexd/plugins/obexd-bluetooth.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-bluetooth.obj `if test -f 'obexd/plugins/bluetooth.c'; then $(CYGPATH_W) 'obexd/plugins/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/bluetooth.c'; fi` + +obexd/plugins/obexd-pcsuite.o: obexd/plugins/pcsuite.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pcsuite.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo -c -o obexd/plugins/obexd-pcsuite.o `test -f 'obexd/plugins/pcsuite.c' || echo '$(srcdir)/'`obexd/plugins/pcsuite.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo obexd/plugins/$(DEPDIR)/obexd-pcsuite.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pcsuite.c' object='obexd/plugins/obexd-pcsuite.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pcsuite.o `test -f 'obexd/plugins/pcsuite.c' || echo '$(srcdir)/'`obexd/plugins/pcsuite.c + +obexd/plugins/obexd-pcsuite.obj: obexd/plugins/pcsuite.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pcsuite.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo -c -o obexd/plugins/obexd-pcsuite.obj `if test -f 'obexd/plugins/pcsuite.c'; then $(CYGPATH_W) 'obexd/plugins/pcsuite.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pcsuite.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo obexd/plugins/$(DEPDIR)/obexd-pcsuite.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pcsuite.c' object='obexd/plugins/obexd-pcsuite.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pcsuite.obj `if test -f 'obexd/plugins/pcsuite.c'; then $(CYGPATH_W) 'obexd/plugins/pcsuite.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pcsuite.c'; fi` + +obexd/plugins/obexd-opp.o: obexd/plugins/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-opp.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/plugins/obexd-opp.o `test -f 'obexd/plugins/opp.c' || echo '$(srcdir)/'`obexd/plugins/opp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-opp.Tpo obexd/plugins/$(DEPDIR)/obexd-opp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/opp.c' object='obexd/plugins/obexd-opp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-opp.o `test -f 'obexd/plugins/opp.c' || echo '$(srcdir)/'`obexd/plugins/opp.c + +obexd/plugins/obexd-opp.obj: obexd/plugins/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-opp.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/plugins/obexd-opp.obj `if test -f 'obexd/plugins/opp.c'; then $(CYGPATH_W) 'obexd/plugins/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/opp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-opp.Tpo obexd/plugins/$(DEPDIR)/obexd-opp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/opp.c' object='obexd/plugins/obexd-opp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-opp.obj `if test -f 'obexd/plugins/opp.c'; then $(CYGPATH_W) 'obexd/plugins/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/opp.c'; fi` + +obexd/plugins/obexd-ftp.o: obexd/plugins/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-ftp.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/plugins/obexd-ftp.o `test -f 'obexd/plugins/ftp.c' || echo '$(srcdir)/'`obexd/plugins/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo obexd/plugins/$(DEPDIR)/obexd-ftp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/ftp.c' object='obexd/plugins/obexd-ftp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-ftp.o `test -f 'obexd/plugins/ftp.c' || echo '$(srcdir)/'`obexd/plugins/ftp.c + +obexd/plugins/obexd-ftp.obj: obexd/plugins/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-ftp.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/plugins/obexd-ftp.obj `if test -f 'obexd/plugins/ftp.c'; then $(CYGPATH_W) 'obexd/plugins/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/ftp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo obexd/plugins/$(DEPDIR)/obexd-ftp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/ftp.c' object='obexd/plugins/obexd-ftp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-ftp.obj `if test -f 'obexd/plugins/ftp.c'; then $(CYGPATH_W) 'obexd/plugins/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/ftp.c'; fi` + +obexd/plugins/obexd-irmc.o: obexd/plugins/irmc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-irmc.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo -c -o obexd/plugins/obexd-irmc.o `test -f 'obexd/plugins/irmc.c' || echo '$(srcdir)/'`obexd/plugins/irmc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo obexd/plugins/$(DEPDIR)/obexd-irmc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/irmc.c' object='obexd/plugins/obexd-irmc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-irmc.o `test -f 'obexd/plugins/irmc.c' || echo '$(srcdir)/'`obexd/plugins/irmc.c + +obexd/plugins/obexd-irmc.obj: obexd/plugins/irmc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-irmc.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo -c -o obexd/plugins/obexd-irmc.obj `if test -f 'obexd/plugins/irmc.c'; then $(CYGPATH_W) 'obexd/plugins/irmc.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/irmc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo obexd/plugins/$(DEPDIR)/obexd-irmc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/irmc.c' object='obexd/plugins/obexd-irmc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-irmc.obj `if test -f 'obexd/plugins/irmc.c'; then $(CYGPATH_W) 'obexd/plugins/irmc.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/irmc.c'; fi` + +obexd/plugins/obexd-pbap.o: obexd/plugins/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pbap.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/plugins/obexd-pbap.o `test -f 'obexd/plugins/pbap.c' || echo '$(srcdir)/'`obexd/plugins/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo obexd/plugins/$(DEPDIR)/obexd-pbap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pbap.c' object='obexd/plugins/obexd-pbap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pbap.o `test -f 'obexd/plugins/pbap.c' || echo '$(srcdir)/'`obexd/plugins/pbap.c + +obexd/plugins/obexd-pbap.obj: obexd/plugins/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pbap.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/plugins/obexd-pbap.obj `if test -f 'obexd/plugins/pbap.c'; then $(CYGPATH_W) 'obexd/plugins/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pbap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo obexd/plugins/$(DEPDIR)/obexd-pbap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pbap.c' object='obexd/plugins/obexd-pbap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pbap.obj `if test -f 'obexd/plugins/pbap.c'; then $(CYGPATH_W) 'obexd/plugins/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pbap.c'; fi` + +obexd/plugins/obexd-vcard.o: obexd/plugins/vcard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-vcard.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo -c -o obexd/plugins/obexd-vcard.o `test -f 'obexd/plugins/vcard.c' || echo '$(srcdir)/'`obexd/plugins/vcard.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo obexd/plugins/$(DEPDIR)/obexd-vcard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/vcard.c' object='obexd/plugins/obexd-vcard.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-vcard.o `test -f 'obexd/plugins/vcard.c' || echo '$(srcdir)/'`obexd/plugins/vcard.c + +obexd/plugins/obexd-vcard.obj: obexd/plugins/vcard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-vcard.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo -c -o obexd/plugins/obexd-vcard.obj `if test -f 'obexd/plugins/vcard.c'; then $(CYGPATH_W) 'obexd/plugins/vcard.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/vcard.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo obexd/plugins/$(DEPDIR)/obexd-vcard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/vcard.c' object='obexd/plugins/obexd-vcard.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-vcard.obj `if test -f 'obexd/plugins/vcard.c'; then $(CYGPATH_W) 'obexd/plugins/vcard.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/vcard.c'; fi` + +obexd/plugins/obexd-phonebook-dummy.o: obexd/plugins/phonebook-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-phonebook-dummy.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Tpo -c -o obexd/plugins/obexd-phonebook-dummy.o `test -f 'obexd/plugins/phonebook-dummy.c' || echo '$(srcdir)/'`obexd/plugins/phonebook-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/phonebook-dummy.c' object='obexd/plugins/obexd-phonebook-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-phonebook-dummy.o `test -f 'obexd/plugins/phonebook-dummy.c' || echo '$(srcdir)/'`obexd/plugins/phonebook-dummy.c + +obexd/plugins/obexd-phonebook-dummy.obj: obexd/plugins/phonebook-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-phonebook-dummy.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Tpo -c -o obexd/plugins/obexd-phonebook-dummy.obj `if test -f 'obexd/plugins/phonebook-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/phonebook-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/phonebook-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-phonebook-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/phonebook-dummy.c' object='obexd/plugins/obexd-phonebook-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-phonebook-dummy.obj `if test -f 'obexd/plugins/phonebook-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/phonebook-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/phonebook-dummy.c'; fi` + +obexd/plugins/obexd-mas.o: obexd/plugins/mas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-mas.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-mas.Tpo -c -o obexd/plugins/obexd-mas.o `test -f 'obexd/plugins/mas.c' || echo '$(srcdir)/'`obexd/plugins/mas.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-mas.Tpo obexd/plugins/$(DEPDIR)/obexd-mas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/mas.c' object='obexd/plugins/obexd-mas.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-mas.o `test -f 'obexd/plugins/mas.c' || echo '$(srcdir)/'`obexd/plugins/mas.c + +obexd/plugins/obexd-mas.obj: obexd/plugins/mas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-mas.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-mas.Tpo -c -o obexd/plugins/obexd-mas.obj `if test -f 'obexd/plugins/mas.c'; then $(CYGPATH_W) 'obexd/plugins/mas.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/mas.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-mas.Tpo obexd/plugins/$(DEPDIR)/obexd-mas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/mas.c' object='obexd/plugins/obexd-mas.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-mas.obj `if test -f 'obexd/plugins/mas.c'; then $(CYGPATH_W) 'obexd/plugins/mas.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/mas.c'; fi` + +obexd/plugins/obexd-messages-dummy.o: obexd/plugins/messages-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-messages-dummy.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo -c -o obexd/plugins/obexd-messages-dummy.o `test -f 'obexd/plugins/messages-dummy.c' || echo '$(srcdir)/'`obexd/plugins/messages-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/messages-dummy.c' object='obexd/plugins/obexd-messages-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-messages-dummy.o `test -f 'obexd/plugins/messages-dummy.c' || echo '$(srcdir)/'`obexd/plugins/messages-dummy.c + +obexd/plugins/obexd-messages-dummy.obj: obexd/plugins/messages-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-messages-dummy.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo -c -o obexd/plugins/obexd-messages-dummy.obj `if test -f 'obexd/plugins/messages-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/messages-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/messages-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/messages-dummy.c' object='obexd/plugins/obexd-messages-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-messages-dummy.obj `if test -f 'obexd/plugins/messages-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/messages-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/messages-dummy.c'; fi` + +obexd/client/obexd-mns.o: obexd/client/mns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-mns.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-mns.Tpo -c -o obexd/client/obexd-mns.o `test -f 'obexd/client/mns.c' || echo '$(srcdir)/'`obexd/client/mns.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-mns.Tpo obexd/client/$(DEPDIR)/obexd-mns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/mns.c' object='obexd/client/obexd-mns.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-mns.o `test -f 'obexd/client/mns.c' || echo '$(srcdir)/'`obexd/client/mns.c + +obexd/client/obexd-mns.obj: obexd/client/mns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-mns.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-mns.Tpo -c -o obexd/client/obexd-mns.obj `if test -f 'obexd/client/mns.c'; then $(CYGPATH_W) 'obexd/client/mns.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/mns.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-mns.Tpo obexd/client/$(DEPDIR)/obexd-mns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/mns.c' object='obexd/client/obexd-mns.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-mns.obj `if test -f 'obexd/client/mns.c'; then $(CYGPATH_W) 'obexd/client/mns.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/mns.c'; fi` + +obexd/src/obexd-main.o: obexd/src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-main.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-main.Tpo -c -o obexd/src/obexd-main.o `test -f 'obexd/src/main.c' || echo '$(srcdir)/'`obexd/src/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-main.Tpo obexd/src/$(DEPDIR)/obexd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/main.c' object='obexd/src/obexd-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-main.o `test -f 'obexd/src/main.c' || echo '$(srcdir)/'`obexd/src/main.c + +obexd/src/obexd-main.obj: obexd/src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-main.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-main.Tpo -c -o obexd/src/obexd-main.obj `if test -f 'obexd/src/main.c'; then $(CYGPATH_W) 'obexd/src/main.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-main.Tpo obexd/src/$(DEPDIR)/obexd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/main.c' object='obexd/src/obexd-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-main.obj `if test -f 'obexd/src/main.c'; then $(CYGPATH_W) 'obexd/src/main.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/main.c'; fi` + +obexd/src/obexd-plugin.o: obexd/src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-plugin.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-plugin.Tpo -c -o obexd/src/obexd-plugin.o `test -f 'obexd/src/plugin.c' || echo '$(srcdir)/'`obexd/src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-plugin.Tpo obexd/src/$(DEPDIR)/obexd-plugin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/plugin.c' object='obexd/src/obexd-plugin.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-plugin.o `test -f 'obexd/src/plugin.c' || echo '$(srcdir)/'`obexd/src/plugin.c + +obexd/src/obexd-plugin.obj: obexd/src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-plugin.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-plugin.Tpo -c -o obexd/src/obexd-plugin.obj `if test -f 'obexd/src/plugin.c'; then $(CYGPATH_W) 'obexd/src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/plugin.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-plugin.Tpo obexd/src/$(DEPDIR)/obexd-plugin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/plugin.c' object='obexd/src/obexd-plugin.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-plugin.obj `if test -f 'obexd/src/plugin.c'; then $(CYGPATH_W) 'obexd/src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/plugin.c'; fi` + +obexd/src/obexd-log.o: obexd/src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-log.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-log.Tpo -c -o obexd/src/obexd-log.o `test -f 'obexd/src/log.c' || echo '$(srcdir)/'`obexd/src/log.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-log.Tpo obexd/src/$(DEPDIR)/obexd-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/log.c' object='obexd/src/obexd-log.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-log.o `test -f 'obexd/src/log.c' || echo '$(srcdir)/'`obexd/src/log.c + +obexd/src/obexd-log.obj: obexd/src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-log.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-log.Tpo -c -o obexd/src/obexd-log.obj `if test -f 'obexd/src/log.c'; then $(CYGPATH_W) 'obexd/src/log.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/log.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-log.Tpo obexd/src/$(DEPDIR)/obexd-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/log.c' object='obexd/src/obexd-log.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-log.obj `if test -f 'obexd/src/log.c'; then $(CYGPATH_W) 'obexd/src/log.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/log.c'; fi` + +obexd/src/obexd-manager.o: obexd/src/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-manager.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/src/obexd-manager.o `test -f 'obexd/src/manager.c' || echo '$(srcdir)/'`obexd/src/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-manager.Tpo obexd/src/$(DEPDIR)/obexd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/manager.c' object='obexd/src/obexd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-manager.o `test -f 'obexd/src/manager.c' || echo '$(srcdir)/'`obexd/src/manager.c + +obexd/src/obexd-manager.obj: obexd/src/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-manager.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/src/obexd-manager.obj `if test -f 'obexd/src/manager.c'; then $(CYGPATH_W) 'obexd/src/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-manager.Tpo obexd/src/$(DEPDIR)/obexd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/manager.c' object='obexd/src/obexd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-manager.obj `if test -f 'obexd/src/manager.c'; then $(CYGPATH_W) 'obexd/src/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/manager.c'; fi` + +obexd/src/obexd-obex.o: obexd/src/obex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-obex.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-obex.Tpo -c -o obexd/src/obexd-obex.o `test -f 'obexd/src/obex.c' || echo '$(srcdir)/'`obexd/src/obex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-obex.Tpo obexd/src/$(DEPDIR)/obexd-obex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/obex.c' object='obexd/src/obexd-obex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-obex.o `test -f 'obexd/src/obex.c' || echo '$(srcdir)/'`obexd/src/obex.c + +obexd/src/obexd-obex.obj: obexd/src/obex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-obex.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-obex.Tpo -c -o obexd/src/obexd-obex.obj `if test -f 'obexd/src/obex.c'; then $(CYGPATH_W) 'obexd/src/obex.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/obex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-obex.Tpo obexd/src/$(DEPDIR)/obexd-obex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/obex.c' object='obexd/src/obexd-obex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-obex.obj `if test -f 'obexd/src/obex.c'; then $(CYGPATH_W) 'obexd/src/obex.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/obex.c'; fi` + +obexd/src/obexd-mimetype.o: obexd/src/mimetype.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-mimetype.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-mimetype.Tpo -c -o obexd/src/obexd-mimetype.o `test -f 'obexd/src/mimetype.c' || echo '$(srcdir)/'`obexd/src/mimetype.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-mimetype.Tpo obexd/src/$(DEPDIR)/obexd-mimetype.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/mimetype.c' object='obexd/src/obexd-mimetype.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-mimetype.o `test -f 'obexd/src/mimetype.c' || echo '$(srcdir)/'`obexd/src/mimetype.c + +obexd/src/obexd-mimetype.obj: obexd/src/mimetype.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-mimetype.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-mimetype.Tpo -c -o obexd/src/obexd-mimetype.obj `if test -f 'obexd/src/mimetype.c'; then $(CYGPATH_W) 'obexd/src/mimetype.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/mimetype.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-mimetype.Tpo obexd/src/$(DEPDIR)/obexd-mimetype.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/mimetype.c' object='obexd/src/obexd-mimetype.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-mimetype.obj `if test -f 'obexd/src/mimetype.c'; then $(CYGPATH_W) 'obexd/src/mimetype.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/mimetype.c'; fi` + +obexd/src/obexd-service.o: obexd/src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-service.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-service.Tpo -c -o obexd/src/obexd-service.o `test -f 'obexd/src/service.c' || echo '$(srcdir)/'`obexd/src/service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-service.Tpo obexd/src/$(DEPDIR)/obexd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/service.c' object='obexd/src/obexd-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-service.o `test -f 'obexd/src/service.c' || echo '$(srcdir)/'`obexd/src/service.c + +obexd/src/obexd-service.obj: obexd/src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-service.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-service.Tpo -c -o obexd/src/obexd-service.obj `if test -f 'obexd/src/service.c'; then $(CYGPATH_W) 'obexd/src/service.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-service.Tpo obexd/src/$(DEPDIR)/obexd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/service.c' object='obexd/src/obexd-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-service.obj `if test -f 'obexd/src/service.c'; then $(CYGPATH_W) 'obexd/src/service.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/service.c'; fi` + +obexd/src/obexd-transport.o: obexd/src/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-transport.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/src/obexd-transport.o `test -f 'obexd/src/transport.c' || echo '$(srcdir)/'`obexd/src/transport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-transport.Tpo obexd/src/$(DEPDIR)/obexd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/transport.c' object='obexd/src/obexd-transport.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-transport.o `test -f 'obexd/src/transport.c' || echo '$(srcdir)/'`obexd/src/transport.c + +obexd/src/obexd-transport.obj: obexd/src/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-transport.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/src/obexd-transport.obj `if test -f 'obexd/src/transport.c'; then $(CYGPATH_W) 'obexd/src/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/transport.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-transport.Tpo obexd/src/$(DEPDIR)/obexd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/transport.c' object='obexd/src/obexd-transport.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-transport.obj `if test -f 'obexd/src/transport.c'; then $(CYGPATH_W) 'obexd/src/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/transport.c'; fi` + +obexd/src/obexd-server.o: obexd/src/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-server.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-server.Tpo -c -o obexd/src/obexd-server.o `test -f 'obexd/src/server.c' || echo '$(srcdir)/'`obexd/src/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-server.Tpo obexd/src/$(DEPDIR)/obexd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/server.c' object='obexd/src/obexd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-server.o `test -f 'obexd/src/server.c' || echo '$(srcdir)/'`obexd/src/server.c + +obexd/src/obexd-server.obj: obexd/src/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-server.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-server.Tpo -c -o obexd/src/obexd-server.obj `if test -f 'obexd/src/server.c'; then $(CYGPATH_W) 'obexd/src/server.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-server.Tpo obexd/src/$(DEPDIR)/obexd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/server.c' object='obexd/src/obexd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-server.obj `if test -f 'obexd/src/server.c'; then $(CYGPATH_W) 'obexd/src/server.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/server.c'; fi` + +obexd/client/obexd-manager.o: obexd/client/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-manager.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/client/obexd-manager.o `test -f 'obexd/client/manager.c' || echo '$(srcdir)/'`obexd/client/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-manager.Tpo obexd/client/$(DEPDIR)/obexd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/manager.c' object='obexd/client/obexd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-manager.o `test -f 'obexd/client/manager.c' || echo '$(srcdir)/'`obexd/client/manager.c + +obexd/client/obexd-manager.obj: obexd/client/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-manager.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/client/obexd-manager.obj `if test -f 'obexd/client/manager.c'; then $(CYGPATH_W) 'obexd/client/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-manager.Tpo obexd/client/$(DEPDIR)/obexd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/manager.c' object='obexd/client/obexd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-manager.obj `if test -f 'obexd/client/manager.c'; then $(CYGPATH_W) 'obexd/client/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/manager.c'; fi` + +obexd/client/obexd-session.o: obexd/client/session.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-session.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-session.Tpo -c -o obexd/client/obexd-session.o `test -f 'obexd/client/session.c' || echo '$(srcdir)/'`obexd/client/session.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-session.Tpo obexd/client/$(DEPDIR)/obexd-session.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/session.c' object='obexd/client/obexd-session.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-session.o `test -f 'obexd/client/session.c' || echo '$(srcdir)/'`obexd/client/session.c + +obexd/client/obexd-session.obj: obexd/client/session.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-session.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-session.Tpo -c -o obexd/client/obexd-session.obj `if test -f 'obexd/client/session.c'; then $(CYGPATH_W) 'obexd/client/session.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/session.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-session.Tpo obexd/client/$(DEPDIR)/obexd-session.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/session.c' object='obexd/client/obexd-session.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-session.obj `if test -f 'obexd/client/session.c'; then $(CYGPATH_W) 'obexd/client/session.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/session.c'; fi` + +obexd/client/obexd-bluetooth.o: obexd/client/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-bluetooth.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/client/obexd-bluetooth.o `test -f 'obexd/client/bluetooth.c' || echo '$(srcdir)/'`obexd/client/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo obexd/client/$(DEPDIR)/obexd-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/bluetooth.c' object='obexd/client/obexd-bluetooth.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-bluetooth.o `test -f 'obexd/client/bluetooth.c' || echo '$(srcdir)/'`obexd/client/bluetooth.c + +obexd/client/obexd-bluetooth.obj: obexd/client/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-bluetooth.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/client/obexd-bluetooth.obj `if test -f 'obexd/client/bluetooth.c'; then $(CYGPATH_W) 'obexd/client/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/bluetooth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo obexd/client/$(DEPDIR)/obexd-bluetooth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/bluetooth.c' object='obexd/client/obexd-bluetooth.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-bluetooth.obj `if test -f 'obexd/client/bluetooth.c'; then $(CYGPATH_W) 'obexd/client/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/bluetooth.c'; fi` + +obexd/client/obexd-sync.o: obexd/client/sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-sync.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-sync.Tpo -c -o obexd/client/obexd-sync.o `test -f 'obexd/client/sync.c' || echo '$(srcdir)/'`obexd/client/sync.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-sync.Tpo obexd/client/$(DEPDIR)/obexd-sync.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/sync.c' object='obexd/client/obexd-sync.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-sync.o `test -f 'obexd/client/sync.c' || echo '$(srcdir)/'`obexd/client/sync.c + +obexd/client/obexd-sync.obj: obexd/client/sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-sync.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-sync.Tpo -c -o obexd/client/obexd-sync.obj `if test -f 'obexd/client/sync.c'; then $(CYGPATH_W) 'obexd/client/sync.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/sync.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-sync.Tpo obexd/client/$(DEPDIR)/obexd-sync.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/sync.c' object='obexd/client/obexd-sync.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-sync.obj `if test -f 'obexd/client/sync.c'; then $(CYGPATH_W) 'obexd/client/sync.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/sync.c'; fi` + +obexd/client/obexd-pbap.o: obexd/client/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-pbap.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/client/obexd-pbap.o `test -f 'obexd/client/pbap.c' || echo '$(srcdir)/'`obexd/client/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-pbap.Tpo obexd/client/$(DEPDIR)/obexd-pbap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/pbap.c' object='obexd/client/obexd-pbap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-pbap.o `test -f 'obexd/client/pbap.c' || echo '$(srcdir)/'`obexd/client/pbap.c + +obexd/client/obexd-pbap.obj: obexd/client/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-pbap.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/client/obexd-pbap.obj `if test -f 'obexd/client/pbap.c'; then $(CYGPATH_W) 'obexd/client/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/pbap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-pbap.Tpo obexd/client/$(DEPDIR)/obexd-pbap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/pbap.c' object='obexd/client/obexd-pbap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-pbap.obj `if test -f 'obexd/client/pbap.c'; then $(CYGPATH_W) 'obexd/client/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/pbap.c'; fi` + +obexd/client/obexd-ftp.o: obexd/client/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-ftp.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/client/obexd-ftp.o `test -f 'obexd/client/ftp.c' || echo '$(srcdir)/'`obexd/client/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-ftp.Tpo obexd/client/$(DEPDIR)/obexd-ftp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/ftp.c' object='obexd/client/obexd-ftp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-ftp.o `test -f 'obexd/client/ftp.c' || echo '$(srcdir)/'`obexd/client/ftp.c + +obexd/client/obexd-ftp.obj: obexd/client/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-ftp.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/client/obexd-ftp.obj `if test -f 'obexd/client/ftp.c'; then $(CYGPATH_W) 'obexd/client/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/ftp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-ftp.Tpo obexd/client/$(DEPDIR)/obexd-ftp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/ftp.c' object='obexd/client/obexd-ftp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-ftp.obj `if test -f 'obexd/client/ftp.c'; then $(CYGPATH_W) 'obexd/client/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/ftp.c'; fi` + +obexd/client/obexd-opp.o: obexd/client/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-opp.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/client/obexd-opp.o `test -f 'obexd/client/opp.c' || echo '$(srcdir)/'`obexd/client/opp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-opp.Tpo obexd/client/$(DEPDIR)/obexd-opp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/opp.c' object='obexd/client/obexd-opp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-opp.o `test -f 'obexd/client/opp.c' || echo '$(srcdir)/'`obexd/client/opp.c + +obexd/client/obexd-opp.obj: obexd/client/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-opp.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/client/obexd-opp.obj `if test -f 'obexd/client/opp.c'; then $(CYGPATH_W) 'obexd/client/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/opp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-opp.Tpo obexd/client/$(DEPDIR)/obexd-opp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/opp.c' object='obexd/client/obexd-opp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-opp.obj `if test -f 'obexd/client/opp.c'; then $(CYGPATH_W) 'obexd/client/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/opp.c'; fi` + +obexd/client/obexd-map.o: obexd/client/map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map.Tpo -c -o obexd/client/obexd-map.o `test -f 'obexd/client/map.c' || echo '$(srcdir)/'`obexd/client/map.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map.Tpo obexd/client/$(DEPDIR)/obexd-map.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map.c' object='obexd/client/obexd-map.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map.o `test -f 'obexd/client/map.c' || echo '$(srcdir)/'`obexd/client/map.c + +obexd/client/obexd-map.obj: obexd/client/map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map.Tpo -c -o obexd/client/obexd-map.obj `if test -f 'obexd/client/map.c'; then $(CYGPATH_W) 'obexd/client/map.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map.Tpo obexd/client/$(DEPDIR)/obexd-map.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map.c' object='obexd/client/obexd-map.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map.obj `if test -f 'obexd/client/map.c'; then $(CYGPATH_W) 'obexd/client/map.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map.c'; fi` + +obexd/client/obexd-map-event.o: obexd/client/map-event.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map-event.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map-event.Tpo -c -o obexd/client/obexd-map-event.o `test -f 'obexd/client/map-event.c' || echo '$(srcdir)/'`obexd/client/map-event.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map-event.Tpo obexd/client/$(DEPDIR)/obexd-map-event.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map-event.c' object='obexd/client/obexd-map-event.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map-event.o `test -f 'obexd/client/map-event.c' || echo '$(srcdir)/'`obexd/client/map-event.c + +obexd/client/obexd-map-event.obj: obexd/client/map-event.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map-event.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map-event.Tpo -c -o obexd/client/obexd-map-event.obj `if test -f 'obexd/client/map-event.c'; then $(CYGPATH_W) 'obexd/client/map-event.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map-event.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map-event.Tpo obexd/client/$(DEPDIR)/obexd-map-event.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map-event.c' object='obexd/client/obexd-map-event.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map-event.obj `if test -f 'obexd/client/map-event.c'; then $(CYGPATH_W) 'obexd/client/map-event.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map-event.c'; fi` + +obexd/client/obexd-transfer.o: obexd/client/transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transfer.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transfer.Tpo -c -o obexd/client/obexd-transfer.o `test -f 'obexd/client/transfer.c' || echo '$(srcdir)/'`obexd/client/transfer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transfer.Tpo obexd/client/$(DEPDIR)/obexd-transfer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transfer.c' object='obexd/client/obexd-transfer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transfer.o `test -f 'obexd/client/transfer.c' || echo '$(srcdir)/'`obexd/client/transfer.c + +obexd/client/obexd-transfer.obj: obexd/client/transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transfer.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transfer.Tpo -c -o obexd/client/obexd-transfer.obj `if test -f 'obexd/client/transfer.c'; then $(CYGPATH_W) 'obexd/client/transfer.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transfer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transfer.Tpo obexd/client/$(DEPDIR)/obexd-transfer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transfer.c' object='obexd/client/obexd-transfer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transfer.obj `if test -f 'obexd/client/transfer.c'; then $(CYGPATH_W) 'obexd/client/transfer.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transfer.c'; fi` + +obexd/client/obexd-transport.o: obexd/client/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transport.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/client/obexd-transport.o `test -f 'obexd/client/transport.c' || echo '$(srcdir)/'`obexd/client/transport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transport.Tpo obexd/client/$(DEPDIR)/obexd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transport.c' object='obexd/client/obexd-transport.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transport.o `test -f 'obexd/client/transport.c' || echo '$(srcdir)/'`obexd/client/transport.c + +obexd/client/obexd-transport.obj: obexd/client/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transport.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/client/obexd-transport.obj `if test -f 'obexd/client/transport.c'; then $(CYGPATH_W) 'obexd/client/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transport.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transport.Tpo obexd/client/$(DEPDIR)/obexd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transport.c' object='obexd/client/obexd-transport.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transport.obj `if test -f 'obexd/client/transport.c'; then $(CYGPATH_W) 'obexd/client/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transport.c'; fi` + +obexd/client/obexd-dbus.o: obexd/client/dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-dbus.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-dbus.Tpo -c -o obexd/client/obexd-dbus.o `test -f 'obexd/client/dbus.c' || echo '$(srcdir)/'`obexd/client/dbus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-dbus.Tpo obexd/client/$(DEPDIR)/obexd-dbus.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/dbus.c' object='obexd/client/obexd-dbus.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-dbus.o `test -f 'obexd/client/dbus.c' || echo '$(srcdir)/'`obexd/client/dbus.c + +obexd/client/obexd-dbus.obj: obexd/client/dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-dbus.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-dbus.Tpo -c -o obexd/client/obexd-dbus.obj `if test -f 'obexd/client/dbus.c'; then $(CYGPATH_W) 'obexd/client/dbus.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/dbus.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-dbus.Tpo obexd/client/$(DEPDIR)/obexd-dbus.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/dbus.c' object='obexd/client/obexd-dbus.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-dbus.obj `if test -f 'obexd/client/dbus.c'; then $(CYGPATH_W) 'obexd/client/dbus.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/dbus.c'; fi` + +obexd/client/obexd-driver.o: obexd/client/driver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-driver.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-driver.Tpo -c -o obexd/client/obexd-driver.o `test -f 'obexd/client/driver.c' || echo '$(srcdir)/'`obexd/client/driver.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-driver.Tpo obexd/client/$(DEPDIR)/obexd-driver.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/driver.c' object='obexd/client/obexd-driver.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-driver.o `test -f 'obexd/client/driver.c' || echo '$(srcdir)/'`obexd/client/driver.c + +obexd/client/obexd-driver.obj: obexd/client/driver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-driver.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-driver.Tpo -c -o obexd/client/obexd-driver.obj `if test -f 'obexd/client/driver.c'; then $(CYGPATH_W) 'obexd/client/driver.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/driver.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-driver.Tpo obexd/client/$(DEPDIR)/obexd-driver.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/driver.c' object='obexd/client/obexd-driver.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-driver.obj `if test -f 'obexd/client/driver.c'; then $(CYGPATH_W) 'obexd/client/driver.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/driver.c'; fi` + +plugins/bluetoothd-hostname.o: plugins/hostname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-hostname.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-hostname.Tpo -c -o plugins/bluetoothd-hostname.o `test -f 'plugins/hostname.c' || echo '$(srcdir)/'`plugins/hostname.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-hostname.Tpo plugins/$(DEPDIR)/bluetoothd-hostname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/hostname.c' object='plugins/bluetoothd-hostname.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-hostname.o `test -f 'plugins/hostname.c' || echo '$(srcdir)/'`plugins/hostname.c + +plugins/bluetoothd-hostname.obj: plugins/hostname.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-hostname.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-hostname.Tpo -c -o plugins/bluetoothd-hostname.obj `if test -f 'plugins/hostname.c'; then $(CYGPATH_W) 'plugins/hostname.c'; else $(CYGPATH_W) '$(srcdir)/plugins/hostname.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-hostname.Tpo plugins/$(DEPDIR)/bluetoothd-hostname.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/hostname.c' object='plugins/bluetoothd-hostname.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-hostname.obj `if test -f 'plugins/hostname.c'; then $(CYGPATH_W) 'plugins/hostname.c'; else $(CYGPATH_W) '$(srcdir)/plugins/hostname.c'; fi` + +plugins/bluetoothd-wiimote.o: plugins/wiimote.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-wiimote.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-wiimote.Tpo -c -o plugins/bluetoothd-wiimote.o `test -f 'plugins/wiimote.c' || echo '$(srcdir)/'`plugins/wiimote.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-wiimote.Tpo plugins/$(DEPDIR)/bluetoothd-wiimote.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/wiimote.c' object='plugins/bluetoothd-wiimote.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-wiimote.o `test -f 'plugins/wiimote.c' || echo '$(srcdir)/'`plugins/wiimote.c + +plugins/bluetoothd-wiimote.obj: plugins/wiimote.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-wiimote.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-wiimote.Tpo -c -o plugins/bluetoothd-wiimote.obj `if test -f 'plugins/wiimote.c'; then $(CYGPATH_W) 'plugins/wiimote.c'; else $(CYGPATH_W) '$(srcdir)/plugins/wiimote.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-wiimote.Tpo plugins/$(DEPDIR)/bluetoothd-wiimote.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/wiimote.c' object='plugins/bluetoothd-wiimote.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-wiimote.obj `if test -f 'plugins/wiimote.c'; then $(CYGPATH_W) 'plugins/wiimote.c'; else $(CYGPATH_W) '$(srcdir)/plugins/wiimote.c'; fi` + +plugins/bluetoothd-autopair.o: plugins/autopair.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-autopair.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-autopair.Tpo -c -o plugins/bluetoothd-autopair.o `test -f 'plugins/autopair.c' || echo '$(srcdir)/'`plugins/autopair.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-autopair.Tpo plugins/$(DEPDIR)/bluetoothd-autopair.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/autopair.c' object='plugins/bluetoothd-autopair.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-autopair.o `test -f 'plugins/autopair.c' || echo '$(srcdir)/'`plugins/autopair.c + +plugins/bluetoothd-autopair.obj: plugins/autopair.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-autopair.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-autopair.Tpo -c -o plugins/bluetoothd-autopair.obj `if test -f 'plugins/autopair.c'; then $(CYGPATH_W) 'plugins/autopair.c'; else $(CYGPATH_W) '$(srcdir)/plugins/autopair.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-autopair.Tpo plugins/$(DEPDIR)/bluetoothd-autopair.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/autopair.c' object='plugins/bluetoothd-autopair.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-autopair.obj `if test -f 'plugins/autopair.c'; then $(CYGPATH_W) 'plugins/autopair.c'; else $(CYGPATH_W) '$(srcdir)/plugins/autopair.c'; fi` + +plugins/bluetoothd-dropcam.o: plugins/dropcam.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-dropcam.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-dropcam.Tpo -c -o plugins/bluetoothd-dropcam.o `test -f 'plugins/dropcam.c' || echo '$(srcdir)/'`plugins/dropcam.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-dropcam.Tpo plugins/$(DEPDIR)/bluetoothd-dropcam.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/dropcam.c' object='plugins/bluetoothd-dropcam.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-dropcam.o `test -f 'plugins/dropcam.c' || echo '$(srcdir)/'`plugins/dropcam.c + +plugins/bluetoothd-dropcam.obj: plugins/dropcam.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-dropcam.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-dropcam.Tpo -c -o plugins/bluetoothd-dropcam.obj `if test -f 'plugins/dropcam.c'; then $(CYGPATH_W) 'plugins/dropcam.c'; else $(CYGPATH_W) '$(srcdir)/plugins/dropcam.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-dropcam.Tpo plugins/$(DEPDIR)/bluetoothd-dropcam.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/dropcam.c' object='plugins/bluetoothd-dropcam.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-dropcam.obj `if test -f 'plugins/dropcam.c'; then $(CYGPATH_W) 'plugins/dropcam.c'; else $(CYGPATH_W) '$(srcdir)/plugins/dropcam.c'; fi` + +plugins/bluetoothd-policy.o: plugins/policy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-policy.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-policy.Tpo -c -o plugins/bluetoothd-policy.o `test -f 'plugins/policy.c' || echo '$(srcdir)/'`plugins/policy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-policy.Tpo plugins/$(DEPDIR)/bluetoothd-policy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/policy.c' object='plugins/bluetoothd-policy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-policy.o `test -f 'plugins/policy.c' || echo '$(srcdir)/'`plugins/policy.c + +plugins/bluetoothd-policy.obj: plugins/policy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-policy.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-policy.Tpo -c -o plugins/bluetoothd-policy.obj `if test -f 'plugins/policy.c'; then $(CYGPATH_W) 'plugins/policy.c'; else $(CYGPATH_W) '$(srcdir)/plugins/policy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-policy.Tpo plugins/$(DEPDIR)/bluetoothd-policy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/policy.c' object='plugins/bluetoothd-policy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-policy.obj `if test -f 'plugins/policy.c'; then $(CYGPATH_W) 'plugins/policy.c'; else $(CYGPATH_W) '$(srcdir)/plugins/policy.c'; fi` + +plugins/bluetoothd-gatt-example.o: plugins/gatt-example.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-gatt-example.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-gatt-example.Tpo -c -o plugins/bluetoothd-gatt-example.o `test -f 'plugins/gatt-example.c' || echo '$(srcdir)/'`plugins/gatt-example.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-gatt-example.Tpo plugins/$(DEPDIR)/bluetoothd-gatt-example.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/gatt-example.c' object='plugins/bluetoothd-gatt-example.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-gatt-example.o `test -f 'plugins/gatt-example.c' || echo '$(srcdir)/'`plugins/gatt-example.c + +plugins/bluetoothd-gatt-example.obj: plugins/gatt-example.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-gatt-example.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-gatt-example.Tpo -c -o plugins/bluetoothd-gatt-example.obj `if test -f 'plugins/gatt-example.c'; then $(CYGPATH_W) 'plugins/gatt-example.c'; else $(CYGPATH_W) '$(srcdir)/plugins/gatt-example.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-gatt-example.Tpo plugins/$(DEPDIR)/bluetoothd-gatt-example.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/gatt-example.c' object='plugins/bluetoothd-gatt-example.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-gatt-example.obj `if test -f 'plugins/gatt-example.c'; then $(CYGPATH_W) 'plugins/gatt-example.c'; else $(CYGPATH_W) '$(srcdir)/plugins/gatt-example.c'; fi` + +plugins/bluetoothd-neard.o: plugins/neard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-neard.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-neard.Tpo -c -o plugins/bluetoothd-neard.o `test -f 'plugins/neard.c' || echo '$(srcdir)/'`plugins/neard.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-neard.Tpo plugins/$(DEPDIR)/bluetoothd-neard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/neard.c' object='plugins/bluetoothd-neard.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-neard.o `test -f 'plugins/neard.c' || echo '$(srcdir)/'`plugins/neard.c + +plugins/bluetoothd-neard.obj: plugins/neard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-neard.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-neard.Tpo -c -o plugins/bluetoothd-neard.obj `if test -f 'plugins/neard.c'; then $(CYGPATH_W) 'plugins/neard.c'; else $(CYGPATH_W) '$(srcdir)/plugins/neard.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-neard.Tpo plugins/$(DEPDIR)/bluetoothd-neard.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/neard.c' object='plugins/bluetoothd-neard.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-neard.obj `if test -f 'plugins/neard.c'; then $(CYGPATH_W) 'plugins/neard.c'; else $(CYGPATH_W) '$(srcdir)/plugins/neard.c'; fi` + +profiles/sap/bluetoothd-main.o: profiles/sap/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-main.o -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-main.Tpo -c -o profiles/sap/bluetoothd-main.o `test -f 'profiles/sap/main.c' || echo '$(srcdir)/'`profiles/sap/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-main.Tpo profiles/sap/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/main.c' object='profiles/sap/bluetoothd-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-main.o `test -f 'profiles/sap/main.c' || echo '$(srcdir)/'`profiles/sap/main.c + +profiles/sap/bluetoothd-main.obj: profiles/sap/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-main.obj -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-main.Tpo -c -o profiles/sap/bluetoothd-main.obj `if test -f 'profiles/sap/main.c'; then $(CYGPATH_W) 'profiles/sap/main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-main.Tpo profiles/sap/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/main.c' object='profiles/sap/bluetoothd-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-main.obj `if test -f 'profiles/sap/main.c'; then $(CYGPATH_W) 'profiles/sap/main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/main.c'; fi` + +profiles/sap/bluetoothd-manager.o: profiles/sap/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-manager.o -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/sap/bluetoothd-manager.o `test -f 'profiles/sap/manager.c' || echo '$(srcdir)/'`profiles/sap/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-manager.Tpo profiles/sap/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/manager.c' object='profiles/sap/bluetoothd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-manager.o `test -f 'profiles/sap/manager.c' || echo '$(srcdir)/'`profiles/sap/manager.c + +profiles/sap/bluetoothd-manager.obj: profiles/sap/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-manager.obj -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/sap/bluetoothd-manager.obj `if test -f 'profiles/sap/manager.c'; then $(CYGPATH_W) 'profiles/sap/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-manager.Tpo profiles/sap/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/manager.c' object='profiles/sap/bluetoothd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-manager.obj `if test -f 'profiles/sap/manager.c'; then $(CYGPATH_W) 'profiles/sap/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/manager.c'; fi` + +profiles/sap/bluetoothd-server.o: profiles/sap/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-server.o -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/sap/bluetoothd-server.o `test -f 'profiles/sap/server.c' || echo '$(srcdir)/'`profiles/sap/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-server.Tpo profiles/sap/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/server.c' object='profiles/sap/bluetoothd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-server.o `test -f 'profiles/sap/server.c' || echo '$(srcdir)/'`profiles/sap/server.c + +profiles/sap/bluetoothd-server.obj: profiles/sap/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-server.obj -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/sap/bluetoothd-server.obj `if test -f 'profiles/sap/server.c'; then $(CYGPATH_W) 'profiles/sap/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-server.Tpo profiles/sap/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/server.c' object='profiles/sap/bluetoothd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-server.obj `if test -f 'profiles/sap/server.c'; then $(CYGPATH_W) 'profiles/sap/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/server.c'; fi` + +profiles/sap/bluetoothd-sap-dummy.o: profiles/sap/sap-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-sap-dummy.o -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Tpo -c -o profiles/sap/bluetoothd-sap-dummy.o `test -f 'profiles/sap/sap-dummy.c' || echo '$(srcdir)/'`profiles/sap/sap-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Tpo profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/sap-dummy.c' object='profiles/sap/bluetoothd-sap-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-sap-dummy.o `test -f 'profiles/sap/sap-dummy.c' || echo '$(srcdir)/'`profiles/sap/sap-dummy.c + +profiles/sap/bluetoothd-sap-dummy.obj: profiles/sap/sap-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/sap/bluetoothd-sap-dummy.obj -MD -MP -MF profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Tpo -c -o profiles/sap/bluetoothd-sap-dummy.obj `if test -f 'profiles/sap/sap-dummy.c'; then $(CYGPATH_W) 'profiles/sap/sap-dummy.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/sap-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Tpo profiles/sap/$(DEPDIR)/bluetoothd-sap-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/sap/sap-dummy.c' object='profiles/sap/bluetoothd-sap-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/sap/bluetoothd-sap-dummy.obj `if test -f 'profiles/sap/sap-dummy.c'; then $(CYGPATH_W) 'profiles/sap/sap-dummy.c'; else $(CYGPATH_W) '$(srcdir)/profiles/sap/sap-dummy.c'; fi` + +profiles/audio/bluetoothd-source.o: profiles/audio/source.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-source.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-source.Tpo -c -o profiles/audio/bluetoothd-source.o `test -f 'profiles/audio/source.c' || echo '$(srcdir)/'`profiles/audio/source.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-source.Tpo profiles/audio/$(DEPDIR)/bluetoothd-source.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/source.c' object='profiles/audio/bluetoothd-source.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-source.o `test -f 'profiles/audio/source.c' || echo '$(srcdir)/'`profiles/audio/source.c + +profiles/audio/bluetoothd-source.obj: profiles/audio/source.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-source.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-source.Tpo -c -o profiles/audio/bluetoothd-source.obj `if test -f 'profiles/audio/source.c'; then $(CYGPATH_W) 'profiles/audio/source.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/source.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-source.Tpo profiles/audio/$(DEPDIR)/bluetoothd-source.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/source.c' object='profiles/audio/bluetoothd-source.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-source.obj `if test -f 'profiles/audio/source.c'; then $(CYGPATH_W) 'profiles/audio/source.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/source.c'; fi` + +profiles/audio/bluetoothd-sink.o: profiles/audio/sink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-sink.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-sink.Tpo -c -o profiles/audio/bluetoothd-sink.o `test -f 'profiles/audio/sink.c' || echo '$(srcdir)/'`profiles/audio/sink.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-sink.Tpo profiles/audio/$(DEPDIR)/bluetoothd-sink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/sink.c' object='profiles/audio/bluetoothd-sink.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-sink.o `test -f 'profiles/audio/sink.c' || echo '$(srcdir)/'`profiles/audio/sink.c + +profiles/audio/bluetoothd-sink.obj: profiles/audio/sink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-sink.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-sink.Tpo -c -o profiles/audio/bluetoothd-sink.obj `if test -f 'profiles/audio/sink.c'; then $(CYGPATH_W) 'profiles/audio/sink.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/sink.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-sink.Tpo profiles/audio/$(DEPDIR)/bluetoothd-sink.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/sink.c' object='profiles/audio/bluetoothd-sink.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-sink.obj `if test -f 'profiles/audio/sink.c'; then $(CYGPATH_W) 'profiles/audio/sink.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/sink.c'; fi` + +profiles/audio/bluetoothd-a2dp.o: profiles/audio/a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-a2dp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Tpo -c -o profiles/audio/bluetoothd-a2dp.o `test -f 'profiles/audio/a2dp.c' || echo '$(srcdir)/'`profiles/audio/a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/a2dp.c' object='profiles/audio/bluetoothd-a2dp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-a2dp.o `test -f 'profiles/audio/a2dp.c' || echo '$(srcdir)/'`profiles/audio/a2dp.c + +profiles/audio/bluetoothd-a2dp.obj: profiles/audio/a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-a2dp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Tpo -c -o profiles/audio/bluetoothd-a2dp.obj `if test -f 'profiles/audio/a2dp.c'; then $(CYGPATH_W) 'profiles/audio/a2dp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/a2dp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/a2dp.c' object='profiles/audio/bluetoothd-a2dp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-a2dp.obj `if test -f 'profiles/audio/a2dp.c'; then $(CYGPATH_W) 'profiles/audio/a2dp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/a2dp.c'; fi` + +profiles/audio/bluetoothd-avdtp.o: profiles/audio/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avdtp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Tpo -c -o profiles/audio/bluetoothd-avdtp.o `test -f 'profiles/audio/avdtp.c' || echo '$(srcdir)/'`profiles/audio/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avdtp.c' object='profiles/audio/bluetoothd-avdtp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avdtp.o `test -f 'profiles/audio/avdtp.c' || echo '$(srcdir)/'`profiles/audio/avdtp.c + +profiles/audio/bluetoothd-avdtp.obj: profiles/audio/avdtp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avdtp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Tpo -c -o profiles/audio/bluetoothd-avdtp.obj `if test -f 'profiles/audio/avdtp.c'; then $(CYGPATH_W) 'profiles/audio/avdtp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avdtp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avdtp.c' object='profiles/audio/bluetoothd-avdtp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avdtp.obj `if test -f 'profiles/audio/avdtp.c'; then $(CYGPATH_W) 'profiles/audio/avdtp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avdtp.c'; fi` + +profiles/audio/bluetoothd-media.o: profiles/audio/media.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-media.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-media.Tpo -c -o profiles/audio/bluetoothd-media.o `test -f 'profiles/audio/media.c' || echo '$(srcdir)/'`profiles/audio/media.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-media.Tpo profiles/audio/$(DEPDIR)/bluetoothd-media.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/media.c' object='profiles/audio/bluetoothd-media.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-media.o `test -f 'profiles/audio/media.c' || echo '$(srcdir)/'`profiles/audio/media.c + +profiles/audio/bluetoothd-media.obj: profiles/audio/media.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-media.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-media.Tpo -c -o profiles/audio/bluetoothd-media.obj `if test -f 'profiles/audio/media.c'; then $(CYGPATH_W) 'profiles/audio/media.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/media.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-media.Tpo profiles/audio/$(DEPDIR)/bluetoothd-media.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/media.c' object='profiles/audio/bluetoothd-media.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-media.obj `if test -f 'profiles/audio/media.c'; then $(CYGPATH_W) 'profiles/audio/media.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/media.c'; fi` + +profiles/audio/bluetoothd-transport.o: profiles/audio/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-transport.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-transport.Tpo -c -o profiles/audio/bluetoothd-transport.o `test -f 'profiles/audio/transport.c' || echo '$(srcdir)/'`profiles/audio/transport.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-transport.Tpo profiles/audio/$(DEPDIR)/bluetoothd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/transport.c' object='profiles/audio/bluetoothd-transport.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-transport.o `test -f 'profiles/audio/transport.c' || echo '$(srcdir)/'`profiles/audio/transport.c + +profiles/audio/bluetoothd-transport.obj: profiles/audio/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-transport.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-transport.Tpo -c -o profiles/audio/bluetoothd-transport.obj `if test -f 'profiles/audio/transport.c'; then $(CYGPATH_W) 'profiles/audio/transport.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/transport.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-transport.Tpo profiles/audio/$(DEPDIR)/bluetoothd-transport.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/transport.c' object='profiles/audio/bluetoothd-transport.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-transport.obj `if test -f 'profiles/audio/transport.c'; then $(CYGPATH_W) 'profiles/audio/transport.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/transport.c'; fi` + +profiles/audio/bluetoothd-control.o: profiles/audio/control.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-control.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-control.Tpo -c -o profiles/audio/bluetoothd-control.o `test -f 'profiles/audio/control.c' || echo '$(srcdir)/'`profiles/audio/control.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-control.Tpo profiles/audio/$(DEPDIR)/bluetoothd-control.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/control.c' object='profiles/audio/bluetoothd-control.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-control.o `test -f 'profiles/audio/control.c' || echo '$(srcdir)/'`profiles/audio/control.c + +profiles/audio/bluetoothd-control.obj: profiles/audio/control.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-control.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-control.Tpo -c -o profiles/audio/bluetoothd-control.obj `if test -f 'profiles/audio/control.c'; then $(CYGPATH_W) 'profiles/audio/control.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/control.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-control.Tpo profiles/audio/$(DEPDIR)/bluetoothd-control.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/control.c' object='profiles/audio/bluetoothd-control.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-control.obj `if test -f 'profiles/audio/control.c'; then $(CYGPATH_W) 'profiles/audio/control.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/control.c'; fi` + +profiles/audio/bluetoothd-avctp.o: profiles/audio/avctp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avctp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avctp.Tpo -c -o profiles/audio/bluetoothd-avctp.o `test -f 'profiles/audio/avctp.c' || echo '$(srcdir)/'`profiles/audio/avctp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avctp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avctp.c' object='profiles/audio/bluetoothd-avctp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avctp.o `test -f 'profiles/audio/avctp.c' || echo '$(srcdir)/'`profiles/audio/avctp.c + +profiles/audio/bluetoothd-avctp.obj: profiles/audio/avctp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avctp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avctp.Tpo -c -o profiles/audio/bluetoothd-avctp.obj `if test -f 'profiles/audio/avctp.c'; then $(CYGPATH_W) 'profiles/audio/avctp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avctp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avctp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avctp.c' object='profiles/audio/bluetoothd-avctp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avctp.obj `if test -f 'profiles/audio/avctp.c'; then $(CYGPATH_W) 'profiles/audio/avctp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avctp.c'; fi` + +profiles/audio/bluetoothd-avrcp.o: profiles/audio/avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avrcp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Tpo -c -o profiles/audio/bluetoothd-avrcp.o `test -f 'profiles/audio/avrcp.c' || echo '$(srcdir)/'`profiles/audio/avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avrcp.c' object='profiles/audio/bluetoothd-avrcp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avrcp.o `test -f 'profiles/audio/avrcp.c' || echo '$(srcdir)/'`profiles/audio/avrcp.c + +profiles/audio/bluetoothd-avrcp.obj: profiles/audio/avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-avrcp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Tpo -c -o profiles/audio/bluetoothd-avrcp.obj `if test -f 'profiles/audio/avrcp.c'; then $(CYGPATH_W) 'profiles/audio/avrcp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avrcp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/avrcp.c' object='profiles/audio/bluetoothd-avrcp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-avrcp.obj `if test -f 'profiles/audio/avrcp.c'; then $(CYGPATH_W) 'profiles/audio/avrcp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/avrcp.c'; fi` + +profiles/audio/bluetoothd-player.o: profiles/audio/player.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-player.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-player.Tpo -c -o profiles/audio/bluetoothd-player.o `test -f 'profiles/audio/player.c' || echo '$(srcdir)/'`profiles/audio/player.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-player.Tpo profiles/audio/$(DEPDIR)/bluetoothd-player.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/player.c' object='profiles/audio/bluetoothd-player.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-player.o `test -f 'profiles/audio/player.c' || echo '$(srcdir)/'`profiles/audio/player.c + +profiles/audio/bluetoothd-player.obj: profiles/audio/player.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-player.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-player.Tpo -c -o profiles/audio/bluetoothd-player.obj `if test -f 'profiles/audio/player.c'; then $(CYGPATH_W) 'profiles/audio/player.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/player.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-player.Tpo profiles/audio/$(DEPDIR)/bluetoothd-player.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/player.c' object='profiles/audio/bluetoothd-player.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-player.obj `if test -f 'profiles/audio/player.c'; then $(CYGPATH_W) 'profiles/audio/player.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/player.c'; fi` + +profiles/network/bluetoothd-manager.o: profiles/network/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-manager.o -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/network/bluetoothd-manager.o `test -f 'profiles/network/manager.c' || echo '$(srcdir)/'`profiles/network/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-manager.Tpo profiles/network/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/manager.c' object='profiles/network/bluetoothd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-manager.o `test -f 'profiles/network/manager.c' || echo '$(srcdir)/'`profiles/network/manager.c + +profiles/network/bluetoothd-manager.obj: profiles/network/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-manager.obj -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/network/bluetoothd-manager.obj `if test -f 'profiles/network/manager.c'; then $(CYGPATH_W) 'profiles/network/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-manager.Tpo profiles/network/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/manager.c' object='profiles/network/bluetoothd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-manager.obj `if test -f 'profiles/network/manager.c'; then $(CYGPATH_W) 'profiles/network/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/manager.c'; fi` + +profiles/network/bluetoothd-bnep.o: profiles/network/bnep.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-bnep.o -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-bnep.Tpo -c -o profiles/network/bluetoothd-bnep.o `test -f 'profiles/network/bnep.c' || echo '$(srcdir)/'`profiles/network/bnep.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-bnep.Tpo profiles/network/$(DEPDIR)/bluetoothd-bnep.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/bnep.c' object='profiles/network/bluetoothd-bnep.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-bnep.o `test -f 'profiles/network/bnep.c' || echo '$(srcdir)/'`profiles/network/bnep.c + +profiles/network/bluetoothd-bnep.obj: profiles/network/bnep.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-bnep.obj -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-bnep.Tpo -c -o profiles/network/bluetoothd-bnep.obj `if test -f 'profiles/network/bnep.c'; then $(CYGPATH_W) 'profiles/network/bnep.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/bnep.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-bnep.Tpo profiles/network/$(DEPDIR)/bluetoothd-bnep.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/bnep.c' object='profiles/network/bluetoothd-bnep.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-bnep.obj `if test -f 'profiles/network/bnep.c'; then $(CYGPATH_W) 'profiles/network/bnep.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/bnep.c'; fi` + +profiles/network/bluetoothd-server.o: profiles/network/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-server.o -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/network/bluetoothd-server.o `test -f 'profiles/network/server.c' || echo '$(srcdir)/'`profiles/network/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-server.Tpo profiles/network/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/server.c' object='profiles/network/bluetoothd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-server.o `test -f 'profiles/network/server.c' || echo '$(srcdir)/'`profiles/network/server.c + +profiles/network/bluetoothd-server.obj: profiles/network/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-server.obj -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/network/bluetoothd-server.obj `if test -f 'profiles/network/server.c'; then $(CYGPATH_W) 'profiles/network/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-server.Tpo profiles/network/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/server.c' object='profiles/network/bluetoothd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-server.obj `if test -f 'profiles/network/server.c'; then $(CYGPATH_W) 'profiles/network/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/server.c'; fi` + +profiles/network/bluetoothd-connection.o: profiles/network/connection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-connection.o -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-connection.Tpo -c -o profiles/network/bluetoothd-connection.o `test -f 'profiles/network/connection.c' || echo '$(srcdir)/'`profiles/network/connection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-connection.Tpo profiles/network/$(DEPDIR)/bluetoothd-connection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/connection.c' object='profiles/network/bluetoothd-connection.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-connection.o `test -f 'profiles/network/connection.c' || echo '$(srcdir)/'`profiles/network/connection.c + +profiles/network/bluetoothd-connection.obj: profiles/network/connection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/network/bluetoothd-connection.obj -MD -MP -MF profiles/network/$(DEPDIR)/bluetoothd-connection.Tpo -c -o profiles/network/bluetoothd-connection.obj `if test -f 'profiles/network/connection.c'; then $(CYGPATH_W) 'profiles/network/connection.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/connection.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/network/$(DEPDIR)/bluetoothd-connection.Tpo profiles/network/$(DEPDIR)/bluetoothd-connection.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/network/connection.c' object='profiles/network/bluetoothd-connection.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/network/bluetoothd-connection.obj `if test -f 'profiles/network/connection.c'; then $(CYGPATH_W) 'profiles/network/connection.c'; else $(CYGPATH_W) '$(srcdir)/profiles/network/connection.c'; fi` + +profiles/input/bluetoothd-manager.o: profiles/input/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-manager.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/input/bluetoothd-manager.o `test -f 'profiles/input/manager.c' || echo '$(srcdir)/'`profiles/input/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-manager.Tpo profiles/input/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/manager.c' object='profiles/input/bluetoothd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-manager.o `test -f 'profiles/input/manager.c' || echo '$(srcdir)/'`profiles/input/manager.c + +profiles/input/bluetoothd-manager.obj: profiles/input/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-manager.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/input/bluetoothd-manager.obj `if test -f 'profiles/input/manager.c'; then $(CYGPATH_W) 'profiles/input/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-manager.Tpo profiles/input/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/manager.c' object='profiles/input/bluetoothd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-manager.obj `if test -f 'profiles/input/manager.c'; then $(CYGPATH_W) 'profiles/input/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/manager.c'; fi` + +profiles/input/bluetoothd-server.o: profiles/input/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-server.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/input/bluetoothd-server.o `test -f 'profiles/input/server.c' || echo '$(srcdir)/'`profiles/input/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-server.Tpo profiles/input/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/server.c' object='profiles/input/bluetoothd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-server.o `test -f 'profiles/input/server.c' || echo '$(srcdir)/'`profiles/input/server.c + +profiles/input/bluetoothd-server.obj: profiles/input/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-server.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/input/bluetoothd-server.obj `if test -f 'profiles/input/server.c'; then $(CYGPATH_W) 'profiles/input/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-server.Tpo profiles/input/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/server.c' object='profiles/input/bluetoothd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-server.obj `if test -f 'profiles/input/server.c'; then $(CYGPATH_W) 'profiles/input/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/server.c'; fi` + +profiles/input/bluetoothd-device.o: profiles/input/device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-device.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-device.Tpo -c -o profiles/input/bluetoothd-device.o `test -f 'profiles/input/device.c' || echo '$(srcdir)/'`profiles/input/device.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-device.Tpo profiles/input/$(DEPDIR)/bluetoothd-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/device.c' object='profiles/input/bluetoothd-device.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-device.o `test -f 'profiles/input/device.c' || echo '$(srcdir)/'`profiles/input/device.c + +profiles/input/bluetoothd-device.obj: profiles/input/device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-device.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-device.Tpo -c -o profiles/input/bluetoothd-device.obj `if test -f 'profiles/input/device.c'; then $(CYGPATH_W) 'profiles/input/device.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/device.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-device.Tpo profiles/input/$(DEPDIR)/bluetoothd-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/device.c' object='profiles/input/bluetoothd-device.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-device.obj `if test -f 'profiles/input/device.c'; then $(CYGPATH_W) 'profiles/input/device.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/device.c'; fi` + +profiles/input/bluetoothd-hog.o: profiles/input/hog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-hog.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-hog.Tpo -c -o profiles/input/bluetoothd-hog.o `test -f 'profiles/input/hog.c' || echo '$(srcdir)/'`profiles/input/hog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-hog.Tpo profiles/input/$(DEPDIR)/bluetoothd-hog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/hog.c' object='profiles/input/bluetoothd-hog.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-hog.o `test -f 'profiles/input/hog.c' || echo '$(srcdir)/'`profiles/input/hog.c + +profiles/input/bluetoothd-hog.obj: profiles/input/hog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-hog.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-hog.Tpo -c -o profiles/input/bluetoothd-hog.obj `if test -f 'profiles/input/hog.c'; then $(CYGPATH_W) 'profiles/input/hog.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/hog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-hog.Tpo profiles/input/$(DEPDIR)/bluetoothd-hog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/hog.c' object='profiles/input/bluetoothd-hog.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-hog.obj `if test -f 'profiles/input/hog.c'; then $(CYGPATH_W) 'profiles/input/hog.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/hog.c'; fi` + +profiles/input/bluetoothd-suspend-dummy.o: profiles/input/suspend-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-suspend-dummy.o -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-suspend-dummy.Tpo -c -o profiles/input/bluetoothd-suspend-dummy.o `test -f 'profiles/input/suspend-dummy.c' || echo '$(srcdir)/'`profiles/input/suspend-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-suspend-dummy.Tpo profiles/input/$(DEPDIR)/bluetoothd-suspend-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/suspend-dummy.c' object='profiles/input/bluetoothd-suspend-dummy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-suspend-dummy.o `test -f 'profiles/input/suspend-dummy.c' || echo '$(srcdir)/'`profiles/input/suspend-dummy.c + +profiles/input/bluetoothd-suspend-dummy.obj: profiles/input/suspend-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/input/bluetoothd-suspend-dummy.obj -MD -MP -MF profiles/input/$(DEPDIR)/bluetoothd-suspend-dummy.Tpo -c -o profiles/input/bluetoothd-suspend-dummy.obj `if test -f 'profiles/input/suspend-dummy.c'; then $(CYGPATH_W) 'profiles/input/suspend-dummy.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/suspend-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/input/$(DEPDIR)/bluetoothd-suspend-dummy.Tpo profiles/input/$(DEPDIR)/bluetoothd-suspend-dummy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/input/suspend-dummy.c' object='profiles/input/bluetoothd-suspend-dummy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/input/bluetoothd-suspend-dummy.obj `if test -f 'profiles/input/suspend-dummy.c'; then $(CYGPATH_W) 'profiles/input/suspend-dummy.c'; else $(CYGPATH_W) '$(srcdir)/profiles/input/suspend-dummy.c'; fi` + +profiles/health/bluetoothd-mcap.o: profiles/health/mcap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-mcap.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-mcap.Tpo -c -o profiles/health/bluetoothd-mcap.o `test -f 'profiles/health/mcap.c' || echo '$(srcdir)/'`profiles/health/mcap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-mcap.Tpo profiles/health/$(DEPDIR)/bluetoothd-mcap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/mcap.c' object='profiles/health/bluetoothd-mcap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-mcap.o `test -f 'profiles/health/mcap.c' || echo '$(srcdir)/'`profiles/health/mcap.c + +profiles/health/bluetoothd-mcap.obj: profiles/health/mcap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-mcap.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-mcap.Tpo -c -o profiles/health/bluetoothd-mcap.obj `if test -f 'profiles/health/mcap.c'; then $(CYGPATH_W) 'profiles/health/mcap.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/mcap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-mcap.Tpo profiles/health/$(DEPDIR)/bluetoothd-mcap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/mcap.c' object='profiles/health/bluetoothd-mcap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-mcap.obj `if test -f 'profiles/health/mcap.c'; then $(CYGPATH_W) 'profiles/health/mcap.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/mcap.c'; fi` + +profiles/health/bluetoothd-mcap_sync.o: profiles/health/mcap_sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-mcap_sync.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-mcap_sync.Tpo -c -o profiles/health/bluetoothd-mcap_sync.o `test -f 'profiles/health/mcap_sync.c' || echo '$(srcdir)/'`profiles/health/mcap_sync.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-mcap_sync.Tpo profiles/health/$(DEPDIR)/bluetoothd-mcap_sync.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/mcap_sync.c' object='profiles/health/bluetoothd-mcap_sync.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-mcap_sync.o `test -f 'profiles/health/mcap_sync.c' || echo '$(srcdir)/'`profiles/health/mcap_sync.c + +profiles/health/bluetoothd-mcap_sync.obj: profiles/health/mcap_sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-mcap_sync.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-mcap_sync.Tpo -c -o profiles/health/bluetoothd-mcap_sync.obj `if test -f 'profiles/health/mcap_sync.c'; then $(CYGPATH_W) 'profiles/health/mcap_sync.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/mcap_sync.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-mcap_sync.Tpo profiles/health/$(DEPDIR)/bluetoothd-mcap_sync.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/mcap_sync.c' object='profiles/health/bluetoothd-mcap_sync.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-mcap_sync.obj `if test -f 'profiles/health/mcap_sync.c'; then $(CYGPATH_W) 'profiles/health/mcap_sync.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/mcap_sync.c'; fi` + +profiles/health/bluetoothd-hdp_main.o: profiles/health/hdp_main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_main.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Tpo -c -o profiles/health/bluetoothd-hdp_main.o `test -f 'profiles/health/hdp_main.c' || echo '$(srcdir)/'`profiles/health/hdp_main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_main.c' object='profiles/health/bluetoothd-hdp_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_main.o `test -f 'profiles/health/hdp_main.c' || echo '$(srcdir)/'`profiles/health/hdp_main.c + +profiles/health/bluetoothd-hdp_main.obj: profiles/health/hdp_main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_main.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Tpo -c -o profiles/health/bluetoothd-hdp_main.obj `if test -f 'profiles/health/hdp_main.c'; then $(CYGPATH_W) 'profiles/health/hdp_main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_main.c' object='profiles/health/bluetoothd-hdp_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_main.obj `if test -f 'profiles/health/hdp_main.c'; then $(CYGPATH_W) 'profiles/health/hdp_main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_main.c'; fi` + +profiles/health/bluetoothd-hdp_manager.o: profiles/health/hdp_manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_manager.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Tpo -c -o profiles/health/bluetoothd-hdp_manager.o `test -f 'profiles/health/hdp_manager.c' || echo '$(srcdir)/'`profiles/health/hdp_manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_manager.c' object='profiles/health/bluetoothd-hdp_manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_manager.o `test -f 'profiles/health/hdp_manager.c' || echo '$(srcdir)/'`profiles/health/hdp_manager.c + +profiles/health/bluetoothd-hdp_manager.obj: profiles/health/hdp_manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_manager.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Tpo -c -o profiles/health/bluetoothd-hdp_manager.obj `if test -f 'profiles/health/hdp_manager.c'; then $(CYGPATH_W) 'profiles/health/hdp_manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_manager.c' object='profiles/health/bluetoothd-hdp_manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_manager.obj `if test -f 'profiles/health/hdp_manager.c'; then $(CYGPATH_W) 'profiles/health/hdp_manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_manager.c'; fi` + +profiles/health/bluetoothd-hdp.o: profiles/health/hdp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp.Tpo -c -o profiles/health/bluetoothd-hdp.o `test -f 'profiles/health/hdp.c' || echo '$(srcdir)/'`profiles/health/hdp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp.c' object='profiles/health/bluetoothd-hdp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp.o `test -f 'profiles/health/hdp.c' || echo '$(srcdir)/'`profiles/health/hdp.c + +profiles/health/bluetoothd-hdp.obj: profiles/health/hdp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp.Tpo -c -o profiles/health/bluetoothd-hdp.obj `if test -f 'profiles/health/hdp.c'; then $(CYGPATH_W) 'profiles/health/hdp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp.c' object='profiles/health/bluetoothd-hdp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp.obj `if test -f 'profiles/health/hdp.c'; then $(CYGPATH_W) 'profiles/health/hdp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp.c'; fi` + +profiles/health/bluetoothd-hdp_util.o: profiles/health/hdp_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_util.o -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Tpo -c -o profiles/health/bluetoothd-hdp_util.o `test -f 'profiles/health/hdp_util.c' || echo '$(srcdir)/'`profiles/health/hdp_util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_util.c' object='profiles/health/bluetoothd-hdp_util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_util.o `test -f 'profiles/health/hdp_util.c' || echo '$(srcdir)/'`profiles/health/hdp_util.c + +profiles/health/bluetoothd-hdp_util.obj: profiles/health/hdp_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/health/bluetoothd-hdp_util.obj -MD -MP -MF profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Tpo -c -o profiles/health/bluetoothd-hdp_util.obj `if test -f 'profiles/health/hdp_util.c'; then $(CYGPATH_W) 'profiles/health/hdp_util.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Tpo profiles/health/$(DEPDIR)/bluetoothd-hdp_util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/health/hdp_util.c' object='profiles/health/bluetoothd-hdp_util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/health/bluetoothd-hdp_util.obj `if test -f 'profiles/health/hdp_util.c'; then $(CYGPATH_W) 'profiles/health/hdp_util.c'; else $(CYGPATH_W) '$(srcdir)/profiles/health/hdp_util.c'; fi` + +profiles/gatt/bluetoothd-gas.o: profiles/gatt/gas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/gatt/bluetoothd-gas.o -MD -MP -MF profiles/gatt/$(DEPDIR)/bluetoothd-gas.Tpo -c -o profiles/gatt/bluetoothd-gas.o `test -f 'profiles/gatt/gas.c' || echo '$(srcdir)/'`profiles/gatt/gas.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/gatt/$(DEPDIR)/bluetoothd-gas.Tpo profiles/gatt/$(DEPDIR)/bluetoothd-gas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/gatt/gas.c' object='profiles/gatt/bluetoothd-gas.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/gatt/bluetoothd-gas.o `test -f 'profiles/gatt/gas.c' || echo '$(srcdir)/'`profiles/gatt/gas.c + +profiles/gatt/bluetoothd-gas.obj: profiles/gatt/gas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/gatt/bluetoothd-gas.obj -MD -MP -MF profiles/gatt/$(DEPDIR)/bluetoothd-gas.Tpo -c -o profiles/gatt/bluetoothd-gas.obj `if test -f 'profiles/gatt/gas.c'; then $(CYGPATH_W) 'profiles/gatt/gas.c'; else $(CYGPATH_W) '$(srcdir)/profiles/gatt/gas.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/gatt/$(DEPDIR)/bluetoothd-gas.Tpo profiles/gatt/$(DEPDIR)/bluetoothd-gas.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/gatt/gas.c' object='profiles/gatt/bluetoothd-gas.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/gatt/bluetoothd-gas.obj `if test -f 'profiles/gatt/gas.c'; then $(CYGPATH_W) 'profiles/gatt/gas.c'; else $(CYGPATH_W) '$(srcdir)/profiles/gatt/gas.c'; fi` + +profiles/scanparam/bluetoothd-scan.o: profiles/scanparam/scan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/scanparam/bluetoothd-scan.o -MD -MP -MF profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Tpo -c -o profiles/scanparam/bluetoothd-scan.o `test -f 'profiles/scanparam/scan.c' || echo '$(srcdir)/'`profiles/scanparam/scan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Tpo profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/scanparam/scan.c' object='profiles/scanparam/bluetoothd-scan.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/scanparam/bluetoothd-scan.o `test -f 'profiles/scanparam/scan.c' || echo '$(srcdir)/'`profiles/scanparam/scan.c + +profiles/scanparam/bluetoothd-scan.obj: profiles/scanparam/scan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/scanparam/bluetoothd-scan.obj -MD -MP -MF profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Tpo -c -o profiles/scanparam/bluetoothd-scan.obj `if test -f 'profiles/scanparam/scan.c'; then $(CYGPATH_W) 'profiles/scanparam/scan.c'; else $(CYGPATH_W) '$(srcdir)/profiles/scanparam/scan.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Tpo profiles/scanparam/$(DEPDIR)/bluetoothd-scan.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/scanparam/scan.c' object='profiles/scanparam/bluetoothd-scan.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/scanparam/bluetoothd-scan.obj `if test -f 'profiles/scanparam/scan.c'; then $(CYGPATH_W) 'profiles/scanparam/scan.c'; else $(CYGPATH_W) '$(srcdir)/profiles/scanparam/scan.c'; fi` + +profiles/deviceinfo/bluetoothd-deviceinfo.o: profiles/deviceinfo/deviceinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/deviceinfo/bluetoothd-deviceinfo.o -MD -MP -MF profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Tpo -c -o profiles/deviceinfo/bluetoothd-deviceinfo.o `test -f 'profiles/deviceinfo/deviceinfo.c' || echo '$(srcdir)/'`profiles/deviceinfo/deviceinfo.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Tpo profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/deviceinfo/deviceinfo.c' object='profiles/deviceinfo/bluetoothd-deviceinfo.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/deviceinfo/bluetoothd-deviceinfo.o `test -f 'profiles/deviceinfo/deviceinfo.c' || echo '$(srcdir)/'`profiles/deviceinfo/deviceinfo.c + +profiles/deviceinfo/bluetoothd-deviceinfo.obj: profiles/deviceinfo/deviceinfo.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/deviceinfo/bluetoothd-deviceinfo.obj -MD -MP -MF profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Tpo -c -o profiles/deviceinfo/bluetoothd-deviceinfo.obj `if test -f 'profiles/deviceinfo/deviceinfo.c'; then $(CYGPATH_W) 'profiles/deviceinfo/deviceinfo.c'; else $(CYGPATH_W) '$(srcdir)/profiles/deviceinfo/deviceinfo.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Tpo profiles/deviceinfo/$(DEPDIR)/bluetoothd-deviceinfo.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/deviceinfo/deviceinfo.c' object='profiles/deviceinfo/bluetoothd-deviceinfo.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/deviceinfo/bluetoothd-deviceinfo.obj `if test -f 'profiles/deviceinfo/deviceinfo.c'; then $(CYGPATH_W) 'profiles/deviceinfo/deviceinfo.c'; else $(CYGPATH_W) '$(srcdir)/profiles/deviceinfo/deviceinfo.c'; fi` + +profiles/alert/bluetoothd-server.o: profiles/alert/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/alert/bluetoothd-server.o -MD -MP -MF profiles/alert/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/alert/bluetoothd-server.o `test -f 'profiles/alert/server.c' || echo '$(srcdir)/'`profiles/alert/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/alert/$(DEPDIR)/bluetoothd-server.Tpo profiles/alert/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/alert/server.c' object='profiles/alert/bluetoothd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/alert/bluetoothd-server.o `test -f 'profiles/alert/server.c' || echo '$(srcdir)/'`profiles/alert/server.c + +profiles/alert/bluetoothd-server.obj: profiles/alert/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/alert/bluetoothd-server.obj -MD -MP -MF profiles/alert/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/alert/bluetoothd-server.obj `if test -f 'profiles/alert/server.c'; then $(CYGPATH_W) 'profiles/alert/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/alert/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/alert/$(DEPDIR)/bluetoothd-server.Tpo profiles/alert/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/alert/server.c' object='profiles/alert/bluetoothd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/alert/bluetoothd-server.obj `if test -f 'profiles/alert/server.c'; then $(CYGPATH_W) 'profiles/alert/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/alert/server.c'; fi` + +profiles/time/bluetoothd-server.o: profiles/time/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/time/bluetoothd-server.o -MD -MP -MF profiles/time/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/time/bluetoothd-server.o `test -f 'profiles/time/server.c' || echo '$(srcdir)/'`profiles/time/server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/time/$(DEPDIR)/bluetoothd-server.Tpo profiles/time/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/time/server.c' object='profiles/time/bluetoothd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/time/bluetoothd-server.o `test -f 'profiles/time/server.c' || echo '$(srcdir)/'`profiles/time/server.c + +profiles/time/bluetoothd-server.obj: profiles/time/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/time/bluetoothd-server.obj -MD -MP -MF profiles/time/$(DEPDIR)/bluetoothd-server.Tpo -c -o profiles/time/bluetoothd-server.obj `if test -f 'profiles/time/server.c'; then $(CYGPATH_W) 'profiles/time/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/time/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/time/$(DEPDIR)/bluetoothd-server.Tpo profiles/time/$(DEPDIR)/bluetoothd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/time/server.c' object='profiles/time/bluetoothd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/time/bluetoothd-server.obj `if test -f 'profiles/time/server.c'; then $(CYGPATH_W) 'profiles/time/server.c'; else $(CYGPATH_W) '$(srcdir)/profiles/time/server.c'; fi` + +profiles/proximity/bluetoothd-main.o: profiles/proximity/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-main.o -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-main.Tpo -c -o profiles/proximity/bluetoothd-main.o `test -f 'profiles/proximity/main.c' || echo '$(srcdir)/'`profiles/proximity/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-main.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/main.c' object='profiles/proximity/bluetoothd-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-main.o `test -f 'profiles/proximity/main.c' || echo '$(srcdir)/'`profiles/proximity/main.c + +profiles/proximity/bluetoothd-main.obj: profiles/proximity/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-main.obj -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-main.Tpo -c -o profiles/proximity/bluetoothd-main.obj `if test -f 'profiles/proximity/main.c'; then $(CYGPATH_W) 'profiles/proximity/main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-main.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/main.c' object='profiles/proximity/bluetoothd-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-main.obj `if test -f 'profiles/proximity/main.c'; then $(CYGPATH_W) 'profiles/proximity/main.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/main.c'; fi` + +profiles/proximity/bluetoothd-manager.o: profiles/proximity/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-manager.o -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/proximity/bluetoothd-manager.o `test -f 'profiles/proximity/manager.c' || echo '$(srcdir)/'`profiles/proximity/manager.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-manager.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/manager.c' object='profiles/proximity/bluetoothd-manager.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-manager.o `test -f 'profiles/proximity/manager.c' || echo '$(srcdir)/'`profiles/proximity/manager.c + +profiles/proximity/bluetoothd-manager.obj: profiles/proximity/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-manager.obj -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-manager.Tpo -c -o profiles/proximity/bluetoothd-manager.obj `if test -f 'profiles/proximity/manager.c'; then $(CYGPATH_W) 'profiles/proximity/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-manager.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-manager.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/manager.c' object='profiles/proximity/bluetoothd-manager.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-manager.obj `if test -f 'profiles/proximity/manager.c'; then $(CYGPATH_W) 'profiles/proximity/manager.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/manager.c'; fi` + +profiles/proximity/bluetoothd-monitor.o: profiles/proximity/monitor.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-monitor.o -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-monitor.Tpo -c -o profiles/proximity/bluetoothd-monitor.o `test -f 'profiles/proximity/monitor.c' || echo '$(srcdir)/'`profiles/proximity/monitor.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-monitor.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-monitor.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/monitor.c' object='profiles/proximity/bluetoothd-monitor.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-monitor.o `test -f 'profiles/proximity/monitor.c' || echo '$(srcdir)/'`profiles/proximity/monitor.c + +profiles/proximity/bluetoothd-monitor.obj: profiles/proximity/monitor.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-monitor.obj -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-monitor.Tpo -c -o profiles/proximity/bluetoothd-monitor.obj `if test -f 'profiles/proximity/monitor.c'; then $(CYGPATH_W) 'profiles/proximity/monitor.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/monitor.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-monitor.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-monitor.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/monitor.c' object='profiles/proximity/bluetoothd-monitor.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-monitor.obj `if test -f 'profiles/proximity/monitor.c'; then $(CYGPATH_W) 'profiles/proximity/monitor.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/monitor.c'; fi` + +profiles/proximity/bluetoothd-reporter.o: profiles/proximity/reporter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-reporter.o -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-reporter.Tpo -c -o profiles/proximity/bluetoothd-reporter.o `test -f 'profiles/proximity/reporter.c' || echo '$(srcdir)/'`profiles/proximity/reporter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-reporter.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-reporter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/reporter.c' object='profiles/proximity/bluetoothd-reporter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-reporter.o `test -f 'profiles/proximity/reporter.c' || echo '$(srcdir)/'`profiles/proximity/reporter.c + +profiles/proximity/bluetoothd-reporter.obj: profiles/proximity/reporter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-reporter.obj -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-reporter.Tpo -c -o profiles/proximity/bluetoothd-reporter.obj `if test -f 'profiles/proximity/reporter.c'; then $(CYGPATH_W) 'profiles/proximity/reporter.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/reporter.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-reporter.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-reporter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/reporter.c' object='profiles/proximity/bluetoothd-reporter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-reporter.obj `if test -f 'profiles/proximity/reporter.c'; then $(CYGPATH_W) 'profiles/proximity/reporter.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/reporter.c'; fi` + +profiles/proximity/bluetoothd-linkloss.o: profiles/proximity/linkloss.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-linkloss.o -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-linkloss.Tpo -c -o profiles/proximity/bluetoothd-linkloss.o `test -f 'profiles/proximity/linkloss.c' || echo '$(srcdir)/'`profiles/proximity/linkloss.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-linkloss.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-linkloss.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/linkloss.c' object='profiles/proximity/bluetoothd-linkloss.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-linkloss.o `test -f 'profiles/proximity/linkloss.c' || echo '$(srcdir)/'`profiles/proximity/linkloss.c + +profiles/proximity/bluetoothd-linkloss.obj: profiles/proximity/linkloss.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-linkloss.obj -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-linkloss.Tpo -c -o profiles/proximity/bluetoothd-linkloss.obj `if test -f 'profiles/proximity/linkloss.c'; then $(CYGPATH_W) 'profiles/proximity/linkloss.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/linkloss.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-linkloss.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-linkloss.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/linkloss.c' object='profiles/proximity/bluetoothd-linkloss.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-linkloss.obj `if test -f 'profiles/proximity/linkloss.c'; then $(CYGPATH_W) 'profiles/proximity/linkloss.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/linkloss.c'; fi` + +profiles/proximity/bluetoothd-immalert.o: profiles/proximity/immalert.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-immalert.o -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-immalert.Tpo -c -o profiles/proximity/bluetoothd-immalert.o `test -f 'profiles/proximity/immalert.c' || echo '$(srcdir)/'`profiles/proximity/immalert.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-immalert.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-immalert.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/immalert.c' object='profiles/proximity/bluetoothd-immalert.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-immalert.o `test -f 'profiles/proximity/immalert.c' || echo '$(srcdir)/'`profiles/proximity/immalert.c + +profiles/proximity/bluetoothd-immalert.obj: profiles/proximity/immalert.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/proximity/bluetoothd-immalert.obj -MD -MP -MF profiles/proximity/$(DEPDIR)/bluetoothd-immalert.Tpo -c -o profiles/proximity/bluetoothd-immalert.obj `if test -f 'profiles/proximity/immalert.c'; then $(CYGPATH_W) 'profiles/proximity/immalert.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/immalert.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/proximity/$(DEPDIR)/bluetoothd-immalert.Tpo profiles/proximity/$(DEPDIR)/bluetoothd-immalert.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/proximity/immalert.c' object='profiles/proximity/bluetoothd-immalert.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/proximity/bluetoothd-immalert.obj `if test -f 'profiles/proximity/immalert.c'; then $(CYGPATH_W) 'profiles/proximity/immalert.c'; else $(CYGPATH_W) '$(srcdir)/profiles/proximity/immalert.c'; fi` + +profiles/thermometer/bluetoothd-thermometer.o: profiles/thermometer/thermometer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/thermometer/bluetoothd-thermometer.o -MD -MP -MF profiles/thermometer/$(DEPDIR)/bluetoothd-thermometer.Tpo -c -o profiles/thermometer/bluetoothd-thermometer.o `test -f 'profiles/thermometer/thermometer.c' || echo '$(srcdir)/'`profiles/thermometer/thermometer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/thermometer/$(DEPDIR)/bluetoothd-thermometer.Tpo profiles/thermometer/$(DEPDIR)/bluetoothd-thermometer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/thermometer/thermometer.c' object='profiles/thermometer/bluetoothd-thermometer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/thermometer/bluetoothd-thermometer.o `test -f 'profiles/thermometer/thermometer.c' || echo '$(srcdir)/'`profiles/thermometer/thermometer.c + +profiles/thermometer/bluetoothd-thermometer.obj: profiles/thermometer/thermometer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/thermometer/bluetoothd-thermometer.obj -MD -MP -MF profiles/thermometer/$(DEPDIR)/bluetoothd-thermometer.Tpo -c -o profiles/thermometer/bluetoothd-thermometer.obj `if test -f 'profiles/thermometer/thermometer.c'; then $(CYGPATH_W) 'profiles/thermometer/thermometer.c'; else $(CYGPATH_W) '$(srcdir)/profiles/thermometer/thermometer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/thermometer/$(DEPDIR)/bluetoothd-thermometer.Tpo profiles/thermometer/$(DEPDIR)/bluetoothd-thermometer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/thermometer/thermometer.c' object='profiles/thermometer/bluetoothd-thermometer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/thermometer/bluetoothd-thermometer.obj `if test -f 'profiles/thermometer/thermometer.c'; then $(CYGPATH_W) 'profiles/thermometer/thermometer.c'; else $(CYGPATH_W) '$(srcdir)/profiles/thermometer/thermometer.c'; fi` + +profiles/heartrate/bluetoothd-heartrate.o: profiles/heartrate/heartrate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/heartrate/bluetoothd-heartrate.o -MD -MP -MF profiles/heartrate/$(DEPDIR)/bluetoothd-heartrate.Tpo -c -o profiles/heartrate/bluetoothd-heartrate.o `test -f 'profiles/heartrate/heartrate.c' || echo '$(srcdir)/'`profiles/heartrate/heartrate.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/heartrate/$(DEPDIR)/bluetoothd-heartrate.Tpo profiles/heartrate/$(DEPDIR)/bluetoothd-heartrate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/heartrate/heartrate.c' object='profiles/heartrate/bluetoothd-heartrate.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/heartrate/bluetoothd-heartrate.o `test -f 'profiles/heartrate/heartrate.c' || echo '$(srcdir)/'`profiles/heartrate/heartrate.c + +profiles/heartrate/bluetoothd-heartrate.obj: profiles/heartrate/heartrate.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/heartrate/bluetoothd-heartrate.obj -MD -MP -MF profiles/heartrate/$(DEPDIR)/bluetoothd-heartrate.Tpo -c -o profiles/heartrate/bluetoothd-heartrate.obj `if test -f 'profiles/heartrate/heartrate.c'; then $(CYGPATH_W) 'profiles/heartrate/heartrate.c'; else $(CYGPATH_W) '$(srcdir)/profiles/heartrate/heartrate.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/heartrate/$(DEPDIR)/bluetoothd-heartrate.Tpo profiles/heartrate/$(DEPDIR)/bluetoothd-heartrate.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/heartrate/heartrate.c' object='profiles/heartrate/bluetoothd-heartrate.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/heartrate/bluetoothd-heartrate.obj `if test -f 'profiles/heartrate/heartrate.c'; then $(CYGPATH_W) 'profiles/heartrate/heartrate.c'; else $(CYGPATH_W) '$(srcdir)/profiles/heartrate/heartrate.c'; fi` + +profiles/cyclingspeed/bluetoothd-cyclingspeed.o: profiles/cyclingspeed/cyclingspeed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/cyclingspeed/bluetoothd-cyclingspeed.o -MD -MP -MF profiles/cyclingspeed/$(DEPDIR)/bluetoothd-cyclingspeed.Tpo -c -o profiles/cyclingspeed/bluetoothd-cyclingspeed.o `test -f 'profiles/cyclingspeed/cyclingspeed.c' || echo '$(srcdir)/'`profiles/cyclingspeed/cyclingspeed.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/cyclingspeed/$(DEPDIR)/bluetoothd-cyclingspeed.Tpo profiles/cyclingspeed/$(DEPDIR)/bluetoothd-cyclingspeed.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/cyclingspeed/cyclingspeed.c' object='profiles/cyclingspeed/bluetoothd-cyclingspeed.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/cyclingspeed/bluetoothd-cyclingspeed.o `test -f 'profiles/cyclingspeed/cyclingspeed.c' || echo '$(srcdir)/'`profiles/cyclingspeed/cyclingspeed.c + +profiles/cyclingspeed/bluetoothd-cyclingspeed.obj: profiles/cyclingspeed/cyclingspeed.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT profiles/cyclingspeed/bluetoothd-cyclingspeed.obj -MD -MP -MF profiles/cyclingspeed/$(DEPDIR)/bluetoothd-cyclingspeed.Tpo -c -o profiles/cyclingspeed/bluetoothd-cyclingspeed.obj `if test -f 'profiles/cyclingspeed/cyclingspeed.c'; then $(CYGPATH_W) 'profiles/cyclingspeed/cyclingspeed.c'; else $(CYGPATH_W) '$(srcdir)/profiles/cyclingspeed/cyclingspeed.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/cyclingspeed/$(DEPDIR)/bluetoothd-cyclingspeed.Tpo profiles/cyclingspeed/$(DEPDIR)/bluetoothd-cyclingspeed.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/cyclingspeed/cyclingspeed.c' object='profiles/cyclingspeed/bluetoothd-cyclingspeed.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o profiles/cyclingspeed/bluetoothd-cyclingspeed.obj `if test -f 'profiles/cyclingspeed/cyclingspeed.c'; then $(CYGPATH_W) 'profiles/cyclingspeed/cyclingspeed.c'; else $(CYGPATH_W) '$(srcdir)/profiles/cyclingspeed/cyclingspeed.c'; fi` + +attrib/bluetoothd-att.o: attrib/att.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-att.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-att.Tpo -c -o attrib/bluetoothd-att.o `test -f 'attrib/att.c' || echo '$(srcdir)/'`attrib/att.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-att.Tpo attrib/$(DEPDIR)/bluetoothd-att.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/att.c' object='attrib/bluetoothd-att.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-att.o `test -f 'attrib/att.c' || echo '$(srcdir)/'`attrib/att.c + +attrib/bluetoothd-att.obj: attrib/att.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-att.obj -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-att.Tpo -c -o attrib/bluetoothd-att.obj `if test -f 'attrib/att.c'; then $(CYGPATH_W) 'attrib/att.c'; else $(CYGPATH_W) '$(srcdir)/attrib/att.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-att.Tpo attrib/$(DEPDIR)/bluetoothd-att.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/att.c' object='attrib/bluetoothd-att.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-att.obj `if test -f 'attrib/att.c'; then $(CYGPATH_W) 'attrib/att.c'; else $(CYGPATH_W) '$(srcdir)/attrib/att.c'; fi` + +attrib/bluetoothd-gatt.o: attrib/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gatt.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gatt.Tpo -c -o attrib/bluetoothd-gatt.o `test -f 'attrib/gatt.c' || echo '$(srcdir)/'`attrib/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gatt.Tpo attrib/$(DEPDIR)/bluetoothd-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gatt.c' object='attrib/bluetoothd-gatt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gatt.o `test -f 'attrib/gatt.c' || echo '$(srcdir)/'`attrib/gatt.c + +attrib/bluetoothd-gatt.obj: attrib/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gatt.obj -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gatt.Tpo -c -o attrib/bluetoothd-gatt.obj `if test -f 'attrib/gatt.c'; then $(CYGPATH_W) 'attrib/gatt.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gatt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gatt.Tpo attrib/$(DEPDIR)/bluetoothd-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gatt.c' object='attrib/bluetoothd-gatt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gatt.obj `if test -f 'attrib/gatt.c'; then $(CYGPATH_W) 'attrib/gatt.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gatt.c'; fi` + +attrib/bluetoothd-gattrib.o: attrib/gattrib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gattrib.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gattrib.Tpo -c -o attrib/bluetoothd-gattrib.o `test -f 'attrib/gattrib.c' || echo '$(srcdir)/'`attrib/gattrib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gattrib.Tpo attrib/$(DEPDIR)/bluetoothd-gattrib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gattrib.c' object='attrib/bluetoothd-gattrib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gattrib.o `test -f 'attrib/gattrib.c' || echo '$(srcdir)/'`attrib/gattrib.c + +attrib/bluetoothd-gattrib.obj: attrib/gattrib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gattrib.obj -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gattrib.Tpo -c -o attrib/bluetoothd-gattrib.obj `if test -f 'attrib/gattrib.c'; then $(CYGPATH_W) 'attrib/gattrib.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gattrib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gattrib.Tpo attrib/$(DEPDIR)/bluetoothd-gattrib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gattrib.c' object='attrib/bluetoothd-gattrib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gattrib.obj `if test -f 'attrib/gattrib.c'; then $(CYGPATH_W) 'attrib/gattrib.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gattrib.c'; fi` + +attrib/bluetoothd-gatt-service.o: attrib/gatt-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gatt-service.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gatt-service.Tpo -c -o attrib/bluetoothd-gatt-service.o `test -f 'attrib/gatt-service.c' || echo '$(srcdir)/'`attrib/gatt-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gatt-service.Tpo attrib/$(DEPDIR)/bluetoothd-gatt-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gatt-service.c' object='attrib/bluetoothd-gatt-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gatt-service.o `test -f 'attrib/gatt-service.c' || echo '$(srcdir)/'`attrib/gatt-service.c + +attrib/bluetoothd-gatt-service.obj: attrib/gatt-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-gatt-service.obj -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-gatt-service.Tpo -c -o attrib/bluetoothd-gatt-service.obj `if test -f 'attrib/gatt-service.c'; then $(CYGPATH_W) 'attrib/gatt-service.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gatt-service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-gatt-service.Tpo attrib/$(DEPDIR)/bluetoothd-gatt-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attrib/gatt-service.c' object='attrib/bluetoothd-gatt-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o attrib/bluetoothd-gatt-service.obj `if test -f 'attrib/gatt-service.c'; then $(CYGPATH_W) 'attrib/gatt-service.c'; else $(CYGPATH_W) '$(srcdir)/attrib/gatt-service.c'; fi` + +btio/bluetoothd-btio.o: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT btio/bluetoothd-btio.o -MD -MP -MF btio/$(DEPDIR)/bluetoothd-btio.Tpo -c -o btio/bluetoothd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/bluetoothd-btio.Tpo btio/$(DEPDIR)/bluetoothd-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/bluetoothd-btio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o btio/bluetoothd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c + +btio/bluetoothd-btio.obj: btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT btio/bluetoothd-btio.obj -MD -MP -MF btio/$(DEPDIR)/bluetoothd-btio.Tpo -c -o btio/bluetoothd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/bluetoothd-btio.Tpo btio/$(DEPDIR)/bluetoothd-btio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/bluetoothd-btio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o btio/bluetoothd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` + +src/bluetoothd-main.o: src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-main.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-main.Tpo -c -o src/bluetoothd-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-main.Tpo src/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/bluetoothd-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c + +src/bluetoothd-main.obj: src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-main.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-main.Tpo -c -o src/bluetoothd-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-main.Tpo src/$(DEPDIR)/bluetoothd-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/bluetoothd-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` + +src/bluetoothd-log.o: src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-log.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-log.Tpo -c -o src/bluetoothd-log.o `test -f 'src/log.c' || echo '$(srcdir)/'`src/log.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-log.Tpo src/$(DEPDIR)/bluetoothd-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/log.c' object='src/bluetoothd-log.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-log.o `test -f 'src/log.c' || echo '$(srcdir)/'`src/log.c + +src/bluetoothd-log.obj: src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-log.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-log.Tpo -c -o src/bluetoothd-log.obj `if test -f 'src/log.c'; then $(CYGPATH_W) 'src/log.c'; else $(CYGPATH_W) '$(srcdir)/src/log.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-log.Tpo src/$(DEPDIR)/bluetoothd-log.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/log.c' object='src/bluetoothd-log.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-log.obj `if test -f 'src/log.c'; then $(CYGPATH_W) 'src/log.c'; else $(CYGPATH_W) '$(srcdir)/src/log.c'; fi` + +src/bluetoothd-systemd.o: src/systemd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-systemd.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-systemd.Tpo -c -o src/bluetoothd-systemd.o `test -f 'src/systemd.c' || echo '$(srcdir)/'`src/systemd.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-systemd.Tpo src/$(DEPDIR)/bluetoothd-systemd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/systemd.c' object='src/bluetoothd-systemd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-systemd.o `test -f 'src/systemd.c' || echo '$(srcdir)/'`src/systemd.c + +src/bluetoothd-systemd.obj: src/systemd.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-systemd.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-systemd.Tpo -c -o src/bluetoothd-systemd.obj `if test -f 'src/systemd.c'; then $(CYGPATH_W) 'src/systemd.c'; else $(CYGPATH_W) '$(srcdir)/src/systemd.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-systemd.Tpo src/$(DEPDIR)/bluetoothd-systemd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/systemd.c' object='src/bluetoothd-systemd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-systemd.obj `if test -f 'src/systemd.c'; then $(CYGPATH_W) 'src/systemd.c'; else $(CYGPATH_W) '$(srcdir)/src/systemd.c'; fi` + +src/bluetoothd-rfkill.o: src/rfkill.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-rfkill.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-rfkill.Tpo -c -o src/bluetoothd-rfkill.o `test -f 'src/rfkill.c' || echo '$(srcdir)/'`src/rfkill.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-rfkill.Tpo src/$(DEPDIR)/bluetoothd-rfkill.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/rfkill.c' object='src/bluetoothd-rfkill.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-rfkill.o `test -f 'src/rfkill.c' || echo '$(srcdir)/'`src/rfkill.c + +src/bluetoothd-rfkill.obj: src/rfkill.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-rfkill.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-rfkill.Tpo -c -o src/bluetoothd-rfkill.obj `if test -f 'src/rfkill.c'; then $(CYGPATH_W) 'src/rfkill.c'; else $(CYGPATH_W) '$(srcdir)/src/rfkill.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-rfkill.Tpo src/$(DEPDIR)/bluetoothd-rfkill.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/rfkill.c' object='src/bluetoothd-rfkill.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-rfkill.obj `if test -f 'src/rfkill.c'; then $(CYGPATH_W) 'src/rfkill.c'; else $(CYGPATH_W) '$(srcdir)/src/rfkill.c'; fi` + +src/bluetoothd-sdpd-server.o: src/sdpd-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-server.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-server.Tpo -c -o src/bluetoothd-sdpd-server.o `test -f 'src/sdpd-server.c' || echo '$(srcdir)/'`src/sdpd-server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-server.Tpo src/$(DEPDIR)/bluetoothd-sdpd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-server.c' object='src/bluetoothd-sdpd-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-server.o `test -f 'src/sdpd-server.c' || echo '$(srcdir)/'`src/sdpd-server.c + +src/bluetoothd-sdpd-server.obj: src/sdpd-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-server.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-server.Tpo -c -o src/bluetoothd-sdpd-server.obj `if test -f 'src/sdpd-server.c'; then $(CYGPATH_W) 'src/sdpd-server.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-server.Tpo src/$(DEPDIR)/bluetoothd-sdpd-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-server.c' object='src/bluetoothd-sdpd-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-server.obj `if test -f 'src/sdpd-server.c'; then $(CYGPATH_W) 'src/sdpd-server.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-server.c'; fi` + +src/bluetoothd-sdpd-request.o: src/sdpd-request.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-request.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-request.Tpo -c -o src/bluetoothd-sdpd-request.o `test -f 'src/sdpd-request.c' || echo '$(srcdir)/'`src/sdpd-request.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-request.Tpo src/$(DEPDIR)/bluetoothd-sdpd-request.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-request.c' object='src/bluetoothd-sdpd-request.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-request.o `test -f 'src/sdpd-request.c' || echo '$(srcdir)/'`src/sdpd-request.c + +src/bluetoothd-sdpd-request.obj: src/sdpd-request.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-request.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-request.Tpo -c -o src/bluetoothd-sdpd-request.obj `if test -f 'src/sdpd-request.c'; then $(CYGPATH_W) 'src/sdpd-request.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-request.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-request.Tpo src/$(DEPDIR)/bluetoothd-sdpd-request.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-request.c' object='src/bluetoothd-sdpd-request.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-request.obj `if test -f 'src/sdpd-request.c'; then $(CYGPATH_W) 'src/sdpd-request.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-request.c'; fi` + +src/bluetoothd-sdpd-service.o: src/sdpd-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-service.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-service.Tpo -c -o src/bluetoothd-sdpd-service.o `test -f 'src/sdpd-service.c' || echo '$(srcdir)/'`src/sdpd-service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-service.Tpo src/$(DEPDIR)/bluetoothd-sdpd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-service.c' object='src/bluetoothd-sdpd-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-service.o `test -f 'src/sdpd-service.c' || echo '$(srcdir)/'`src/sdpd-service.c + +src/bluetoothd-sdpd-service.obj: src/sdpd-service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-service.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-service.Tpo -c -o src/bluetoothd-sdpd-service.obj `if test -f 'src/sdpd-service.c'; then $(CYGPATH_W) 'src/sdpd-service.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-service.Tpo src/$(DEPDIR)/bluetoothd-sdpd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-service.c' object='src/bluetoothd-sdpd-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-service.obj `if test -f 'src/sdpd-service.c'; then $(CYGPATH_W) 'src/sdpd-service.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-service.c'; fi` + +src/bluetoothd-sdpd-database.o: src/sdpd-database.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-database.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-database.Tpo -c -o src/bluetoothd-sdpd-database.o `test -f 'src/sdpd-database.c' || echo '$(srcdir)/'`src/sdpd-database.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-database.Tpo src/$(DEPDIR)/bluetoothd-sdpd-database.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-database.c' object='src/bluetoothd-sdpd-database.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-database.o `test -f 'src/sdpd-database.c' || echo '$(srcdir)/'`src/sdpd-database.c + +src/bluetoothd-sdpd-database.obj: src/sdpd-database.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdpd-database.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdpd-database.Tpo -c -o src/bluetoothd-sdpd-database.obj `if test -f 'src/sdpd-database.c'; then $(CYGPATH_W) 'src/sdpd-database.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-database.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdpd-database.Tpo src/$(DEPDIR)/bluetoothd-sdpd-database.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdpd-database.c' object='src/bluetoothd-sdpd-database.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdpd-database.obj `if test -f 'src/sdpd-database.c'; then $(CYGPATH_W) 'src/sdpd-database.c'; else $(CYGPATH_W) '$(srcdir)/src/sdpd-database.c'; fi` + +src/bluetoothd-attrib-server.o: src/attrib-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-attrib-server.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-attrib-server.Tpo -c -o src/bluetoothd-attrib-server.o `test -f 'src/attrib-server.c' || echo '$(srcdir)/'`src/attrib-server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-attrib-server.Tpo src/$(DEPDIR)/bluetoothd-attrib-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/attrib-server.c' object='src/bluetoothd-attrib-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-attrib-server.o `test -f 'src/attrib-server.c' || echo '$(srcdir)/'`src/attrib-server.c + +src/bluetoothd-attrib-server.obj: src/attrib-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-attrib-server.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-attrib-server.Tpo -c -o src/bluetoothd-attrib-server.obj `if test -f 'src/attrib-server.c'; then $(CYGPATH_W) 'src/attrib-server.c'; else $(CYGPATH_W) '$(srcdir)/src/attrib-server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-attrib-server.Tpo src/$(DEPDIR)/bluetoothd-attrib-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/attrib-server.c' object='src/bluetoothd-attrib-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-attrib-server.obj `if test -f 'src/attrib-server.c'; then $(CYGPATH_W) 'src/attrib-server.c'; else $(CYGPATH_W) '$(srcdir)/src/attrib-server.c'; fi` + +src/bluetoothd-sdp-xml.o: src/sdp-xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdp-xml.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdp-xml.Tpo -c -o src/bluetoothd-sdp-xml.o `test -f 'src/sdp-xml.c' || echo '$(srcdir)/'`src/sdp-xml.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdp-xml.Tpo src/$(DEPDIR)/bluetoothd-sdp-xml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdp-xml.c' object='src/bluetoothd-sdp-xml.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdp-xml.o `test -f 'src/sdp-xml.c' || echo '$(srcdir)/'`src/sdp-xml.c + +src/bluetoothd-sdp-xml.obj: src/sdp-xml.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdp-xml.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdp-xml.Tpo -c -o src/bluetoothd-sdp-xml.obj `if test -f 'src/sdp-xml.c'; then $(CYGPATH_W) 'src/sdp-xml.c'; else $(CYGPATH_W) '$(srcdir)/src/sdp-xml.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdp-xml.Tpo src/$(DEPDIR)/bluetoothd-sdp-xml.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdp-xml.c' object='src/bluetoothd-sdp-xml.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdp-xml.obj `if test -f 'src/sdp-xml.c'; then $(CYGPATH_W) 'src/sdp-xml.c'; else $(CYGPATH_W) '$(srcdir)/src/sdp-xml.c'; fi` + +src/bluetoothd-sdp-client.o: src/sdp-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdp-client.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdp-client.Tpo -c -o src/bluetoothd-sdp-client.o `test -f 'src/sdp-client.c' || echo '$(srcdir)/'`src/sdp-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdp-client.Tpo src/$(DEPDIR)/bluetoothd-sdp-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdp-client.c' object='src/bluetoothd-sdp-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdp-client.o `test -f 'src/sdp-client.c' || echo '$(srcdir)/'`src/sdp-client.c + +src/bluetoothd-sdp-client.obj: src/sdp-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-sdp-client.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-sdp-client.Tpo -c -o src/bluetoothd-sdp-client.obj `if test -f 'src/sdp-client.c'; then $(CYGPATH_W) 'src/sdp-client.c'; else $(CYGPATH_W) '$(srcdir)/src/sdp-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-sdp-client.Tpo src/$(DEPDIR)/bluetoothd-sdp-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/sdp-client.c' object='src/bluetoothd-sdp-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-sdp-client.obj `if test -f 'src/sdp-client.c'; then $(CYGPATH_W) 'src/sdp-client.c'; else $(CYGPATH_W) '$(srcdir)/src/sdp-client.c'; fi` + +src/bluetoothd-textfile.o: src/textfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-textfile.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-textfile.Tpo -c -o src/bluetoothd-textfile.o `test -f 'src/textfile.c' || echo '$(srcdir)/'`src/textfile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-textfile.Tpo src/$(DEPDIR)/bluetoothd-textfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/textfile.c' object='src/bluetoothd-textfile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-textfile.o `test -f 'src/textfile.c' || echo '$(srcdir)/'`src/textfile.c + +src/bluetoothd-textfile.obj: src/textfile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-textfile.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-textfile.Tpo -c -o src/bluetoothd-textfile.obj `if test -f 'src/textfile.c'; then $(CYGPATH_W) 'src/textfile.c'; else $(CYGPATH_W) '$(srcdir)/src/textfile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-textfile.Tpo src/$(DEPDIR)/bluetoothd-textfile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/textfile.c' object='src/bluetoothd-textfile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-textfile.obj `if test -f 'src/textfile.c'; then $(CYGPATH_W) 'src/textfile.c'; else $(CYGPATH_W) '$(srcdir)/src/textfile.c'; fi` + +src/bluetoothd-uuid-helper.o: src/uuid-helper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-uuid-helper.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-uuid-helper.Tpo -c -o src/bluetoothd-uuid-helper.o `test -f 'src/uuid-helper.c' || echo '$(srcdir)/'`src/uuid-helper.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-uuid-helper.Tpo src/$(DEPDIR)/bluetoothd-uuid-helper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/uuid-helper.c' object='src/bluetoothd-uuid-helper.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-uuid-helper.o `test -f 'src/uuid-helper.c' || echo '$(srcdir)/'`src/uuid-helper.c + +src/bluetoothd-uuid-helper.obj: src/uuid-helper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-uuid-helper.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-uuid-helper.Tpo -c -o src/bluetoothd-uuid-helper.obj `if test -f 'src/uuid-helper.c'; then $(CYGPATH_W) 'src/uuid-helper.c'; else $(CYGPATH_W) '$(srcdir)/src/uuid-helper.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-uuid-helper.Tpo src/$(DEPDIR)/bluetoothd-uuid-helper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/uuid-helper.c' object='src/bluetoothd-uuid-helper.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-uuid-helper.obj `if test -f 'src/uuid-helper.c'; then $(CYGPATH_W) 'src/uuid-helper.c'; else $(CYGPATH_W) '$(srcdir)/src/uuid-helper.c'; fi` + +src/bluetoothd-plugin.o: src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-plugin.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-plugin.Tpo -c -o src/bluetoothd-plugin.o `test -f 'src/plugin.c' || echo '$(srcdir)/'`src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-plugin.Tpo src/$(DEPDIR)/bluetoothd-plugin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/plugin.c' object='src/bluetoothd-plugin.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-plugin.o `test -f 'src/plugin.c' || echo '$(srcdir)/'`src/plugin.c + +src/bluetoothd-plugin.obj: src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-plugin.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-plugin.Tpo -c -o src/bluetoothd-plugin.obj `if test -f 'src/plugin.c'; then $(CYGPATH_W) 'src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/src/plugin.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-plugin.Tpo src/$(DEPDIR)/bluetoothd-plugin.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/plugin.c' object='src/bluetoothd-plugin.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-plugin.obj `if test -f 'src/plugin.c'; then $(CYGPATH_W) 'src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/src/plugin.c'; fi` + +src/bluetoothd-storage.o: src/storage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-storage.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-storage.Tpo -c -o src/bluetoothd-storage.o `test -f 'src/storage.c' || echo '$(srcdir)/'`src/storage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-storage.Tpo src/$(DEPDIR)/bluetoothd-storage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/storage.c' object='src/bluetoothd-storage.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-storage.o `test -f 'src/storage.c' || echo '$(srcdir)/'`src/storage.c + +src/bluetoothd-storage.obj: src/storage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-storage.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-storage.Tpo -c -o src/bluetoothd-storage.obj `if test -f 'src/storage.c'; then $(CYGPATH_W) 'src/storage.c'; else $(CYGPATH_W) '$(srcdir)/src/storage.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-storage.Tpo src/$(DEPDIR)/bluetoothd-storage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/storage.c' object='src/bluetoothd-storage.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-storage.obj `if test -f 'src/storage.c'; then $(CYGPATH_W) 'src/storage.c'; else $(CYGPATH_W) '$(srcdir)/src/storage.c'; fi` + +src/bluetoothd-agent.o: src/agent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-agent.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-agent.Tpo -c -o src/bluetoothd-agent.o `test -f 'src/agent.c' || echo '$(srcdir)/'`src/agent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-agent.Tpo src/$(DEPDIR)/bluetoothd-agent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/agent.c' object='src/bluetoothd-agent.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-agent.o `test -f 'src/agent.c' || echo '$(srcdir)/'`src/agent.c + +src/bluetoothd-agent.obj: src/agent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-agent.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-agent.Tpo -c -o src/bluetoothd-agent.obj `if test -f 'src/agent.c'; then $(CYGPATH_W) 'src/agent.c'; else $(CYGPATH_W) '$(srcdir)/src/agent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-agent.Tpo src/$(DEPDIR)/bluetoothd-agent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/agent.c' object='src/bluetoothd-agent.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-agent.obj `if test -f 'src/agent.c'; then $(CYGPATH_W) 'src/agent.c'; else $(CYGPATH_W) '$(srcdir)/src/agent.c'; fi` + +src/bluetoothd-error.o: src/error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-error.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-error.Tpo -c -o src/bluetoothd-error.o `test -f 'src/error.c' || echo '$(srcdir)/'`src/error.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-error.Tpo src/$(DEPDIR)/bluetoothd-error.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/error.c' object='src/bluetoothd-error.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-error.o `test -f 'src/error.c' || echo '$(srcdir)/'`src/error.c + +src/bluetoothd-error.obj: src/error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-error.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-error.Tpo -c -o src/bluetoothd-error.obj `if test -f 'src/error.c'; then $(CYGPATH_W) 'src/error.c'; else $(CYGPATH_W) '$(srcdir)/src/error.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-error.Tpo src/$(DEPDIR)/bluetoothd-error.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/error.c' object='src/bluetoothd-error.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-error.obj `if test -f 'src/error.c'; then $(CYGPATH_W) 'src/error.c'; else $(CYGPATH_W) '$(srcdir)/src/error.c'; fi` + +src/bluetoothd-adapter.o: src/adapter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-adapter.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-adapter.Tpo -c -o src/bluetoothd-adapter.o `test -f 'src/adapter.c' || echo '$(srcdir)/'`src/adapter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-adapter.Tpo src/$(DEPDIR)/bluetoothd-adapter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/adapter.c' object='src/bluetoothd-adapter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-adapter.o `test -f 'src/adapter.c' || echo '$(srcdir)/'`src/adapter.c + +src/bluetoothd-adapter.obj: src/adapter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-adapter.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-adapter.Tpo -c -o src/bluetoothd-adapter.obj `if test -f 'src/adapter.c'; then $(CYGPATH_W) 'src/adapter.c'; else $(CYGPATH_W) '$(srcdir)/src/adapter.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-adapter.Tpo src/$(DEPDIR)/bluetoothd-adapter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/adapter.c' object='src/bluetoothd-adapter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-adapter.obj `if test -f 'src/adapter.c'; then $(CYGPATH_W) 'src/adapter.c'; else $(CYGPATH_W) '$(srcdir)/src/adapter.c'; fi` + +src/bluetoothd-profile.o: src/profile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-profile.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-profile.Tpo -c -o src/bluetoothd-profile.o `test -f 'src/profile.c' || echo '$(srcdir)/'`src/profile.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-profile.Tpo src/$(DEPDIR)/bluetoothd-profile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/profile.c' object='src/bluetoothd-profile.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-profile.o `test -f 'src/profile.c' || echo '$(srcdir)/'`src/profile.c + +src/bluetoothd-profile.obj: src/profile.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-profile.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-profile.Tpo -c -o src/bluetoothd-profile.obj `if test -f 'src/profile.c'; then $(CYGPATH_W) 'src/profile.c'; else $(CYGPATH_W) '$(srcdir)/src/profile.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-profile.Tpo src/$(DEPDIR)/bluetoothd-profile.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/profile.c' object='src/bluetoothd-profile.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-profile.obj `if test -f 'src/profile.c'; then $(CYGPATH_W) 'src/profile.c'; else $(CYGPATH_W) '$(srcdir)/src/profile.c'; fi` + +src/bluetoothd-service.o: src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-service.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-service.Tpo -c -o src/bluetoothd-service.o `test -f 'src/service.c' || echo '$(srcdir)/'`src/service.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-service.Tpo src/$(DEPDIR)/bluetoothd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/service.c' object='src/bluetoothd-service.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-service.o `test -f 'src/service.c' || echo '$(srcdir)/'`src/service.c + +src/bluetoothd-service.obj: src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-service.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-service.Tpo -c -o src/bluetoothd-service.obj `if test -f 'src/service.c'; then $(CYGPATH_W) 'src/service.c'; else $(CYGPATH_W) '$(srcdir)/src/service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-service.Tpo src/$(DEPDIR)/bluetoothd-service.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/service.c' object='src/bluetoothd-service.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-service.obj `if test -f 'src/service.c'; then $(CYGPATH_W) 'src/service.c'; else $(CYGPATH_W) '$(srcdir)/src/service.c'; fi` + +src/bluetoothd-gatt-dbus.o: src/gatt-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-gatt-dbus.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-gatt-dbus.Tpo -c -o src/bluetoothd-gatt-dbus.o `test -f 'src/gatt-dbus.c' || echo '$(srcdir)/'`src/gatt-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-gatt-dbus.Tpo src/$(DEPDIR)/bluetoothd-gatt-dbus.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gatt-dbus.c' object='src/bluetoothd-gatt-dbus.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-gatt-dbus.o `test -f 'src/gatt-dbus.c' || echo '$(srcdir)/'`src/gatt-dbus.c + +src/bluetoothd-gatt-dbus.obj: src/gatt-dbus.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-gatt-dbus.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-gatt-dbus.Tpo -c -o src/bluetoothd-gatt-dbus.obj `if test -f 'src/gatt-dbus.c'; then $(CYGPATH_W) 'src/gatt-dbus.c'; else $(CYGPATH_W) '$(srcdir)/src/gatt-dbus.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-gatt-dbus.Tpo src/$(DEPDIR)/bluetoothd-gatt-dbus.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gatt-dbus.c' object='src/bluetoothd-gatt-dbus.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-gatt-dbus.obj `if test -f 'src/gatt-dbus.c'; then $(CYGPATH_W) 'src/gatt-dbus.c'; else $(CYGPATH_W) '$(srcdir)/src/gatt-dbus.c'; fi` + +src/bluetoothd-gatt.o: src/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-gatt.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-gatt.Tpo -c -o src/bluetoothd-gatt.o `test -f 'src/gatt.c' || echo '$(srcdir)/'`src/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-gatt.Tpo src/$(DEPDIR)/bluetoothd-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gatt.c' object='src/bluetoothd-gatt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-gatt.o `test -f 'src/gatt.c' || echo '$(srcdir)/'`src/gatt.c + +src/bluetoothd-gatt.obj: src/gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-gatt.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-gatt.Tpo -c -o src/bluetoothd-gatt.obj `if test -f 'src/gatt.c'; then $(CYGPATH_W) 'src/gatt.c'; else $(CYGPATH_W) '$(srcdir)/src/gatt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-gatt.Tpo src/$(DEPDIR)/bluetoothd-gatt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gatt.c' object='src/bluetoothd-gatt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-gatt.obj `if test -f 'src/gatt.c'; then $(CYGPATH_W) 'src/gatt.c'; else $(CYGPATH_W) '$(srcdir)/src/gatt.c'; fi` + +src/bluetoothd-device.o: src/device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-device.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-device.Tpo -c -o src/bluetoothd-device.o `test -f 'src/device.c' || echo '$(srcdir)/'`src/device.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-device.Tpo src/$(DEPDIR)/bluetoothd-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/device.c' object='src/bluetoothd-device.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-device.o `test -f 'src/device.c' || echo '$(srcdir)/'`src/device.c + +src/bluetoothd-device.obj: src/device.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-device.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-device.Tpo -c -o src/bluetoothd-device.obj `if test -f 'src/device.c'; then $(CYGPATH_W) 'src/device.c'; else $(CYGPATH_W) '$(srcdir)/src/device.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-device.Tpo src/$(DEPDIR)/bluetoothd-device.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/device.c' object='src/bluetoothd-device.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-device.obj `if test -f 'src/device.c'; then $(CYGPATH_W) 'src/device.c'; else $(CYGPATH_W) '$(srcdir)/src/device.c'; fi` + +src/bluetoothd-dbus-common.o: src/dbus-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-dbus-common.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-dbus-common.Tpo -c -o src/bluetoothd-dbus-common.o `test -f 'src/dbus-common.c' || echo '$(srcdir)/'`src/dbus-common.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-dbus-common.Tpo src/$(DEPDIR)/bluetoothd-dbus-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/dbus-common.c' object='src/bluetoothd-dbus-common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-dbus-common.o `test -f 'src/dbus-common.c' || echo '$(srcdir)/'`src/dbus-common.c + +src/bluetoothd-dbus-common.obj: src/dbus-common.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-dbus-common.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-dbus-common.Tpo -c -o src/bluetoothd-dbus-common.obj `if test -f 'src/dbus-common.c'; then $(CYGPATH_W) 'src/dbus-common.c'; else $(CYGPATH_W) '$(srcdir)/src/dbus-common.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-dbus-common.Tpo src/$(DEPDIR)/bluetoothd-dbus-common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/dbus-common.c' object='src/bluetoothd-dbus-common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-dbus-common.obj `if test -f 'src/dbus-common.c'; then $(CYGPATH_W) 'src/dbus-common.c'; else $(CYGPATH_W) '$(srcdir)/src/dbus-common.c'; fi` + +src/bluetoothd-eir.o: src/eir.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-eir.o -MD -MP -MF src/$(DEPDIR)/bluetoothd-eir.Tpo -c -o src/bluetoothd-eir.o `test -f 'src/eir.c' || echo '$(srcdir)/'`src/eir.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-eir.Tpo src/$(DEPDIR)/bluetoothd-eir.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/eir.c' object='src/bluetoothd-eir.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-eir.o `test -f 'src/eir.c' || echo '$(srcdir)/'`src/eir.c + +src/bluetoothd-eir.obj: src/eir.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/bluetoothd-eir.obj -MD -MP -MF src/$(DEPDIR)/bluetoothd-eir.Tpo -c -o src/bluetoothd-eir.obj `if test -f 'src/eir.c'; then $(CYGPATH_W) 'src/eir.c'; else $(CYGPATH_W) '$(srcdir)/src/eir.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bluetoothd-eir.Tpo src/$(DEPDIR)/bluetoothd-eir.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/eir.c' object='src/bluetoothd-eir.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/bluetoothd-eir.obj `if test -f 'src/eir.c'; then $(CYGPATH_W) 'src/eir.c'; else $(CYGPATH_W) '$(srcdir)/src/eir.c'; fi` + +src/shared/bluetoothd-io-glib.o: src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-io-glib.o -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-io-glib.Tpo -c -o src/shared/bluetoothd-io-glib.o `test -f 'src/shared/io-glib.c' || echo '$(srcdir)/'`src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-io-glib.Tpo src/shared/$(DEPDIR)/bluetoothd-io-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/io-glib.c' object='src/shared/bluetoothd-io-glib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-io-glib.o `test -f 'src/shared/io-glib.c' || echo '$(srcdir)/'`src/shared/io-glib.c + +src/shared/bluetoothd-io-glib.obj: src/shared/io-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-io-glib.obj -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-io-glib.Tpo -c -o src/shared/bluetoothd-io-glib.obj `if test -f 'src/shared/io-glib.c'; then $(CYGPATH_W) 'src/shared/io-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/io-glib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-io-glib.Tpo src/shared/$(DEPDIR)/bluetoothd-io-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/io-glib.c' object='src/shared/bluetoothd-io-glib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-io-glib.obj `if test -f 'src/shared/io-glib.c'; then $(CYGPATH_W) 'src/shared/io-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/io-glib.c'; fi` + +src/shared/bluetoothd-timeout-glib.o: src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-timeout-glib.o -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-timeout-glib.Tpo -c -o src/shared/bluetoothd-timeout-glib.o `test -f 'src/shared/timeout-glib.c' || echo '$(srcdir)/'`src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-timeout-glib.Tpo src/shared/$(DEPDIR)/bluetoothd-timeout-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/timeout-glib.c' object='src/shared/bluetoothd-timeout-glib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-timeout-glib.o `test -f 'src/shared/timeout-glib.c' || echo '$(srcdir)/'`src/shared/timeout-glib.c + +src/shared/bluetoothd-timeout-glib.obj: src/shared/timeout-glib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-timeout-glib.obj -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-timeout-glib.Tpo -c -o src/shared/bluetoothd-timeout-glib.obj `if test -f 'src/shared/timeout-glib.c'; then $(CYGPATH_W) 'src/shared/timeout-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/timeout-glib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-timeout-glib.Tpo src/shared/$(DEPDIR)/bluetoothd-timeout-glib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/timeout-glib.c' object='src/shared/bluetoothd-timeout-glib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-timeout-glib.obj `if test -f 'src/shared/timeout-glib.c'; then $(CYGPATH_W) 'src/shared/timeout-glib.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/timeout-glib.c'; fi` + +src/shared/bluetoothd-queue.o: src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-queue.o -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-queue.Tpo -c -o src/shared/bluetoothd-queue.o `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-queue.Tpo src/shared/$(DEPDIR)/bluetoothd-queue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/queue.c' object='src/shared/bluetoothd-queue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-queue.o `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c + +src/shared/bluetoothd-queue.obj: src/shared/queue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-queue.obj -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-queue.Tpo -c -o src/shared/bluetoothd-queue.obj `if test -f 'src/shared/queue.c'; then $(CYGPATH_W) 'src/shared/queue.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/queue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-queue.Tpo src/shared/$(DEPDIR)/bluetoothd-queue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/queue.c' object='src/shared/bluetoothd-queue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-queue.obj `if test -f 'src/shared/queue.c'; then $(CYGPATH_W) 'src/shared/queue.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/queue.c'; fi` + +src/shared/bluetoothd-util.o: src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-util.o -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-util.Tpo -c -o src/shared/bluetoothd-util.o `test -f 'src/shared/util.c' || echo '$(srcdir)/'`src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-util.Tpo src/shared/$(DEPDIR)/bluetoothd-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/util.c' object='src/shared/bluetoothd-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-util.o `test -f 'src/shared/util.c' || echo '$(srcdir)/'`src/shared/util.c + +src/shared/bluetoothd-util.obj: src/shared/util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-util.obj -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-util.Tpo -c -o src/shared/bluetoothd-util.obj `if test -f 'src/shared/util.c'; then $(CYGPATH_W) 'src/shared/util.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-util.Tpo src/shared/$(DEPDIR)/bluetoothd-util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/util.c' object='src/shared/bluetoothd-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-util.obj `if test -f 'src/shared/util.c'; then $(CYGPATH_W) 'src/shared/util.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/util.c'; fi` + +src/shared/bluetoothd-mgmt.o: src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-mgmt.o -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-mgmt.Tpo -c -o src/shared/bluetoothd-mgmt.o `test -f 'src/shared/mgmt.c' || echo '$(srcdir)/'`src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-mgmt.Tpo src/shared/$(DEPDIR)/bluetoothd-mgmt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/mgmt.c' object='src/shared/bluetoothd-mgmt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-mgmt.o `test -f 'src/shared/mgmt.c' || echo '$(srcdir)/'`src/shared/mgmt.c + +src/shared/bluetoothd-mgmt.obj: src/shared/mgmt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -MT src/shared/bluetoothd-mgmt.obj -MD -MP -MF src/shared/$(DEPDIR)/bluetoothd-mgmt.Tpo -c -o src/shared/bluetoothd-mgmt.obj `if test -f 'src/shared/mgmt.c'; then $(CYGPATH_W) 'src/shared/mgmt.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/mgmt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/bluetoothd-mgmt.Tpo src/shared/$(DEPDIR)/bluetoothd-mgmt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/mgmt.c' object='src/shared/bluetoothd-mgmt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_bluetoothd_CFLAGS) $(CFLAGS) -c -o src/shared/bluetoothd-mgmt.obj `if test -f 'src/shared/mgmt.c'; then $(CYGPATH_W) 'src/shared/mgmt.c'; else $(CYGPATH_W) '$(srcdir)/src/shared/mgmt.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf android/.libs android/_libs + -rm -rf attrib/.libs attrib/_libs + -rm -rf client/.libs client/_libs + -rm -rf emulator/.libs emulator/_libs + -rm -rf gdbus/.libs gdbus/_libs + -rm -rf lib/.libs lib/_libs + -rm -rf monitor/.libs monitor/_libs + -rm -rf obexd/src/.libs obexd/src/_libs + -rm -rf plugins/.libs plugins/_libs + -rm -rf profiles/cups/.libs profiles/cups/_libs + -rm -rf profiles/iap/.libs profiles/iap/_libs + -rm -rf src/.libs src/_libs + -rm -rf tools/.libs tools/_libs + -rm -rf unit/.libs unit/_libs + +distclean-libtool: + -rm -f libtool config.lt +install-man1: $(dist_man_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS) $(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-man8: $(dist_man_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(dist_man_MANS) $(man_MANS)'; \ + test -n "$(man8dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.8[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ + done; } + +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man8dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(dist_man_MANS) $(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.8[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) +install-confDATA: $(conf_DATA) + @$(NORMAL_INSTALL) + @list='$(conf_DATA)'; test -n "$(confdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(confdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(confdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(confdir)" || exit $$?; \ + done + +uninstall-confDATA: + @$(NORMAL_UNINSTALL) + @list='$(conf_DATA)'; test -n "$(confdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(confdir)'; $(am__uninstall_files_from_dir) +install-dbusDATA: $(dbus_DATA) + @$(NORMAL_INSTALL) + @list='$(dbus_DATA)'; test -n "$(dbusdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dbusdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dbusdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusdir)" || exit $$?; \ + done + +uninstall-dbusDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbus_DATA)'; test -n "$(dbusdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbusdir)'; $(am__uninstall_files_from_dir) +install-dbussessionbusDATA: $(dbussessionbus_DATA) + @$(NORMAL_INSTALL) + @list='$(dbussessionbus_DATA)'; test -n "$(dbussessionbusdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dbussessionbusdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dbussessionbusdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbussessionbusdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbussessionbusdir)" || exit $$?; \ + done + +uninstall-dbussessionbusDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbussessionbus_DATA)'; test -n "$(dbussessionbusdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbussessionbusdir)'; $(am__uninstall_files_from_dir) +install-dbussystembusDATA: $(dbussystembus_DATA) + @$(NORMAL_INSTALL) + @list='$(dbussystembus_DATA)'; test -n "$(dbussystembusdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dbussystembusdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dbussystembusdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbussystembusdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dbussystembusdir)" || exit $$?; \ + done + +uninstall-dbussystembusDATA: + @$(NORMAL_UNINSTALL) + @list='$(dbussystembus_DATA)'; test -n "$(dbussystembusdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dbussystembusdir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-rulesDATA: $(rules_DATA) + @$(NORMAL_INSTALL) + @list='$(rules_DATA)'; test -n "$(rulesdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(rulesdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(rulesdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rulesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(rulesdir)" || exit $$?; \ + done + +uninstall-rulesDATA: + @$(NORMAL_UNINSTALL) + @list='$(rules_DATA)'; test -n "$(rulesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(rulesdir)'; $(am__uninstall_files_from_dir) +install-stateDATA: $(state_DATA) + @$(NORMAL_INSTALL) + @list='$(state_DATA)'; test -n "$(statedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(statedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(statedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(statedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(statedir)" || exit $$?; \ + done + +uninstall-stateDATA: + @$(NORMAL_UNINSTALL) + @list='$(state_DATA)'; test -n "$(statedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(statedir)'; $(am__uninstall_files_from_dir) +install-systemdsystemunitDATA: $(systemdsystemunit_DATA) + @$(NORMAL_INSTALL) + @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \ + done + +uninstall-systemdsystemunitDATA: + @$(NORMAL_UNINSTALL) + @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir) +install-systemduserunitDATA: $(systemduserunit_DATA) + @$(NORMAL_INSTALL) + @list='$(systemduserunit_DATA)'; test -n "$(systemduserunitdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(systemduserunitdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(systemduserunitdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemduserunitdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(systemduserunitdir)" || exit $$?; \ + done + +uninstall-systemduserunitDATA: + @$(NORMAL_UNINSTALL) + @list='$(systemduserunit_DATA)'; test -n "$(systemduserunitdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(systemduserunitdir)'; $(am__uninstall_files_from_dir) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + else \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +android/test-ipc.log: android/test-ipc$(EXEEXT) + @p='android/test-ipc$(EXEEXT)'; \ + b='android/test-ipc'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-eir.log: unit/test-eir$(EXEEXT) + @p='unit/test-eir$(EXEEXT)'; \ + b='unit/test-eir'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-uuid.log: unit/test-uuid$(EXEEXT) + @p='unit/test-uuid$(EXEEXT)'; \ + b='unit/test-uuid'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-textfile.log: unit/test-textfile$(EXEEXT) + @p='unit/test-textfile$(EXEEXT)'; \ + b='unit/test-textfile'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-crc.log: unit/test-crc$(EXEEXT) + @p='unit/test-crc$(EXEEXT)'; \ + b='unit/test-crc'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-ringbuf.log: unit/test-ringbuf$(EXEEXT) + @p='unit/test-ringbuf$(EXEEXT)'; \ + b='unit/test-ringbuf'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-queue.log: unit/test-queue$(EXEEXT) + @p='unit/test-queue$(EXEEXT)'; \ + b='unit/test-queue'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-mgmt.log: unit/test-mgmt$(EXEEXT) + @p='unit/test-mgmt$(EXEEXT)'; \ + b='unit/test-mgmt'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-sdp.log: unit/test-sdp$(EXEEXT) + @p='unit/test-sdp$(EXEEXT)'; \ + b='unit/test-sdp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-avdtp.log: unit/test-avdtp$(EXEEXT) + @p='unit/test-avdtp$(EXEEXT)'; \ + b='unit/test-avdtp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-avctp.log: unit/test-avctp$(EXEEXT) + @p='unit/test-avctp$(EXEEXT)'; \ + b='unit/test-avctp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-avrcp.log: unit/test-avrcp$(EXEEXT) + @p='unit/test-avrcp$(EXEEXT)'; \ + b='unit/test-avrcp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-hfp.log: unit/test-hfp$(EXEEXT) + @p='unit/test-hfp$(EXEEXT)'; \ + b='unit/test-hfp'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gdbus-client.log: unit/test-gdbus-client$(EXEEXT) + @p='unit/test-gdbus-client$(EXEEXT)'; \ + b='unit/test-gdbus-client'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex-header.log: unit/test-gobex-header$(EXEEXT) + @p='unit/test-gobex-header$(EXEEXT)'; \ + b='unit/test-gobex-header'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex-packet.log: unit/test-gobex-packet$(EXEEXT) + @p='unit/test-gobex-packet$(EXEEXT)'; \ + b='unit/test-gobex-packet'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex.log: unit/test-gobex$(EXEEXT) + @p='unit/test-gobex$(EXEEXT)'; \ + b='unit/test-gobex'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex-transfer.log: unit/test-gobex-transfer$(EXEEXT) + @p='unit/test-gobex-transfer$(EXEEXT)'; \ + b='unit/test-gobex-transfer'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-gobex-apparam.log: unit/test-gobex-apparam$(EXEEXT) + @p='unit/test-gobex-apparam$(EXEEXT)'; \ + b='unit/test-gobex-apparam'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +unit/test-lib.log: unit/test-lib$(EXEEXT) + @p='unit/test-lib$(EXEEXT)'; \ + b='unit/test-lib'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \ + $(MANS) $(DATA) $(HEADERS) config.h +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsdir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(udevdir)" "$(DESTDIR)$(testdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confdir)" "$(DESTDIR)$(dbusdir)" "$(DESTDIR)$(dbussessionbusdir)" "$(DESTDIR)$(dbussystembusdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(rulesdir)" "$(DESTDIR)$(statedir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(systemduserunitdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f android/$(DEPDIR)/$(am__dirstamp) + -rm -f android/$(am__dirstamp) + -rm -f android/client/$(DEPDIR)/$(am__dirstamp) + -rm -f android/client/$(am__dirstamp) + -rm -f android/hardware/$(DEPDIR)/$(am__dirstamp) + -rm -f android/hardware/$(am__dirstamp) + -rm -f attrib/$(DEPDIR)/$(am__dirstamp) + -rm -f attrib/$(am__dirstamp) + -rm -f btio/$(DEPDIR)/$(am__dirstamp) + -rm -f btio/$(am__dirstamp) + -rm -f client/$(DEPDIR)/$(am__dirstamp) + -rm -f client/$(am__dirstamp) + -rm -f emulator/$(DEPDIR)/$(am__dirstamp) + -rm -f emulator/$(am__dirstamp) + -rm -f gdbus/$(DEPDIR)/$(am__dirstamp) + -rm -f gdbus/$(am__dirstamp) + -rm -f gobex/$(DEPDIR)/$(am__dirstamp) + -rm -f gobex/$(am__dirstamp) + -rm -f lib/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/$(am__dirstamp) + -rm -f monitor/$(DEPDIR)/$(am__dirstamp) + -rm -f monitor/$(am__dirstamp) + -rm -f obexd/client/$(DEPDIR)/$(am__dirstamp) + -rm -f obexd/client/$(am__dirstamp) + -rm -f obexd/plugins/$(DEPDIR)/$(am__dirstamp) + -rm -f obexd/plugins/$(am__dirstamp) + -rm -f obexd/src/$(DEPDIR)/$(am__dirstamp) + -rm -f obexd/src/$(am__dirstamp) + -rm -f plugins/$(DEPDIR)/$(am__dirstamp) + -rm -f plugins/$(am__dirstamp) + -rm -f profiles/alert/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/alert/$(am__dirstamp) + -rm -f profiles/audio/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/audio/$(am__dirstamp) + -rm -f profiles/cups/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/cups/$(am__dirstamp) + -rm -f profiles/cyclingspeed/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/cyclingspeed/$(am__dirstamp) + -rm -f profiles/deviceinfo/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/deviceinfo/$(am__dirstamp) + -rm -f profiles/gatt/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/gatt/$(am__dirstamp) + -rm -f profiles/health/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/health/$(am__dirstamp) + -rm -f profiles/heartrate/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/heartrate/$(am__dirstamp) + -rm -f profiles/iap/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/iap/$(am__dirstamp) + -rm -f profiles/input/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/input/$(am__dirstamp) + -rm -f profiles/network/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/network/$(am__dirstamp) + -rm -f profiles/proximity/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/proximity/$(am__dirstamp) + -rm -f profiles/sap/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/sap/$(am__dirstamp) + -rm -f profiles/scanparam/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/scanparam/$(am__dirstamp) + -rm -f profiles/thermometer/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/thermometer/$(am__dirstamp) + -rm -f profiles/time/$(DEPDIR)/$(am__dirstamp) + -rm -f profiles/time/$(am__dirstamp) + -rm -f src/$(DEPDIR)/$(am__dirstamp) + -rm -f src/$(am__dirstamp) + -rm -f src/shared/$(DEPDIR)/$(am__dirstamp) + -rm -f src/shared/$(am__dirstamp) + -rm -f tools/$(DEPDIR)/$(am__dirstamp) + -rm -f tools/$(am__dirstamp) + -rm -f tools/parser/$(DEPDIR)/$(am__dirstamp) + -rm -f tools/parser/$(am__dirstamp) + -rm -f unit/$(DEPDIR)/$(am__dirstamp) + -rm -f unit/$(am__dirstamp) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-cupsPROGRAMS clean-generic \ + clean-libLTLIBRARIES clean-libexecPROGRAMS clean-libtool \ + clean-local clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS clean-pluginLTLIBRARIES \ + clean-udevPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf android/$(DEPDIR) android/client/$(DEPDIR) android/hardware/$(DEPDIR) attrib/$(DEPDIR) btio/$(DEPDIR) client/$(DEPDIR) emulator/$(DEPDIR) gdbus/$(DEPDIR) gobex/$(DEPDIR) lib/$(DEPDIR) monitor/$(DEPDIR) obexd/client/$(DEPDIR) obexd/plugins/$(DEPDIR) obexd/src/$(DEPDIR) plugins/$(DEPDIR) profiles/alert/$(DEPDIR) profiles/audio/$(DEPDIR) profiles/cups/$(DEPDIR) profiles/cyclingspeed/$(DEPDIR) profiles/deviceinfo/$(DEPDIR) profiles/gatt/$(DEPDIR) profiles/health/$(DEPDIR) profiles/heartrate/$(DEPDIR) profiles/iap/$(DEPDIR) profiles/input/$(DEPDIR) profiles/network/$(DEPDIR) profiles/proximity/$(DEPDIR) profiles/sap/$(DEPDIR) profiles/scanparam/$(DEPDIR) profiles/thermometer/$(DEPDIR) profiles/time/$(DEPDIR) src/$(DEPDIR) src/shared/$(DEPDIR) tools/$(DEPDIR) tools/parser/$(DEPDIR) unit/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-confDATA install-cupsPROGRAMS \ + install-dbusDATA install-dbussessionbusDATA \ + install-dbussystembusDATA install-includeHEADERS install-man \ + install-pkgconfigDATA install-pluginLTLIBRARIES \ + install-rulesDATA install-stateDATA \ + install-systemdsystemunitDATA install-systemduserunitDATA \ + install-testSCRIPTS install-udevPROGRAMS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \ + install-libexecPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 install-man8 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf android/$(DEPDIR) android/client/$(DEPDIR) android/hardware/$(DEPDIR) attrib/$(DEPDIR) btio/$(DEPDIR) client/$(DEPDIR) emulator/$(DEPDIR) gdbus/$(DEPDIR) gobex/$(DEPDIR) lib/$(DEPDIR) monitor/$(DEPDIR) obexd/client/$(DEPDIR) obexd/plugins/$(DEPDIR) obexd/src/$(DEPDIR) plugins/$(DEPDIR) profiles/alert/$(DEPDIR) profiles/audio/$(DEPDIR) profiles/cups/$(DEPDIR) profiles/cyclingspeed/$(DEPDIR) profiles/deviceinfo/$(DEPDIR) profiles/gatt/$(DEPDIR) profiles/health/$(DEPDIR) profiles/heartrate/$(DEPDIR) profiles/iap/$(DEPDIR) profiles/input/$(DEPDIR) profiles/network/$(DEPDIR) profiles/proximity/$(DEPDIR) profiles/sap/$(DEPDIR) profiles/scanparam/$(DEPDIR) profiles/thermometer/$(DEPDIR) profiles/time/$(DEPDIR) src/$(DEPDIR) src/shared/$(DEPDIR) tools/$(DEPDIR) tools/parser/$(DEPDIR) unit/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-confDATA \ + uninstall-cupsPROGRAMS uninstall-dbusDATA \ + uninstall-dbussessionbusDATA uninstall-dbussystembusDATA \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-libexecPROGRAMS uninstall-man \ + uninstall-pkgconfigDATA uninstall-pluginLTLIBRARIES \ + uninstall-rulesDATA uninstall-stateDATA \ + uninstall-systemdsystemunitDATA uninstall-systemduserunitDATA \ + uninstall-testSCRIPTS uninstall-udevPROGRAMS + +uninstall-man: uninstall-man1 uninstall-man8 + +.MAKE: all check check-am install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \ + check-am clean clean-binPROGRAMS clean-cscope \ + clean-cupsPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libexecPROGRAMS clean-libtool clean-local \ + clean-noinstLIBRARIES clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS clean-pluginLTLIBRARIES \ + clean-udevPROGRAMS cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-confDATA install-cupsPROGRAMS \ + install-data install-data-am install-dbusDATA \ + install-dbussessionbusDATA install-dbussystembusDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-includeHEADERS \ + install-info install-info-am install-libLTLIBRARIES \ + install-libexecPROGRAMS install-man install-man1 install-man8 \ + install-pdf install-pdf-am install-pkgconfigDATA \ + install-pluginLTLIBRARIES install-ps install-ps-am \ + install-rulesDATA install-stateDATA install-strip \ + install-systemdsystemunitDATA install-systemduserunitDATA \ + install-testSCRIPTS install-udevPROGRAMS installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-confDATA \ + uninstall-cupsPROGRAMS uninstall-dbusDATA \ + uninstall-dbussessionbusDATA uninstall-dbussystembusDATA \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES \ + uninstall-libexecPROGRAMS uninstall-man uninstall-man1 \ + uninstall-man8 uninstall-pkgconfigDATA \ + uninstall-pluginLTLIBRARIES uninstall-rulesDATA \ + uninstall-stateDATA uninstall-systemdsystemunitDATA \ + uninstall-systemduserunitDATA uninstall-testSCRIPTS \ + uninstall-udevPROGRAMS + + +obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h + +obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources) + $(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@ + +%.service: %.service.in Makefile + $(SED_PROCESS) + +src/builtin.h: src/genbuiltin $(builtin_sources) + $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@ + +tools/%.rules: + $(AM_V_GEN)cp $(srcdir)/$(subst 97-,,$@) $@ + +$(lib_libbluetooth_la_OBJECTS): $(local_headers) + +lib/bluetooth/%.h: lib/%.h + $(AM_V_at)$(MKDIR_P) lib/bluetooth + $(AM_V_GEN)$(LN_S) -f "$(abs_top_builddir)"/$< $@ + +clean-local: + $(RM) -r lib/bluetooth + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT:
diff --git a/bluez/Makefile.obexd b/bluez/Makefile.obexd new file mode 100644 index 0000000..3760867 --- /dev/null +++ b/bluez/Makefile.obexd
@@ -0,0 +1,112 @@ + +if SYSTEMD +systemduserunitdir = @SYSTEMD_USERUNITDIR@ +systemduserunit_DATA = obexd/src/obex.service + +dbussessionbusdir = @DBUS_SESSIONBUSDIR@ +dbussessionbus_DATA = obexd/src/org.bluez.obex.service +endif + +EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service + +obex_plugindir = $(libdir)/obex/plugins + +obexd_builtin_modules = +obexd_builtin_sources = +obexd_builtin_nodist = + +obexd_builtin_modules += filesystem +obexd_builtin_sources += obexd/plugins/filesystem.c obexd/plugins/filesystem.h + +obexd_builtin_modules += bluetooth +obexd_builtin_sources += obexd/plugins/bluetooth.c + +if EXPERIMENTAL +obexd_builtin_modules += pcsuite +obexd_builtin_sources += obexd/plugins/pcsuite.c +endif + +obexd_builtin_modules += opp +obexd_builtin_sources += obexd/plugins/opp.c + +obexd_builtin_modules += ftp +obexd_builtin_sources += obexd/plugins/ftp.c obexd/plugins/ftp.h + +if OBEX +obexd_builtin_modules += irmc +obexd_builtin_sources += obexd/plugins/irmc.c + +obexd_builtin_modules += pbap +obexd_builtin_sources += obexd/plugins/pbap.c \ + obexd/plugins/vcard.h obexd/plugins/vcard.c \ + obexd/plugins/phonebook.h \ + obexd/plugins/phonebook-dummy.c +endif + +obexd_builtin_modules += mas +obexd_builtin_sources += obexd/plugins/mas.c obexd/src/map_ap.h \ + obexd/plugins/messages.h \ + obexd/plugins/messages-dummy.c + +obexd_builtin_modules += mns +obexd_builtin_sources += obexd/client/mns.c obexd/src/map_ap.h \ + obexd/client/map-event.h + +libexec_PROGRAMS += obexd/src/obexd + +obexd_src_obexd_SOURCES = $(btio_sources) $(gobex_sources) \ + $(obexd_builtin_sources) \ + obexd/src/main.c obexd/src/obexd.h \ + obexd/src/plugin.h obexd/src/plugin.c \ + obexd/src/log.h obexd/src/log.c \ + obexd/src/manager.h obexd/src/manager.c \ + obexd/src/obex.h obexd/src/obex.c obexd/src/obex-priv.h \ + obexd/src/mimetype.h obexd/src/mimetype.c \ + obexd/src/service.h obexd/src/service.c \ + obexd/src/transport.h obexd/src/transport.c \ + obexd/src/server.h obexd/src/server.c \ + obexd/client/manager.h obexd/client/manager.c \ + obexd/client/session.h obexd/client/session.c \ + obexd/client/bluetooth.h obexd/client/bluetooth.c \ + obexd/client/sync.h obexd/client/sync.c \ + obexd/client/pbap.h obexd/client/pbap.c \ + obexd/client/ftp.h obexd/client/ftp.c \ + obexd/client/opp.h obexd/client/opp.c \ + obexd/client/map.h obexd/client/map.c \ + obexd/client/map-event.h obexd/client/map-event.c \ + obexd/client/transfer.h obexd/client/transfer.c \ + obexd/client/transport.h obexd/client/transport.c \ + obexd/client/dbus.h obexd/client/dbus.c \ + obexd/client/driver.h obexd/client/driver.c \ + obexd/src/map_ap.h +obexd_src_obexd_LDADD = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la \ + @ICAL_LIBS@ @DBUS_LIBS@ @GLIB_LIBS@ -ldl + +obexd_src_obexd_LDFLAGS = -Wl,--export-dynamic + +obexd_src_obexd_CFLAGS = $(AM_CFLAGS) @GLIB_CFLAGS@ @DBUS_CFLAGS@ \ + @ICAL_CFLAGS@ -DOBEX_PLUGIN_BUILTIN \ + -DPLUGINDIR=\""$(obex_plugindir)"\" \ + -fPIC -D_FILE_OFFSET_BITS=64 + +obexd_src_obexd_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/obexd/src \ + -I$(srcdir)/obexd/src -I$(srcdir)/btio \ + -I$(srcdir)/gobex -I$(srcdir)/gdbus + +obexd_src_obexd_SHORTNAME = obexd + +obexd_builtin_files = obexd/src/builtin.h $(obexd_builtin_nodist) + +nodist_obexd_src_obexd_SOURCES = $(obexd_builtin_files) + +BUILT_SOURCES += obexd/src/builtin.h + +obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h + +obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources) + $(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@ + +CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service + +EXTRA_DIST += obexd/src/genbuiltin
diff --git a/bluez/Makefile.plugins b/bluez/Makefile.plugins new file mode 100644 index 0000000..415d023 --- /dev/null +++ b/bluez/Makefile.plugins
@@ -0,0 +1,123 @@ + +builtin_modules += hostname +builtin_sources += plugins/hostname.c + +builtin_modules += wiimote +builtin_sources += plugins/wiimote.c + +builtin_modules += autopair +builtin_sources += plugins/autopair.c + +builtin_modules += dropcam +builtin_sources += plugins/dropcam.c + +builtin_modules += policy +builtin_sources += plugins/policy.c + +if MAINTAINER_MODE +builtin_modules += gatt_example +builtin_sources += plugins/gatt-example.c +endif + +if EXPERIMENTAL +builtin_modules += neard +builtin_sources += plugins/neard.c + +builtin_modules += sap +builtin_sources += profiles/sap/main.c profiles/sap/manager.h \ + profiles/sap/manager.c profiles/sap/server.h \ + profiles/sap/server.c profiles/sap/sap.h \ + profiles/sap/sap-dummy.c + +noinst_LIBRARIES += profiles/sap/libsap.a +profiles_sap_libsap_a_SOURCES = profiles/sap/sap.h profiles/sap/sap-u8500.c +endif + +builtin_modules += a2dp +builtin_sources += profiles/audio/source.h profiles/audio/source.c \ + profiles/audio/sink.h profiles/audio/sink.c \ + profiles/audio/a2dp.h profiles/audio/a2dp.c \ + profiles/audio/avdtp.h profiles/audio/avdtp.c \ + profiles/audio/media.h profiles/audio/media.c \ + profiles/audio/transport.h profiles/audio/transport.c \ + profiles/audio/a2dp-codecs.h + +builtin_modules += avrcp +builtin_sources += profiles/audio/control.h profiles/audio/control.c \ + profiles/audio/avctp.h profiles/audio/avctp.c \ + profiles/audio/avrcp.h profiles/audio/avrcp.c \ + profiles/audio/player.h profiles/audio/player.c + +builtin_modules += network +builtin_sources += profiles/network/manager.c \ + profiles/network/bnep.h profiles/network/bnep.c \ + profiles/network/server.h profiles/network/server.c \ + profiles/network/connection.h \ + profiles/network/connection.c + +builtin_modules += input +builtin_sources += profiles/input/manager.c \ + profiles/input/server.h profiles/input/server.c \ + profiles/input/device.h profiles/input/device.c + +builtin_modules += hog +builtin_sources += profiles/input/hog.c profiles/input/uhid_copy.h \ + profiles/input/suspend.h profiles/input/suspend-dummy.c + +if EXPERIMENTAL +builtin_modules += health +builtin_sources += profiles/health/mcap_lib.h profiles/health/mcap_internal.h \ + profiles/health/mcap.h profiles/health/mcap.c \ + profiles/health/mcap_sync.c \ + profiles/health/hdp_main.c profiles/health/hdp_types.h \ + profiles/health/hdp_manager.h \ + profiles/health/hdp_manager.c \ + profiles/health/hdp.h profiles/health/hdp.c \ + profiles/health/hdp_util.h profiles/health/hdp_util.c +endif + +builtin_modules += gatt +builtin_sources += profiles/gatt/gas.c + +builtin_modules += scanparam +builtin_sources += profiles/scanparam/scan.c + +builtin_modules += deviceinfo +builtin_sources += profiles/deviceinfo/deviceinfo.c + +if EXPERIMENTAL +builtin_modules += alert +builtin_sources += profiles/alert/server.c + +builtin_modules += time +builtin_sources += profiles/time/server.c + +builtin_modules += proximity +builtin_sources += profiles/proximity/main.c profiles/proximity/manager.h \ + profiles/proximity/manager.c \ + profiles/proximity/monitor.h \ + profiles/proximity/monitor.c \ + profiles/proximity/reporter.h \ + profiles/proximity/reporter.c \ + profiles/proximity/linkloss.h \ + profiles/proximity/linkloss.c \ + profiles/proximity/immalert.h \ + profiles/proximity/immalert.c + +builtin_modules += thermometer +builtin_sources += profiles/thermometer/thermometer.c + +builtin_modules += heartrate +builtin_sources += profiles/heartrate/heartrate.c + +builtin_modules += cyclingspeed +builtin_sources += profiles/cyclingspeed/cyclingspeed.c +endif + +if SIXAXIS +plugin_LTLIBRARIES += plugins/sixaxis.la +plugins_sixaxis_la_SOURCES = plugins/sixaxis.c +plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ + -no-undefined @UDEV_LIBS@ +plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @UDEV_CFLAGS@ +endif
diff --git a/bluez/Makefile.tools b/bluez/Makefile.tools new file mode 100644 index 0000000..a5491ac --- /dev/null +++ b/bluez/Makefile.tools
@@ -0,0 +1,414 @@ + +if CLIENT +bin_PROGRAMS += client/bluetoothctl + +client_bluetoothctl_SOURCES = client/main.c \ + client/display.h client/display.c \ + client/agent.h client/agent.c \ + monitor/uuid.h monitor/uuid.c +client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ + -lreadline +endif + +if MONITOR +bin_PROGRAMS += monitor/btmon + +monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c \ + monitor/display.h monitor/display.c \ + monitor/hcidump.h monitor/hcidump.c \ + monitor/ellisys.h monitor/ellisys.c \ + monitor/control.h monitor/control.c \ + monitor/packet.h monitor/packet.c \ + monitor/vendor.h monitor/vendor.c \ + monitor/lmp.h monitor/lmp.c \ + monitor/crc.h monitor/crc.c \ + monitor/ll.h monitor/ll.c \ + monitor/l2cap.h monitor/l2cap.c \ + monitor/sdp.h monitor/sdp.c \ + monitor/uuid.h monitor/uuid.c \ + monitor/hwdb.h monitor/hwdb.c \ + monitor/keys.h monitor/keys.c \ + monitor/analyze.h monitor/analyze.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/btsnoop.h src/shared/btsnoop.c +monitor_btmon_LDADD = lib/libbluetooth-internal.la @UDEV_LIBS@ +endif + +if EXPERIMENTAL +noinst_PROGRAMS += emulator/btvirt emulator/b1ee emulator/hfp tools/3dsp \ + tools/mgmt-tester tools/gap-tester \ + tools/l2cap-tester tools/sco-tester \ + tools/smp-tester tools/hci-tester \ + tools/rfcomm-tester + +emulator_btvirt_SOURCES = emulator/main.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/timeout.h \ + src/shared/timeout-mainloop.c \ + src/shared/util.h src/shared/util.c \ + src/shared/crypto.h src/shared/crypto.c \ + emulator/server.h emulator/server.c \ + emulator/vhci.h emulator/vhci.c \ + emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + emulator/amp.h emulator/amp.c \ + emulator/le.h emulator/le.c +emulator_btvirt_LDADD = lib/libbluetooth-internal.la + +emulator_b1ee_SOURCES = emulator/b1ee.c monitor/mainloop.h monitor/mainloop.c + +emulator_hfp_SOURCES = emulator/hfp.c \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/io.h src/shared/io-mainloop.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/ringbuf.h src/shared/ringbuf.c \ + src/shared/hfp.h src/shared/hfp.c + +tools_3dsp_SOURCES = tools/3dsp.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/io.h src/shared/io-mainloop.c \ + src/shared/timeout.h \ + src/shared/timeout-mainloop.c \ + src/shared/hci.h src/shared/hci.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c + +tools_mgmt_tester_SOURCES = tools/mgmt-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c +tools_mgmt_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +tools_l2cap_tester_SOURCES = tools/l2cap-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c +tools_l2cap_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +tools_rfcomm_tester_SOURCES = tools/rfcomm-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c +tools_rfcomm_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +tools_smp_tester_SOURCES = tools/smp-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c +tools_smp_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +tools_gap_tester_SOURCES = tools/gap-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c +tools_gap_tester_LDADD = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la \ + @GLIB_LIBS@ @DBUS_LIBS@ + +tools_sco_tester_SOURCES = tools/sco-tester.c monitor/bt.h \ + emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c +tools_sco_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +tools_hci_tester_SOURCES = tools/hci-tester.c monitor/bt.h \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/hci.h src/shared/hci.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/tester.h src/shared/tester.c +tools_hci_tester_LDADD = @GLIB_LIBS@ +endif + +if TOOLS +bin_PROGRAMS += tools/hciattach tools/hciconfig tools/hcitool tools/hcidump \ + tools/rfcomm tools/rctest tools/l2test tools/l2ping \ + tools/sdptool tools/ciptool tools/bccmd tools/bluemoon + +tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \ + tools/hciattach_st.c \ + tools/hciattach_ti.c \ + tools/hciattach_tialt.c \ + tools/hciattach_ath3k.c \ + tools/hciattach_qualcomm.c \ + tools/hciattach_intel.c +tools_hciattach_LDADD = lib/libbluetooth-internal.la + +tools_hciconfig_SOURCES = tools/hciconfig.c tools/csr.h tools/csr.c +tools_hciconfig_LDADD = lib/libbluetooth-internal.la + +tools_hcitool_SOURCES = tools/hcitool.c src/oui.h src/oui.c +tools_hcitool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ @UDEV_LIBS@ + +tools_hcidump_SOURCES = tools/hcidump.c \ + tools/parser/parser.h tools/parser/parser.c \ + tools/parser/lmp.c \ + tools/parser/hci.c \ + tools/parser/l2cap.h tools/parser/l2cap.c \ + tools/parser/amp.c \ + tools/parser/smp.c \ + tools/parser/att.c \ + tools/parser/sdp.h tools/parser/sdp.c \ + tools/parser/rfcomm.h tools/parser/rfcomm.c \ + tools/parser/bnep.c \ + tools/parser/cmtp.c \ + tools/parser/hidp.c \ + tools/parser/hcrp.c \ + tools/parser/avdtp.c \ + tools/parser/avctp.c \ + tools/parser/avrcp.c \ + tools/parser/sap.c \ + tools/parser/obex.c \ + tools/parser/capi.c \ + tools/parser/ppp.c \ + tools/parser/tcpip.c \ + tools/parser/ericsson.c \ + tools/parser/csr.c \ + tools/parser/bpa.c +tools_hcidump_LDADD = lib/libbluetooth-internal.la + +tools_rfcomm_LDADD = lib/libbluetooth-internal.la + +tools_rctest_LDADD = lib/libbluetooth-internal.la + +tools_l2test_LDADD = lib/libbluetooth-internal.la + +tools_l2ping_LDADD = lib/libbluetooth-internal.la + +tools_sdptool_SOURCES = tools/sdptool.c src/sdp-xml.h src/sdp-xml.c +tools_sdptool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +tools_ciptool_LDADD = lib/libbluetooth-internal.la + +tools_bccmd_SOURCES = tools/bccmd.c tools/csr.h tools/csr.c \ + tools/csr_hci.c tools/csr_usb.c \ + tools/csr_h4.c tools/csr_3wire.c \ + tools/csr_bcsp.c tools/ubcsp.h tools/ubcsp.c +tools_bccmd_LDADD = lib/libbluetooth-internal.la + +tools_bluemoon_SOURCES = tools/bluemoon.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/io.h src/shared/io-mainloop.c \ + src/shared/hci.h src/shared/hci.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c + +dist_man_MANS += tools/hciattach.1 tools/hciconfig.1 \ + tools/hcitool.1 tools/hcidump.1 \ + tools/rfcomm.1 tools/rctest.1 tools/l2ping.1 \ + tools/sdptool.1 tools/ciptool.1 tools/bccmd.1 +else +EXTRA_DIST += tools/hciattach.1 tools/hciconfig.1 \ + tools/hcitool.1 tools/hcidump.1 \ + tools/rfcomm.1 tools/rctest.1 tools/l2ping.1 \ + tools/sdptool.1 tools/ciptool.1 tools/bccmd.1 +endif + +if HID2HCI +udevdir = @UDEV_DIR@ + +udev_PROGRAMS = tools/hid2hci + +tools_hid2hci_LDADD = @UDEV_LIBS@ + +dist_man_MANS += tools/hid2hci.1 +else +EXTRA_DIST += tools/hid2hci.1 +endif + +if EXPERIMENTAL +noinst_PROGRAMS += tools/bdaddr tools/avinfo tools/avtest \ + tools/scotest tools/amptest tools/hwdb \ + tools/hcieventmask tools/hcisecfilter \ + tools/btmgmt tools/btinfo tools/btattach \ + tools/btsnoop tools/btproxy tools/btiotest \ + tools/mpris-player tools/cltest tools/seq2bseq \ + tools/ibeacon + +tools_bdaddr_SOURCES = tools/bdaddr.c src/oui.h src/oui.c +tools_bdaddr_LDADD = lib/libbluetooth-internal.la @UDEV_LIBS@ + +tools_avinfo_LDADD = lib/libbluetooth-internal.la + +tools_avtest_LDADD = lib/libbluetooth-internal.la + +tools_scotest_LDADD = lib/libbluetooth-internal.la + +tools_amptest_LDADD = lib/libbluetooth-internal.la + +tools_hwdb_LDADD = lib/libbluetooth-internal.la + +tools_hcieventmask_LDADD = lib/libbluetooth-internal.la + +tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/io.h src/shared/io-mainloop.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c +tools_btmgmt_LDADD = lib/libbluetooth-internal.la + +tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/io.h src/shared/io-mainloop.c \ + src/shared/timeout.h \ + src/shared/timeout-mainloop.c \ + src/shared/hci.h src/shared/hci.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c + +tools_btsnoop_SOURCES = tools/btsnoop.c \ + src/shared/pcap.h src/shared/pcap.c \ + src/shared/btsnoop.h src/shared/btsnoop.c + +tools_btproxy_SOURCES = tools/btproxy.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/util.h src/shared/util.c + +tools_btiotest_SOURCES = tools/btiotest.c btio/btio.h btio/btio.c +tools_btiotest_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +tools_mpris_player_SOURCES = tools/mpris-player.c +tools_mpris_player_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ + +tools_cltest_SOURCES = tools/cltest.c monitor/mainloop.h monitor/mainloop.c +tools_cltest_LDADD = lib/libbluetooth-internal.la + +tools_seq2bseq_SOURCES = tools/seq2bseq.c + +tools_ibeacon_SOURCES = tools/ibeacon.c monitor/bt.h \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/io.h src/shared/io-mainloop.c \ + src/shared/timeout.h \ + src/shared/timeout-mainloop.c \ + src/shared/hci.h src/shared/hci.c \ + src/shared/util.h src/shared/util.c \ + src/shared/queue.h src/shared/queue.c + +EXTRA_DIST += tools/bdaddr.1 +endif + +if READLINE +noinst_PROGRAMS += attrib/gatttool \ + tools/obex-client-tool tools/obex-server-tool \ + tools/bluetooth-player tools/obexctl + +attrib_gatttool_SOURCES = attrib/gatttool.c attrib/att.c attrib/gatt.c \ + attrib/gattrib.c btio/btio.c \ + attrib/gatttool.h attrib/interactive.c \ + attrib/utils.c src/log.c client/display.c \ + client/display.h +attrib_gatttool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ -lreadline + +tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \ + tools/obex-client-tool.c +tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \ + @GLIB_LIBS@ -lreadline + +tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ + tools/obex-server-tool.c +tools_obex_server_tool_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +tools_bluetooth_player_SOURCES = tools/bluetooth-player.c \ + client/display.h client/display.c +tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ + @GLIB_LIBS@ @DBUS_LIBS@ -lreadline + +tools_obexctl_SOURCES = tools/obexctl.c \ + client/display.h client/display.c +tools_obexctl_LDADD = gdbus/libgdbus-internal.la \ + @GLIB_LIBS@ @DBUS_LIBS@ -lreadline +endif + +if EXPERIMENTAL +noinst_PROGRAMS += tools/gatt-service + +tools_gatt_service_SOURCES = tools/gatt-service.c +tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la + +noinst_PROGRAMS += profiles/iap/iapd + +profiles_iap_iapd_SOURCES = profiles/iap/main.c +profiles_iap_iapd_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ +endif + +if CUPS +cupsdir = $(libdir)/cups/backend + +cups_PROGRAMS = profiles/cups/bluetooth + +profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \ + profiles/cups/cups.h \ + profiles/cups/sdp.c \ + profiles/cups/spp.c \ + profiles/cups/hcrp.c + +profiles_cups_bluetooth_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ \ + lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la +endif + +test_scripts += test/sap_client.py test/bluezutils.py \ + test/dbusdef.py test/monitor-bluetooth test/list-devices \ + test/test-discovery test/test-manager test/test-adapter \ + test/test-device test/simple-agent \ + test/simple-service test/simple-endpoint test/test-sap-server \ + test/test-proximity test/test-network \ + test/test-thermometer test/test-profile test/test-health \ + test/test-health-sink test/service-record.dtd \ + test/service-did.xml test/service-spp.xml test/service-opp.xml \ + test/service-ftp.xml test/simple-player test/test-nap \ + test/test-heartrate test/test-alert test/test-hfp \ + test/test-cyclingspeed test/opp-client test/ftp-client \ + test/pbap-client test/map-client
diff --git a/bluez/NEWS b/bluez/NEWS new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/bluez/NEWS
diff --git a/bluez/README b/bluez/README new file mode 100644 index 0000000..c991ab0 --- /dev/null +++ b/bluez/README
@@ -0,0 +1,127 @@ +BlueZ - Bluetooth protocol stack for Linux +****************************************** + +Copyright (C) 2000-2001 Qualcomm Incorporated +Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com> +Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org> + + +Compilation and installation +============================ + +In order to compile Bluetooth utilities you need following software packages: + - GCC compiler + - GLib library + - D-Bus library + - udev library (optional) + - readline (command line clients) + +To configure run: + ./configure --prefix=/usr --mandir=/usr/share/man \ + --sysconfdir=/etc --localstatedir=/var + +Configure automatically searches for all required components and packages. + +To compile and install run: + make && make install + + +Configuration and options +========================= + +For a working system, certain configuration options need to be enabled: + + --enable-library + + Enable installation of Bluetooth library + + By default the Bluetooth library is no longer installed. + + The user interfaces or command line utilities do not + require an installed Bluetooth library anymore. This + option is provided for legacy third party applications + that still depend on the library. + + When the library installation is enabled, it is a good + idea to use a separate bluez-library or libbluetooth + package for it. + + --disable-tools + + Disable support for Bluetooth utilities + + By default the Bluetooth utilities are built and also + installed. For production systems the tools are not + needed and this option allows to disable them to save + build time and disk space. + + When the tools are selected, it is a good idea to + use a separate bluez-tools package for them. + + --disable-cups + + Disable support for CUPS printer backend + + By default the printer backend for CUPS is build and + also installed. For systems that do not require printing + over Bluetooth, this options allows to disable it. + + When the CUPS backend is selected, it is a good idea to + use a separate bluez-cups package for it. + + --disable-monitor + + Disable support for the Bluetooth monitor utility + + By default the monitor utility is enabled. It provides + support for HCI level tracing and debugging. For systems + that don't require any kind of tracing or debugging + capabilities, this options allows to disable it. + + The monitor utility should be placed in the main package + along with the daemons. It is universally useful. + + --disable-client + + Disable support for the command line client + + By default the command line client is enabled and uses the + readline library. For specific systems where BlueZ is + configured by other means, the command line client can be + disabled and the dependency on readline is removed. + + The client should be placed in the main package along + with the daemons. It is universally useful. + + --disable-systemd + + Disable integration with systemd + + By default the integration with systemd is enabled and + installed. This gives the best integration into all + distributions based on systemd. + + This option is provided for distributions that do not + support systemd. In that case all integration with the + init system is up to the package. + + --enable-experimental + + Enable experimental plugins + + By default all plugins that are still in development + are disabled. This option can be used to enable them. + + It is not recommended to enable this option for production + systems. The APIs or behavior of the experimental plugins + is unstable and might still change. + + +Information +=========== + +Mailing lists: + linux-bluetooth@vger.kernel.org + +For additional information about the project visit BlueZ web site: + http://www.bluez.org
diff --git a/bluez/TODO b/bluez/TODO new file mode 100644 index 0000000..eb2177e --- /dev/null +++ b/bluez/TODO
@@ -0,0 +1,271 @@ +Background +========== + +- Priority scale: High, Medium and Low + +- Complexity scale: C1, C2, C4 and C8. The complexity scale is exponential, + with complexity 1 being the lowest complexity. Complexity is a function + of both task 'complexity' and task 'scope'. + + The general rule of thumb is that a complexity 1 task should take 1-2 weeks + for a person very familiar with BlueZ codebase. Higher complexity tasks + require more time and have higher uncertainty. + + Higher complexity tasks should be refined into several lower complexity tasks + once the task is better understood. + +General +========== + +- UUID handling: Use the new functions created for UUID handling in all parts + of BlueZ code. Currently, the new bt_uuid_* functions are being used by + GATT-related code only. + + Priority: high + Complexity: C4 + +- Add support for Authentication for client sessions in obexd + + Priority: high + Complexity: C2 + +- Update PBAP client/server implementation to 1.2 and create necessary APIs for + new features it introduces. + + Priority: Medium + Complexity: C4 + +- Create GOEP unit tests based on its test specification: + + https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=230559 + + Priority: Medium + Complexity: C2 + +- Rename glib-helper file to a more convenient name. The idea is try to keep + only sdp helpers functions. bt_* prefix shall be also changed. + + Priority: Low + Complexity: C1 + +- Function in src/adapter.c to convert old storage files to new ini-file format + should be removed 6-8 months after first BlueZ 5 release. + + Priority: Low + Complexity: C1 + +- Remove usage of symlinks for drivers, such as profiles/input/suspend.c and + profiles/sap/sap.c. Instead, select drivers at runtime by using config + options or probing for running D-Bus services (using e.g. + g_dbus_add_service_watch()). Idea first mentioned on + http://thread.gmane.org/gmane.linux.bluez.kernel/30175/focus=30190. + +- Reuse connection handling code of src/profile.c also for built-in profiles + so plugins would only need to register their btd_profile and the core takes + care of the rest including listen to the right channel and manages the sdp + record. Once btd_profile manages the connection it can also notify about + their state, this probably remove the need of having callbacks to + .connect/.disconnect since their state can be tracked, it also enables any + plugin to track any profile state change which can be useful for e.g. + a connection policy plugin in case one is needed. + + Priority: Low + Complexity: C2 + +Low Energy +========== + +- Advertising management. Adapter interface needs to be changed to manage + connection modes, adapter type and advertising policy. See Volume 3, + Part C, section 9.3. If Attribute Server is enabled the LE capable + adapter shall to start advertising. Further investigation is necessary + to define which connectable mode needs to be supported: Non-connectable, + directed connectable and undirected connectable. Basically, two connectable + scenarios shall be addressed: + 1. GATT client is disconnected, but intends to become a Peripheral to + receive indications/notifications. + 2. GATT server intends to accept connections. + + Priority: Medium + Complexity: C2 + +- Define Auto Connection Establishment Procedure. Some profiles such as + Proximity requires an active link to identify path lost situation. It is + necessary to define how to manage connections, it seems that White List + is appropriated to address auto connections, however is not clear if the + this procedure shall be a profile specific detail or if the remote device + object can expose a property "WhiteList", maybe "Trusted" property can be + also used for this purpose. Another alternative is to define a method to + allow application to request/register the wanted scanning/connection + parameters. Before start this task, a RFC/PATCH shall be sent to the ML. + See Volume 3, Part C, section 9.3.5 for more information. + + Priority: Medium + Complexity: C2 + +- Implement a tool(or extend hciconfig) to setup the advertising parameters + and data. Extend hciconfig passing extra arguments when enabling the + advertises is not the right approach, it will be almost impossible to + address all arguments needed in an acceptable way. For testing, we need + a tool to change easily the AD Flags, the UUIDs and other data that can be + exported through the advertising data field. Suggestions: 1) extend hciconfig + passing a config file when enabling advertises; 2) write a ncurses based tool + + Priority: Medium + Complexity: C2 + +- Add new property in the DeviceFound signal to report the device type: + BR/EDR, single mode or dual-mode. + + Priority: Medium + Complexity: C1 + +- Privacy: When privacy is enabled in the adapter, LE scanning/connection + should use a private address. StartDiscovery method shall be changed and + new adapter property shall be added. + + Priority: Medium + Complexity: C1 + +- Static random address setup and storage. Once this address is written + in a given remote, the address can not be changed anymore. + + Priority: Low + Complexity: C1 + +- Reconnection address: Reconnection address is a non resolvable private + address that the central writes in the peripheral. BlueZ will support + multiple profiles, it is not clear how it needs to be implemented. + Further discussion is necessary. + + Priority: Low + Complexity: C2 + +- Device Name Characteristic is a GAP characteristic for Low Energy. This + characteristic shall be integrated/used in the discovery procedure. The + idea is to report the value of this characteristic using DeviceFound signals. + Discussion with the community is needed before to start this task. Other GAP + characteristics for LE needs to follow a similar approach. It is not clear + if all GAP characteristics can be exposed using properties instead of a primary + service characteristics. + See Volume 3, Part C, section 12.1 for more information. + + Priority: Low + Complexity: C2 + +ATT/GATT +======== + +- At the moment authentication and authorization is not supported at the + same time, read/write requirements in the attribute server needs to + be extended. According to Bluetooth Specification a server shall check + authentication and authorization requirements before any other check is + performed. + + Priority: Medium + Complexity: C1 + +- ATT/GATT parsing to hcidump. Partially implemented, missing to fix + multiple advertises in the same event and RSSI. + + Priority: Medium + Complexity: C2 + +- Implement ATT PDU validation. Malformed PDUs can cause division by zero + when decoding PDUs. A proper error PDU should be returned for this case. + See decoding function in att.c file. + + Priority: Medium + Complexity: C1 + +- Fix hard-coded PSM for GATT services over basic rate. + + Priority: Low + Complexity: C1 + +- Refactor read_by_group() and read_by_type() in src/attrib-server.c + (they've grown simply too big). First step could be to move out the + long for-loops to new functions called e.g. get_groups() and get_types(). + + Priority: Low + Complexity: C1 + +- Agent for characteristics: Agent interface should be extended to support + authorization per characteristic if the remote is not in the trusted list. + + Priority: Low + Complexity: C1 + +- gatttool should have the ability to wait for req responses before + quitting (some servers require a small sleep even with cmd's). Maybe a + --delay-exit or --timeout command line switch. + + Priority: Low + Complexity: C1 + +- Refactoring of gatt.c functions. Currently, the callbacks of the services + and characteristics discovery functions return the ATT PDU and the caller + needs to call again the same function to fetch the remaining data when + necessary. Investigate if all results can be returned in the callback + result to avoid repeated code. Before change the code, please analyze + if this change will not break the GATT/ATT qualification tests. Maybe + an interactive fetch/query is necessary to pass the tests. + + Priority: Low + Complexity: C1 + +- Client needs to export a property in the Device Characteristic hierarchy + to manage characteristic value changes reports in the remote device. + Currently, Client Characteristic Configuration attribute is not exposed + as an object. The user needs to use gatttool to change the value of the + this attribute to receive notification/indications. Export this attribute + as a property is a proposal that needs further discussion. + + Priority: Low + Complexity: C1 + +- Attribute server should process queued GATT/ATT commands if the + client disconnects. The client can simply send a command and quit, + without wait for a response(ex: Write Command). For this scenario + that the client disconnects the link quickly the queued received + command is ignored. + + Priority: Low + Complecity: C1 + +- Add sdp discovery support to gatttool with BR (--sdp, default is 0x1f) + + Priority: Low + Complexity: C1 + +- Implement Server characteristic Configuration support in the attribute + server to manage characteristic value broadcasting. There is a single + instance of the Server Characteristic Configuration for all clients. + See Volume 3, Part G, section 3.3.3.4 for more information. + + Priority: Low + Complexity: C1 + +- Long write is not implemented. Attribute server, client and command line + tool shall be changed to support this feature. + + Priority: Low + Complexity: C2 + +- Define attribute server API. External applications needs to register, + change attributes and to be notified about changes. Example: Proximity, + Time and Alert Profiles. "Local Service hierarchy" in the attribute-api + needs to be proposed and a RFC shall be sent to the ML. + + Priority: Low + Complexity: C2 + Owner: Anderson Lizardo <anderson.lizardo@openbossa.org> + +Management Interface +==================== + +- Whitelist support (initially only for LE) + + Priority: Medium + Complexity: C2 + Owner: Andre Guedes <andre.guedes@openbossa.org>
diff --git a/bluez/acinclude.m4 b/bluez/acinclude.m4 new file mode 100644 index 0000000..2065852 --- /dev/null +++ b/bluez/acinclude.m4
@@ -0,0 +1,56 @@ +AC_DEFUN([AC_PROG_CC_PIE], [ + AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], ac_cv_prog_cc_pie, [ + echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -fPIE -pie -c conftest.c 2>&1`"; then + ac_cv_prog_cc_pie=yes + else + ac_cv_prog_cc_pie=no + fi + rm -rf conftest* + ]) +]) + +AC_DEFUN([COMPILER_FLAGS], [ + with_cflags="" + if (test "$USE_MAINTAINER_MODE" = "yes"); then + with_cflags="$with_cflags -Wall -Werror -Wextra" + with_cflags="$with_cflags -Wno-unused-parameter" + with_cflags="$with_cflags -Wno-missing-field-initializers" + with_cflags="$with_cflags -Wdeclaration-after-statement" + with_cflags="$with_cflags -Wmissing-declarations" + with_cflags="$with_cflags -Wredundant-decls" + with_cflags="$with_cflags -Wcast-align" + with_cflags="$with_cflags -DG_DISABLE_DEPRECATED" + with_cflags="$with_cflags -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_28" + with_cflags="$with_cflags -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_28" + fi + AC_SUBST([WARNING_CFLAGS], $with_cflags) +]) + +AC_DEFUN([MISC_FLAGS], [ + misc_cflags="" + misc_ldflags="" + AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization], + [disable code optimization through compiler]), [ + if (test "${enableval}" = "no"); then + misc_cflags="$misc_cflags -O0" + fi + ]) + AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], + [enable compiling with debugging information]), [ + if (test "${enableval}" = "yes" && + test "${ac_cv_prog_cc_g}" = "yes"); then + misc_cflags="$misc_cflags -g" + fi + ]) + AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie], + [enable position independent executables flag]), [ + if (test "${enableval}" = "yes" && + test "${ac_cv_prog_cc_pie}" = "yes"); then + misc_cflags="$misc_cflags -fPIC" + misc_ldflags="$misc_ldflags -pie" + fi + ]) + AC_SUBST([MISC_CFLAGS], $misc_cflags) + AC_SUBST([MISC_LDFLAGS], $misc_ldflags) +])
diff --git a/bluez/aclocal.m4 b/bluez/aclocal.m4 new file mode 100644 index 0000000..0483402 --- /dev/null +++ b/bluez/aclocal.m4
@@ -0,0 +1,9881 @@ +# generated automatically by aclocal 1.13.3 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to <bug-libtool@gnu.org>." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib<name>.so + # instead of lib<name>.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$lt_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$lt_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +_LT_PATH_LD_GNU +AC_SUBST([LD]) + +_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) +])# LT_PATH_LD + +# Old names: +AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) +AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_LD], []) +dnl AC_DEFUN([AC_PROG_LD], []) + + +# _LT_PATH_LD_GNU +#- -------------- +m4_defun([_LT_PATH_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac]) +with_gnu_ld=$lt_cv_prog_gnu_ld +])# _LT_PATH_LD_GNU + + +# _LT_CMD_RELOAD +# -------------- +# find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +m4_defun([_LT_CMD_RELOAD], +[AC_CACHE_CHECK([for $LD option to reload object files], + lt_cv_ld_reload_flag, + [lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac +_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_TAGDECL([], [reload_cmds], [2])dnl +])# _LT_CMD_RELOAD + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.13' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.13.3], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.13.3])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> +# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + AM_RUN_LOG([cat conftest.dir/file]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([acinclude.m4])
diff --git a/bluez/android/Android.mk b/bluez/android/Android.mk new file mode 100644 index 0000000..0e0932d --- /dev/null +++ b/bluez/android/Android.mk
@@ -0,0 +1,468 @@ +LOCAL_PATH := external/bluetooth + +# Retrieve BlueZ version from configure.ac file +BLUEZ_VERSION := `grep "^AC_INIT" $(LOCAL_PATH)/bluez/configure.ac | sed -e "s/.*,.\(.*\))/\1/"` + +# Specify pathmap for glib and sbc +pathmap_INCL += glib:external/bluetooth/glib \ + sbc:external/bluetooth/sbc \ + +# Specify common compiler flags +BLUEZ_COMMON_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\" \ + -DANDROID_STORAGEDIR=\"/data/misc/bluetooth\" \ + +# Enable warnings enabled in autotools build +BLUEZ_COMMON_CFLAGS += -Wall -Wextra \ + -Wdeclaration-after-statement \ + -Wmissing-declarations \ + -Wredundant-decls \ + -Wcast-align \ + +# Disable warnings enabled by Android but not enabled in autotools build +BLUEZ_COMMON_CFLAGS += -Wno-pointer-arith \ + -Wno-missing-field-initializers \ + -Wno-unused-parameter \ + +# +# Android BlueZ daemon (bluetoothd) +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/android/main.c \ + bluez/android/bluetooth.c \ + bluez/android/hidhost.c \ + bluez/android/socket.c \ + bluez/android/ipc.c \ + bluez/android/avdtp.c \ + bluez/android/a2dp.c \ + bluez/android/avctp.c \ + bluez/android/avrcp.c \ + bluez/android/avrcp-lib.c \ + bluez/android/pan.c \ + bluez/android/handsfree.c \ + bluez/android/gatt.c \ + bluez/android/health.c \ + bluez/src/log.c \ + bluez/src/shared/mgmt.c \ + bluez/src/shared/util.c \ + bluez/src/shared/queue.c \ + bluez/src/shared/ringbuf.c \ + bluez/src/shared/hfp.c \ + bluez/src/shared/io-glib.c \ + bluez/src/sdpd-database.c \ + bluez/src/sdpd-service.c \ + bluez/src/sdpd-request.c \ + bluez/src/sdpd-server.c \ + bluez/src/uuid-helper.c \ + bluez/src/eir.c \ + bluez/lib/sdp.c \ + bluez/lib/bluetooth.c \ + bluez/lib/hci.c \ + bluez/lib/uuid.c \ + bluez/btio/btio.c \ + bluez/src/sdp-client.c \ + bluez/profiles/network/bnep.c \ + bluez/attrib/gattrib.c \ + bluez/attrib/gatt.c \ + bluez/attrib/att.c + +LOCAL_C_INCLUDES := \ + $(call include-path-for, glib) \ + $(call include-path-for, glib)/glib \ + +LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/bluez \ + $(LOCAL_PATH)/bluez/lib \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_SHARED_LIBRARIES := \ + libglib \ + +lib_headers := \ + bluetooth.h \ + hci.h \ + hci_lib.h \ + l2cap.h \ + sdp_lib.h \ + sdp.h \ + rfcomm.h \ + sco.h \ + bnep.h \ + +$(shell mkdir -p $(LOCAL_PATH)/bluez/lib/bluetooth) + +$(foreach file,$(lib_headers), $(shell ln -sf ../$(file) $(LOCAL_PATH)/bluez/lib/bluetooth/$(file))) + +LOCAL_MODULE_TAGS := optional + +# for userdebug/eng this module is bluetoothd-main since bluetoothd is used as +# wrapper to launch bluetooth with Valgrind +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) +LOCAL_MODULE := bluetoothd-main +LOCAL_STRIP_MODULE := false +else +LOCAL_MODULE := bluetoothd +endif + +include $(BUILD_EXECUTABLE) + +# +# bluetooth.default.so HAL +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/android/hal-ipc.c \ + bluez/android/hal-bluetooth.c \ + bluez/android/hal-socket.c \ + bluez/android/hal-hidhost.c \ + bluez/android/hal-pan.c \ + bluez/android/hal-a2dp.c \ + bluez/android/hal-avrcp.c \ + bluez/android/hal-handsfree.c \ + bluez/android/hal-gatt.c \ + bluez/android/hal-utils.c \ + bluez/android/hal-health.c \ + +LOCAL_C_INCLUDES += \ + $(call include-path-for, system-core) \ + $(call include-path-for, libhardware) \ + +LOCAL_SHARED_LIBRARIES := \ + libcutils \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE := bluetooth.default +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_CLASS := SHARED_LIBRARIES +LOCAL_REQUIRED_MODULES := bluetoothd bluetoothd-snoop init.bluetooth.rc + +include $(BUILD_SHARED_LIBRARY) + +# +# haltest +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/android/client/haltest.c \ + bluez/android/client/pollhandler.c \ + bluez/android/client/terminal.c \ + bluez/android/client/history.c \ + bluez/android/client/tabcompletion.c \ + bluez/android/client/if-audio.c \ + bluez/android/client/if-av.c \ + bluez/android/client/if-rc.c \ + bluez/android/client/if-bt.c \ + bluez/android/client/if-hf.c \ + bluez/android/client/if-hh.c \ + bluez/android/client/if-pan.c \ + bluez/android/client/if-sock.c \ + bluez/android/client/if-gatt.c \ + bluez/android/hal-utils.c \ + +LOCAL_C_INCLUDES += \ + $(call include-path-for, system-core) \ + $(call include-path-for, libhardware) \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_SHARED_LIBRARIES := libhardware + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := debug +LOCAL_MODULE := haltest + +include $(BUILD_EXECUTABLE) + +# +# btmon +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/monitor/main.c \ + bluez/monitor/mainloop.c \ + bluez/monitor/display.c \ + bluez/monitor/hcidump.c \ + bluez/monitor/control.c \ + bluez/monitor/packet.c \ + bluez/monitor/l2cap.c \ + bluez/monitor/uuid.c \ + bluez/monitor/sdp.c \ + bluez/monitor/vendor.c \ + bluez/monitor/lmp.c \ + bluez/monitor/crc.c \ + bluez/monitor/ll.c \ + bluez/monitor/hwdb.c \ + bluez/monitor/keys.c \ + bluez/monitor/ellisys.c \ + bluez/monitor/analyze.c \ + bluez/src/shared/util.c \ + bluez/src/shared/queue.c \ + bluez/src/shared/crypto.c \ + bluez/src/shared/btsnoop.c \ + bluez/lib/hci.c \ + bluez/lib/bluetooth.c \ + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/bluez \ + $(LOCAL_PATH)/bluez/lib \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := debug +LOCAL_MODULE := btmon + +include $(BUILD_EXECUTABLE) + +# +# btproxy +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/tools/btproxy.c \ + bluez/monitor/mainloop.c \ + bluez/src/shared/util.c \ + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/bluez \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := debug +LOCAL_MODULE := btproxy + +include $(BUILD_EXECUTABLE) + +# +# A2DP audio +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := bluez/android/hal-audio.c + +LOCAL_C_INCLUDES = \ + $(call include-path-for, system-core) \ + $(call include-path-for, libhardware) \ + $(call include-path-for, sbc) \ + +LOCAL_SHARED_LIBRARIES := \ + libcutils \ + libsbc \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := audio.a2dp.default + +include $(BUILD_SHARED_LIBRARY) + +# +# l2cap-test +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/tools/l2test.c \ + bluez/lib/bluetooth.c \ + bluez/lib/hci.c \ + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/bluez \ + $(LOCAL_PATH)/bluez/lib \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := debug +LOCAL_MODULE := l2test + +include $(BUILD_EXECUTABLE) + +# +# bluetoothd-snoop +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/android/bluetoothd-snoop.c \ + bluez/monitor/mainloop.c \ + bluez/src/shared/btsnoop.c \ + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/bluez \ + $(LOCAL_PATH)/bluez/lib \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := bluetoothd-snoop + +include $(BUILD_EXECUTABLE) + +# +# init.bluetooth.rc +# + +include $(CLEAR_VARS) + +LOCAL_MODULE := init.bluetooth.rc +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := bluez/android/$(LOCAL_MODULE) +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) + +include $(BUILD_PREBUILT) + +# +# btmgmt +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/tools/btmgmt.c \ + bluez/lib/bluetooth.c \ + bluez/lib/sdp.c \ + bluez/monitor/mainloop.c \ + bluez/src/shared/io-mainloop.c \ + bluez/src/shared/mgmt.c \ + bluez/src/shared/queue.c \ + bluez/src/shared/util.c \ + bluez/src/uuid-helper.c \ + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/bluez \ + $(LOCAL_PATH)/bluez/lib \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := debug +LOCAL_MODULE := btmgmt + +include $(BUILD_EXECUTABLE) + +# +# l2ping +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/tools/l2ping.c \ + bluez/lib/bluetooth.c \ + bluez/lib/hci.c \ + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/bluez/lib \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := debug +LOCAL_MODULE := l2ping + +include $(BUILD_EXECUTABLE) + +# +# avtest +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/tools/avtest.c \ + bluez/lib/bluetooth.c \ + bluez/lib/hci.c \ + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/bluez/lib \ + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := debug +LOCAL_MODULE := avtest + +include $(BUILD_EXECUTABLE) + +# +# libsbc +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES:= \ + sbc/sbc/sbc.c \ + sbc/sbc/sbc_primitives.c \ + sbc/sbc/sbc_primitives_mmx.c \ + sbc/sbc/sbc_primitives_neon.c \ + sbc/sbc/sbc_primitives_armv6.c \ + sbc/sbc/sbc_primitives_iwmmxt.c \ + +LOCAL_C_INCLUDES:= \ + $(LOCAL_PATH)/sbc \ + +LOCAL_CFLAGS:= \ + -Os \ + -Wno-sign-compare \ + -Wno-missing-field-initializers \ + -Wno-unused-parameter \ + -Wno-type-limits \ + -Wno-empty-body \ + +LOCAL_MODULE := libsbc + +include $(BUILD_SHARED_LIBRARY) + +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) + +# +# bluetoothd (debug) +# this is just a wrapper used in userdebug/eng to launch bluetoothd-main +# with/without Valgrind +# + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + bluez/android/bluetoothd-wrapper.c + +LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS) + +LOCAL_SHARED_LIBRARIES := \ + libcutils \ + +LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES) +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE := bluetoothd + +LOCAL_REQUIRED_MODULES := \ + bluetoothd-main \ + valgrind \ + memcheck-$(TARGET_ARCH)-linux \ + vgpreload_core-$(TARGET_ARCH)-linux \ + vgpreload_memcheck-$(TARGET_ARCH)-linux \ + default.supp + +include $(BUILD_EXECUTABLE) + +endif
diff --git a/bluez/android/Makefile.am b/bluez/android/Makefile.am new file mode 100644 index 0000000..58ee3c9 --- /dev/null +++ b/bluez/android/Makefile.am
@@ -0,0 +1,233 @@ +if ANDROID +android_plugindir = $(abs_top_srcdir)/android/.libs + +noinst_PROGRAMS += android/system-emulator + +android_system_emulator_SOURCES = android/system-emulator.c \ + monitor/mainloop.h monitor/mainloop.c + +noinst_PROGRAMS += android/bluetoothd-snoop + +android_bluetoothd_snoop_SOURCES = android/bluetoothd-snoop.c \ + monitor/mainloop.h monitor/mainloop.c \ + src/shared/btsnoop.h src/shared/btsnoop.c + +noinst_PROGRAMS += android/bluetoothd + +android_bluetoothd_SOURCES = android/main.c \ + src/log.c \ + android/hal-msg.h \ + android/audio-msg.h \ + android/utils.h \ + src/sdpd-database.c src/sdpd-server.c \ + src/sdpd-service.c src/sdpd-request.c \ + src/uuid-helper.h src/uuid-helper.c \ + src/eir.h src/eir.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/ringbuf.h src/shared/ringbuf.c \ + src/shared/hfp.h src/shared/hfp.c \ + android/bluetooth.h android/bluetooth.c \ + android/hidhost.h android/hidhost.c \ + android/ipc-common.h \ + android/ipc.h android/ipc.c \ + android/avdtp.h android/avdtp.c \ + android/a2dp.h android/a2dp.c \ + android/avctp.h android/avctp.c \ + android/avrcp.h android/avrcp.c \ + android/avrcp-lib.h android/avrcp-lib.c \ + android/socket.h android/socket.c \ + android/pan.h android/pan.c \ + android/handsfree.h android/handsfree.c \ + android/gatt.h android/gatt.c \ + android/health.h android/health.c \ + attrib/att.c attrib/att.h \ + attrib/gatt.c attrib/gatt.h \ + attrib/gattrib.c attrib/gattrib.h \ + btio/btio.h btio/btio.c \ + src/sdp-client.h src/sdp-client.c \ + profiles/network/bnep.h profiles/network/bnep.c + +android_bluetoothd_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +plugin_LTLIBRARIES += android/bluetooth.default.la + +android_bluetooth_default_la_SOURCES = android/hal.h android/hal-bluetooth.c \ + android/hal-socket.c \ + android/hal-hidhost.c \ + android/hal-health.c \ + android/hal-pan.c \ + android/hal-a2dp.c \ + android/hal-avrcp.c \ + android/hal-handsfree.c \ + android/hal-gatt.c \ + android/hardware/bluetooth.h \ + android/hardware/bt_av.h \ + android/hardware/bt_gatt.h \ + android/hardware/bt_gatt_client.h \ + android/hardware/bt_gatt_server.h \ + android/hardware/bt_gatt_types.h \ + android/hardware/bt_hf.h \ + android/hardware/bt_hh.h \ + android/hardware/bt_hl.h \ + android/hardware/bt_pan.h \ + android/hardware/bt_rc.h \ + android/hardware/bt_sock.h \ + android/hardware/hardware.h \ + android/cutils/properties.h \ + android/ipc-common.h \ + android/hal-log.h \ + android/hal-ipc.h android/hal-ipc.c \ + android/hal-utils.h android/hal-utils.c + +android_bluetooth_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android +android_bluetooth_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ + -no-undefined + +noinst_PROGRAMS += android/haltest + +android_haltest_SOURCES = android/client/haltest.c \ + android/client/pollhandler.h \ + android/client/pollhandler.c \ + android/client/terminal.h \ + android/client/terminal.c \ + android/client/history.h \ + android/client/history.c \ + android/client/tabcompletion.c \ + android/client/if-main.h \ + android/client/if-av.c \ + android/client/if-rc.c \ + android/client/if-bt.c \ + android/client/if-gatt.c \ + android/client/if-hf.c \ + android/client/if-hh.c \ + android/client/if-pan.c \ + android/client/if-sock.c \ + android/client/if-audio.c \ + android/hardware/hardware.c \ + android/hal-utils.h android/hal-utils.c + +android_haltest_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \ + -DPLUGINDIR=\""$(android_plugindir)"\" + +android_haltest_LDFLAGS = -pthread -ldl -lm + +noinst_PROGRAMS += android/android-tester + +android_android_tester_SOURCES = emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c \ + monitor/rfcomm.h \ + android/hardware/hardware.c \ + android/android-tester.c + +android_android_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \ + -DPLUGINDIR=\""$(android_plugindir)"\" + +android_android_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +android_android_tester_LDFLAGS = -pthread -ldl + +noinst_PROGRAMS += android/ipc-tester + +android_ipc_tester_SOURCES = emulator/btdev.h emulator/btdev.c \ + emulator/bthost.h emulator/bthost.c \ + emulator/smp.c \ + src/shared/crypto.h src/shared/crypto.c \ + src/shared/io.h src/shared/io-glib.c \ + src/shared/queue.h src/shared/queue.c \ + src/shared/util.h src/shared/util.c \ + src/shared/mgmt.h src/shared/mgmt.c \ + src/shared/hciemu.h src/shared/hciemu.c \ + src/shared/tester.h src/shared/tester.c \ + src/shared/timeout.h src/shared/timeout-glib.c \ + android/hal-utils.h android/hal-utils.c \ + android/ipc-common.h android/ipc-tester.c + +android_ipc_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android + +android_ipc_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@ + +android_audio_a2dp_default_la_SOURCES = android/audio-msg.h \ + android/hal-msg.h \ + android/hal-audio.c \ + android/hardware/audio.h \ + android/hardware/audio_effect.h \ + android/hardware/hardware.h \ + android/system/audio.h + +unit_tests += android/test-ipc + +android_test_ipc_SOURCES = android/test-ipc.c \ + src/shared/util.h src/shared/util.c \ + src/log.h src/log.c \ + android/ipc-common.h \ + android/ipc.c android/ipc.h +android_test_ipc_LDADD = @GLIB_LIBS@ + +plugin_LTLIBRARIES += android/audio.a2dp.default.la + +android_audio_a2dp_default_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android + +android_audio_a2dp_default_la_LIBADD = @SBC_LIBS@ + +android_audio_a2dp_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ + -no-undefined -pthread -lrt + +endif + +EXTRA_DIST += android/Android.mk android/README \ + android/init.bluetooth.rc \ + android/hal-ipc-api.txt \ + android/audio-ipc-api.txt \ + android/pics-l2cap.txt \ + android/pics-gap.txt \ + android/pics-did.txt \ + android/pics-hid.txt \ + android/pics-pan.txt \ + android/pics-opp.txt \ + android/pics-map.txt \ + android/pics-pbap.txt \ + android/pics-a2dp.txt \ + android/pics-avctp.txt \ + android/pics-avrcp.txt \ + android/pics-hsp.txt \ + android/pics-hfp.txt \ + android/pics-gatt.txt \ + android/pixit-l2cap.txt \ + android/pixit-gap.txt \ + android/pixit-did.txt \ + android/pixit-hid.txt \ + android/pixit-pan.txt \ + android/pixit-opp.txt \ + android/pixit-map.txt \ + android/pixit-pbap.txt \ + android/pixit-a2dp.txt \ + android/pixit-avctp.txt \ + android/pixit-avrcp.txt \ + android/pixit-hsp.txt \ + android/pixit-hfp.txt \ + android/pixit-gatt.txt \ + android/pts-l2cap.txt \ + android/pts-gap.txt \ + android/pts-did.txt \ + android/pts-hid.txt \ + android/pts-pan.txt \ + android/pts-opp.txt \ + android/pts-map.txt \ + android/pts-a2dp.txt \ + android/pts-avrcp.txt \ + android/pts-avctp.txt \ + android/pts-pbap.txt \ + android/pts-hfp.txt \ + android/pts-hsp.txt
diff --git a/bluez/android/README b/bluez/android/README new file mode 100644 index 0000000..5fd4cfa --- /dev/null +++ b/bluez/android/README
@@ -0,0 +1,316 @@ +BlueZ for Android +***************** + +Since Android 4.2 there exists a well standardized HAL interface that the +Bluetooth stack is expected to provide and which enables the easy replacement +of the stack of choice on Android. Android BlueZ is intended as a drop-in +replacement to Android provided Bluetooth stack. + +More details about BlueZ for Android architecture and components can be found +in android/hal-ipc-api.txt file. + +Supported Android version: 4.4 + + +Building and running on Android +=============================== + +Steps needed to build and run Android Open Source Project 4.4.2 with +integrated BlueZ. + + +Build requirements +------------------ + +- GLib - Android 4.2 or later don't provide GLib and one must provide it in +'external/bluetooth/glib' folder of Android tree. Sample Android GLib port +is available at https://code.google.com/p/aosp-bluez.glib/ + +- SBC - A2DP code requires SBC library (version 1.2 or higher) present in +'external/bluetooth/sbc' directory. Library is build from Android.mk provided +by BlueZ. SBC code is available at git://git.kernel.org/pub/scm/bluetooth/sbc + +- Bionic support - Currently only 'master' branch available at +https://android.googlesource.com/platform/bionic provides all required +functionality and running BlueZ on release branch requires backporting missing +features (currently only epoll_create1 call for Android 4.4.2). Sample +Bionic for Android 4.4.2 with all required features backported is available at +https://code.google.com/p/aosp-bluez.platform-bionic/ + + +Runtime requirements +-------------------- + +BlueZ HAL library requires 'bluetoothd' and 'bluetoothd-snoop' services to be +available on Android system. Some permissions settings are also required. + +This can be done by importing init.bluetooth.rc file in init.rc file of targeted +board: +import init.bluetooth.rc + +For convenience examples are provided at: +https://code.google.com/p/aosp-bluez.device-lge-mako/ (Nexus 4) +https://code.google.com/p/aosp-bluez.device-asus-flo/ (Nexus 7 2013) + + +Downloading and building +------------------------ + +Building for Android requires full Android AOSP source tree. Sample Android +4.4.2 tree with all required components present is available at +http://code.google.com/p/aosp-bluez/ + +This tree provides support for Nexus4 (target aosp_mako-userdebug) and +Nexus 7 2013 (target aosp_flo-userdebug). Tree does not provide binary blobs +needed to run Android on supported devices. Those can be obtained from +https://developers.google.com/android/nexus/drivers. Binary blobs needs to be +unpacked (EULA acceptance required) into 'vendor' directory of Android tree. + +Downloading: +repo init -u https://code.google.com/p/aosp-bluez.platform-manifest -b kitkat +repo sync + +Building: +source build/envsetup.sh +lunch aosp_mako-userdebug or lunch aosp_flo-userdebug +make -j8 + +Flashing: +adb reboot bootloader +fastboot flashall -w + +After full build is done it is possible to rebuild only BlueZ: +'cd external/bluetooth/bluez/android/' +'mm' (or 'mm -B' to force rebuilding of all files) +'adb sync' to update target device. + + +Linux Kernel requirements +------------------------- + +BlueZ for Android uses Linux Bluetooth subsystem and it must be enabled in +kernel. Minimal required version of management interface is 1.3. This +corresponds to Linux 3.9 but latest available version is recommended. Other +requirements include UHID and network bridge support. + +Following kernel options should be enabled: +CONFIG_BT +CONFIG_BT_RFCOMM +CONFIG_BT_RFCOMM_TTY +CONFIG_BT_BNEP +CONFIG_BT_BNEP_MC_FILTER +CONFIG_BT_BNEP_PROTO_FILTER +CONFIG_BRIDGE +CONFIG_UHID + +Also BT chip driver needs to be enabled e.g: +CONFIG_BT_HCIBTUSB + +If it is not possible to use new enough Linux kernel one can use updated +bluetooth subsytem from Backports project. More information about Backports can +be found at https://backports.wiki.kernel.org. Sample kernels using backports +for running BlueZ on Android are available at +https://code.google.com/p/aosp-bluez. + + +Running with Valgrind +--------------------- + +BlueZ for Android is preconfigured to be easily run under Valgrind memcheck. +Appropriate configuration and required modules are automatically included when +building either userdebug or eng variant of Android platform. + +Valgrind can be enabled in runtime by setting "persist.sys.bluetooth.valgrind" +property to either literal "true" or any numeric value >0. For example: +adb root +adb shell setprop persist.sys.bluetooth.valgrind true + +After changing property value Bluetooth need to be restarted to apply changes +(this can be done using UI, just disable and enable it again). Property is +persistent, i.e. there's no need to enable Valgrind again after reboot. + +It's recommended to have unstripped libglib.so installed which will enable +complete backtraces in Valgrind output. Otherwise, in many cases backtrace +will break at e.g. g_free() function without prior callers. It's possible to +have proper library installed automatically by appropriate entry in Android.mk, +see https://code.google.com/p/aosp-bluez.glib/ for an example. + + +Enabling BlueZ debugs +--------------------- + +BlueZ debug logs can be enabled in runtime by setting "persist.sys.bluetooth.debug" +property to either literal "true" or any numeric value >0. For example: +adb root +adb shell setprop persist.sys.bluetooth.debug 1 + +After changing property value Bluetooth needs to be restarted to apply changes. + +There is also a possibility to enable mgmt debug logs which also enables debugs +as above. To enable it procced in the same way as described above but use +system properties called: persist.sys.bluetooth.mgmtdbg + +Note: Debugs are only available on NON USER build variants + + +Customization +------------- + +It is possible to customize BlueZ for Android through Android system properties. +This may include enabling extra profiles or features inside HALs implementation +These properties are read on Bluetooth stack startup only and require stack +restart if changed. All customization properties names start with +"persist.sys.bluetooth." followed by specific HAL name e.g. +"persist.sys.bluetooth.handsfree". This section list available customization +options. + +Property Value Description +------------------------------------------- +handsfree hfp Enable Handsfree Profile (HFP) with narrowband + speech only + hfp_wbs Enable Handsfree Profile (HFP) with narrowband + and wideband speech support + <none> Don't enable Handsfree Profile (HFP) + + +Building and running on Linux +----------------------------- + +It is possible to build and test BlueZ for Android daemon on Linux (eg. PC). +Simply follow instructions available at README file in BlueZ top directory. +Android daemon binary is located at android/bluetoothd. See next section on +how to test Android daemon on Linux. + + +Testing tool +------------ + +BT HAL test tools located in android/haltest is provided for HAL level testing +of both Android daemon and HAL library. Start it with '-n' parameter and type +'bluetooth init' in prompt to initialize HAL library. Running without parameter +will make haltest try to initialize all services after start. On Android +required bluetoothd service will be started automatically. On Linux it is +required to start android/bluetoothd manually before init command timeout or +use provided android/system-emulator, which takes care of launching daemon +automatically on HAL library initialization. To deinitialize HAL library and +stop daemon type 'bluetooth cleanup'. Type 'help' for more information. Tab +completion is also supported. + + +Implementation status +===================== + +Summary of HALs implementation status. + +complete - implementation is feature complete and Android Framework is able + to use it normally +partial - implementation is in progress and not all required features are + present, Android Framework is able to use some of features +initial - only initial implementations is present, Android Framework is + able to initialize but most likely not able to use it +not started - no implementation, Android Framework is not able to initialize it + +Profile ID HAL header Status +--------------------------------------- +core bluetooth.h complete +a2dp bt_av.h complete +gatt bt_gatt.h initial + bt_gatt_client.h initial + bt_gatt_server.h not started +handsfree bt_hf.h complete +hidhost bt_hh.h complete +health bt_hl.h initial +pan bt_pan.h complete +avrcp bt_rc.h complete +socket bt_sock.h complete + + +Implementation shortcomings +=========================== + +It is possible that some of HAL functionality (although being marked as +complete) is missing implementation due to reasons like feature feasibility or +necessity for latest Android Framework. This sections provides list of such +deficiencies. Note that HAL library is always expected to fully implement HAL +API so missing implementation might happen only in daemon. + + +HAL Bluetooth +------------- + +methods: +dut_mode_send never called from Android Framework +le_test_mode never called from Android Framework +get_remote_service_record never called from Android Framework + +callbacks: +dut_mode_recv_cb empty JNI implementation +le_test_mode_cb empty JNI implementation + +properties: +BT_PROPERTY_SERVICE_RECORD not supported for adapter and device, for + device this property is to be returned as + response to get_remote_service_record, + not sure what to return on get_property + calls (records of all services?) + +BT_PROPERTY_REMOTE_VERSION_INFO information required by this property (LMP + information) are not accessible from mgmt + interface, also marking this property as + settable is probably a typo in HAL header + +HAL Socket +---------- + +Support only for BTSOCK_RFCOMM socket type. + + +HAL AVRCP +--------- + +methods: +list_player_app_attr_rsp never called from Android Framework +list_player_app_value_rsp never called from Android Framework +get_player_app_value_rsp never called from Android Framework +get_player_app_attr_text_rsp never called from Android Framework +get_player_app_value_text_rsp never called from Android Framework +set_player_app_value_rsp never called from Android Framework + +callbacks: +list_player_app_attr_cb NULL JNI implementation +list_player_app_values_cb NULL JNI implementation +get_player_app_value_cb NULL JNI implementation +get_player_app_attrs_text_cb NULL JNI implementation +get_player_app_values_text_cb NULL JNI implementation +set_player_app_value_cb NULL JNI implementation + + +Known Android issues +==================== + +It is possible that BlueZ is triggering bugs on Android Framework that could +affect qualification or user experience. This section provides list of +recommended Android fixes that are not part of latest AOSP release supported by +BlueZ. + +https://android-review.googlesource.com/82757 +https://android-review.googlesource.com/87670 +https://android-review.googlesource.com/88384 + + +Unimplemented Bluetooth features +================================ + +Some Bluetooth functionality require support from outside of BT stack +eg. telephony stack. This sections describes profiles optional features not +implemented due to lack of support in other Android subsystems or missing API +in respective BT HALs. + +Profile Feature Comments +-------------------------------------------------------- +HFP Attach a phone number to AT+BINP=1 + a voice tag +HFP Enhanced Call Control AT+CHLD={1x,2x} +HFP Explicit Call Transfer AT+CHLD=4 +HFP Response and Hold AT+BTRH, +BTRH +HFP In-band Ring Tone +BSIR
diff --git a/bluez/android/a2dp.c b/bluez/android/a2dp.c new file mode 100644 index 0000000..4ea16e2 --- /dev/null +++ b/bluez/android/a2dp.c
@@ -0,0 +1,1645 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdint.h> +#include <stdbool.h> +#include <stdlib.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <glib.h> + +#include "btio/btio.h" +#include "lib/bluetooth.h" +#include "lib/sdp.h" +#include "lib/sdp_lib.h" +#include "profiles/audio/a2dp-codecs.h" +#include "src/log.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "ipc.h" +#include "a2dp.h" +#include "utils.h" +#include "bluetooth.h" +#include "avdtp.h" +#include "avrcp.h" +#include "audio-msg.h" + +#define L2CAP_PSM_AVDTP 0x19 +#define SVC_HINT_CAPTURING 0x08 +#define IDLE_TIMEOUT 1 +#define AUDIO_RETRY_TIMEOUT 2 + +static GIOChannel *server = NULL; +static GSList *devices = NULL; +static GSList *endpoints = NULL; +static GSList *setups = NULL; +static bdaddr_t adapter_addr; +static uint32_t record_id = 0; +static guint audio_retry_id = 0; +static bool audio_retrying = false; + +static struct ipc *hal_ipc = NULL; +static struct ipc *audio_ipc = NULL; + +struct a2dp_preset { + void *data; + int8_t len; +}; + +struct a2dp_endpoint { + uint8_t id; + uint8_t codec; + struct avdtp_local_sep *sep; + struct a2dp_preset *caps; + GSList *presets; +}; + +struct a2dp_device { + bdaddr_t dst; + uint8_t state; + GIOChannel *io; + struct avdtp *session; + guint idle_id; +}; + +struct a2dp_setup { + struct a2dp_device *dev; + struct a2dp_endpoint *endpoint; + struct a2dp_preset *preset; + struct avdtp_stream *stream; + uint8_t state; +}; + +static int device_cmp(gconstpointer s, gconstpointer user_data) +{ + const struct a2dp_device *dev = s; + const bdaddr_t *dst = user_data; + + return bacmp(&dev->dst, dst); +} + +static void preset_free(void *data) +{ + struct a2dp_preset *preset = data; + + g_free(preset->data); + g_free(preset); +} + +static void unregister_endpoint(void *data) +{ + struct a2dp_endpoint *endpoint = data; + + if (endpoint->sep) + avdtp_unregister_sep(endpoint->sep); + + if (endpoint->caps) + preset_free(endpoint->caps); + + g_slist_free_full(endpoint->presets, preset_free); + + g_free(endpoint); +} + +static void setup_free(void *data) +{ + struct a2dp_setup *setup = data; + + if (!g_slist_find(setup->endpoint->presets, setup->preset)) + preset_free(setup->preset); + + g_free(setup); +} + +static void setup_remove(struct a2dp_setup *setup) +{ + setups = g_slist_remove(setups, setup); + setup_free(setup); +} + +static void setup_remove_all_by_dev(struct a2dp_device *dev) +{ + GSList *l = setups; + + while (l) { + struct a2dp_setup *setup = l->data; + GSList *next = g_slist_next(l); + + if (setup->dev == dev) + setup_remove(setup); + + l = next; + } +} + +static void a2dp_device_free(void *data) +{ + struct a2dp_device *dev = data; + + if (dev->idle_id > 0) + g_source_remove(dev->idle_id); + + if (dev->session) + avdtp_unref(dev->session); + + if (dev->io) { + g_io_channel_shutdown(dev->io, FALSE, NULL); + g_io_channel_unref(dev->io); + } + + setup_remove_all_by_dev(dev); + + g_free(dev); +} + +static void a2dp_device_remove(struct a2dp_device *dev) +{ + devices = g_slist_remove(devices, dev); + a2dp_device_free(dev); +} + +static struct a2dp_device *a2dp_device_new(const bdaddr_t *dst) +{ + struct a2dp_device *dev; + + dev = g_new0(struct a2dp_device, 1); + bacpy(&dev->dst, dst); + devices = g_slist_prepend(devices, dev); + + return dev; +} + +static bool a2dp_device_connect(struct a2dp_device *dev, BtIOConnect cb) +{ + GError *err = NULL; + + dev->io = bt_io_connect(cb, dev, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_DEST_BDADDR, &dev->dst, + BT_IO_OPT_PSM, L2CAP_PSM_AVDTP, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_INVALID); + if (err) { + error("%s", err->message); + g_error_free(err); + return false; + } + + return true; +} + +static void bt_a2dp_notify_state(struct a2dp_device *dev, uint8_t state) +{ + struct hal_ev_a2dp_conn_state ev; + char address[18]; + + if (dev->state == state) + return; + + dev->state = state; + + ba2str(&dev->dst, address); + DBG("device %s state %u", address, state); + + bdaddr2android(&dev->dst, ev.bdaddr); + ev.state = state; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_A2DP, HAL_EV_A2DP_CONN_STATE, + sizeof(ev), &ev); + + if (state != HAL_A2DP_STATE_DISCONNECTED) + return; + + bt_avrcp_disconnect(&dev->dst); + + a2dp_device_remove(dev); +} + +static void bt_audio_notify_state(struct a2dp_setup *setup, uint8_t state) +{ + struct hal_ev_a2dp_audio_state ev; + char address[18]; + + if (setup->state == state) + return; + + setup->state = state; + + ba2str(&setup->dev->dst, address); + DBG("device %s state %u", address, state); + + bdaddr2android(&setup->dev->dst, ev.bdaddr); + ev.state = state; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_A2DP, HAL_EV_A2DP_AUDIO_STATE, + sizeof(ev), &ev); +} + +static void disconnect_cb(void *user_data) +{ + struct a2dp_device *dev = user_data; + + bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTED); +} + +static int sbc_check_config(void *caps, uint8_t caps_len, void *conf, + uint8_t conf_len) +{ + a2dp_sbc_t *cap, *config; + + if (conf_len != caps_len || conf_len != sizeof(a2dp_sbc_t)) { + error("SBC: Invalid configuration size (%u)", conf_len); + return -EINVAL; + } + + cap = caps; + config = conf; + + if (!(cap->frequency & config->frequency)) { + error("SBC: Unsupported frequency (%u) by endpoint", + config->frequency); + return -EINVAL; + } + + if (!(cap->channel_mode & config->channel_mode)) { + error("SBC: Unsupported channel mode (%u) by endpoint", + config->channel_mode); + return -EINVAL; + } + + if (!(cap->block_length & config->block_length)) { + error("SBC: Unsupported block length (%u) by endpoint", + config->block_length); + return -EINVAL; + } + + if (!(cap->allocation_method & config->allocation_method)) { + error("SBC: Unsupported allocation method (%u) by endpoint", + config->block_length); + return -EINVAL; + } + + if (config->max_bitpool < cap->min_bitpool) { + error("SBC: Invalid maximun bitpool (%u < %u)", + config->max_bitpool, cap->min_bitpool); + return -EINVAL; + } + + if (config->min_bitpool > cap->max_bitpool) { + error("SBC: Invalid minimun bitpool (%u > %u)", + config->min_bitpool, cap->min_bitpool); + return -EINVAL; + } + + if (config->max_bitpool > cap->max_bitpool) + return -ERANGE; + + if (config->min_bitpool < cap->min_bitpool) + return -ERANGE; + + return 0; +} + +static int check_capabilities(struct a2dp_preset *preset, + struct avdtp_media_codec_capability *codec, + uint8_t codec_len) +{ + /* Codec specific */ + switch (codec->media_codec_type) { + case A2DP_CODEC_SBC: + return sbc_check_config(codec->data, codec_len, preset->data, + preset->len); + default: + return -EINVAL; + } +} + +static struct a2dp_preset *sbc_select_range(void *caps, uint8_t caps_len, + void *conf, uint8_t conf_len) +{ + struct a2dp_preset *p; + a2dp_sbc_t *cap, *config; + + cap = caps; + config = conf; + + config->min_bitpool = MAX(config->min_bitpool, cap->min_bitpool); + config->max_bitpool = MIN(config->max_bitpool, cap->max_bitpool); + + p = g_new0(struct a2dp_preset, 1); + p->len = conf_len; + p->data = g_memdup(conf, p->len); + + return p; +} + +static struct a2dp_preset *select_preset_range(struct a2dp_preset *preset, + struct avdtp_media_codec_capability *codec, + uint8_t codec_len) +{ + /* Codec specific */ + switch (codec->media_codec_type) { + case A2DP_CODEC_SBC: + return sbc_select_range(codec->data, codec_len, preset->data, + preset->len); + default: + return NULL; + } +} + +static struct a2dp_preset *select_preset(struct a2dp_endpoint *endpoint, + struct avdtp_remote_sep *rsep) +{ + struct avdtp_service_capability *service; + struct avdtp_media_codec_capability *codec; + GSList *l; + uint8_t codec_len; + + service = avdtp_get_codec(rsep); + codec = (struct avdtp_media_codec_capability *) service->data; + codec_len = service->length - sizeof(*codec); + + for (l = endpoint->presets; l; l = g_slist_next(l)) { + struct a2dp_preset *preset = l->data; + int err; + + err = check_capabilities(preset, codec, codec_len); + if (err == 0) + return preset; + + if (err == -ERANGE) + return select_preset_range(preset, codec, codec_len); + } + + return NULL; +} + +static void setup_add(struct a2dp_device *dev, struct a2dp_endpoint *endpoint, + struct a2dp_preset *preset, struct avdtp_stream *stream) +{ + struct a2dp_setup *setup; + + setup = g_new0(struct a2dp_setup, 1); + setup->dev = dev; + setup->endpoint = endpoint; + setup->preset = preset; + setup->stream = stream; + setups = g_slist_append(setups, setup); + + if (dev->idle_id > 0) { + g_source_remove(dev->idle_id); + dev->idle_id = 0; + } +} + +static int select_configuration(struct a2dp_device *dev, + struct a2dp_endpoint *endpoint, + struct avdtp_remote_sep *rsep) +{ + struct a2dp_preset *preset; + struct avdtp_stream *stream; + struct avdtp_service_capability *service; + struct avdtp_media_codec_capability *codec; + GSList *caps; + int err; + + preset = select_preset(endpoint, rsep); + if (!preset) { + error("Unable to select codec preset"); + return -EINVAL; + } + + service = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT, NULL, 0); + caps = g_slist_append(NULL, service); + + codec = g_malloc0(sizeof(*codec) + preset->len); + codec->media_type = AVDTP_MEDIA_TYPE_AUDIO; + codec->media_codec_type = endpoint->codec; + memcpy(codec->data, preset->data, preset->len); + + service = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, codec, + sizeof(*codec) + preset->len); + caps = g_slist_append(caps, service); + + g_free(codec); + + err = avdtp_set_configuration(dev->session, rsep, endpoint->sep, caps, + &stream); + g_slist_free_full(caps, g_free); + if (err < 0) { + error("avdtp_set_configuration: %s", strerror(-err)); + return err; + } + + setup_add(dev, endpoint, preset, stream); + + return 0; +} + +static void discover_cb(struct avdtp *session, GSList *seps, + struct avdtp_error *err, void *user_data) +{ + struct a2dp_device *dev = user_data; + struct a2dp_endpoint *endpoint = NULL; + struct avdtp_remote_sep *rsep = NULL; + GSList *l; + + for (l = endpoints; l; l = g_slist_next(l)) { + endpoint = l->data; + + rsep = avdtp_find_remote_sep(session, endpoint->sep); + if (rsep) + break; + } + + if (!rsep) { + error("Unable to find matching endpoint"); + goto failed; + } + + if (select_configuration(dev, endpoint, rsep) < 0) + goto failed; + + return; + +failed: + avdtp_shutdown(session); +} + +static gboolean idle_timeout(gpointer user_data) +{ + struct a2dp_device *dev = user_data; + int err; + + dev->idle_id = 0; + + err = avdtp_discover(dev->session, discover_cb, dev); + if (err == 0) + return FALSE; + + error("avdtp_discover: %s", strerror(-err)); + bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTED); + + return FALSE; +} + +static void signaling_connect_cb(GIOChannel *chan, GError *err, + gpointer user_data) +{ + struct a2dp_device *dev = user_data; + uint16_t imtu, omtu; + GError *gerr = NULL; + int fd; + + if (err) { + bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTED); + error("%s", err->message); + return; + } + + bt_io_get(chan, &gerr, + BT_IO_OPT_IMTU, &imtu, + BT_IO_OPT_OMTU, &omtu, + BT_IO_OPT_INVALID); + if (gerr) { + error("%s", gerr->message); + g_error_free(gerr); + goto failed; + } + + fd = g_io_channel_unix_get_fd(chan); + + /* FIXME: Add proper version */ + dev->session = avdtp_new(fd, imtu, omtu, 0x0100); + if (!dev->session) + goto failed; + + avdtp_add_disconnect_cb(dev->session, disconnect_cb, dev); + + if (dev->io) { + g_io_channel_unref(dev->io); + dev->io = NULL; + } + + /* Proceed to stream setup if initiator */ + if (dev->state == HAL_A2DP_STATE_CONNECTING) { + int perr; + + perr = avdtp_discover(dev->session, discover_cb, dev); + if (perr < 0) { + error("avdtp_discover: %s", strerror(-perr)); + goto failed; + } + bt_avrcp_connect(&dev->dst); + } else /* Init idle timeout to discover */ + dev->idle_id = g_timeout_add_seconds(IDLE_TIMEOUT, idle_timeout, + dev); + + return; + +failed: + bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTED); +} + +static void bt_a2dp_connect(const void *buf, uint16_t len) +{ + const struct hal_cmd_a2dp_connect *cmd = buf; + struct a2dp_device *dev; + uint8_t status; + char addr[18]; + bdaddr_t dst; + GSList *l; + + DBG(""); + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = a2dp_device_new(&dst); + if (!a2dp_device_connect(dev, signaling_connect_cb)) { + a2dp_device_remove(dev); + status = HAL_STATUS_FAILED; + goto failed; + } + + ba2str(&dev->dst, addr); + DBG("connecting to %s", addr); + + bt_a2dp_notify_state(dev, HAL_A2DP_STATE_CONNECTING); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_A2DP, HAL_OP_A2DP_CONNECT, status); +} + +static void bt_a2dp_disconnect(const void *buf, uint16_t len) +{ + const struct hal_cmd_a2dp_connect *cmd = buf; + uint8_t status; + struct a2dp_device *dev; + GSList *l; + bdaddr_t dst; + + DBG(""); + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + status = HAL_STATUS_SUCCESS; + + if (dev->io) { + bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTED); + goto failed; + } + + /* Wait AVDTP session to shutdown */ + avdtp_shutdown(dev->session); + bt_a2dp_notify_state(dev, HAL_A2DP_STATE_DISCONNECTING); + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_A2DP, HAL_OP_A2DP_DISCONNECT, + status); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_A2DP_CONNECT */ + { bt_a2dp_connect, false, sizeof(struct hal_cmd_a2dp_connect) }, + /* HAL_OP_A2DP_DISCONNECT */ + { bt_a2dp_disconnect, false, sizeof(struct hal_cmd_a2dp_disconnect) }, +}; + +static struct a2dp_setup *find_setup_by_device(struct a2dp_device *dev) +{ + GSList *l; + + for (l = setups; l; l = g_slist_next(l)) { + struct a2dp_setup *setup = l->data; + + if (setup->dev == dev) + return setup; + } + + return NULL; +} + +static void transport_connect_cb(GIOChannel *chan, GError *err, + gpointer user_data) +{ + struct a2dp_device *dev = user_data; + struct a2dp_setup *setup; + uint16_t imtu, omtu; + GError *gerr = NULL; + int fd; + + if (err) { + error("%s", err->message); + return; + } + + setup = find_setup_by_device(dev); + if (!setup) { + error("Unable to find stream setup"); + return; + } + + bt_io_get(chan, &gerr, + BT_IO_OPT_IMTU, &imtu, + BT_IO_OPT_OMTU, &omtu, + BT_IO_OPT_INVALID); + if (gerr) { + error("%s", gerr->message); + g_error_free(gerr); + return; + } + + fd = g_io_channel_unix_get_fd(chan); + + if (!avdtp_stream_set_transport(setup->stream, fd, imtu, omtu)) { + error("avdtp_stream_set_transport: failed"); + return; + } + + g_io_channel_set_close_on_unref(chan, FALSE); + + if (dev->io) { + g_io_channel_unref(dev->io); + dev->io = NULL; + } + + bt_a2dp_notify_state(dev, HAL_A2DP_STATE_CONNECTED); +} + +static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data) +{ + struct a2dp_device *dev; + bdaddr_t src, dst; + char address[18]; + GError *gerr = NULL; + GSList *l; + + if (err) { + error("%s", err->message); + return; + } + + bt_io_get(chan, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &src, + BT_IO_OPT_DEST_BDADDR, &dst, + BT_IO_OPT_INVALID); + if (gerr) { + error("%s", gerr->message); + g_error_free(gerr); + g_io_channel_shutdown(chan, TRUE, NULL); + return; + } + + ba2str(&dst, address); + DBG("Incoming connection from %s", address); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (l) { + transport_connect_cb(chan, err, l->data); + return; + } + + dev = a2dp_device_new(&dst); + signaling_connect_cb(chan, err, dev); +} + +static sdp_record_t *a2dp_record(void) +{ + sdp_list_t *svclass_id, *pfseq, *apseq, *root; + uuid_t root_uuid, l2cap_uuid, avdtp_uuid, a2dp_uuid; + sdp_profile_desc_t profile[1]; + sdp_list_t *aproto, *proto[2]; + sdp_record_t *record; + sdp_data_t *psm, *version, *features; + uint16_t lp = AVDTP_UUID; + uint16_t a2dp_ver = 0x0103, avdtp_ver = 0x0103, feat = 0x000f; + + record = sdp_record_alloc(); + if (!record) + return NULL; + + sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP); + root = sdp_list_append(NULL, &root_uuid); + sdp_set_browse_groups(record, root); + + sdp_uuid16_create(&a2dp_uuid, AUDIO_SOURCE_SVCLASS_ID); + svclass_id = sdp_list_append(NULL, &a2dp_uuid); + sdp_set_service_classes(record, svclass_id); + + sdp_uuid16_create(&profile[0].uuid, ADVANCED_AUDIO_PROFILE_ID); + profile[0].version = a2dp_ver; + pfseq = sdp_list_append(NULL, &profile[0]); + sdp_set_profile_descs(record, pfseq); + + sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID); + proto[0] = sdp_list_append(NULL, &l2cap_uuid); + psm = sdp_data_alloc(SDP_UINT16, &lp); + proto[0] = sdp_list_append(proto[0], psm); + apseq = sdp_list_append(NULL, proto[0]); + + sdp_uuid16_create(&avdtp_uuid, AVDTP_UUID); + proto[1] = sdp_list_append(NULL, &avdtp_uuid); + version = sdp_data_alloc(SDP_UINT16, &avdtp_ver); + proto[1] = sdp_list_append(proto[1], version); + apseq = sdp_list_append(apseq, proto[1]); + + aproto = sdp_list_append(NULL, apseq); + sdp_set_access_protos(record, aproto); + + features = sdp_data_alloc(SDP_UINT16, &feat); + sdp_attr_add(record, SDP_ATTR_SUPPORTED_FEATURES, features); + + sdp_set_info_attr(record, "Audio Source", NULL, NULL); + + sdp_data_free(psm); + sdp_data_free(version); + sdp_list_free(proto[0], NULL); + sdp_list_free(proto[1], NULL); + sdp_list_free(apseq, NULL); + sdp_list_free(pfseq, NULL); + sdp_list_free(aproto, NULL); + sdp_list_free(root, NULL); + sdp_list_free(svclass_id, NULL); + + return record; +} + +static gboolean sep_getcap_ind(struct avdtp *session, + struct avdtp_local_sep *sep, + GSList **caps, uint8_t *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_preset *cap = endpoint->caps; + struct avdtp_service_capability *service; + struct avdtp_media_codec_capability *codec; + + *caps = NULL; + + service = avdtp_service_cap_new(AVDTP_MEDIA_TRANSPORT, NULL, 0); + *caps = g_slist_append(*caps, service); + + codec = g_malloc0(sizeof(*codec) + cap->len); + codec->media_type = AVDTP_MEDIA_TYPE_AUDIO; + codec->media_codec_type = endpoint->codec; + memcpy(codec->data, cap->data, cap->len); + + service = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, codec, + sizeof(*codec) + cap->len); + *caps = g_slist_append(*caps, service); + g_free(codec); + + return TRUE; +} + +static int check_config(struct a2dp_endpoint *endpoint, + struct a2dp_preset *config) +{ + GSList *l; + struct a2dp_preset *caps; + + for (l = endpoint->presets; l; l = g_slist_next(l)) { + struct a2dp_preset *preset = l->data; + + if (preset->len != config->len) + continue; + + if (memcmp(preset->data, config->data, preset->len) == 0) + return 0; + } + + caps = endpoint->caps; + + /* Codec specific */ + switch (endpoint->codec) { + case A2DP_CODEC_SBC: + return sbc_check_config(caps->data, caps->len, config->data, + config->len); + default: + return -EINVAL; + } +} + +static struct a2dp_device *find_device_by_session(struct avdtp *session) +{ + GSList *l; + + for (l = devices; l; l = g_slist_next(l)) { + struct a2dp_device *dev = l->data; + + if (dev->session == session) + return dev; + } + + return NULL; +} + +static struct a2dp_setup *find_setup(uint8_t id) +{ + GSList *l; + + for (l = setups; l; l = g_slist_next(l)) { + struct a2dp_setup *setup = l->data; + + if (setup->endpoint->id == id) + return setup; + } + + return NULL; +} + +static void setup_remove_by_id(uint8_t id) +{ + struct a2dp_setup *setup; + + setup = find_setup(id); + if (!setup) { + error("Unable to find stream setup for endpoint %u", id); + return; + } + + setup_remove(setup); +} + +static gboolean sep_setconf_ind(struct avdtp *session, + struct avdtp_local_sep *sep, + struct avdtp_stream *stream, + GSList *caps, + avdtp_set_configuration_cb cb, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_device *dev; + struct a2dp_preset *preset = NULL; + + DBG(""); + + dev = find_device_by_session(session); + if (!dev) { + error("Unable to find device for session %p", session); + return FALSE; + } + + for (; caps != NULL; caps = g_slist_next(caps)) { + struct avdtp_service_capability *cap = caps->data; + struct avdtp_media_codec_capability *codec; + + if (cap->category == AVDTP_DELAY_REPORTING) + return FALSE; + + if (cap->category != AVDTP_MEDIA_CODEC) + continue; + + codec = (struct avdtp_media_codec_capability *) cap->data; + + if (codec->media_codec_type != endpoint->codec) + return FALSE; + + preset = g_new0(struct a2dp_preset, 1); + preset->len = cap->length - sizeof(*codec); + preset->data = g_memdup(codec->data, preset->len); + + if (check_config(endpoint, preset) < 0) { + preset_free(preset); + return FALSE; + } + } + + if (!preset) + return FALSE; + + setup_add(dev, endpoint, preset, stream); + + cb(session, stream, NULL); + + return TRUE; +} + +static gboolean sep_open_ind(struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, uint8_t *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_setup *setup; + + DBG(""); + + setup = find_setup(endpoint->id); + if (!setup) { + error("Unable to find stream setup for endpoint %u", + endpoint->id); + *err = AVDTP_SEP_NOT_IN_USE; + return FALSE; + } + + return TRUE; +} + +static gboolean sep_close_ind(struct avdtp *session, + struct avdtp_local_sep *sep, + struct avdtp_stream *stream, + uint8_t *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_setup *setup; + + DBG(""); + + setup = find_setup(endpoint->id); + if (!setup) { + error("Unable to find stream setup for endpoint %u", + endpoint->id); + *err = AVDTP_SEP_NOT_IN_USE; + return FALSE; + } + + bt_audio_notify_state(setup, HAL_AUDIO_STOPPED); + + setup_remove(setup); + + return TRUE; +} + +static gboolean sep_start_ind(struct avdtp *session, + struct avdtp_local_sep *sep, + struct avdtp_stream *stream, + uint8_t *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_setup *setup; + + DBG(""); + + setup = find_setup(endpoint->id); + if (!setup) { + error("Unable to find stream setup for endpoint %u", + endpoint->id); + *err = AVDTP_SEP_NOT_IN_USE; + return FALSE; + } + + bt_audio_notify_state(setup, HAL_AUDIO_STARTED); + + return TRUE; +} + +static gboolean sep_suspend_ind(struct avdtp *session, + struct avdtp_local_sep *sep, + struct avdtp_stream *stream, + uint8_t *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_setup *setup; + + DBG(""); + + setup = find_setup(endpoint->id); + if (!setup) { + error("Unable to find stream setup for endpoint %u", + endpoint->id); + *err = AVDTP_SEP_NOT_IN_USE; + return FALSE; + } + + bt_audio_notify_state(setup, HAL_AUDIO_SUSPEND); + + return TRUE; +} + +static struct avdtp_sep_ind sep_ind = { + .get_capability = sep_getcap_ind, + .set_configuration = sep_setconf_ind, + .open = sep_open_ind, + .close = sep_close_ind, + .start = sep_start_ind, + .suspend = sep_suspend_ind, +}; + +static void sep_setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, + struct avdtp_error *err, void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_setup *setup; + int ret; + + DBG(""); + + setup = find_setup(endpoint->id); + if (!setup) { + error("Unable to find stream setup for endpoint %u", + endpoint->id); + return; + } + + if (err) + goto failed; + + ret = avdtp_open(session, stream); + if (ret < 0) { + error("avdtp_open: %s", strerror(-ret)); + goto failed; + } + + return; + +failed: + setup_remove(setup); +} + +static void sep_open_cfm(struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, struct avdtp_error *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_device *dev; + + DBG(""); + + if (err) + goto failed; + + dev = find_device_by_session(session); + if (!dev) { + error("Unable to find device for session"); + goto failed; + } + + a2dp_device_connect(dev, transport_connect_cb); + + return; + +failed: + setup_remove_by_id(endpoint->id); +} + +static void sep_start_cfm(struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, struct avdtp_error *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_setup *setup; + + DBG(""); + + if (err) { + setup_remove_by_id(endpoint->id); + return; + } + + setup = find_setup(endpoint->id); + if (!setup) { + error("Unable to find stream setup for %u endpoint", + endpoint->id); + return; + } + + bt_audio_notify_state(setup, HAL_AUDIO_STARTED); +} + +static void sep_suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, struct avdtp_error *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_setup *setup; + + DBG(""); + + if (err) { + setup_remove_by_id(endpoint->id); + return; + } + + setup = find_setup(endpoint->id); + if (!setup) { + error("Unable to find stream setup for %u endpoint", + endpoint->id); + return; + } + + bt_audio_notify_state(setup, HAL_AUDIO_STOPPED); +} + +static void sep_close_cfm(struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, struct avdtp_error *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + struct a2dp_setup *setup; + + DBG(""); + + if (err) + return; + + setup = find_setup(endpoint->id); + if (!setup) { + error("Unable to find stream setup for %u endpoint", + endpoint->id); + return; + } + + bt_audio_notify_state(setup, HAL_AUDIO_STOPPED); + + setup_remove(setup); +} + +static void sep_abort_cfm(struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, struct avdtp_error *err, + void *user_data) +{ + struct a2dp_endpoint *endpoint = user_data; + + DBG(""); + + if (err) + return; + + setup_remove_by_id(endpoint->id); +} + +static struct avdtp_sep_cfm sep_cfm = { + .set_configuration = sep_setconf_cfm, + .open = sep_open_cfm, + .start = sep_start_cfm, + .suspend = sep_suspend_cfm, + .close = sep_close_cfm, + .abort = sep_abort_cfm, +}; + +static uint8_t register_endpoint(const uint8_t *uuid, uint8_t codec, + GSList *presets) +{ + struct a2dp_endpoint *endpoint; + + /* FIXME: Add proper check for uuid */ + + endpoint = g_new0(struct a2dp_endpoint, 1); + endpoint->id = g_slist_length(endpoints) + 1; + endpoint->codec = codec; + endpoint->sep = avdtp_register_sep(AVDTP_SEP_TYPE_SOURCE, + AVDTP_MEDIA_TYPE_AUDIO, + codec, FALSE, &sep_ind, + &sep_cfm, endpoint); + endpoint->caps = presets->data; + endpoint->presets = g_slist_copy(g_slist_nth(presets, 1)); + + endpoints = g_slist_append(endpoints, endpoint); + + return endpoint->id; +} + +static GSList *parse_presets(const struct audio_preset *p, uint8_t count, + uint16_t len) +{ + GSList *l = NULL; + uint8_t i; + + for (i = 0; count > i; i++) { + const uint8_t *ptr = (const uint8_t *) p; + struct a2dp_preset *preset; + + if (len < sizeof(struct audio_preset)) { + DBG("Invalid preset index %u", i); + g_slist_free_full(l, preset_free); + return NULL; + } + + len -= sizeof(struct audio_preset); + if (len == 0 || len < p->len) { + DBG("Invalid preset size of %u for index %u", len, i); + g_slist_free_full(l, preset_free); + return NULL; + } + + preset = g_new0(struct a2dp_preset, 1); + preset->len = p->len; + preset->data = g_memdup(p->data, preset->len); + l = g_slist_append(l, preset); + + len -= preset->len; + ptr += sizeof(*p) + preset->len; + p = (const struct audio_preset *) ptr; + } + + return l; +} + +static void bt_audio_open(const void *buf, uint16_t len) +{ + const struct audio_cmd_open *cmd = buf; + struct audio_rsp_open rsp; + GSList *presets; + + DBG(""); + + audio_retrying = false; + + if (cmd->presets == 0) { + error("No audio presets found"); + goto failed; + } + + presets = parse_presets(cmd->preset, cmd->presets, len - sizeof(*cmd)); + if (!presets) { + error("No audio presets found"); + goto failed; + } + + rsp.id = register_endpoint(cmd->uuid, cmd->codec, presets); + if (rsp.id == 0) { + g_slist_free_full(presets, preset_free); + error("Unable to register endpoint"); + goto failed; + } + + g_slist_free(presets); + + ipc_send_rsp_full(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_OPEN, + sizeof(rsp), &rsp, -1); + + return; + +failed: + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_OPEN, + AUDIO_STATUS_FAILED); +} + +static struct a2dp_endpoint *find_endpoint(uint8_t id) +{ + GSList *l; + + for (l = endpoints; l; l = g_slist_next(l)) { + struct a2dp_endpoint *endpoint = l->data; + + if (endpoint->id == id) + return endpoint; + } + + return NULL; +} + +static void bt_audio_close(const void *buf, uint16_t len) +{ + const struct audio_cmd_close *cmd = buf; + struct a2dp_endpoint *endpoint; + + DBG(""); + + endpoint = find_endpoint(cmd->id); + if (!endpoint) { + error("Unable to find endpoint %u", cmd->id); + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_CLOSE, + AUDIO_STATUS_FAILED); + return; + } + + endpoints = g_slist_remove(endpoints, endpoint); + unregister_endpoint(endpoint); + + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_CLOSE, + AUDIO_STATUS_SUCCESS); +} + +static void bt_stream_open(const void *buf, uint16_t len) +{ + const struct audio_cmd_open_stream *cmd = buf; + struct audio_rsp_open_stream *rsp; + struct a2dp_setup *setup; + int fd; + uint16_t omtu; + + DBG(""); + + setup = find_setup(cmd->id); + if (!setup) { + error("Unable to find stream for endpoint %u", cmd->id); + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_OPEN_STREAM, + AUDIO_STATUS_FAILED); + return; + } + + if (!avdtp_stream_get_transport(setup->stream, &fd, NULL, &omtu, + NULL)) { + error("avdtp_stream_get_transport: failed"); + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_OPEN_STREAM, + AUDIO_STATUS_FAILED); + return; + } + + len = sizeof(struct audio_rsp_open_stream) + + sizeof(struct audio_preset) + setup->preset->len; + rsp = g_malloc0(len); + rsp->mtu = omtu; + rsp->preset->len = setup->preset->len; + memcpy(rsp->preset->data, setup->preset->data, setup->preset->len); + + ipc_send_rsp_full(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_OPEN_STREAM, + len, rsp, fd); + + g_free(rsp); +} + +static void bt_stream_close(const void *buf, uint16_t len) +{ + const struct audio_cmd_close_stream *cmd = buf; + struct a2dp_setup *setup; + int err; + + DBG(""); + + setup = find_setup(cmd->id); + if (!setup) { + error("Unable to find stream for endpoint %u", cmd->id); + goto failed; + } + + err = avdtp_close(setup->dev->session, setup->stream, FALSE); + if (err < 0) { + error("avdtp_close: %s", strerror(-err)); + goto failed; + } + + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_CLOSE_STREAM, + AUDIO_STATUS_SUCCESS); + + return; + +failed: + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_CLOSE_STREAM, + AUDIO_STATUS_FAILED); +} + +static void bt_stream_resume(const void *buf, uint16_t len) +{ + const struct audio_cmd_resume_stream *cmd = buf; + struct a2dp_setup *setup; + int err; + + DBG(""); + + setup = find_setup(cmd->id); + if (!setup) { + error("Unable to find stream for endpoint %u", cmd->id); + goto failed; + } + + if (setup->state != HAL_AUDIO_STARTED) { + err = avdtp_start(setup->dev->session, setup->stream); + if (err < 0) { + error("avdtp_start: %s", strerror(-err)); + goto failed; + } + } + + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_RESUME_STREAM, + AUDIO_STATUS_SUCCESS); + + return; + +failed: + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_RESUME_STREAM, + AUDIO_STATUS_FAILED); +} + +static void bt_stream_suspend(const void *buf, uint16_t len) +{ + const struct audio_cmd_suspend_stream *cmd = buf; + struct a2dp_setup *setup; + int err; + + DBG(""); + + setup = find_setup(cmd->id); + if (!setup) { + error("Unable to find stream for endpoint %u", cmd->id); + goto failed; + } + + err = avdtp_suspend(setup->dev->session, setup->stream); + if (err < 0) { + error("avdtp_suspend: %s", strerror(-err)); + goto failed; + } + + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_SUSPEND_STREAM, + AUDIO_STATUS_SUCCESS); + + return; + +failed: + ipc_send_rsp(audio_ipc, AUDIO_SERVICE_ID, AUDIO_OP_SUSPEND_STREAM, + AUDIO_STATUS_FAILED); +} + +static const struct ipc_handler audio_handlers[] = { + /* AUDIO_OP_OPEN */ + { bt_audio_open, true, sizeof(struct audio_cmd_open) }, + /* AUDIO_OP_CLOSE */ + { bt_audio_close, false, sizeof(struct audio_cmd_close) }, + /* AUDIO_OP_OPEN_STREAM */ + { bt_stream_open, false, sizeof(struct audio_cmd_open_stream) }, + /* AUDIO_OP_CLOSE_STREAM */ + { bt_stream_close, false, sizeof(struct audio_cmd_close_stream) }, + /* AUDIO_OP_RESUME_STREAM */ + { bt_stream_resume, false, sizeof(struct audio_cmd_resume_stream) }, + /* AUDIO_OP_SUSPEND_STREAM */ + { bt_stream_suspend, false, sizeof(struct audio_cmd_suspend_stream) }, +}; + +static void bt_audio_unregister(void) +{ + DBG(""); + + if (audio_retry_id > 0) + g_source_remove(audio_retry_id); + + g_slist_free_full(endpoints, unregister_endpoint); + endpoints = NULL; + + g_slist_free_full(setups, setup_free); + setups = NULL; + + ipc_cleanup(audio_ipc); + audio_ipc = NULL; +} + +static bool bt_audio_register(ipc_disconnect_cb disconnect) +{ + DBG(""); + + audio_ipc = ipc_init(BLUEZ_AUDIO_SK_PATH, sizeof(BLUEZ_AUDIO_SK_PATH), + AUDIO_SERVICE_ID_MAX, false, disconnect, NULL); + if (!audio_ipc) + return false; + + ipc_register(audio_ipc, AUDIO_SERVICE_ID, audio_handlers, + G_N_ELEMENTS(audio_handlers)); + + return true; +} + +static gboolean audio_retry_register(void *data) +{ + ipc_disconnect_cb cb = data; + + audio_retry_id = 0; + audio_retrying = true; + + bt_audio_register(cb); + + return FALSE; +} + +static void audio_disconnected(void *data) +{ + GSList *l; + bool restart; + + DBG(""); + + if (audio_retrying) + goto retry; + + restart = endpoints != NULL ? true : false; + + bt_audio_unregister(); + + for (l = devices; l; l = g_slist_next(l)) { + struct a2dp_device *dev = l->data; + + avdtp_shutdown(dev->session); + } + + if (!restart) + return; + +retry: + audio_retry_id = g_timeout_add_seconds(AUDIO_RETRY_TIMEOUT, + audio_retry_register, + audio_disconnected); +} + +bool bt_a2dp_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode) +{ + GError *err = NULL; + sdp_record_t *rec; + + DBG(""); + + bacpy(&adapter_addr, addr); + + server = bt_io_listen(connect_cb, NULL, NULL, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_PSM, L2CAP_PSM_AVDTP, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_INVALID); + if (!server) { + error("Failed to listen on AVDTP channel: %s", err->message); + g_error_free(err); + return false; + } + + rec = a2dp_record(); + if (!rec) { + error("Failed to allocate A2DP record"); + goto fail; + } + + if (bt_adapter_add_record(rec, SVC_HINT_CAPTURING) < 0) { + error("Failed to register A2DP record"); + sdp_record_free(rec); + goto fail; + } + record_id = rec->handle; + + hal_ipc = ipc; + + ipc_register(hal_ipc, HAL_SERVICE_ID_A2DP, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); + + if (bt_audio_register(audio_disconnected)) + return true; + +fail: + g_io_channel_shutdown(server, TRUE, NULL); + g_io_channel_unref(server); + server = NULL; + return false; +} + +void bt_a2dp_unregister(void) +{ + DBG(""); + + g_slist_free_full(setups, setup_free); + setups = NULL; + + g_slist_free_full(endpoints, unregister_endpoint); + endpoints = NULL; + + g_slist_free_full(devices, a2dp_device_free); + devices = NULL; + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_A2DP); + hal_ipc = NULL; + + bt_adapter_remove_record(record_id); + record_id = 0; + + if (server) { + g_io_channel_shutdown(server, TRUE, NULL); + g_io_channel_unref(server); + server = NULL; + } + + if (audio_ipc) { + ipc_unregister(audio_ipc, AUDIO_SERVICE_ID); + ipc_cleanup(audio_ipc); + audio_ipc = NULL; + } +}
diff --git a/bluez/android/a2dp.h b/bluez/android/a2dp.h new file mode 100644 index 0000000..8a70407 --- /dev/null +++ b/bluez/android/a2dp.h
@@ -0,0 +1,25 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +bool bt_a2dp_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode); +void bt_a2dp_unregister(void);
diff --git a/bluez/android/android-tester.c b/bluez/android/android-tester.c new file mode 100644 index 0000000..6d2edc7 --- /dev/null +++ b/bluez/android/android-tester.c
@@ -0,0 +1,4856 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdlib.h> +#include <unistd.h> +#include <fcntl.h> + +#include <glib.h> +#include <sys/socket.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <sys/un.h> +#include <sys/signalfd.h> +#include <libgen.h> + +#include "lib/bluetooth.h" +#include "lib/mgmt.h" + +#include "src/shared/util.h" +#include "src/shared/tester.h" +#include "src/shared/mgmt.h" +#include "src/shared/hciemu.h" + +#include "emulator/bthost.h" +#include "monitor/bt.h" + +#include <hardware/hardware.h> +#include <hardware/bluetooth.h> +#include <hardware/bt_sock.h> +#include <hardware/bt_hh.h> + +#include "utils.h" + +struct priority_property { + bt_property_t prop; + int prio; +}; + +struct generic_data { + int expected_adapter_status; + uint32_t expect_settings_set; + int expected_cb_count; + bt_property_t set_property; + bt_callbacks_t expected_hal_cb; + struct priority_property *expected_properties; + uint8_t expected_properties_num; +}; + +struct socket_data { + btsock_type_t sock_type; + const char *service_name; + const uint8_t *service_uuid; + const bt_bdaddr_t *bdaddr; + int channel; + int flags; + bt_status_t expected_status; + bool test_channel; +}; + +struct hidhost_generic_data { + bthh_status_t expected_status; + int expected_conn_state; + int expected_cb_count; + bthh_protocol_mode_t expected_protocol_mode; + int expected_report; + bthh_callbacks_t expected_hal_cb; + int expected_report_size; +}; + +#define WAIT_FOR_SIGNAL_TIME 2 /* in seconds */ +#define EMULATOR_SIGNAL "emulator_started" + +#define BT_STATUS_NOT_EXPECTED -1 + +struct test_data { + struct mgmt *mgmt; + uint16_t mgmt_index; + unsigned int mgmt_settings_id; + struct hciemu *hciemu; + enum hciemu_type hciemu_type; + const void *test_data; + pid_t bluetoothd_pid; + guint signalfd; + + struct hw_device_t *device; + const bt_interface_t *if_bluetooth; + const btsock_interface_t *if_sock; + const bthh_interface_t *if_hid; + + int conditions_left; + + /* Set to true if test conditions should be verified */ + bool test_checks_valid; + + bool test_result_set; + + int cb_count; + GSList *expected_properties_list; + + /* hidhost */ + uint16_t sdp_handle; + uint16_t sdp_cid; + uint16_t ctrl_handle; + uint16_t ctrl_cid; + uint16_t intr_handle; + uint16_t intr_cid; +}; + +struct bt_cb_data { + bt_state_t state; + bt_status_t status; + + bt_bdaddr_t bdaddr; + bt_bdname_t bdname; + uint32_t cod; + + bt_ssp_variant_t ssp_variant; + uint32_t passkey; + + int num; + bt_property_t *props; +}; + +struct hh_cb_data { + bt_bdaddr_t bdaddr; + + bthh_status_t status; + bthh_hid_info_t hid_info; + bthh_protocol_mode_t mode; + bthh_connection_state_t state; + + uint8_t *report; + int size; +}; + +static char exec_dir[PATH_MAX + 1]; + +static gint scheduled_cbacks_num = 0; + +static gboolean check_callbacks_called(gpointer user_data) +{ + /* Wait for all callbacks scheduled in current test context to execute + * in main loop. This will avoid late callback calls after test case has + * already failed or timed out. + */ + + if (g_atomic_int_get(&scheduled_cbacks_num) == 0) { + tester_teardown_complete(); + return FALSE; + } + + return TRUE; +} +static void check_daemon_term(void) +{ + int status; + pid_t pid; + struct test_data *data = tester_get_data(); + + if (!data) + return; + + pid = waitpid(data->bluetoothd_pid, &status, WNOHANG); + if (pid != data->bluetoothd_pid) + return; + + data->bluetoothd_pid = 0; + + if (WIFEXITED(status) && (WEXITSTATUS(status) == EXIT_SUCCESS)) { + g_idle_add(check_callbacks_called, NULL); + return; + } + + tester_warn("Unexpected Daemon shutdown with status %d", status); +} + +static gboolean signal_handler(GIOChannel *channel, GIOCondition cond, + gpointer user_data) +{ + struct signalfd_siginfo si; + ssize_t result; + int fd; + + if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) + return FALSE; + + fd = g_io_channel_unix_get_fd(channel); + + result = read(fd, &si, sizeof(si)); + if (result != sizeof(si)) + return FALSE; + + switch (si.ssi_signo) { + case SIGCHLD: + check_daemon_term(); + break; + } + + return TRUE; +} + +static guint setup_signalfd(void) +{ + GIOChannel *channel; + guint source; + sigset_t mask; + int fd; + + sigemptyset(&mask); + sigaddset(&mask, SIGCHLD); + + if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) + return 0; + + fd = signalfd(-1, &mask, 0); + if (fd < 0) + return 0; + + channel = g_io_channel_unix_new(fd); + + g_io_channel_set_close_on_unref(channel, TRUE); + g_io_channel_set_encoding(channel, NULL, NULL); + g_io_channel_set_buffered(channel, FALSE); + + source = g_io_add_watch(channel, + G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, + signal_handler, NULL); + + g_io_channel_unref(channel); + + return source; +} + +static void mgmt_debug(const char *str, void *user_data) +{ + const char *prefix = user_data; + + tester_print("%s%s", prefix, str); +} + +static void test_update_state(void) +{ + struct test_data *data = tester_get_data(); + + if (data->conditions_left == 0 && !data->test_result_set) { + data->test_result_set = true; + tester_test_passed(); + } +} + +static void test_mgmt_settings_set(struct test_data *data) +{ + data->conditions_left--; + + test_update_state(); +} + +static void command_generic_new_settings(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test_data = data->test_data; + uint32_t settings; + + if (length != 4) { + tester_warn("Invalid parameter size for new settings event"); + tester_test_failed(); + return; + } + + settings = get_le32(param); + + if ((settings & test_data->expect_settings_set) != + test_data->expect_settings_set) + return; + + test_mgmt_settings_set(data); + mgmt_unregister(data->mgmt, data->mgmt_settings_id); +} + +static void check_cb_count(void) +{ + struct test_data *data = tester_get_data(); + + if (!data->test_checks_valid) + return; + + if (data->cb_count == 0) { + data->conditions_left--; + test_update_state(); + } +} + +static void expected_cb_count_init(struct test_data *data) +{ + const struct generic_data *test_data = data->test_data; + + data->cb_count = test_data->expected_cb_count; + + check_cb_count(); +} + +static void mgmt_cb_init(struct test_data *data) +{ + const struct generic_data *test_data = data->test_data; + + if (!test_data->expect_settings_set) + test_mgmt_settings_set(data); + else + data->mgmt_settings_id = mgmt_register(data->mgmt, + MGMT_EV_NEW_SETTINGS, data->mgmt_index, + command_generic_new_settings, NULL, NULL); +} + +static void expected_status_init(struct test_data *data) +{ + const struct generic_data *test_data = data->test_data; + + if (test_data->expected_adapter_status == BT_STATUS_NOT_EXPECTED) + data->conditions_left--; +} + +static void test_property_init(struct test_data *data) +{ + const struct generic_data *test_data = data->test_data; + GSList *l = data->expected_properties_list; + int i; + + if (!test_data->expected_properties_num) { + data->conditions_left--; + return; + } + + for (i = 0; i < test_data->expected_properties_num; i++) + l = g_slist_prepend(l, &(test_data->expected_properties[i])); + + data->expected_properties_list = l; +} + +static void init_test_conditions(struct test_data *data) +{ + data->test_checks_valid = true; + + data->conditions_left = 4; + + expected_cb_count_init(data); + mgmt_cb_init(data); + expected_status_init(data); + test_property_init(data); +} + +static void check_expected_status(uint8_t status) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test_data = data->test_data; + + if (test_data->expected_adapter_status == status) { + data->conditions_left--; + test_update_state(); + } else + tester_test_failed(); +} + +static int locate_property(gconstpointer expected_data, + gconstpointer received_prop) +{ + bt_property_t rec_prop = *((bt_property_t *)received_prop); + bt_property_t exp_prop = + ((struct priority_property *)expected_data)->prop; + + if (exp_prop.type && (exp_prop.type != rec_prop.type)) + return 1; + if (exp_prop.len && (exp_prop.len != rec_prop.len)) + return 1; + if (exp_prop.val && memcmp(exp_prop.val, rec_prop.val, exp_prop.len)) + return 1; + + return 0; +} + +static int compare_priorities(gconstpointer prop_list, gconstpointer priority) +{ + int prio = GPOINTER_TO_INT(priority); + int comp_prio = ((struct priority_property *)prop_list)->prio; + + if (prio > comp_prio) + return 0; + + return 1; +} + +static bool check_prop_priority(int rec_prop_prio) +{ + struct test_data *data = tester_get_data(); + GSList *l = data->expected_properties_list; + + if (!rec_prop_prio || !g_slist_length(l)) + return true; + + if (g_slist_find_custom(l, GINT_TO_POINTER(rec_prop_prio), + &compare_priorities)) + return false; + + return true; +} + +static void check_expected_property(bt_property_t received_prop) +{ + struct test_data *data = tester_get_data(); + int rec_prio; + GSList *l = data->expected_properties_list; + GSList *found_exp_prop; + + if (!g_slist_length(l)) + return; + + found_exp_prop = g_slist_find_custom(l, &received_prop, + &locate_property); + + if (found_exp_prop) { + rec_prio = ((struct priority_property *) + (found_exp_prop->data))->prio; + if (check_prop_priority(rec_prio)) + l = g_slist_remove(l, found_exp_prop->data); + } + + data->expected_properties_list = l; + + if (g_slist_length(l)) + return; + + data->conditions_left--; + test_update_state(); +} + +static bool check_test_property(bt_property_t received_prop, + bt_property_t expected_prop) +{ + if (expected_prop.type && (expected_prop.type != received_prop.type)) + return false; + if (expected_prop.len && (expected_prop.len != received_prop.len)) + return false; + if (expected_prop.val && memcmp(expected_prop.val, received_prop.val, + expected_prop.len)) + return false; + + return true; +} + +static void read_info_callback(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + const struct mgmt_rp_read_info *rp = param; + char addr[18]; + uint16_t manufacturer; + uint32_t supported_settings, current_settings; + + tester_print("Read Info callback"); + tester_print(" Status: 0x%02x", status); + + if (status || !param) { + tester_pre_setup_failed(); + return; + } + + ba2str(&rp->bdaddr, addr); + manufacturer = btohs(rp->manufacturer); + supported_settings = btohl(rp->supported_settings); + current_settings = btohl(rp->current_settings); + + tester_print(" Address: %s", addr); + tester_print(" Version: 0x%02x", rp->version); + tester_print(" Manufacturer: 0x%04x", manufacturer); + tester_print(" Supported settings: 0x%08x", supported_settings); + tester_print(" Current settings: 0x%08x", current_settings); + tester_print(" Class: 0x%02x%02x%02x", + rp->dev_class[2], rp->dev_class[1], rp->dev_class[0]); + tester_print(" Name: %s", rp->name); + tester_print(" Short name: %s", rp->short_name); + + if (strcmp(hciemu_get_address(data->hciemu), addr)) { + tester_pre_setup_failed(); + return; + } + + tester_pre_setup_complete(); +} + +static void index_added_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + + tester_print("Index Added callback"); + tester_print(" Index: 0x%04x", index); + + data->mgmt_index = index; + + mgmt_send(data->mgmt, MGMT_OP_READ_INFO, data->mgmt_index, 0, NULL, + read_info_callback, NULL, NULL); +} + +static void index_removed_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + + tester_print("Index Removed callback"); + tester_print(" Index: 0x%04x", index); + + if (index != data->mgmt_index) + return; + + mgmt_unregister_index(data->mgmt, data->mgmt_index); + + mgmt_unref(data->mgmt); + data->mgmt = NULL; + + tester_post_teardown_complete(); +} + +static void read_index_list_callback(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + + tester_print("Read Index List callback"); + tester_print(" Status: 0x%02x", status); + + if (status || !param) { + tester_pre_setup_failed(); + return; + } + + mgmt_register(data->mgmt, MGMT_EV_INDEX_ADDED, MGMT_INDEX_NONE, + index_added_callback, NULL, NULL); + + mgmt_register(data->mgmt, MGMT_EV_INDEX_REMOVED, MGMT_INDEX_NONE, + index_removed_callback, NULL, NULL); + + data->hciemu = hciemu_new(data->hciemu_type); + if (!data->hciemu) { + tester_warn("Failed to setup HCI emulation"); + tester_pre_setup_failed(); + return; + } + + tester_print("New hciemu instance created"); +} + +static void test_pre_setup(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + data->signalfd = setup_signalfd(); + if (!data->signalfd) { + tester_warn("Failed to setup signalfd"); + tester_pre_setup_failed(); + return; + } + + data->mgmt = mgmt_new_default(); + if (!data->mgmt) { + tester_warn("Failed to setup management interface"); + tester_pre_setup_failed(); + return; + } + + if (!tester_use_debug()) + fclose(stderr); + else + mgmt_set_debug(data->mgmt, mgmt_debug, "mgmt: ", NULL); + + mgmt_send(data->mgmt, MGMT_OP_READ_INDEX_LIST, MGMT_INDEX_NONE, 0, + NULL, read_index_list_callback, NULL, NULL); +} + +static void test_post_teardown(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + hciemu_unref(data->hciemu); + data->hciemu = NULL; + + g_source_remove(data->signalfd); + data->signalfd = 0; +} + +static void bluetoothd_start(int hci_index) +{ + char prg_name[PATH_MAX + 1]; + char index[8]; + char *prg_argv[5]; + + snprintf(prg_name, sizeof(prg_name), "%s/%s", exec_dir, "bluetoothd"); + snprintf(index, sizeof(index), "%d", hci_index); + + prg_argv[0] = prg_name; + prg_argv[1] = "-i"; + prg_argv[2] = index; + prg_argv[3] = "-d"; + prg_argv[4] = NULL; + + if (!tester_use_debug()) + fclose(stderr); + + execve(prg_argv[0], prg_argv, NULL); +} + +static void emulator(int pipe, int hci_index) +{ + static const char SYSTEM_SOCKET_PATH[] = "\0android_system"; + char buf[1024]; + struct sockaddr_un addr; + struct timeval tv; + int fd; + ssize_t len; + + fd = socket(PF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0); + if (fd < 0) + goto failed; + + tv.tv_sec = WAIT_FOR_SIGNAL_TIME; + tv.tv_usec = 0; + setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv)); + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + memcpy(addr.sun_path, SYSTEM_SOCKET_PATH, sizeof(SYSTEM_SOCKET_PATH)); + + if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + perror("Failed to bind system socket"); + goto failed; + } + + len = write(pipe, EMULATOR_SIGNAL, sizeof(EMULATOR_SIGNAL)); + if (len != sizeof(EMULATOR_SIGNAL)) + goto failed; + + memset(buf, 0, sizeof(buf)); + + len = read(fd, buf, sizeof(buf)); + if (len <= 0 || strcmp(buf, "bluetooth.start=daemon")) + goto failed; + + close(pipe); + close(fd); + return bluetoothd_start(hci_index); + +failed: + close(pipe); + + if (fd >= 0) + close(fd); +} + +static void emu_connectable_complete(uint16_t opcode, uint8_t status, + const void *param, uint8_t len, + void *user_data) +{ + switch (opcode) { + case BT_HCI_CMD_WRITE_SCAN_ENABLE: + case BT_HCI_CMD_LE_SET_ADV_ENABLE: + break; + default: + return; + } + + tester_print("Emulated remote set connectable status 0x%02x", status); + + if (status) + tester_setup_failed(); + else + tester_setup_complete(); +} + +static void setup_powered_emulated_remote(void) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost; + + tester_print("Controller powered on"); + + bthost = hciemu_client_get_host(data->hciemu); + bthost_set_cmd_complete_cb(bthost, emu_connectable_complete, data); + + if (data->hciemu_type == HCIEMU_TYPE_LE) + bthost_set_adv_enable(bthost, 0x01); + else + bthost_write_scan_enable(bthost, 0x03); +} + +static void enable_success_cb(bt_state_t state) +{ + struct test_data *data = tester_get_data(); + + if (state == BT_STATE_ON) { + setup_powered_emulated_remote(); + data->cb_count--; + check_cb_count(); + } +} + +static void disable_success_cb(bt_state_t state) +{ + struct test_data *data = tester_get_data(); + + if (state == BT_STATE_OFF) { + data->cb_count--; + check_cb_count(); + } +} + +static gboolean adapter_state_changed(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + struct bt_cb_data *cb_data = user_data; + + if (data->test_checks_valid && + test->expected_hal_cb.adapter_state_changed_cb) { + test->expected_hal_cb.adapter_state_changed_cb(cb_data->state); + goto cleanup; + } + + if (!data->test_checks_valid && cb_data->state == BT_STATE_ON) + setup_powered_emulated_remote(); + +cleanup: + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void adapter_state_changed_cb(bt_state_t state) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->state = state; + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(adapter_state_changed, cb_data); +} + +static void discovery_start_success_cb(bt_discovery_state_t state) +{ + struct test_data *data = tester_get_data(); + + if (state == BT_DISCOVERY_STARTED) { + data->cb_count--; + check_cb_count(); + } +} + +static void discovery_start_done_cb(bt_discovery_state_t state) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + + status = data->if_bluetooth->start_discovery(); + data->cb_count--; + + check_cb_count(); + check_expected_status(status); +} + +static void discovery_stop_success_cb(bt_discovery_state_t state) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + + if (state == BT_DISCOVERY_STARTED && data->cb_count == 2) { + status = data->if_bluetooth->cancel_discovery(); + check_expected_status(status); + data->cb_count--; + return; + } + if (state == BT_DISCOVERY_STOPPED && data->cb_count == 1) { + data->cb_count--; + check_cb_count(); + } +} + +static void discovery_device_found_state_changed_cb(bt_discovery_state_t state) +{ + struct test_data *data = tester_get_data(); + + if (state == BT_DISCOVERY_STARTED && data->cb_count == 3) { + data->cb_count--; + return; + } + if (state == BT_DISCOVERY_STOPPED && data->cb_count == 1) { + data->cb_count--; + check_cb_count(); + } +} + +static void remote_discovery_state_changed_cb(bt_discovery_state_t state) +{ + struct test_data *data = tester_get_data(); + + if (state == BT_DISCOVERY_STARTED && data->cb_count == 3) { + data->cb_count--; + return; + } + if (state == BT_DISCOVERY_STOPPED && data->cb_count == 1) { + data->cb_count--; + check_cb_count(); + } +} + +static void remote_setprop_disc_state_changed_cb(bt_discovery_state_t state) +{ + struct test_data *data = tester_get_data(); + + if (state == BT_DISCOVERY_STARTED && data->cb_count == 4) { + data->cb_count--; + return; + } + if (state == BT_DISCOVERY_STOPPED) { + data->cb_count--; + check_cb_count(); + } +} + +static gboolean discovery_state_changed(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + struct bt_cb_data *cb_data = user_data; + + if (test && test->expected_hal_cb.discovery_state_changed_cb) + test->expected_hal_cb.discovery_state_changed_cb( + cb_data->state); + + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void discovery_state_changed_cb(bt_discovery_state_t state) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->state = state; + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(discovery_state_changed, cb_data); +} + +static bt_property_t *copy_properties(int num_properties, + bt_property_t *properties) +{ + int i; + bt_property_t *props = g_new0(bt_property_t, num_properties); + + for (i = 0; i < num_properties; i++) { + props[i].type = properties[i].type; + props[i].len = properties[i].len; + props[i].val = g_memdup(properties[i].val, properties[i].len); + } + + return props; +} + +static void free_properties(int num_properties, bt_property_t *properties) +{ + int i; + + for (i = 0; i < num_properties; i++) + g_free(properties[i].val); + + g_free(properties); +} + +static void discovery_device_found_cb(int num_properties, + bt_property_t *properties) +{ + struct test_data *data = tester_get_data(); + uint8_t *remote_bdaddr = + (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + uint32_t emu_remote_type = BT_DEVICE_DEVTYPE_BREDR; + int32_t emu_remote_rssi = -60; + bt_bdaddr_t emu_remote_bdaddr; + int i; + bt_property_t expected_prop; + bt_property_t received_prop; + + data->cb_count--; + check_cb_count(); + + if (num_properties < 1) { + tester_test_failed(); + return; + } + + bdaddr2android((const bdaddr_t *) remote_bdaddr, &emu_remote_bdaddr); + + for (i = 0; i < num_properties; i++) { + received_prop = properties[i]; + + switch (properties[i].type) { + case BT_PROPERTY_BDADDR: + expected_prop.type = BT_PROPERTY_BDADDR; + expected_prop.len = sizeof(emu_remote_bdaddr); + expected_prop.val = &emu_remote_bdaddr; + break; + + case BT_PROPERTY_TYPE_OF_DEVICE: + expected_prop.type = BT_PROPERTY_TYPE_OF_DEVICE; + expected_prop.len = sizeof(emu_remote_type); + expected_prop.val = &emu_remote_type; + break; + + case BT_PROPERTY_REMOTE_RSSI: + expected_prop.type = BT_PROPERTY_REMOTE_RSSI; + expected_prop.len = sizeof(emu_remote_rssi); + expected_prop.val = &emu_remote_rssi; + break; + + default: + expected_prop.type = 0; + expected_prop.len = 0; + expected_prop.val = NULL; + break; + } + + if (!check_test_property(received_prop, expected_prop)) { + data->if_bluetooth->cancel_discovery(); + tester_test_failed(); + return; + } + } + + data->if_bluetooth->cancel_discovery(); +} + +static void remote_getprops_device_found_cb(int num_properties, + bt_property_t *properties) +{ + struct test_data *data = tester_get_data(); + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + if (data->cb_count == 2) + data->cb_count--; + + data->if_bluetooth->cancel_discovery(); + data->if_bluetooth->get_remote_device_properties(&remote_addr); +} + +static void remote_get_property_device_found_cb(int num_properties, + bt_property_t *properties) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + bt_status_t status; + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + + const bt_property_t prop = test->expected_properties[0].prop; + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + if (data->cb_count == 2) + data->cb_count--; + + data->if_bluetooth->cancel_discovery(); + status = data->if_bluetooth->get_remote_device_property(&remote_addr, + prop.type); + check_expected_status(status); +} + +static void remote_setprop_device_found_cb(int num_properties, + bt_property_t *properties) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + bt_status_t status; + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + + const bt_property_t prop = test->expected_properties[0].prop; + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + if (data->cb_count == 3) + data->cb_count--; + + data->if_bluetooth->cancel_discovery(); + status = data->if_bluetooth->set_remote_device_property(&remote_addr, + &prop); + check_expected_status(status); +} + +static void remote_setprop_fail_device_found_cb(int num_properties, + bt_property_t *properties) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + bt_status_t status; + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + + const bt_property_t prop = test->expected_properties[0].prop; + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + if (data->cb_count == 2) + data->cb_count--; + + data->if_bluetooth->cancel_discovery(); + status = data->if_bluetooth->set_remote_device_property(&remote_addr, + &prop); + check_expected_status(status); +} + +static void bond_device_found_cb(int num_properties, bt_property_t *properties) +{ + struct test_data *data = tester_get_data(); + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + bt_status_t status; + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + if (data->cb_count == 4) { + data->cb_count--; + status = data->if_bluetooth->create_bond(&remote_addr); + check_expected_status(status); + } +} + +static void bond_nostatus_device_found_cb(int num_properties, + bt_property_t *properties) +{ + struct test_data *data = tester_get_data(); + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + if (data->cb_count == 4) { + data->cb_count--; + data->if_bluetooth->create_bond(&remote_addr); + } +} + +static gboolean device_found(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + struct bt_cb_data *cb_data = user_data; + + if (data->test_checks_valid && test->expected_hal_cb.device_found_cb) + test->expected_hal_cb.device_found_cb(cb_data->num, + cb_data->props); + + free_properties(cb_data->num, cb_data->props); + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void device_found_cb(int num_properties, bt_property_t *properties) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->num = num_properties; + cb_data->props = copy_properties(num_properties, properties); + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(device_found, cb_data); +} + +static void check_count_properties_cb(bt_status_t status, int num_properties, + bt_property_t *properties) +{ + int i; + + for (i = 0; i < num_properties; i++) + check_expected_property(properties[i]); +} + +static gboolean adapter_properties(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + struct bt_cb_data *cb_data = user_data; + + if (data->test_checks_valid && + test->expected_hal_cb.adapter_properties_cb) + test->expected_hal_cb.adapter_properties_cb(cb_data->status, + cb_data->num, cb_data->props); + + free_properties(cb_data->num, cb_data->props); + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void adapter_properties_cb(bt_status_t status, int num_properties, + bt_property_t *properties) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->status = status; + cb_data->num = num_properties; + cb_data->props = copy_properties(num_properties, properties); + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(adapter_properties, cb_data); +} + +static void remote_test_device_properties_cb(bt_status_t status, + bt_bdaddr_t *bd_addr, int num_properties, + bt_property_t *properties) +{ + int i; + + for (i = 0; i < num_properties; i++) + check_expected_property(properties[i]); +} + +static void remote_setprop_device_properties_cb(bt_status_t status, + bt_bdaddr_t *bd_addr, int num_properties, + bt_property_t *properties) +{ + int i; + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + const bt_property_t prop = test->expected_properties[1].prop; + + for (i = 0; i < num_properties; i++) + check_expected_property(properties[i]); + + if (g_slist_length(data->expected_properties_list) == 1) { + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + data->cb_count--; + check_cb_count(); + data->if_bluetooth->get_remote_device_property(&remote_addr, + prop.type); + } +} + +static gboolean remote_device_properties(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + struct bt_cb_data *cb_data = user_data; + + if (data->test_checks_valid && + test->expected_hal_cb.remote_device_properties_cb) + test->expected_hal_cb.remote_device_properties_cb( + cb_data->status, &cb_data->bdaddr, + cb_data->num, cb_data->props); + + free_properties(cb_data->num, cb_data->props); + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void remote_device_properties_cb(bt_status_t status, + bt_bdaddr_t *bd_addr, int num_properties, + bt_property_t *properties) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->status = status; + cb_data->bdaddr = *bd_addr; + cb_data->num = num_properties; + cb_data->props = copy_properties(num_properties, properties); + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(remote_device_properties, cb_data); +} + +static void bond_test_bonded_state_changed_cb(bt_status_t status, + bt_bdaddr_t *remote_bd_addr, bt_bond_state_t state) +{ + struct test_data *data = tester_get_data(); + + switch (state) { + case BT_BOND_STATE_BONDING: + data->cb_count--; + break; + case BT_BOND_STATE_BONDED: + data->cb_count--; + check_cb_count(); + break; + default: + tester_test_failed(); + break; + } +} + +static void bond_test_none_state_changed_cb(bt_status_t status, + bt_bdaddr_t *remote_bd_addr, bt_bond_state_t state) +{ + struct test_data *data = tester_get_data(); + + switch (state) { + case BT_BOND_STATE_BONDING: + data->cb_count--; + break; + case BT_BOND_STATE_NONE: + data->cb_count--; + check_cb_count(); + break; + default: + tester_test_failed(); + break; + } +} + +static void bond_remove_success_state_changed_cb(bt_status_t status, + bt_bdaddr_t *remote_bd_addr, bt_bond_state_t state) +{ + struct test_data *data = tester_get_data(); + bt_status_t remove_status; + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + if (state == BT_BOND_STATE_BONDED) { + data->cb_count--; + remove_status = data->if_bluetooth->remove_bond(&remote_addr); + check_expected_status(remove_status); + return; + } + + if (state == BT_BOND_STATE_NONE) { + data->cb_count--; + check_cb_count(); + } +} + +static gboolean bond_state_changed(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + struct bt_cb_data *cb_data = user_data; + + if (data->test_checks_valid && + test->expected_hal_cb.bond_state_changed_cb) + test->expected_hal_cb.bond_state_changed_cb(cb_data->status, + &cb_data->bdaddr, cb_data->state); + + g_free(cb_data); + return FALSE; +} + +static void bond_state_changed_cb(bt_status_t status, + bt_bdaddr_t *remote_bd_addr, bt_bond_state_t state) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->status = status; + cb_data->bdaddr = *remote_bd_addr; + cb_data->state = state; + + g_idle_add(bond_state_changed, cb_data); +} + +static void bond_create_pin_success_request_cb(bt_bdaddr_t *remote_bd_addr, + bt_bdname_t *bd_name, uint32_t cod) +{ + struct test_data *data = tester_get_data(); + const bt_bdaddr_t *bdaddr = remote_bd_addr; + bt_pin_code_t pin_code = { + .pin = { 0x30, 0x30, 0x30, 0x30 }, + }; + uint8_t pin_len = 4; + + data->cb_count--; + + data->if_bluetooth->pin_reply(bdaddr, TRUE, pin_len, &pin_code); +} + +static void bond_create_pin_fail_request_cb(bt_bdaddr_t *remote_bd_addr, + bt_bdname_t *bd_name, uint32_t cod) +{ + struct test_data *data = tester_get_data(); + const bt_bdaddr_t *bdaddr = remote_bd_addr; + bt_pin_code_t pin_code = { + .pin = { 0x31, 0x31, 0x31, 0x31 }, + }; + uint8_t pin_len = 4; + + data->cb_count--; + + data->if_bluetooth->pin_reply(bdaddr, TRUE, pin_len, &pin_code); +} + +static gboolean pin_request(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + struct bt_cb_data *cb_data = user_data; + + if (data->test_checks_valid && test->expected_hal_cb.pin_request_cb) + test->expected_hal_cb.pin_request_cb(&cb_data->bdaddr, + &cb_data->bdname, cb_data->cod); + + g_free(cb_data); + return FALSE; +} + +static void pin_request_cb(bt_bdaddr_t *remote_bd_addr, + bt_bdname_t *bd_name, uint32_t cod) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->bdaddr = *remote_bd_addr; + cb_data->bdname = *bd_name; + cb_data->cod = cod; + + g_idle_add(pin_request, cb_data); +} + +static void bond_create_ssp_request_cb(const bt_bdaddr_t *remote_bd_addr, + bt_ssp_variant_t pairing_variant, + bool accept, uint32_t pass_key) +{ + struct test_data *data = tester_get_data(); + + data->if_bluetooth->ssp_reply(remote_bd_addr, + BT_SSP_VARIANT_PASSKEY_CONFIRMATION, + accept, pass_key); + + data->cb_count--; +} + +static void bond_create_ssp_success_request_cb(bt_bdaddr_t *remote_bd_addr, + bt_bdname_t *bd_name, uint32_t cod, + bt_ssp_variant_t pairing_variant, + uint32_t pass_key) +{ + bool accept = true; + + bond_create_ssp_request_cb(remote_bd_addr, pairing_variant, accept, + pass_key); +} + +static void bond_create_ssp_fail_request_cb(bt_bdaddr_t *remote_bd_addr, + bt_bdname_t *bd_name, uint32_t cod, + bt_ssp_variant_t pairing_variant, + uint32_t pass_key) +{ + bool accept = false; + + bond_create_ssp_request_cb(remote_bd_addr, pairing_variant, accept, + pass_key); +} + +static void bond_cancel_success_ssp_request_cb(bt_bdaddr_t *remote_bd_addr, + bt_bdname_t *bd_name, uint32_t cod, + bt_ssp_variant_t pairing_variant, + uint32_t pass_key) +{ + struct test_data *data = tester_get_data(); + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + bt_status_t status; + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + data->cb_count--; + + status = data->if_bluetooth->cancel_bond(&remote_addr); + check_expected_status(status); +} + +static gboolean ssp_request(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + struct bt_cb_data *cb_data = user_data; + + if (data->test_checks_valid && test->expected_hal_cb.ssp_request_cb) + test->expected_hal_cb.ssp_request_cb(&cb_data->bdaddr, + &cb_data->bdname, cb_data->cod, + cb_data->ssp_variant, cb_data->passkey); + + g_free(cb_data); + return FALSE; +} + +static void ssp_request_cb(bt_bdaddr_t *remote_bd_addr, bt_bdname_t *bd_name, + uint32_t cod, bt_ssp_variant_t pairing_variant, + uint32_t pass_key) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->bdaddr = *remote_bd_addr; + cb_data->bdname = *bd_name; + cb_data->cod = cod; + cb_data->ssp_variant = pairing_variant; + cb_data->passkey = pass_key; + + g_idle_add(ssp_request, cb_data); +} + +static bt_bdaddr_t enable_done_bdaddr_val = { {0x00} }; +static const char enable_done_bdname_val[] = "BlueZ for Android"; +static bt_uuid_t enable_done_uuids_val = { + .uu = { 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, + 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb}, +}; +static bt_device_type_t enable_done_tod_val = BT_DEVICE_DEVTYPE_DUAL; +static bt_scan_mode_t enable_done_scanmode_val = BT_SCAN_MODE_NONE; +static uint32_t enable_done_disctimeout_val = 120; + +static struct priority_property enable_done_props[] = { + { + .prop.type = BT_PROPERTY_BDADDR, + .prop.len = sizeof(enable_done_bdaddr_val), + .prop.val = &enable_done_bdaddr_val, + .prio = 1, + }, + { + .prop.type = BT_PROPERTY_BDNAME, + .prop.len = sizeof(enable_done_bdname_val) - 1, + .prop.val = &enable_done_bdname_val, + .prio = 2, + }, + { + .prop.type = BT_PROPERTY_UUIDS, + .prop.len = sizeof(enable_done_uuids_val), + .prop.val = &enable_done_uuids_val, + .prio = 3, + }, + { + .prop.type = BT_PROPERTY_CLASS_OF_DEVICE, + .prop.len = sizeof(uint32_t), + .prop.val = NULL, + .prio = 4, + }, + { + .prop.type = BT_PROPERTY_TYPE_OF_DEVICE, + .prop.len = sizeof(enable_done_tod_val), + .prop.val = &enable_done_tod_val, + .prio = 5, + }, + { + .prop.type = BT_PROPERTY_ADAPTER_SCAN_MODE, + .prop.len = sizeof(enable_done_scanmode_val), + .prop.val = &enable_done_scanmode_val, + .prio = 6, + }, + { + .prop.type = BT_PROPERTY_ADAPTER_BONDED_DEVICES, + .prop.len = 0, + .prop.val = NULL, + .prio = 7, + }, + { + .prop.type = BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT, + .prop.len = sizeof(enable_done_disctimeout_val), + .prop.val = &enable_done_disctimeout_val, + .prio = 8, + }, +}; + +static const struct generic_data bluetooth_enable_success_test = { + .expected_hal_cb.adapter_state_changed_cb = enable_success_cb, + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_cb_count = 1, + .expected_properties_num = 8, + .expected_properties = enable_done_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bluetooth_enable_success2_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_adapter_status = BT_STATUS_SUCCESS, + .expected_properties_num = 8, + .expected_properties = enable_done_props, +}; + +static const struct generic_data bluetooth_disable_success_test = { + .expected_hal_cb.adapter_state_changed_cb = disable_success_cb, + .expected_cb_count = 1, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static char test_set_bdname[] = "test_bdname_set"; + +static struct priority_property setprop_bdname_props[] = { + { + .prop.type = BT_PROPERTY_BDNAME, + .prop.val = test_set_bdname, + .prop.len = sizeof(test_set_bdname) - 1, + .prio = 0, + }, +}; + +static const struct generic_data bluetooth_setprop_bdname_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = setprop_bdname_props, +}; + +static bt_scan_mode_t test_setprop_scanmode_val = + BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE; + +static struct priority_property setprop_scanmode_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_SCAN_MODE, + .prop.val = &test_setprop_scanmode_val, + .prop.len = sizeof(bt_scan_mode_t), + }, +}; + +static const struct generic_data bluetooth_setprop_scanmode_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = setprop_scanmode_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static uint32_t test_setprop_disctimeout_val = 120; + +static struct priority_property setprop_disctimeout_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT, + .prop.val = &test_setprop_disctimeout_val, + .prop.len = sizeof(test_setprop_disctimeout_val), + }, +}; + +static const struct generic_data bluetooth_setprop_disctimeout_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = setprop_disctimeout_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_bdaddr_t test_getprop_bdaddr_val = { {0x00} }; + +static struct priority_property getprop_bdaddr_props[] = { + { + .prop.type = BT_PROPERTY_BDADDR, + .prop.val = &test_getprop_bdaddr_val, + .prop.len = sizeof(test_getprop_bdaddr_val), + }, +}; + +static const struct generic_data bluetooth_getprop_bdaddr_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = getprop_bdaddr_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const char test_bdname[] = "test_bdname_setget"; + +static struct priority_property getprop_bdname_props[] = { + { + .prop.type = BT_PROPERTY_BDNAME, + .prop.val = &test_bdname, + .prop.len = sizeof(test_bdname) - 1, + }, +}; + +static const struct generic_data bluetooth_getprop_bdname_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = getprop_bdname_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static unsigned char setprop_uuids[] = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, + 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 }; + +static struct priority_property setprop_uuid_prop[] = { + { + .prop.type = BT_PROPERTY_UUIDS, + .prop.val = &setprop_uuids, + .prop.len = sizeof(setprop_uuids), + }, +}; + +static const struct generic_data bluetooth_setprop_uuid_invalid_test = { + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static uint32_t setprop_class_of_device = 0; + +static struct priority_property setprop_cod_props[] = { + { + .prop.type = BT_PROPERTY_CLASS_OF_DEVICE, + .prop.val = &setprop_class_of_device, + .prop.len = sizeof(setprop_class_of_device), + }, +}; + +static const struct generic_data bluetooth_setprop_cod_invalid_test = { + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_device_type_t setprop_type_of_device = BT_DEVICE_DEVTYPE_DUAL; + +static struct priority_property setprop_tod_props[] = { + { + .prop.type = BT_PROPERTY_TYPE_OF_DEVICE, + .prop.val = &setprop_type_of_device, + .prop.len = sizeof(setprop_type_of_device), + }, +}; + +static const struct generic_data bluetooth_setprop_tod_invalid_test = { + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static int32_t setprop_remote_rssi = 0; + +static struct priority_property setprop_remote_rssi_props[] = { + { + .prop.type = BT_PROPERTY_REMOTE_RSSI, + .prop.val = &setprop_remote_rssi, + .prop.len = sizeof(setprop_remote_rssi), + }, +}; + +static const struct generic_data bluetooth_setprop_remote_rssi_invalid_test = { + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_service_record_t setprop_remote_service = { + .uuid = { {0x00} }, + .channel = 12, + .name = "bt_name", +}; + +static struct priority_property setprop_service_record_props[] = { + { + .prop.type = BT_PROPERTY_SERVICE_RECORD, + .prop.val = &setprop_remote_service, + .prop.len = sizeof(setprop_remote_service), + }, +}; + +static const struct generic_data + bluetooth_setprop_service_record_invalid_test = { + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_bdaddr_t setprop_bdaddr = { + .address = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, +}; + +static struct priority_property setprop_bdaddr_props[] = { + { + .prop.type = BT_PROPERTY_BDADDR, + .prop.val = &setprop_bdaddr, + .prop.len = sizeof(setprop_bdaddr), + }, +}; + +static const struct generic_data bluetooth_setprop_bdaddr_invalid_test = { + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_scan_mode_t setprop_scanmode_connectable = BT_SCAN_MODE_CONNECTABLE; + +static struct priority_property setprop_scanmode_connectable_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_SCAN_MODE, + .prop.val = &setprop_scanmode_connectable, + .prop.len = sizeof(setprop_scanmode_connectable), + }, +}; + +static const struct generic_data + bluetooth_setprop_scanmode_connectable_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = setprop_scanmode_connectable_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_bdaddr_t setprop_bonded_devices = { + .address = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 }, +}; + +static struct priority_property setprop_bonded_devices_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_BONDED_DEVICES, + .prop.val = &setprop_bonded_devices, + .prop.len = sizeof(setprop_bonded_devices), + }, +}; + +static const struct generic_data + bluetooth_setprop_bonded_devices_invalid_test = { + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static uint32_t getprop_cod = 0x00020c; + +static struct priority_property getprop_cod_props[] = { + { + .prop.type = BT_PROPERTY_CLASS_OF_DEVICE, + .prop.val = &getprop_cod, + .prop.len = sizeof(getprop_cod), + }, +}; + +static const struct generic_data bluetooth_getprop_cod_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = getprop_cod_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_device_type_t getprop_tod = BT_DEVICE_DEVTYPE_DUAL; + +static struct priority_property getprop_tod_props[] = { + { + .prop.type = BT_PROPERTY_TYPE_OF_DEVICE, + .prop.val = &getprop_tod, + .prop.len = sizeof(getprop_tod), + }, +}; + +static const struct generic_data bluetooth_getprop_tod_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = getprop_tod_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_scan_mode_t getprop_scanmode = BT_SCAN_MODE_NONE; + +static struct priority_property getprop_scanmode_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_SCAN_MODE, + .prop.val = &getprop_scanmode, + .prop.len = sizeof(getprop_scanmode), + }, +}; + +static const struct generic_data bluetooth_getprop_scanmode_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = getprop_scanmode_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static uint32_t getprop_disctimeout_val = 120; + +static struct priority_property getprop_disctimeout_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT, + .prop.val = &getprop_disctimeout_val, + .prop.len = sizeof(getprop_disctimeout_val), + }, +}; + +static const struct generic_data bluetooth_getprop_disctimeout_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = getprop_disctimeout_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_uuid_t getprop_uuids = { + .uu = { 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, + 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }, +}; + +static struct priority_property getprop_uuids_props[] = { + { + .prop.type = BT_PROPERTY_UUIDS, + .prop.val = &getprop_uuids, + .prop.len = sizeof(getprop_uuids), + }, +}; + +static const struct generic_data bluetooth_getprop_uuids_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = getprop_uuids_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static struct priority_property getprop_bondeddev_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_BONDED_DEVICES, + .prop.val = NULL, + .prop.len = 0, + }, +}; + +static const struct generic_data bluetooth_getprop_bondeddev_success_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = getprop_bondeddev_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_scan_mode_t setprop_scanmode_none = BT_SCAN_MODE_NONE; + +static struct priority_property setprop_scanmode_none_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_SCAN_MODE, + .prop.val = &setprop_scanmode_none, + .prop.len = sizeof(setprop_scanmode_none), + }, +}; + +static const struct generic_data + bluetooth_setprop_scanmode_none_success2_test = { + .expected_hal_cb.adapter_properties_cb = check_count_properties_cb, + .expected_properties_num = 1, + .expected_properties = setprop_scanmode_none_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bluetooth_discovery_start_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + discovery_start_success_cb, + .expected_cb_count = 1, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bluetooth_discovery_start_success2_test = { + .expected_hal_cb.discovery_state_changed_cb = discovery_start_done_cb, + .expected_cb_count = 1, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bluetooth_discovery_stop_success2_test = { + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bluetooth_discovery_stop_success_test = { + .expected_hal_cb.discovery_state_changed_cb = discovery_stop_success_cb, + .expected_cb_count = 2, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bluetooth_discovery_device_found_test = { + .expected_hal_cb.discovery_state_changed_cb = + discovery_device_found_state_changed_cb, + .expected_hal_cb.device_found_cb = discovery_device_found_cb, + .expected_cb_count = 3, + .expected_adapter_status = BT_STATUS_NOT_EXPECTED, +}; + +static const char remote_get_properties_bdname_val[] = "00:AA:01:01:00:00"; +static uint32_t remote_get_properties_cod_val = 0; +static bt_device_type_t remote_get_properties_tod_val = BT_DEVICE_DEVTYPE_BREDR; +static int32_t remote_get_properties_rssi_val = -60; + +static struct priority_property remote_getprops_props[] = { + { + .prop.type = BT_PROPERTY_BDNAME, + .prop.val = &remote_get_properties_bdname_val, + .prop.len = sizeof(remote_get_properties_bdname_val) - 1, + .prio = 1, + }, + { + .prop.type = BT_PROPERTY_UUIDS, + .prop.val = NULL, + .prop.len = 0, + .prio = 2, + }, + { + .prop.type = BT_PROPERTY_CLASS_OF_DEVICE, + .prop.val = &remote_get_properties_cod_val, + .prop.len = sizeof(remote_get_properties_cod_val), + .prio = 3, + }, + { + .prop.type = BT_PROPERTY_TYPE_OF_DEVICE, + .prop.val = &remote_get_properties_tod_val, + .prop.len = sizeof(remote_get_properties_tod_val), + .prio = 4, + }, + { + .prop.type = BT_PROPERTY_REMOTE_RSSI, + .prop.val = &remote_get_properties_rssi_val, + .prop.len = sizeof(remote_get_properties_rssi_val), + .prio = 5, + }, + { + .prop.type = BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP, + .prop.val = NULL, + .prop.len = 4, + .prio = 6, + }, +}; + +static const struct generic_data bt_dev_getprops_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_getprops_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties_num = 6, + .expected_properties = remote_getprops_props, + .expected_adapter_status = BT_STATUS_NOT_EXPECTED, +}; + +static const char remote_getprop_bdname_val[] = "00:AA:01:01:00:00"; + +static struct priority_property remote_getprop_bdname_props[] = { + { + .prop.type = BT_PROPERTY_BDNAME, + .prop.val = &remote_getprop_bdname_val, + .prop.len = sizeof(remote_getprop_bdname_val) - 1, + }, +}; + +static const struct generic_data bt_dev_getprop_bdname_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties_num = 1, + .expected_properties = remote_getprop_bdname_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static struct priority_property remote_getprop_uuids_props[] = { + { + .prop.type = BT_PROPERTY_UUIDS, + .prop.val = NULL, + .prop.len = 0, + }, +}; + +static const struct generic_data bt_dev_getprop_uuids_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties_num = 1, + .expected_properties = remote_getprop_uuids_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static uint32_t remote_getprop_cod_val = 0; + +static struct priority_property remote_getprop_cod_props[] = { + { + .prop.type = BT_PROPERTY_CLASS_OF_DEVICE, + .prop.val = &remote_getprop_cod_val, + .prop.len = sizeof(remote_getprop_cod_val), + }, +}; + +static const struct generic_data bt_dev_getprop_cod_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties_num = 1, + .expected_properties = remote_getprop_cod_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_device_type_t remote_getprop_tod_val = BT_DEVICE_DEVTYPE_BREDR; + +static struct priority_property remote_getprop_tod_props[] = { + { + .prop.type = BT_PROPERTY_TYPE_OF_DEVICE, + .prop.val = &remote_getprop_tod_val, + .prop.len = sizeof(remote_getprop_tod_val), + }, +}; + +static const struct generic_data bt_dev_getprop_tod_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties_num = 1, + .expected_properties = remote_getprop_tod_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static int32_t remote_getprop_rssi_val = -60; + +static struct priority_property remote_getprop_rssi_props[] = { + { + .prop.type = BT_PROPERTY_REMOTE_RSSI, + .prop.val = &remote_getprop_rssi_val, + .prop.len = sizeof(remote_getprop_rssi_val), + }, +}; + +static const struct generic_data bt_dev_getprop_rssi_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties_num = 1, + .expected_properties = remote_getprop_rssi_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static struct priority_property remote_getprop_timestamp_props[] = { + { + .prop.type = BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP, + .prop.val = NULL, + .prop.len = 4, + }, +}; + +static const struct generic_data bt_dev_getprop_timpestamp_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties_num = 1, + .expected_properties = remote_getprop_timestamp_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_bdaddr_t remote_getprop_bdaddr_val = { + .address = { 0x00, 0xaa, 0x01, 0x00, 0x00, 0x00 } +}; + +static struct priority_property remote_getprop_bdaddr_props[] = { + { + .prop.type = BT_PROPERTY_BDADDR, + .prop.val = &remote_getprop_bdaddr_val, + .prop.len = sizeof(remote_getprop_bdaddr_val), + }, +}; + +static const struct generic_data bt_dev_getprop_bdaddr_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties = remote_getprop_bdaddr_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_service_record_t remote_getprop_servrec_val = { + .uuid = { {0x00} }, + .channel = 12, + .name = "bt_name", +}; + +static struct priority_property remote_getprop_servrec_props[] = { + { + .prop.type = BT_PROPERTY_SERVICE_RECORD, + .prop.val = &remote_getprop_servrec_val, + .prop.len = sizeof(remote_getprop_servrec_val), + }, +}; + +static const struct generic_data bt_dev_getprop_servrec_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties = remote_getprop_servrec_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_scan_mode_t remote_getprop_scanmode_val = BT_SCAN_MODE_CONNECTABLE; + +static struct priority_property remote_getprop_scanmode_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_SCAN_MODE, + .prop.val = &remote_getprop_scanmode_val, + .prop.len = sizeof(remote_getprop_scanmode_val), + }, +}; + +static const struct generic_data bt_dev_getprop_scanmode_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties = remote_getprop_scanmode_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static struct priority_property remote_getprop_bondeddev_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_BONDED_DEVICES, + .prop.val = NULL, + .prop.len = 0, + }, +}; + +static const struct generic_data bt_dev_getprop_bondeddev_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties = remote_getprop_bondeddev_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static uint32_t remote_getprop_disctimeout_val = 120; + +static struct priority_property remote_getprop_disctimeout_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT, + .prop.val = &remote_getprop_disctimeout_val, + .prop.len = sizeof(remote_getprop_disctimeout_val), + }, +}; + +static const struct generic_data bt_dev_getprop_disctimeout_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties = remote_getprop_disctimeout_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static struct priority_property remote_getprop_verinfo_props[] = { + { + .prop.type = BT_PROPERTY_REMOTE_VERSION_INFO, + .prop.val = NULL, + .prop.len = 0, + }, +}; + +static const struct generic_data bt_dev_getprop_verinfo_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties = remote_getprop_verinfo_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static struct priority_property remote_getprop_fname_props[] = { + { + .prop.type = BT_PROPERTY_REMOTE_VERSION_INFO, + .prop.val = NULL, + .prop.len = 0, + }, +}; + +static const struct generic_data bt_dev_getprop_fname_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_get_property_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_test_device_properties_cb, + .expected_cb_count = 3, + .expected_properties = remote_getprop_fname_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static const char remote_setprop_fname_val[] = "set_fname_test"; + +static struct priority_property remote_setprop_fname_props[] = { + { + .prop.type = BT_PROPERTY_REMOTE_FRIENDLY_NAME, + .prop.val = &remote_setprop_fname_val, + .prop.len = sizeof(remote_setprop_fname_val) - 1, + }, + { + .prop.type = BT_PROPERTY_REMOTE_FRIENDLY_NAME, + .prop.val = &remote_setprop_fname_val, + .prop.len = sizeof(remote_setprop_fname_val) - 1, + }, +}; + +static const struct generic_data bt_dev_setprop_fname_success_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_setprop_disc_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_device_found_cb, + .expected_hal_cb.remote_device_properties_cb = + remote_setprop_device_properties_cb, + .expected_cb_count = 4, + .expected_properties_num = 2, + .expected_properties = remote_setprop_fname_props, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const char remote_setprop_bdname_val[] = "setprop_bdname_fail"; + +static struct priority_property remote_setprop_bdname_props[] = { + { + .prop.type = BT_PROPERTY_BDNAME, + .prop.val = &remote_setprop_bdname_val, + .prop.len = sizeof(remote_setprop_bdname_val) - 1, + }, +}; + +static const struct generic_data bt_dev_setprop_bdname_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_bdname_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static struct priority_property remote_setprop_uuids_props[] = { + { + .prop.type = BT_PROPERTY_UUIDS, + .prop.val = NULL, + .prop.len = 0, + }, +}; + +static const struct generic_data bt_dev_setprop_uuids_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_uuids_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static uint32_t remote_setprop_cod_val = 0; + +static struct priority_property remote_setprop_cod_props[] = { + { + .prop.type = BT_PROPERTY_CLASS_OF_DEVICE, + .prop.val = &remote_setprop_cod_val, + .prop.len = sizeof(remote_setprop_cod_val), + }, +}; + +static const struct generic_data bt_dev_setprop_cod_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_cod_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_device_type_t remote_setprop_tod_val = BT_DEVICE_DEVTYPE_BREDR; + +static struct priority_property remote_setprop_tod_props[] = { + { + .prop.type = BT_PROPERTY_TYPE_OF_DEVICE, + .prop.val = &remote_setprop_tod_val, + .prop.len = sizeof(remote_setprop_tod_val), + }, +}; + +static const struct generic_data bt_dev_setprop_tod_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_tod_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static int32_t remote_setprop_rssi_val = -60; + +static struct priority_property remote_setprop_rssi_props[] = { + { + .prop.type = BT_PROPERTY_REMOTE_RSSI, + .prop.val = &remote_setprop_rssi_val, + .prop.len = sizeof(remote_setprop_rssi_val), + }, +}; + +static const struct generic_data bt_dev_setprop_rssi_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_rssi_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static int32_t remote_setprop_timestamp_val = 0xAB; + +static struct priority_property remote_setprop_timestamp_props[] = { + { + .prop.type = BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP, + .prop.val = (&remote_setprop_timestamp_val), + .prop.len = sizeof(remote_setprop_timestamp_val), + }, +}; + +static const struct generic_data bt_dev_setprop_timpestamp_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_timestamp_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_bdaddr_t remote_setprop_bdaddr_val = { + .address = { 0x00, 0xaa, 0x01, 0x00, 0x00, 0x00 } +}; + +static struct priority_property remote_setprop_bdaddr_props[] = { + { + .prop.type = BT_PROPERTY_BDADDR, + .prop.val = &remote_setprop_bdaddr_val, + .prop.len = sizeof(remote_setprop_bdaddr_val), + }, +}; + +static const struct generic_data bt_dev_setprop_bdaddr_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_bdaddr_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_service_record_t remote_setprop_servrec_val = { + .uuid = { {0x00} }, + .channel = 12, + .name = "bt_name", +}; + +static struct priority_property remote_setprop_servrec_props[] = { + { + .prop.type = BT_PROPERTY_SERVICE_RECORD, + .prop.val = &remote_setprop_servrec_val, + .prop.len = sizeof(remote_setprop_servrec_val), + }, +}; + +static const struct generic_data bt_dev_setprop_servrec_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_servrec_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_scan_mode_t remote_setprop_scanmode_val = BT_SCAN_MODE_CONNECTABLE; + +static struct priority_property remote_setprop_scanmode_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_SCAN_MODE, + .prop.val = &remote_setprop_scanmode_val, + .prop.len = sizeof(remote_setprop_scanmode_val), + }, +}; + +static const struct generic_data bt_dev_setprop_scanmode_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_scanmode_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static bt_bdaddr_t remote_setprop_bondeddev_val = { + .address = { 0x00, 0xaa, 0x01, 0x00, 0x00, 0x00 } +}; + +static struct priority_property remote_setprop_bondeddev_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_BONDED_DEVICES, + .prop.val = &remote_setprop_bondeddev_val, + .prop.len = sizeof(remote_setprop_bondeddev_val), + }, +}; + +static const struct generic_data bt_dev_setprop_bondeddev_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_bondeddev_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static uint32_t remote_setprop_disctimeout_val = 120; + +static struct priority_property remote_setprop_disctimeout_props[] = { + { + .prop.type = BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT, + .prop.val = &remote_setprop_disctimeout_val, + .prop.len = sizeof(remote_setprop_disctimeout_val), + }, +}; + +static const struct generic_data bt_dev_setprop_disctimeout_fail_test = { + .expected_hal_cb.discovery_state_changed_cb = + remote_discovery_state_changed_cb, + .expected_hal_cb.device_found_cb = remote_setprop_fail_device_found_cb, + .expected_cb_count = 3, + .expected_properties = remote_setprop_disctimeout_props, + .expected_adapter_status = BT_STATUS_FAIL, +}; + +static const struct generic_data bt_bond_create_pin_success_test = { + .expected_hal_cb.device_found_cb = bond_device_found_cb, + .expected_hal_cb.bond_state_changed_cb = + bond_test_bonded_state_changed_cb, + .expected_hal_cb.pin_request_cb = bond_create_pin_success_request_cb, + .expected_cb_count = 4, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bt_bond_create_pin_fail_test = { + .expected_hal_cb.device_found_cb = bond_nostatus_device_found_cb, + .expected_hal_cb.bond_state_changed_cb = + bond_test_none_state_changed_cb, + .expected_hal_cb.pin_request_cb = bond_create_pin_fail_request_cb, + .expected_cb_count = 4, + .expected_adapter_status = MGMT_STATUS_AUTH_FAILED, +}; + +static const struct generic_data bt_bond_create_ssp_success_test = { + .expected_hal_cb.device_found_cb = bond_device_found_cb, + .expected_hal_cb.bond_state_changed_cb = + bond_test_bonded_state_changed_cb, + .expected_hal_cb.ssp_request_cb = bond_create_ssp_success_request_cb, + .expected_cb_count = 4, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bt_bond_create_ssp_fail_test = { + .expected_hal_cb.device_found_cb = bond_nostatus_device_found_cb, + .expected_hal_cb.bond_state_changed_cb = + bond_test_none_state_changed_cb, + .expected_hal_cb.ssp_request_cb = bond_create_ssp_fail_request_cb, + .expected_cb_count = 4, + .expected_adapter_status = MGMT_STATUS_AUTH_FAILED, +}; + +static const struct generic_data bt_bond_create_no_disc_success_test = { + .expected_hal_cb.bond_state_changed_cb = + bond_test_bonded_state_changed_cb, + .expected_hal_cb.ssp_request_cb = bond_create_ssp_success_request_cb, + .expected_cb_count = 3, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bt_bond_create_bad_addr_success_test = { + .expected_adapter_status = MGMT_STATUS_CONNECT_FAILED, +}; + +static const struct generic_data bt_bond_cancel_success_test = { + .expected_hal_cb.device_found_cb = bond_nostatus_device_found_cb, + .expected_hal_cb.bond_state_changed_cb = + bond_test_none_state_changed_cb, + .expected_hal_cb.ssp_request_cb = bond_cancel_success_ssp_request_cb, + .expected_cb_count = 4, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static const struct generic_data bt_bond_remove_success_test = { + .expected_hal_cb.device_found_cb = bond_nostatus_device_found_cb, + .expected_hal_cb.bond_state_changed_cb = + bond_remove_success_state_changed_cb, + .expected_hal_cb.ssp_request_cb = bond_create_ssp_success_request_cb, + .expected_cb_count = 4, + .expected_adapter_status = BT_STATUS_SUCCESS, +}; + +static bt_callbacks_t bt_callbacks = { + .size = sizeof(bt_callbacks), + .adapter_state_changed_cb = adapter_state_changed_cb, + .adapter_properties_cb = adapter_properties_cb, + .remote_device_properties_cb = remote_device_properties_cb, + .device_found_cb = device_found_cb, + .discovery_state_changed_cb = discovery_state_changed_cb, + .pin_request_cb = pin_request_cb, + .ssp_request_cb = ssp_request_cb, + .bond_state_changed_cb = bond_state_changed_cb, + .acl_state_changed_cb = NULL, + .thread_evt_cb = NULL, + .dut_mode_recv_cb = NULL, + .le_test_mode_cb = NULL +}; + +static bool setup(struct test_data *data) +{ + const hw_module_t *module; + hw_device_t *device; + int signal_fd[2]; + char buf[1024]; + pid_t pid; + int len; + int err; + + if (pipe(signal_fd)) + return false; + + pid = fork(); + + if (pid < 0) { + close(signal_fd[0]); + close(signal_fd[1]); + return false; + } + + if (pid == 0) { + if (!tester_use_debug()) + fclose(stderr); + + close(signal_fd[0]); + emulator(signal_fd[1], data->mgmt_index); + exit(0); + } + + close(signal_fd[1]); + data->bluetoothd_pid = pid; + + len = read(signal_fd[0], buf, sizeof(buf)); + if (len <= 0 || strcmp(buf, EMULATOR_SIGNAL)) { + close(signal_fd[0]); + return false; + } + + close(signal_fd[0]); + + err = hw_get_module(BT_HARDWARE_MODULE_ID, &module); + if (err) + return false; + + err = module->methods->open(module, BT_HARDWARE_MODULE_ID, &device); + if (err) + return false; + + data->device = device; + + data->if_bluetooth = ((bluetooth_device_t *) + device)->get_bluetooth_interface(); + if (!data->if_bluetooth) + return false; + + return true; +} + +static void setup_base(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + + if (!setup(data)) { + tester_setup_failed(); + return; + } + + status = data->if_bluetooth->init(&bt_callbacks); + if (status != BT_STATUS_SUCCESS) { + data->if_bluetooth = NULL; + tester_setup_failed(); + return; + } + + tester_setup_complete(); +} + +static void setup_enabled_adapter(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + + if (!setup(data)) { + tester_setup_failed(); + return; + } + + status = data->if_bluetooth->init(&bt_callbacks); + if (status != BT_STATUS_SUCCESS) { + data->if_bluetooth = NULL; + tester_setup_failed(); + return; + } + + status = data->if_bluetooth->enable(); + if (status != BT_STATUS_SUCCESS) + tester_setup_failed(); +} + +static void teardown(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + if (data->if_hid) { + data->if_hid->cleanup(); + data->if_hid = NULL; + } + + if (data->if_bluetooth) { + data->if_bluetooth->cleanup(); + data->if_bluetooth = NULL; + } + + /* Test result already known, no need to check further */ + data->test_checks_valid = false; + + if (data->expected_properties_list) + g_slist_free(data->expected_properties_list); + + data->device->close(data->device); + + if (!data->bluetoothd_pid) + tester_teardown_complete(); +} + +static void test_dummy(const void *test_data) +{ + tester_test_passed(); +} + +static void test_enable(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t adapter_status; + + uint8_t *bdaddr = (uint8_t *)hciemu_get_master_bdaddr(data->hciemu); + + init_test_conditions(data); + + bdaddr2android((const bdaddr_t *)bdaddr, + &enable_done_bdaddr_val.address); + + adapter_status = data->if_bluetooth->enable(); + check_expected_status(adapter_status); +} + +static void test_enable_done(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t adapter_status; + + uint8_t *bdaddr = (uint8_t *)hciemu_get_master_bdaddr(data->hciemu); + + init_test_conditions(data); + + bdaddr2android((const bdaddr_t *)bdaddr, + &enable_done_bdaddr_val.address); + + adapter_status = data->if_bluetooth->enable(); + check_expected_status(adapter_status); +} + +static void test_disable(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->disable(); + check_expected_status(adapter_status); +} + +static void test_setprop_bdname_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_bdname_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_scanmode_succes(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_scanmode_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_disctimeout_succes(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_disctimeout_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_getprop_bdaddr_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t prop = setprop_bdaddr_props[0].prop; + bt_status_t adapter_status; + uint8_t *bdaddr = (uint8_t *)hciemu_get_master_bdaddr(data->hciemu); + + init_test_conditions(data); + + bdaddr2android((const bdaddr_t *)bdaddr, + &test_getprop_bdaddr_val.address); + + adapter_status = data->if_bluetooth->get_adapter_property(prop.type); + check_expected_status(adapter_status); +} + +static void test_getprop_bdname_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(getprop_bdname_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + if (adapter_status != BT_STATUS_SUCCESS) { + tester_test_failed(); + return; + } + + adapter_status = data->if_bluetooth->get_adapter_property((*prop).type); + check_expected_status(adapter_status); +} +static void test_setprop_uuid_invalid(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_uuid_prop[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_cod_invalid(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_cod_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_tod_invalid(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const struct generic_data *test = data->test_data; + const bt_property_t *prop = &test->set_property; + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_rssi_invalid(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_remote_rssi_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_service_record_invalid(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_service_record_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_bdaddr_invalid(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_bdaddr_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_scanmode_connectable_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = + &(setprop_scanmode_connectable_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_setprop_bonded_devices_invalid(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_bonded_devices_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_getprop_cod_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t prop = setprop_cod_props[0].prop; + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->get_adapter_property(prop.type); + check_expected_status(adapter_status); +} + +static void test_getprop_tod_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t prop = setprop_tod_props[0].prop; + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->get_adapter_property(prop.type); + check_expected_status(adapter_status); +} + +static void test_getprop_scanmode_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t prop = setprop_scanmode_props[0].prop; + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->get_adapter_property(prop.type); + check_expected_status(adapter_status); +} + +static void test_getprop_disctimeout_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t prop = setprop_disctimeout_props[0].prop; + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->get_adapter_property(prop.type); + check_expected_status(adapter_status); +} + +static void test_getprop_uuids_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t prop = getprop_uuids_props[0].prop; + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->get_adapter_property(prop.type); + check_expected_status(adapter_status); +} + +static void test_getprop_bondeddev_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t prop = getprop_bondeddev_props[0].prop; + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->get_adapter_property(prop.type); + check_expected_status(adapter_status); +} + +static void test_setprop_scanmode_none_done(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const bt_property_t *prop = &(setprop_scanmode_none_props[0].prop); + bt_status_t adapter_status; + + init_test_conditions(data); + + adapter_status = data->if_bluetooth->set_adapter_property(prop); + check_expected_status(adapter_status); +} + +static void test_discovery_start_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + + init_test_conditions(data); + + status = data->if_bluetooth->start_discovery(); + check_expected_status(status); +} + +static void test_discovery_stop_done(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + + init_test_conditions(data); + + status = data->if_bluetooth->cancel_discovery(); + check_expected_status(status); +} + +static void test_discovery_stop_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_discovery_start_done(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_discovery_device_found(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprops_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_bdname_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_uuids_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_cod_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_tod_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_rssi_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_timestamp_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_bdaddr_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_servrec_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_scanmode_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_bondeddev_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_disctimeout_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_verinfo_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_getprop_fname_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_fname_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_bdname_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_uuids_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_cod_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_tod_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_rssi_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_timestamp_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_bdaddr_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_servrec_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_scanmode_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_bondeddev_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void test_dev_setprop_disctimeout_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + init_test_conditions(data); + + data->if_bluetooth->start_discovery(); +} + +static void bond_device_auth_fail_callback(uint16_t index, uint16_t length, + const void *param, + void *user_data) +{ + const struct mgmt_ev_auth_failed *ev = param; + + check_expected_status(ev->status); +} + +static void test_bond_create_pin_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + static uint8_t pair_device_pin[] = { 0x30, 0x30, 0x30, 0x30 }; + const void *pin = pair_device_pin; + uint8_t pin_len = 4; + + init_test_conditions(data); + + bthost_set_pin_code(bthost, pin, pin_len); + + data->if_bluetooth->start_discovery(); +} + +static void test_bond_create_pin_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + static uint8_t pair_device_pin[] = { 0x30, 0x30, 0x30, 0x30 }; + const void *pin = pair_device_pin; + uint8_t pin_len = 4; + + init_test_conditions(data); + + mgmt_register(data->mgmt, MGMT_EV_AUTH_FAILED, data->mgmt_index, + bond_device_auth_fail_callback, data, + NULL); + + bthost_set_pin_code(bthost, pin, pin_len); + + data->if_bluetooth->start_discovery(); +} + +static void test_bond_create_ssp_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + init_test_conditions(data); + + bthost_write_ssp_mode(bthost, 0x01); + + data->if_bluetooth->start_discovery(); +} + +static void test_bond_create_ssp_fail(const void *test_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + init_test_conditions(data); + + mgmt_register(data->mgmt, MGMT_EV_AUTH_FAILED, data->mgmt_index, + bond_device_auth_fail_callback, data, + NULL); + + bthost_write_ssp_mode(bthost, 0x01); + + data->if_bluetooth->start_discovery(); +} + +static void test_bond_create_no_disc_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + uint8_t *bdaddr = (uint8_t *)hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t remote_addr; + bt_status_t status; + + init_test_conditions(data); + + bdaddr2android((const bdaddr_t *)bdaddr, &remote_addr.address); + + bthost_write_ssp_mode(bthost, 0x01); + + status = data->if_bluetooth->create_bond(&remote_addr); + check_expected_status(status); +} + +static void test_bond_create_bad_addr_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_bdaddr_t bad_addr = { + .address = { 0x12, 0x34, 0x56, 0x78, 0x90, 0x12 } + }; + + init_test_conditions(data); + + mgmt_register(data->mgmt, MGMT_EV_CONNECT_FAILED, data->mgmt_index, + bond_device_auth_fail_callback, data, + NULL); + + data->if_bluetooth->create_bond(&bad_addr); +} + +static void test_bond_cancel_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + init_test_conditions(data); + + bthost_write_ssp_mode(bthost, 0x01); + + data->if_bluetooth->start_discovery(); +} + +static void test_bond_remove_success(const void *test_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + init_test_conditions(data); + + bthost_write_ssp_mode(bthost, 0x01); + + data->if_bluetooth->start_discovery(); +} + +/* Test Socket HAL */ + +static gboolean adapter_socket_state_changed(gpointer user_data) +{ + struct bt_cb_data *cb_data = user_data; + + switch (cb_data->state) { + case BT_STATE_ON: + setup_powered_emulated_remote(); + break; + case BT_STATE_OFF: + tester_setup_failed(); + break; + default: + break; + } + + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void adapter_socket_state_changed_cb(bt_state_t state) +{ + struct bt_cb_data *cb_data = g_new0(struct bt_cb_data, 1); + + cb_data->state = state; + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(adapter_socket_state_changed, cb_data); +} + +const bt_bdaddr_t bdaddr_dummy = { + .address = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55} +}; + +static const struct socket_data btsock_inv_param_socktype = { + .bdaddr = &bdaddr_dummy, + .sock_type = 0, + .channel = 1, + .service_uuid = NULL, + .service_name = "Test service", + .flags = 0, + .expected_status = BT_STATUS_PARM_INVALID, +}; + +static const struct socket_data btsock_inv_param_socktype_l2cap = { + .bdaddr = &bdaddr_dummy, + .sock_type = BTSOCK_L2CAP, + .channel = 1, + .service_uuid = NULL, + .service_name = "Test service", + .flags = 0, + .expected_status = BT_STATUS_UNSUPPORTED, +}; + +/* Test invalid: channel & uuid are both zeroes */ +static const struct socket_data btsock_inv_params_chan_uuid = { + .bdaddr = &bdaddr_dummy, + .sock_type = BTSOCK_RFCOMM, + .channel = 0, + .service_uuid = NULL, + .service_name = "Test service", + .flags = 0, + .expected_status = BT_STATUS_PARM_INVALID, +}; + +static const struct socket_data btsock_success = { + .bdaddr = &bdaddr_dummy, + .sock_type = BTSOCK_RFCOMM, + .channel = 1, + .service_uuid = NULL, + .service_name = "Test service", + .flags = 0, + .expected_status = BT_STATUS_SUCCESS, + .test_channel = false +}; + +static const struct socket_data btsock_success_check_chan = { + .sock_type = BTSOCK_RFCOMM, + .channel = 1, + .service_uuid = NULL, + .service_name = "Test service", + .flags = 0, + .expected_status = BT_STATUS_SUCCESS, + .test_channel = true, +}; + +static const struct socket_data btsock_inv_param_bdaddr = { + .bdaddr = NULL, + .sock_type = BTSOCK_RFCOMM, + .channel = 1, + .service_uuid = NULL, + .service_name = "Test service", + .flags = 0, + .expected_status = BT_STATUS_PARM_INVALID, +}; + +static const struct socket_data btsock_inv_listen_listen = { + .sock_type = BTSOCK_RFCOMM, + .channel = 1, + .service_uuid = NULL, + .service_name = "Test service", + .flags = 0, + .expected_status = BT_STATUS_BUSY, + .test_channel = true, +}; + +static bt_callbacks_t bt_socket_callbacks = { + .size = sizeof(bt_callbacks), + .adapter_state_changed_cb = adapter_socket_state_changed_cb, + .adapter_properties_cb = NULL, + .remote_device_properties_cb = NULL, + .device_found_cb = NULL, + .discovery_state_changed_cb = NULL, + .pin_request_cb = NULL, + .ssp_request_cb = NULL, + .bond_state_changed_cb = NULL, + .acl_state_changed_cb = NULL, + .thread_evt_cb = NULL, + .dut_mode_recv_cb = NULL, + .le_test_mode_cb = NULL +}; + +static void setup_socket_interface(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + const void *sock; + + if (!setup(data)) { + tester_setup_failed(); + return; + } + + status = data->if_bluetooth->init(&bt_socket_callbacks); + if (status != BT_STATUS_SUCCESS) { + data->if_bluetooth = NULL; + tester_setup_failed(); + return; + } + + sock = data->if_bluetooth->get_profile_interface(BT_PROFILE_SOCKETS_ID); + if (!sock) { + tester_setup_failed(); + return; + } + + data->if_sock = sock; + + tester_setup_complete(); +} + +static void setup_socket_interface_enabled(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + const void *sock; + + if (!setup(data)) { + tester_setup_failed(); + return; + } + + status = data->if_bluetooth->init(&bt_socket_callbacks); + if (status != BT_STATUS_SUCCESS) { + data->if_bluetooth = NULL; + tester_setup_failed(); + return; + } + + sock = data->if_bluetooth->get_profile_interface(BT_PROFILE_SOCKETS_ID); + if (!sock) { + tester_setup_failed(); + return; + } + + data->if_sock = sock; + + status = data->if_bluetooth->enable(); + if (status != BT_STATUS_SUCCESS) + tester_setup_failed(); +} + +static void test_generic_listen(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const struct socket_data *test = data->test_data; + bt_status_t status; + int sock_fd = -1; + + status = data->if_sock->listen(test->sock_type, + test->service_name, test->service_uuid, + test->channel, &sock_fd, test->flags); + if (status != test->expected_status) { + tester_test_failed(); + goto clean; + } + + /* Check that file descriptor is valid */ + if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) < 0) { + tester_test_failed(); + return; + } + + if (status == BT_STATUS_SUCCESS && test->test_channel) { + int channel, len; + + len = read(sock_fd, &channel, sizeof(channel)); + if (len != sizeof(channel) || channel != test->channel) { + tester_test_failed(); + goto clean; + } + + tester_print("read correct channel: %d", channel); + } + + tester_test_passed(); + +clean: + if (sock_fd >= 0) + close(sock_fd); +} + +static void test_listen_close(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const struct socket_data *test = data->test_data; + bt_status_t status; + int sock_fd = -1; + + status = data->if_sock->listen(test->sock_type, + test->service_name, test->service_uuid, + test->channel, &sock_fd, test->flags); + if (status != test->expected_status) { + tester_warn("sock->listen() failed"); + tester_test_failed(); + goto clean; + } + + /* Check that file descriptor is valid */ + if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) < 0) { + tester_warn("sock_fd %d is not valid", sock_fd); + tester_test_failed(); + return; + } + + tester_print("Got valid sock_fd: %d", sock_fd); + + /* Now close sock_fd */ + close(sock_fd); + sock_fd = -1; + + /* Try to listen again */ + status = data->if_sock->listen(test->sock_type, + test->service_name, test->service_uuid, + test->channel, &sock_fd, test->flags); + if (status != test->expected_status) { + tester_warn("sock->listen() failed"); + tester_test_failed(); + goto clean; + } + + /* Check that file descriptor is valid */ + if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) < 0) { + tester_warn("sock_fd %d is not valid", sock_fd); + tester_test_failed(); + return; + } + + tester_print("Got valid sock_fd: %d", sock_fd); + + tester_test_passed(); + +clean: + if (sock_fd >= 0) + close(sock_fd); +} + +static void test_listen_listen(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const struct socket_data *test = data->test_data; + bt_status_t status; + int sock_fd1 = -1, sock_fd2 = -1; + + status = data->if_sock->listen(test->sock_type, + test->service_name, test->service_uuid, + test->channel, &sock_fd1, test->flags); + if (status != BT_STATUS_SUCCESS) { + tester_warn("sock->listen() failed"); + tester_test_failed(); + goto clean; + } + + status = data->if_sock->listen(test->sock_type, + test->service_name, test->service_uuid, + test->channel, &sock_fd2, test->flags); + if (status != test->expected_status) { + tester_warn("sock->listen() failed, status %d", status); + tester_test_failed(); + goto clean; + } + + tester_print("status after second listen(): %d", status); + + tester_test_passed(); + +clean: + if (sock_fd1 >= 0) + close(sock_fd1); + + if (sock_fd2 >= 0) + close(sock_fd2); +} + +static void test_generic_connect(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const struct socket_data *test = data->test_data; + bt_status_t status; + int sock_fd = -1; + + status = data->if_sock->connect(test->bdaddr, test->sock_type, + test->service_uuid, test->channel, + &sock_fd, test->flags); + if (status != test->expected_status) { + tester_test_failed(); + goto clean; + } + + /* Check that file descriptor is valid */ + if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) < 0) { + tester_test_failed(); + return; + } + + tester_test_passed(); + +clean: + if (sock_fd >= 0) + close(sock_fd); +} + +static gboolean socket_chan_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + int sock_fd = g_io_channel_unix_get_fd(io); + struct test_data *data = tester_get_data(); + const struct socket_data *test = data->test_data; + int channel, len; + + tester_print("%s", __func__); + + if (cond & G_IO_HUP) { + tester_warn("Socket %d hang up", sock_fd); + goto failed; + } + + if (cond & (G_IO_ERR | G_IO_NVAL)) { + tester_warn("Socket error: sock %d cond %d", sock_fd, cond); + goto failed; + } + + if (test->test_channel) { + len = read(sock_fd, &channel, sizeof(channel)); + if (len != sizeof(channel) || channel != test->channel) + goto failed; + + tester_print("read correct channel: %d", channel); + tester_test_passed(); + return FALSE; + } + +failed: + tester_test_failed(); + return FALSE; +} + +static void test_socket_real_connect(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const struct socket_data *test = data->test_data; + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + const uint8_t *client_bdaddr; + bt_bdaddr_t emu_bdaddr; + bt_status_t status; + int sock_fd = -1; + + client_bdaddr = hciemu_get_client_bdaddr(data->hciemu); + if (!client_bdaddr) { + tester_warn("No client bdaddr"); + tester_test_failed(); + return; + } + + bdaddr2android((bdaddr_t *) client_bdaddr, &emu_bdaddr); + + bthost_add_l2cap_server(bthost, 0x0003, NULL, NULL); + + status = data->if_sock->connect(&emu_bdaddr, test->sock_type, + test->service_uuid, test->channel, + &sock_fd, test->flags); + if (status != test->expected_status) { + tester_test_failed(); + goto clean; + } + + /* Check that file descriptor is valid */ + if (status == BT_STATUS_SUCCESS && fcntl(sock_fd, F_GETFD) < 0) { + tester_test_failed(); + return; + } + + tester_print("status %d sock_fd %d", status, sock_fd); + + if (status == BT_STATUS_SUCCESS) { + GIOChannel *io; + + io = g_io_channel_unix_new(sock_fd); + g_io_channel_set_close_on_unref(io, TRUE); + + g_io_add_watch(io, G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, + socket_chan_cb, NULL); + + g_io_channel_unref(io); + } + + return; + +clean: + if (sock_fd >= 0) + close(sock_fd); +} + +static gboolean hidhost_connection_state(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct hidhost_generic_data *test = data->test_data; + struct hh_cb_data *cb_data = user_data; + + data->cb_count++; + + if (cb_data->state == BTHH_CONN_STATE_CONNECTED) + tester_setup_complete(); + + if (test && test->expected_hal_cb.connection_state_cb) + test->expected_hal_cb.connection_state_cb(&cb_data->bdaddr, + cb_data->state); + + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void hidhost_connection_state_cb(bt_bdaddr_t *bd_addr, + bthh_connection_state_t state) +{ + struct hh_cb_data *cb_data = g_new0(struct hh_cb_data, 1); + + cb_data->state = state; + cb_data->bdaddr = *bd_addr; + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(hidhost_connection_state, cb_data); +} + +static gboolean hidhost_virual_unplug(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct hidhost_generic_data *test = data->test_data; + struct hh_cb_data *cb_data = user_data; + + data->cb_count++; + + if (test && test->expected_hal_cb.virtual_unplug_cb) + test->expected_hal_cb.virtual_unplug_cb(&cb_data->bdaddr, + cb_data->status); + + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void hidhost_virual_unplug_cb(bt_bdaddr_t *bd_addr, bthh_status_t status) +{ + struct hh_cb_data *cb_data = g_new0(struct hh_cb_data, 1); + + cb_data->bdaddr = *bd_addr; + cb_data->status = status; + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(hidhost_virual_unplug, cb_data); +} + +static gboolean hidhost_hid_info(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct hidhost_generic_data *test = data->test_data; + struct hh_cb_data *cb_data = user_data; + + data->cb_count++; + + if (test && test->expected_hal_cb.hid_info_cb) + test->expected_hal_cb.hid_info_cb(&cb_data->bdaddr, + cb_data->hid_info); + + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void hidhost_hid_info_cb(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid) +{ + struct hh_cb_data *cb_data = g_new0(struct hh_cb_data, 1); + + cb_data->bdaddr = *bd_addr; + cb_data->hid_info = hid; + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(hidhost_hid_info, cb_data); +} + +static gboolean hidhost_protocol_mode(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct hidhost_generic_data *test = data->test_data; + struct hh_cb_data *cb_data = user_data; + + data->cb_count++; + + if (test && test->expected_hal_cb.protocol_mode_cb) + test->expected_hal_cb.protocol_mode_cb(&cb_data->bdaddr, + cb_data->status, cb_data->mode); + + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void hidhost_protocol_mode_cb(bt_bdaddr_t *bd_addr, + bthh_status_t status, + bthh_protocol_mode_t mode) +{ + struct hh_cb_data *cb_data = g_new0(struct hh_cb_data, 1); + + cb_data->bdaddr = *bd_addr; + cb_data->status = status; + cb_data->mode = mode; + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(hidhost_protocol_mode, cb_data); +} + +static gboolean hidhost_get_report(gpointer user_data) +{ + struct test_data *data = tester_get_data(); + const struct hidhost_generic_data *test = data->test_data; + struct hh_cb_data *cb_data = user_data; + + data->cb_count++; + + if (test && test->expected_hal_cb.get_report_cb) + test->expected_hal_cb.get_report_cb(&cb_data->bdaddr, + cb_data->status, cb_data->report, cb_data->size); + + g_free(cb_data->report); + g_free(cb_data); + + g_atomic_int_dec_and_test(&scheduled_cbacks_num); + return FALSE; +} + +static void hidhost_get_report_cb(bt_bdaddr_t *bd_addr, bthh_status_t status, + uint8_t *report, int size) +{ + struct hh_cb_data *cb_data = g_new0(struct hh_cb_data, 1); + + cb_data->bdaddr = *bd_addr; + cb_data->status = status; + cb_data->report = g_memdup(report, size); + cb_data->size = size; + + g_atomic_int_inc(&scheduled_cbacks_num); + g_idle_add(hidhost_get_report, cb_data); +} + +static bthh_callbacks_t bthh_callbacks = { + .size = sizeof(bthh_callbacks), + .connection_state_cb = hidhost_connection_state_cb, + .hid_info_cb = hidhost_hid_info_cb, + .protocol_mode_cb = hidhost_protocol_mode_cb, + .idle_time_cb = NULL, + .get_report_cb = hidhost_get_report_cb, + .virtual_unplug_cb = hidhost_virual_unplug_cb +}; + +static bool setup_hidhost(const void *test_data) +{ + struct test_data *data = tester_get_data(); + bt_status_t status; + const void *hid; + + if (!setup(data)) + return false; + + status = data->if_bluetooth->init(&bt_callbacks); + if (status != BT_STATUS_SUCCESS) { + data->if_bluetooth = NULL; + return false; + } + + hid = data->if_bluetooth->get_profile_interface(BT_PROFILE_HIDHOST_ID); + if (!hid) + return false; + + data->if_hid = hid; + + status = data->if_hid->init(&bthh_callbacks); + if (status != BT_STATUS_SUCCESS) { + data->if_hid = NULL; + return false; + } + + return true; +} + +static void setup_hidhost_interface(const void *test_data) +{ + if (setup_hidhost(test_data)) + tester_setup_complete(); + else + tester_setup_failed(); +} + +#define HID_GET_REPORT_PROTOCOL 0x60 +#define HID_GET_BOOT_PROTOCOL 0x61 +#define HID_SET_REPORT_PROTOCOL 0x70 +#define HID_SET_BOOT_PROTOCOL 0x71 + +#define HID_SET_INPUT_REPORT 0x51 +#define HID_SET_OUTPUT_REPORT 0x52 +#define HID_SET_FEATURE_REPORT 0x53 + +#define HID_SEND_DATA 0xa2 + +#define HID_GET_INPUT_REPORT 0x49 +#define HID_GET_OUTPUT_REPORT 0x4a +#define HID_GET_FEATURE_REPORT 0x4b + +static void hid_prepare_reply_protocol_mode(const void *data, uint16_t len) +{ + struct test_data *t_data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(t_data->hciemu); + uint8_t pdu[2] = { 0, 0 }; + uint16_t pdu_len = 0; + + pdu_len = 2; + pdu[0] = 0xa0; + pdu[1] = 0x00; + + bthost_send_cid(bthost, t_data->ctrl_handle, t_data->ctrl_cid, + (void *)pdu, pdu_len); +} + +static void hid_prepare_reply_report(const void *data, uint16_t len) +{ + struct test_data *t_data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(t_data->hciemu); + uint8_t pdu[3] = { 0, 0, 0 }; + uint16_t pdu_len = 0; + + pdu_len = 3; + pdu[0] = 0xa2; + pdu[1] = 0x01; + pdu[2] = 0x00; + + bthost_send_cid(bthost, t_data->ctrl_handle, t_data->ctrl_cid, + (void *)pdu, pdu_len); +} + +static void hid_intr_cid_hook_cb(const void *data, uint16_t len, + void *user_data) +{ + uint8_t header = ((uint8_t *) data)[0]; + + switch (header) { + case HID_SEND_DATA: + tester_test_passed(); + break; + } +} + +static void hid_intr_connect_cb(uint16_t handle, uint16_t cid, void *user_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + data->intr_handle = handle; + data->intr_cid = cid; + + bthost_add_cid_hook(bthost, handle, cid, hid_intr_cid_hook_cb, NULL); +} + +static void hid_ctrl_cid_hook_cb(const void *data, uint16_t len, + void *user_data) +{ + uint8_t header = ((uint8_t *) data)[0]; + + switch (header) { + case HID_GET_REPORT_PROTOCOL: + case HID_GET_BOOT_PROTOCOL: + case HID_SET_REPORT_PROTOCOL: + case HID_SET_BOOT_PROTOCOL: + hid_prepare_reply_protocol_mode(data, len); + break; + case HID_GET_INPUT_REPORT: + case HID_GET_OUTPUT_REPORT: + case HID_GET_FEATURE_REPORT: + hid_prepare_reply_report(data, len); + break; + /* HID device doesnot reply for this commads, so reaching pdu's + * to hid device means assuming test passed */ + case HID_SET_INPUT_REPORT: + case HID_SET_OUTPUT_REPORT: + case HID_SET_FEATURE_REPORT: + case HID_SEND_DATA: + tester_test_passed(); + break; + } +} + +static void hid_ctrl_connect_cb(uint16_t handle, uint16_t cid, void *user_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + data->ctrl_handle = handle; + data->ctrl_cid = cid; + + bthost_add_cid_hook(bthost, handle, cid, hid_ctrl_cid_hook_cb, NULL); +} + +static const uint8_t did_req_pdu[] = { 0x06, /* PDU id */ + 0x00, 0x00, /* Transaction id */ + 0x00, 0x0f, /* Req length */ + 0x35, 0x03, /* Attributes length */ + 0x19, 0x12, 0x00, 0xff, 0xff, 0x35, 0x05, 0x0a, 0x00, + 0x00, 0xff, 0xff, 0x00 }; /* no continuation */ + +static const uint8_t did_rsp_pdu[] = { 0x07, /* PDU id */ + 0x00, 0x00, /* Transaction id */ + 0x00, 0x4f, /* Response length */ + 0x00, 0x4c, /* Attributes length */ + 0x35, 0x4a, 0x35, 0x48, 0x09, 0x00, 0x00, 0x0a, 0x00, + 0x01, 0x00, 0x00, 0x09, 0x00, 0x01, 0x35, 0x03, 0x19, + 0x12, 0x00, 0x09, 0x00, 0x05, 0x35, 0x03, 0x19, 0x10, + 0x02, 0x09, 0x00, 0x09, 0x35, 0x08, 0x35, 0x06, 0x19, + 0x12, 0x00, 0x09, 0x01, 0x03, 0x09, 0x02, 0x00, 0x09, + 0x01, 0x03, 0x09, 0x02, 0x01, 0x09, 0x1d, 0x6b, 0x09, + 0x02, 0x02, 0x09, 0x02, 0x46, 0x09, 0x02, 0x03, 0x09, + 0x05, 0x0e, 0x09, 0x02, 0x04, 0x28, 0x01, 0x09, 0x02, + 0x05, 0x09, 0x00, 0x02, + 0x00 }; /* no continuation */ + +static const uint8_t hid_rsp_pdu[] = { 0x07, /* PDU id */ + 0x00, 0x01, /* Transaction id */ + 0x01, 0x71, /* Response length */ + 0x01, 0x6E, /* Attributes length */ + 0x36, 0x01, 0x6b, 0x36, 0x01, 0x68, 0x09, 0x00, 0x00, + 0x0a, 0x00, 0x01, 0x00, 0x00, 0x09, 0x00, 0x01, 0x35, + 0x03, 0x19, 0x11, 0x24, 0x09, 0x00, 0x04, 0x35, 0x0d, + 0x35, 0x06, 0x19, 0x01, 0x00, 0x09, 0x00, 0x11, 0x35, + 0x03, 0x19, 0x00, 0x11, 0x09, 0x00, 0x05, 0x35, 0x03, + 0x19, 0x10, 0x02, 0x09, 0x00, 0x06, 0x35, 0x09, 0x09, + 0x65, 0x6e, 0x09, 0x00, 0x6a, 0x09, 0x01, 0x00, 0x09, + 0x00, 0x09, 0x35, 0x08, 0x35, 0x06, 0x19, 0x11, 0x24, + 0x09, 0x01, 0x00, 0x09, 0x00, 0x0d, 0x35, 0x0f, 0x35, + 0x0d, 0x35, 0x06, 0x19, 0x01, 0x00, 0x09, 0x00, 0x13, + 0x35, 0x03, 0x19, 0x00, 0x11, 0x09, 0x01, 0x00, 0x25, + 0x1e, 0x4c, 0x6f, 0x67, 0x69, 0x74, 0x65, 0x63, 0x68, + 0x20, 0x42, 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74, + 0x68, 0x20, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x20, 0x4d, + 0x35, 0x35, 0x35, 0x62, 0x09, 0x01, 0x01, 0x25, 0x0f, + 0x42, 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74, 0x68, + 0x20, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x09, 0x01, 0x02, + 0x25, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x74, 0x65, 0x63, + 0x68, 0x09, 0x02, 0x00, 0x09, 0x01, 0x00, 0x09, 0x02, + 0x01, 0x09, 0x01, 0x11, 0x09, 0x02, 0x02, 0x08, 0x80, + 0x09, 0x02, 0x03, 0x08, 0x21, 0x09, 0x02, 0x04, 0x28, + 0x01, 0x09, 0x02, 0x05, 0x28, 0x01, 0x09, 0x02, 0x06, + 0x35, 0x74, 0x35, 0x72, 0x08, 0x22, 0x25, 0x6e, 0x05, + 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, + 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x08, 0x15, + 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x08, 0x81, 0x02, + 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x16, 0x01, 0xf8, + 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x81, 0x06, + 0x09, 0x38, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, + 0x01, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x81, + 0x06, 0x05, 0x09, 0x19, 0x09, 0x29, 0x10, 0x15, 0x00, + 0x25, 0x01, 0x95, 0x08, 0x75, 0x01, 0x81, 0x02, 0xc0, + 0xc0, 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, + 0x10, 0x75, 0x08, 0x95, 0x06, 0x15, 0x00, 0x26, 0xff, + 0x00, 0x09, 0x01, 0x81, 0x00, 0x09, 0x01, 0x91, 0x00, + 0xc0, 0x09, 0x02, 0x07, 0x35, 0x08, 0x35, 0x06, 0x09, + 0x04, 0x09, 0x09, 0x01, 0x00, 0x09, 0x02, 0x08, 0x28, + 0x00, 0x09, 0x02, 0x09, 0x28, 0x01, 0x09, 0x02, 0x0a, + 0x28, 0x01, 0x09, 0x02, 0x0b, 0x09, 0x01, 0x00, 0x09, + 0x02, 0x0c, 0x09, 0x0c, 0x80, 0x09, 0x02, 0x0d, 0x28, + 0x00, 0x09, 0x02, 0x0e, 0x28, 0x01, + 0x00 }; /* no continuation */ + +static void hid_sdp_cid_hook_cb(const void *data, uint16_t len, void *user_data) +{ + struct test_data *t_data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(t_data->hciemu); + + if (!memcmp(did_req_pdu, data, len)) { + bthost_send_cid(bthost, t_data->sdp_handle, t_data->sdp_cid, + did_rsp_pdu, sizeof(did_rsp_pdu)); + return; + } + + bthost_send_cid(bthost, t_data->sdp_handle, t_data->sdp_cid, + hid_rsp_pdu, sizeof(hid_rsp_pdu)); +} + +static void hid_sdp_search_cb(uint16_t handle, uint16_t cid, void *user_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost = hciemu_client_get_host(data->hciemu); + + data->sdp_handle = handle; + data->sdp_cid = cid; + + bthost_add_cid_hook(bthost, handle, cid, hid_sdp_cid_hook_cb, NULL); +} + +static void emu_powered_complete(uint16_t opcode, uint8_t status, + const void *param, uint8_t len, + void *user_data) +{ + struct test_data *data = tester_get_data(); + const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t bdaddr; + bt_status_t bt_status; + + switch (opcode) { + case BT_HCI_CMD_WRITE_SCAN_ENABLE: + case BT_HCI_CMD_LE_SET_ADV_ENABLE: + break; + default: + return; + } + + if (status) { + tester_setup_failed(); + return; + } + + data->cb_count = 0; + bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr); + bt_status = data->if_hid->connect(&bdaddr); + if (bt_status != BT_STATUS_SUCCESS) + tester_setup_failed(); +} + +static void setup_hidhost_connect(const void *test_data) +{ + struct test_data *data = tester_get_data(); + struct bthost *bthost; + + if (!setup_hidhost(test_data)) { + tester_setup_failed(); + return; + } + + bthost = hciemu_client_get_host(data->hciemu); + + /* Emulate SDP (PSM = 1) */ + bthost_add_l2cap_server(bthost, 1, hid_sdp_search_cb, NULL); + /* Emulate Control Channel (PSM = 17) */ + bthost_add_l2cap_server(bthost, 17, hid_ctrl_connect_cb, NULL); + /* Emulate Interrupt Channel (PSM = 19) */ + bthost_add_l2cap_server(bthost, 19, hid_intr_connect_cb, NULL); + + bthost_set_cmd_complete_cb(bthost, emu_powered_complete, data); + bthost_write_scan_enable(bthost, 0x03); +} + +static void hid_discon_cb(bt_bdaddr_t *bd_addr, bthh_connection_state_t state) +{ + if (state == BTHH_CONN_STATE_DISCONNECTED) + tester_test_passed(); +} + +static const struct hidhost_generic_data hidhost_test_disconnect = { + .expected_hal_cb.connection_state_cb = hid_discon_cb, +}; + +static void test_hidhost_disconnect(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t bdaddr; + bt_status_t bt_status; + + data->cb_count = 0; + bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr); + bt_status = data->if_hid->disconnect(&bdaddr); + if (bt_status != BT_STATUS_SUCCESS) + tester_test_failed(); +} + +static void test_hidhost_virtual_unplug(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t bdaddr; + bt_status_t bt_status; + + data->cb_count = 0; + bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr); + bt_status = data->if_hid->virtual_unplug(&bdaddr); + if (bt_status != BT_STATUS_SUCCESS) + tester_test_failed(); +} + +static void hid_protocol_mode_cb(bt_bdaddr_t *bd_addr, bthh_status_t status, + bthh_protocol_mode_t mode) +{ + struct test_data *data = tester_get_data(); + const struct hidhost_generic_data *test = data->test_data; + + if (data->cb_count == test->expected_cb_count && + status == test->expected_status && + mode == test->expected_protocol_mode) + tester_test_passed(); + else + tester_test_failed(); +} + +static const struct hidhost_generic_data hidhost_test_get_protocol = { + .expected_hal_cb.protocol_mode_cb = hid_protocol_mode_cb, + .expected_cb_count = 1, + .expected_protocol_mode = BTHH_BOOT_MODE, + .expected_status = BTHH_OK, +}; + +static void test_hidhost_get_protocol(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t bdaddr; + bt_status_t bt_status; + + data->cb_count = 0; + bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr); + bt_status = data->if_hid->get_protocol(&bdaddr, BTHH_REPORT_MODE); + if (bt_status != BT_STATUS_SUCCESS) + tester_test_failed(); +} + +static void test_hidhost_set_protocol(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t bdaddr; + bt_status_t bt_status; + + data->cb_count = 0; + bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr); + bt_status = data->if_hid->set_protocol(&bdaddr, BTHH_REPORT_MODE); + if (bt_status != BT_STATUS_SUCCESS) + tester_test_failed(); +} + +static void test_hidhost_set_report(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t bdaddr; + bt_status_t bt_status; + char *buf = "010101"; + + data->cb_count = 0; + bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr); + bt_status = data->if_hid->set_report(&bdaddr, BTHH_INPUT_REPORT, buf); + if (bt_status != BT_STATUS_SUCCESS) + tester_test_failed(); +} + +static void test_hidhost_send_data(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t bdaddr; + bt_status_t bt_status; + char *buf = "fe0201"; + + data->cb_count = 0; + bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr); + bt_status = data->if_hid->send_data(&bdaddr, buf); + if (bt_status != BT_STATUS_SUCCESS) + tester_test_failed(); +} + +static void hid_get_report_cb(bt_bdaddr_t *bd_addr, bthh_status_t status, + uint8_t *report, int size) +{ + struct test_data *data = tester_get_data(); + const struct hidhost_generic_data *test = data->test_data; + + if (data->cb_count == test->expected_cb_count && + status == test->expected_status && + size == test->expected_report_size) + tester_test_passed(); + else + tester_test_failed(); +} + +static const struct hidhost_generic_data hidhost_test_get_report = { + .expected_hal_cb.get_report_cb = hid_get_report_cb, + .expected_cb_count = 1, + .expected_status = BTHH_OK, + .expected_report_size = 2, +}; + +static void test_hidhost_get_report(const void *test_data) +{ + struct test_data *data = tester_get_data(); + const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu); + bt_bdaddr_t bdaddr; + bt_status_t bt_status; + + data->cb_count = 0; + bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr); + bt_status = data->if_hid->get_report(&bdaddr, BTHH_INPUT_REPORT, 1, 20); + if (bt_status != BT_STATUS_SUCCESS) + tester_test_failed(); +} + +#define test_bredr(name, data, test_setup, test, test_teardown) \ + do { \ + struct test_data *user; \ + user = g_malloc0(sizeof(struct test_data)); \ + if (!user) \ + break; \ + user->hciemu_type = HCIEMU_TYPE_BREDR; \ + user->test_data = data; \ + tester_add_full(name, data, test_pre_setup, test_setup, \ + test, test_teardown, test_post_teardown, \ + 1, user, g_free); \ + } while (0) + +#define test_bredrle(name, data, test_setup, test, test_teardown) \ + do { \ + struct test_data *user; \ + user = g_malloc0(sizeof(struct test_data)); \ + if (!user) \ + break; \ + user->hciemu_type = HCIEMU_TYPE_BREDRLE; \ + user->test_data = data; \ + tester_add_full(name, data, test_pre_setup, test_setup, \ + test, test_teardown, test_post_teardown, \ + 3, user, g_free); \ + } while (0) + +int main(int argc, char *argv[]) +{ + snprintf(exec_dir, sizeof(exec_dir), "%s", dirname(argv[0])); + + tester_init(&argc, &argv); + + test_bredrle("Bluetooth Init", NULL, setup_base, test_dummy, teardown); + + test_bredrle("Bluetooth Enable - Success", + &bluetooth_enable_success_test, + setup_base, test_enable, + teardown); + + test_bredrle("Bluetooth Enable - Success 2", + &bluetooth_enable_success2_test, + setup_enabled_adapter, + test_enable_done, teardown); + + test_bredrle("Bluetooth Disable - Success", + &bluetooth_disable_success_test, + setup_enabled_adapter, + test_disable, teardown); + + test_bredrle("Bluetooth Set BDNAME - Success", + &bluetooth_setprop_bdname_success_test, + setup_enabled_adapter, + test_setprop_bdname_success, teardown); + + test_bredrle("Bluetooth Set SCAN_MODE - Success", + &bluetooth_setprop_scanmode_success_test, + setup_enabled_adapter, + test_setprop_scanmode_succes, teardown); + + test_bredrle("Bluetooth Set DISCOVERY_TIMEOUT - Success", + &bluetooth_setprop_disctimeout_success_test, + setup_enabled_adapter, + test_setprop_disctimeout_succes, teardown); + + test_bredrle("Bluetooth Get BDADDR - Success", + &bluetooth_getprop_bdaddr_success_test, + setup_enabled_adapter, + test_getprop_bdaddr_success, teardown); + + test_bredrle("Bluetooth Get BDNAME - Success", + &bluetooth_getprop_bdname_success_test, + setup_enabled_adapter, + test_getprop_bdname_success, teardown); + + test_bredrle("Bluetooth Set UUID - Invalid", + &bluetooth_setprop_uuid_invalid_test, + setup_enabled_adapter, + test_setprop_uuid_invalid, teardown); + + test_bredrle("Bluetooth Set CLASS_OF_DEVICE - Invalid", + &bluetooth_setprop_cod_invalid_test, + setup_enabled_adapter, + test_setprop_cod_invalid, teardown); + + test_bredrle("Bluetooth Set TYPE_OF_DEVICE - Invalid", + &bluetooth_setprop_tod_invalid_test, + setup_enabled_adapter, + test_setprop_tod_invalid, teardown); + + test_bredrle("Bluetooth Set REMOTE_RSSI - Invalid", + &bluetooth_setprop_remote_rssi_invalid_test, + setup_enabled_adapter, + test_setprop_rssi_invalid, teardown); + + test_bredrle("Bluetooth Set SERVICE_RECORD - Invalid", + &bluetooth_setprop_service_record_invalid_test, + setup_enabled_adapter, + test_setprop_service_record_invalid, teardown); + + test_bredrle("Bluetooth Set BDADDR - Invalid", + &bluetooth_setprop_bdaddr_invalid_test, + setup_enabled_adapter, + test_setprop_bdaddr_invalid, teardown); + + test_bredrle("Bluetooth Set SCAN_MODE CONNECTABLE - Success", + &bluetooth_setprop_scanmode_connectable_success_test, + setup_enabled_adapter, + test_setprop_scanmode_connectable_success, teardown); + + test_bredrle("Bluetooth Set BONDED_DEVICES - Invalid", + &bluetooth_setprop_bonded_devices_invalid_test, + setup_enabled_adapter, + test_setprop_bonded_devices_invalid, teardown); + + test_bredrle("Bluetooth Get CLASS_OF_DEVICE - Success", + &bluetooth_getprop_cod_success_test, + setup_enabled_adapter, + test_getprop_cod_success, teardown); + + test_bredrle("Bluetooth Get TYPE_OF_DEVICE - Success", + &bluetooth_getprop_tod_success_test, + setup_enabled_adapter, + test_getprop_tod_success, teardown); + + test_bredrle("Bluetooth Get SCAN_MODE - Success", + &bluetooth_getprop_scanmode_success_test, + setup_enabled_adapter, + test_getprop_scanmode_success, teardown); + + test_bredrle("Bluetooth Get DISCOVERY_TIMEOUT - Success", + &bluetooth_getprop_disctimeout_success_test, + setup_enabled_adapter, + test_getprop_disctimeout_success, teardown); + + test_bredrle("Bluetooth Get UUIDS - Success", + &bluetooth_getprop_uuids_success_test, + setup_enabled_adapter, + test_getprop_uuids_success, teardown); + + test_bredrle("Bluetooth Get BONDED_DEVICES - Success", + &bluetooth_getprop_bondeddev_success_test, + setup_enabled_adapter, + test_getprop_bondeddev_success, teardown); + + test_bredrle("Bluetooth Set SCAN_MODE NONE - Success 2", + &bluetooth_setprop_scanmode_none_success2_test, + setup_enabled_adapter, + test_setprop_scanmode_none_done, teardown); + + test_bredrle("Bluetooth BR/EDR Discovery Start - Success", + &bluetooth_discovery_start_success_test, + setup_enabled_adapter, + test_discovery_start_success, teardown); + + test_bredrle("Bluetooth BR/EDR Discovery Start - Success 2", + &bluetooth_discovery_start_success2_test, + setup_enabled_adapter, + test_discovery_start_done, teardown); + + test_bredrle("Bluetooth BR/EDR Discovery Stop - Success", + &bluetooth_discovery_stop_success_test, + setup_enabled_adapter, + test_discovery_stop_success, teardown); + + test_bredrle("Bluetooth BR/EDR Discovery Stop - Success 2", + &bluetooth_discovery_stop_success2_test, + setup_enabled_adapter, + test_discovery_stop_done, teardown); + + test_bredr("Bluetooth BR/EDR Discovery Device Found", + &bluetooth_discovery_device_found_test, + setup_enabled_adapter, + test_discovery_device_found, teardown); + + test_bredr("Bluetooth Device Get Props - Success", + &bt_dev_getprops_success_test, + setup_enabled_adapter, + test_dev_getprops_success, teardown); + + test_bredr("Bluetooth Device Get BDNAME - Success", + &bt_dev_getprop_bdname_success_test, + setup_enabled_adapter, + test_dev_getprop_bdname_success, teardown); + + test_bredr("Bluetooth Device Get UUIDS - Success", + &bt_dev_getprop_uuids_success_test, + setup_enabled_adapter, + test_dev_getprop_uuids_success, teardown); + + test_bredr("Bluetooth Device Get COD - Success", + &bt_dev_getprop_cod_success_test, + setup_enabled_adapter, + test_dev_getprop_cod_success, teardown); + + test_bredr("Bluetooth Device Get TOD - Success", + &bt_dev_getprop_tod_success_test, + setup_enabled_adapter, + test_dev_getprop_tod_success, teardown); + + test_bredr("Bluetooth Device Get RSSI - Success", + &bt_dev_getprop_rssi_success_test, + setup_enabled_adapter, + test_dev_getprop_rssi_success, teardown); + + test_bredr("Bluetooth Device Get TIMESTAMP - Success", + &bt_dev_getprop_timpestamp_success_test, + setup_enabled_adapter, + test_dev_getprop_timestamp_success, teardown); + + test_bredr("Bluetooth Device Get BDADDR - Fail", + &bt_dev_getprop_bdaddr_fail_test, + setup_enabled_adapter, + test_dev_getprop_bdaddr_fail, teardown); + + test_bredr("Bluetooth Device Get SERVICE_RECORD - Fail", + &bt_dev_getprop_servrec_fail_test, + setup_enabled_adapter, + test_dev_getprop_servrec_fail, teardown); + + test_bredr("Bluetooth Device Get SCAN_MODE - Fail", + &bt_dev_getprop_scanmode_fail_test, + setup_enabled_adapter, + test_dev_getprop_scanmode_fail, teardown); + + test_bredr("Bluetooth Device Get BONDED_DEVICES - Fail", + &bt_dev_getprop_bondeddev_fail_test, + setup_enabled_adapter, + test_dev_getprop_bondeddev_fail, teardown); + + test_bredr("Bluetooth Device Get DISCOVERY_TIMEOUT - Fail", + &bt_dev_getprop_disctimeout_fail_test, + setup_enabled_adapter, + test_dev_getprop_disctimeout_fail, teardown); + + test_bredr("Bluetooth Device Get VERSION_INFO - Fail", + &bt_dev_getprop_verinfo_fail_test, + setup_enabled_adapter, + test_dev_getprop_verinfo_fail, teardown); + + test_bredr("Bluetooth Device Get FRIENDLY_NAME - Fail", + &bt_dev_getprop_fname_fail_test, + setup_enabled_adapter, + test_dev_getprop_fname_fail, teardown); + + test_bredr("Bluetooth Device Set FRIENDLY_NAME - Success", + &bt_dev_setprop_fname_success_test, + setup_enabled_adapter, + test_dev_setprop_fname_success, teardown); + + test_bredr("Bluetooth Device Set BDNAME - Fail", + &bt_dev_setprop_bdname_fail_test, + setup_enabled_adapter, + test_dev_setprop_bdname_fail, teardown); + + test_bredr("Bluetooth Device Set UUIDS - Fail", + &bt_dev_setprop_uuids_fail_test, + setup_enabled_adapter, + test_dev_setprop_uuids_fail, teardown); + + test_bredr("Bluetooth Device Set COD - Fail", + &bt_dev_setprop_cod_fail_test, + setup_enabled_adapter, + test_dev_setprop_cod_fail, teardown); + + test_bredr("Bluetooth Device Set TOD - Fail", + &bt_dev_setprop_tod_fail_test, + setup_enabled_adapter, + test_dev_setprop_tod_fail, teardown); + + test_bredr("Bluetooth Device Set RSSI - Fail", + &bt_dev_setprop_rssi_fail_test, + setup_enabled_adapter, + test_dev_setprop_rssi_fail, teardown); + + test_bredr("Bluetooth Device Set TIMESTAMP - Fail", + &bt_dev_setprop_timpestamp_fail_test, + setup_enabled_adapter, + test_dev_setprop_timestamp_fail, teardown); + + test_bredr("Bluetooth Device Set BDADDR - Fail", + &bt_dev_setprop_bdaddr_fail_test, + setup_enabled_adapter, + test_dev_setprop_bdaddr_fail, teardown); + + test_bredr("Bluetooth Device Set SERVICE_RECORD - Fail", + &bt_dev_setprop_servrec_fail_test, + setup_enabled_adapter, + test_dev_setprop_servrec_fail, teardown); + + test_bredr("Bluetooth Device Set SCAN_MODE - Fail", + &bt_dev_setprop_scanmode_fail_test, + setup_enabled_adapter, + test_dev_setprop_scanmode_fail, teardown); + + test_bredr("Bluetooth Device Set BONDED_DEVICES - Fail", + &bt_dev_setprop_bondeddev_fail_test, + setup_enabled_adapter, + test_dev_setprop_bondeddev_fail, teardown); + + test_bredr("Bluetooth Device Set DISCOVERY_TIMEOUT - Fail", + &bt_dev_setprop_disctimeout_fail_test, + setup_enabled_adapter, + test_dev_setprop_disctimeout_fail, teardown); + + test_bredr("Bluetooth Create Bond PIN - Success", + &bt_bond_create_pin_success_test, + setup_enabled_adapter, + test_bond_create_pin_success, teardown); + + test_bredr("Bluetooth Create Bond PIN - Bad PIN", + &bt_bond_create_pin_fail_test, + setup_enabled_adapter, + test_bond_create_pin_fail, teardown); + + test_bredr("Bluetooth Create Bond SSP - Success", + &bt_bond_create_ssp_success_test, + setup_enabled_adapter, + test_bond_create_ssp_success, teardown); + + test_bredr("Bluetooth Create Bond SSP - Negative reply", + &bt_bond_create_ssp_fail_test, + setup_enabled_adapter, + test_bond_create_ssp_fail, teardown); + + test_bredrle("Bluetooth Create Bond - No Discovery", + &bt_bond_create_no_disc_success_test, + setup_enabled_adapter, + test_bond_create_no_disc_success, teardown); + + test_bredrle("Bluetooth Create Bond - Bad Address", + &bt_bond_create_bad_addr_success_test, + setup_enabled_adapter, + test_bond_create_bad_addr_success, teardown); + + test_bredr("Bluetooth Cancel Bonding - Success", + &bt_bond_cancel_success_test, + setup_enabled_adapter, + test_bond_cancel_success, teardown); + + test_bredr("Bluetooth Remove Bond - Success", + &bt_bond_remove_success_test, + setup_enabled_adapter, + test_bond_remove_success, teardown); + + test_bredrle("Socket Init", NULL, setup_socket_interface, + test_dummy, teardown); + + test_bredrle("Socket Listen - Invalid: sock_type 0", + &btsock_inv_param_socktype, setup_socket_interface, + test_generic_listen, teardown); + + test_bredrle("Socket Listen - Invalid: sock_type L2CAP", + &btsock_inv_param_socktype_l2cap, + setup_socket_interface, test_generic_listen, teardown); + + test_bredrle("Socket Listen - Invalid: chan, uuid", + &btsock_inv_params_chan_uuid, + setup_socket_interface, test_generic_listen, teardown); + + test_bredrle("Socket Listen - Check returned fd valid", + &btsock_success, + setup_socket_interface, test_generic_listen, teardown); + + test_bredrle("Socket Listen - Check returned channel", + &btsock_success_check_chan, + setup_socket_interface, test_generic_listen, teardown); + + test_bredrle("Socket Listen - Close and Listen again", + &btsock_success_check_chan, + setup_socket_interface, test_listen_close, teardown); + + test_bredrle("Socket Listen - Invalid: double Listen", + &btsock_inv_listen_listen, + setup_socket_interface, test_listen_listen, teardown); + + test_bredrle("Socket Connect - Check returned fd valid", + &btsock_success, setup_socket_interface, + test_generic_connect, teardown); + + test_bredrle("Socket Connect - Invalid: sock_type 0", + &btsock_inv_param_socktype, setup_socket_interface, + test_generic_connect, teardown); + + test_bredrle("Socket Connect - Invalid: sock_type L2CAP", + &btsock_inv_param_socktype_l2cap, + setup_socket_interface, test_generic_connect, teardown); + + test_bredrle("Socket Connect - Invalid: chan, uuid", + &btsock_inv_params_chan_uuid, + setup_socket_interface, test_generic_connect, teardown); + + test_bredrle("Socket Connect - Invalid: bdaddr", + &btsock_inv_param_bdaddr, + setup_socket_interface, test_generic_connect, teardown); + + test_bredrle("Socket Connect - Check returned chan", + &btsock_success_check_chan, + setup_socket_interface_enabled, + test_socket_real_connect, teardown); + + test_bredrle("HIDHost Init", NULL, setup_hidhost_interface, + test_dummy, teardown); + + test_bredrle("HIDHost Connect Success", + NULL, setup_hidhost_connect, + test_dummy, teardown); + + test_bredrle("HIDHost Disconnect Success", + &hidhost_test_disconnect, setup_hidhost_connect, + test_hidhost_disconnect, teardown); + + test_bredrle("HIDHost VirtualUnplug Success", + &hidhost_test_disconnect, setup_hidhost_connect, + test_hidhost_virtual_unplug, teardown); + + test_bredrle("HIDHost GetProtocol Success", + &hidhost_test_get_protocol, setup_hidhost_connect, + test_hidhost_get_protocol, teardown); + + test_bredrle("HIDHost SetProtocol Success", + &hidhost_test_get_protocol, setup_hidhost_connect, + test_hidhost_set_protocol, teardown); + + test_bredrle("HIDHost GetReport Success", + &hidhost_test_get_report, setup_hidhost_connect, + test_hidhost_get_report, teardown); + + test_bredrle("HIDHost SetReport Success", + NULL, setup_hidhost_connect, + test_hidhost_set_report, teardown); + + test_bredrle("HIDHost SendData Success", + NULL, setup_hidhost_connect, + test_hidhost_send_data, teardown); + return tester_run(); +}
diff --git a/bluez/android/audio-ipc-api.txt b/bluez/android/audio-ipc-api.txt new file mode 100644 index 0000000..f4a497d --- /dev/null +++ b/bluez/android/audio-ipc-api.txt
@@ -0,0 +1,87 @@ +Bluetooth Audio Plugin +====================== + +The audio plugin happen to be in a different socket but all the rules for +HAL socket apply here as well, the abstract socket name is +"\0bluez_audio_socket" (tentative): + + .---Audio---. .--Android--. + | Plugin | | Daemon | + | | Command | | + | | --------------------------> | | + | | | | + | | <-------------------------- | | + | | Response | | + | | | | + | | | | + | | | | + '-----------' '-----------' + + + Audio HAL Daemon + ---------------------------------------------------- + + call dev->open() --> command 0x01 + return dev->open() <-- response 0x01 + + call dev->open_output_stream() --> command 0x03 + return dev->open_output_stream() <-- response 0x03 + + call stream->write() --> command 0x05 + return stream->write() <-- response 0x05 + + call stream->common.standby() --> command 0x06 + return stream->common.standby() <-- response 0x06 + + call dev->close_output_stream() --> command 0x04 + return dev->close_output_stream() <-- response 0x04 + + call dev->close() --> command 0x02 + return dev->close() <-- response 0x02 + +Audio Service (ID 0) +==================== + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Opcode 0x01 - Open Audio Endpoint commmand + + Command parameters: Service UUID (16 octets) + Codec ID (1 octet) + Number of codec presets (1 octet) + Codec capabilities length (1 octet) + Codec capabilities (variable) + Codec preset # length (1 octet) + Codec preset # configuration (variable) + ... + Response parameters: Endpoint ID (1 octet) + + Opcode 0x02 - Close Audio Endpoint command + + Command parameters: Endpoint ID (1 octet) + Response parameters: <none> + + Opcode 0x03 - Open Stream command + + Command parameters: Endpoint ID (1 octet) + Response parameters: Outgoing MTU (2 octets) + Codec configuration length (1 octet) + Codec configuration (1 octet) + File descriptor (inline) + + Opcode 0x04 - Close Stream command + + Command parameters: Endpoint ID (1 octet) + Response parameters: <none> + + Opcode 0x05 - Resume Stream command + + Command parameters: Endpoint ID (1 octet) + Response parameters: <none> + + Opcode 0x06 - Suspend Stream command + + Command parameters: Endpoint ID (1 octet) + Response parameters: <none>
diff --git a/bluez/android/audio-msg.h b/bluez/android/audio-msg.h new file mode 100644 index 0000000..5981355 --- /dev/null +++ b/bluez/android/audio-msg.h
@@ -0,0 +1,81 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#define BLUEZ_AUDIO_MTU 1024 + +static const char BLUEZ_AUDIO_SK_PATH[] = "\0bluez_audio_socket"; + +#define AUDIO_SERVICE_ID 0 +#define AUDIO_SERVICE_ID_MAX AUDIO_SERVICE_ID + +#define AUDIO_STATUS_SUCCESS IPC_STATUS_SUCCESS +#define AUDIO_STATUS_FAILED 0x01 + +#define AUDIO_OP_STATUS IPC_OP_STATUS + +#define AUDIO_OP_OPEN 0x01 +struct audio_preset { + uint8_t len; + uint8_t data[0]; +} __attribute__((packed)); + +struct audio_cmd_open { + uint8_t uuid[16]; + uint8_t codec; + uint8_t presets; + struct audio_preset preset[0]; +} __attribute__((packed)); + +struct audio_rsp_open { + uint8_t id; +} __attribute__((packed)); + +#define AUDIO_OP_CLOSE 0x02 +struct audio_cmd_close { + uint8_t id; +} __attribute__((packed)); + +#define AUDIO_OP_OPEN_STREAM 0x03 +struct audio_cmd_open_stream { + uint8_t id; +} __attribute__((packed)); + +struct audio_rsp_open_stream { + uint16_t mtu; + struct audio_preset preset[0]; +} __attribute__((packed)); + +#define AUDIO_OP_CLOSE_STREAM 0x04 +struct audio_cmd_close_stream { + uint8_t id; +} __attribute__((packed)); + +#define AUDIO_OP_RESUME_STREAM 0x05 +struct audio_cmd_resume_stream { + uint8_t id; +} __attribute__((packed)); + +#define AUDIO_OP_SUSPEND_STREAM 0x06 +struct audio_cmd_suspend_stream { + uint8_t id; +} __attribute__((packed));
diff --git a/bluez/android/avctp.c b/bluez/android/avctp.c new file mode 100644 index 0000000..ed91810 --- /dev/null +++ b/bluez/android/avctp.c
@@ -0,0 +1,1556 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2006-2010 Nokia Corporation + * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> + * Copyright (C) 2011 Texas Instruments, Inc. + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdlib.h> +#include <stdint.h> +#include <stdbool.h> +#include <errno.h> +#include <unistd.h> +#include <assert.h> +#include <signal.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <netinet/in.h> + +#include <bluetooth/sdp.h> + +#include <glib.h> + +#include "src/log.h" +#include "src/uinput.h" + +#include "avctp.h" + +/* AV/C Panel 1.23, page 76: + * command with the pressed value is valid for two seconds + */ +#define AVC_PRESS_TIMEOUT 2 + +#define QUIRK_NO_RELEASE 1 << 0 + +/* Message types */ +#define AVCTP_COMMAND 0 +#define AVCTP_RESPONSE 1 + +/* Packet types */ +#define AVCTP_PACKET_SINGLE 0 +#define AVCTP_PACKET_START 1 +#define AVCTP_PACKET_CONTINUE 2 +#define AVCTP_PACKET_END 3 + +#if __BYTE_ORDER == __LITTLE_ENDIAN + +struct avctp_header { + uint8_t ipid:1; + uint8_t cr:1; + uint8_t packet_type:2; + uint8_t transaction:4; + uint16_t pid; +} __attribute__ ((packed)); +#define AVCTP_HEADER_LENGTH 3 + +struct avc_header { + uint8_t code:4; + uint8_t _hdr0:4; + uint8_t subunit_id:3; + uint8_t subunit_type:5; + uint8_t opcode; +} __attribute__ ((packed)); +#define AVC_HEADER_LENGTH 3 + +#elif __BYTE_ORDER == __BIG_ENDIAN + +struct avctp_header { + uint8_t transaction:4; + uint8_t packet_type:2; + uint8_t cr:1; + uint8_t ipid:1; + uint16_t pid; +} __attribute__ ((packed)); +#define AVCTP_HEADER_LENGTH 3 + +struct avc_header { + uint8_t _hdr0:4; + uint8_t code:4; + uint8_t subunit_type:5; + uint8_t subunit_id:3; + uint8_t opcode; +} __attribute__ ((packed)); +#define AVC_HEADER_LENGTH 3 + +#else +#error "Unknown byte order" +#endif + +struct avctp_control_req { + struct avctp_pending_req *p; + uint8_t code; + uint8_t subunit; + uint8_t op; + uint8_t *operands; + uint16_t operand_count; + avctp_rsp_cb func; + void *user_data; +}; + +struct avctp_browsing_req { + struct avctp_pending_req *p; + uint8_t *operands; + uint16_t operand_count; + avctp_browsing_rsp_cb func; + void *user_data; +}; + +typedef int (*avctp_process_cb) (void *data); + +struct avctp_pending_req { + struct avctp_channel *chan; + uint8_t transaction; + guint timeout; + int err; + avctp_process_cb process; + void *data; + avctp_destroy_cb_t destroy; +}; + +struct avctp_channel { + struct avctp *session; + GIOChannel *io; + uint8_t transaction; + guint watch; + uint16_t imtu; + uint16_t omtu; + uint8_t *buffer; + GSList *handlers; + struct avctp_pending_req *p; + GQueue *queue; + GSList *processed; + guint process_id; + avctp_destroy_cb_t destroy; +}; + +struct key_pressed { + uint8_t op; + uint8_t *params; + size_t params_len; + guint timer; +}; + +struct avctp { + int uinput; + + unsigned int passthrough_id; + unsigned int unit_id; + unsigned int subunit_id; + + struct avctp_channel *control; + struct avctp_channel *browsing; + + struct avctp_passthrough_handler *handler; + + uint8_t key_quirks[256]; + struct key_pressed key; + uint16_t version; + + avctp_destroy_cb_t destroy; + void *data; +}; + +struct avctp_passthrough_handler { + avctp_passthrough_cb cb; + void *user_data; + unsigned int id; +}; + +struct avctp_pdu_handler { + uint8_t opcode; + avctp_control_pdu_cb cb; + void *user_data; + unsigned int id; +}; + +struct avctp_browsing_pdu_handler { + avctp_browsing_pdu_cb cb; + void *user_data; + unsigned int id; + avctp_destroy_cb_t destroy; +}; + +static struct { + const char *name; + uint8_t avc; + uint16_t uinput; +} key_map[] = { + { "SELECT", AVC_SELECT, KEY_SELECT }, + { "UP", AVC_UP, KEY_UP }, + { "DOWN", AVC_DOWN, KEY_DOWN }, + { "LEFT", AVC_LEFT, KEY_LEFT }, + { "RIGHT", AVC_RIGHT, KEY_RIGHT }, + { "ROOT MENU", AVC_ROOT_MENU, KEY_MENU }, + { "CONTENTS MENU", AVC_CONTENTS_MENU, KEY_PROGRAM }, + { "FAVORITE MENU", AVC_FAVORITE_MENU, KEY_FAVORITES }, + { "EXIT", AVC_EXIT, KEY_EXIT }, + { "ON DEMAND MENU", AVC_ON_DEMAND_MENU, KEY_MENU }, + { "APPS MENU", AVC_APPS_MENU, KEY_MENU }, + { "0", AVC_0, KEY_0 }, + { "1", AVC_1, KEY_1 }, + { "2", AVC_2, KEY_2 }, + { "3", AVC_3, KEY_3 }, + { "4", AVC_4, KEY_4 }, + { "5", AVC_5, KEY_5 }, + { "6", AVC_6, KEY_6 }, + { "7", AVC_7, KEY_7 }, + { "8", AVC_8, KEY_8 }, + { "9", AVC_9, KEY_9 }, + { "DOT", AVC_DOT, KEY_DOT }, + { "ENTER", AVC_ENTER, KEY_ENTER }, + { "CHANNEL UP", AVC_CHANNEL_UP, KEY_CHANNELUP }, + { "CHANNEL DOWN", AVC_CHANNEL_DOWN, KEY_CHANNELDOWN }, + { "CHANNEL PREVIOUS", AVC_CHANNEL_PREVIOUS, KEY_LAST }, + { "INPUT SELECT", AVC_INPUT_SELECT, KEY_CONFIG }, + { "INFO", AVC_INFO, KEY_INFO }, + { "HELP", AVC_HELP, KEY_HELP }, + { "POWER", AVC_POWER, KEY_POWER2 }, + { "VOLUME UP", AVC_VOLUME_UP, KEY_VOLUMEUP }, + { "VOLUME DOWN", AVC_VOLUME_DOWN, KEY_VOLUMEDOWN }, + { "MUTE", AVC_MUTE, KEY_MUTE }, + { "PLAY", AVC_PLAY, KEY_PLAYCD }, + { "STOP", AVC_STOP, KEY_STOPCD }, + { "PAUSE", AVC_PAUSE, KEY_PAUSECD }, + { "FORWARD", AVC_FORWARD, KEY_NEXTSONG }, + { "BACKWARD", AVC_BACKWARD, KEY_PREVIOUSSONG }, + { "RECORD", AVC_RECORD, KEY_RECORD }, + { "REWIND", AVC_REWIND, KEY_REWIND }, + { "FAST FORWARD", AVC_FAST_FORWARD, KEY_FASTFORWARD }, + { "LIST", AVC_LIST, KEY_LIST }, + { "F1", AVC_F1, KEY_F1 }, + { "F2", AVC_F2, KEY_F2 }, + { "F3", AVC_F3, KEY_F3 }, + { "F4", AVC_F4, KEY_F4 }, + { "F5", AVC_F5, KEY_F5 }, + { "F6", AVC_F6, KEY_F6 }, + { "F7", AVC_F7, KEY_F7 }, + { "F8", AVC_F8, KEY_F8 }, + { "F9", AVC_F9, KEY_F9 }, + { "RED", AVC_RED, KEY_RED }, + { "GREEN", AVC_GREEN, KEY_GREEN }, + { "BLUE", AVC_BLUE, KEY_BLUE }, + { "YELLOW", AVC_YELLOW, KEY_YELLOW }, + { NULL } +}; + +static gboolean process_queue(gpointer user_data); +static gboolean avctp_passthrough_rsp(struct avctp *session, uint8_t code, + uint8_t subunit, uint8_t *operands, + size_t operand_count, void *user_data); + +static int send_event(int fd, uint16_t type, uint16_t code, int32_t value) +{ + struct uinput_event event; + int err; + + memset(&event, 0, sizeof(event)); + event.type = type; + event.code = code; + event.value = value; + + do { + err = write(fd, &event, sizeof(event)); + } while (err < 0 && errno == EINTR); + + if (err < 0) { + err = -errno; + error("send_event: %s (%d)", strerror(-err), -err); + } + + return err; +} + +static void send_key(int fd, uint16_t key, int pressed) +{ + send_event(fd, EV_KEY, key, pressed); + send_event(fd, EV_SYN, SYN_REPORT, 0); +} + +static gboolean auto_release(gpointer user_data) +{ + struct avctp *session = user_data; + + session->key.timer = 0; + + DBG("AV/C: key press timeout"); + + send_key(session->uinput, session->key.op, 0); + + return FALSE; +} + +static ssize_t handle_panel_passthrough(struct avctp *session, + uint8_t transaction, uint8_t *code, + uint8_t *subunit, uint8_t *operands, + size_t operand_count, void *user_data) +{ + struct avctp_passthrough_handler *handler = session->handler; + const char *status; + int pressed, i; + + if (*code != AVC_CTYPE_CONTROL || *subunit != AVC_SUBUNIT_PANEL) { + *code = AVC_CTYPE_REJECTED; + return operand_count; + } + + if (operand_count == 0) + goto done; + + if (operands[0] & 0x80) { + status = "released"; + pressed = 0; + } else { + status = "pressed"; + pressed = 1; + } + + if (session->key.timer == 0 && handler != NULL) { + if (handler->cb(session, operands[0] & 0x7F, + pressed, handler->user_data)) + goto done; + } + + if (session->uinput < 0) { + DBG("AV/C: uinput not initialized"); + *code = AVC_CTYPE_NOT_IMPLEMENTED; + return 0; + } + + for (i = 0; key_map[i].name != NULL; i++) { + uint8_t key_quirks; + + if ((operands[0] & 0x7F) != key_map[i].avc) + continue; + + DBG("AV/C: %s %s", key_map[i].name, status); + + key_quirks = session->key_quirks[key_map[i].avc]; + + if (key_quirks & QUIRK_NO_RELEASE) { + if (!pressed) { + DBG("AV/C: Ignoring release"); + break; + } + + DBG("AV/C: treating key press as press + release"); + send_key(session->uinput, key_map[i].uinput, 1); + send_key(session->uinput, key_map[i].uinput, 0); + break; + } + + if (pressed) { + if (session->key.timer > 0) { + g_source_remove(session->key.timer); + send_key(session->uinput, session->key.op, 0); + } + + session->key.op = key_map[i].uinput; + session->key.timer = g_timeout_add_seconds( + AVC_PRESS_TIMEOUT, + auto_release, + session); + } else if (session->key.timer > 0) { + g_source_remove(session->key.timer); + session->key.timer = 0; + } + + send_key(session->uinput, key_map[i].uinput, pressed); + break; + } + + if (key_map[i].name == NULL) { + DBG("AV/C: unknown button 0x%02X %s", + operands[0] & 0x7F, status); + *code = AVC_CTYPE_NOT_IMPLEMENTED; + return operand_count; + } + +done: + *code = AVC_CTYPE_ACCEPTED; + return operand_count; +} + +static ssize_t handle_unit_info(struct avctp *session, + uint8_t transaction, uint8_t *code, + uint8_t *subunit, uint8_t *operands, + size_t operand_count, void *user_data) +{ + if (*code != AVC_CTYPE_STATUS) { + *code = AVC_CTYPE_REJECTED; + return 0; + } + + *code = AVC_CTYPE_STABLE; + + /* The first operand should be 0x07 for the UNITINFO response. + * Neither AVRCP (section 22.1, page 117) nor AVC Digital + * Interface Command Set (section 9.2.1, page 45) specs + * explain this value but both use it */ + if (operand_count >= 1) + operands[0] = 0x07; + if (operand_count >= 2) + operands[1] = AVC_SUBUNIT_PANEL << 3; + + DBG("reply to AVC_OP_UNITINFO"); + + return operand_count; +} + +static ssize_t handle_subunit_info(struct avctp *session, + uint8_t transaction, uint8_t *code, + uint8_t *subunit, uint8_t *operands, + size_t operand_count, void *user_data) +{ + if (*code != AVC_CTYPE_STATUS) { + *code = AVC_CTYPE_REJECTED; + return 0; + } + + *code = AVC_CTYPE_STABLE; + + /* The first operand should be 0x07 for the UNITINFO response. + * Neither AVRCP (section 22.1, page 117) nor AVC Digital + * Interface Command Set (section 9.2.1, page 45) specs + * explain this value but both use it */ + if (operand_count >= 2) + operands[1] = AVC_SUBUNIT_PANEL << 3; + + DBG("reply to AVC_OP_SUBUNITINFO"); + + return operand_count; +} + +static struct avctp_pdu_handler *find_handler(GSList *list, uint8_t opcode) +{ + for (; list; list = list->next) { + struct avctp_pdu_handler *handler = list->data; + + if (handler->opcode == opcode) + return handler; + } + + return NULL; +} + +static void pending_destroy(gpointer data, gpointer user_data) +{ + struct avctp_pending_req *req = data; + + if (req->destroy) + req->destroy(req->data); + + if (req->timeout > 0) + g_source_remove(req->timeout); + + g_free(req); +} + +static void avctp_channel_destroy(struct avctp_channel *chan) +{ + g_io_channel_shutdown(chan->io, TRUE, NULL); + g_io_channel_unref(chan->io); + + if (chan->watch) + g_source_remove(chan->watch); + + if (chan->p) + pending_destroy(chan->p, NULL); + + if (chan->process_id > 0) + g_source_remove(chan->process_id); + + if (chan->destroy) + chan->destroy(chan); + + g_free(chan->buffer); + g_queue_foreach(chan->queue, pending_destroy, NULL); + g_queue_free(chan->queue); + g_slist_foreach(chan->processed, pending_destroy, NULL); + g_slist_free(chan->processed); + g_slist_free_full(chan->handlers, g_free); + g_free(chan); +} + +static int avctp_send(struct avctp_channel *control, uint8_t transaction, + uint8_t cr, uint8_t code, + uint8_t subunit, uint8_t opcode, + uint8_t *operands, size_t operand_count) +{ + struct avctp_header *avctp; + struct avc_header *avc; + struct msghdr msg; + struct iovec iov[2]; + int sk, err = 0; + + iov[0].iov_base = control->buffer; + iov[0].iov_len = sizeof(*avctp) + sizeof(*avc); + iov[1].iov_base = operands; + iov[1].iov_len = operand_count; + + if (control->omtu < (iov[0].iov_len + iov[1].iov_len)) + return -EOVERFLOW; + + sk = g_io_channel_unix_get_fd(control->io); + + memset(control->buffer, 0, iov[0].iov_len); + + avctp = (void *) control->buffer; + avc = (void *) avctp + sizeof(*avctp); + + avctp->transaction = transaction; + avctp->packet_type = AVCTP_PACKET_SINGLE; + avctp->cr = cr; + avctp->pid = htons(AV_REMOTE_SVCLASS_ID); + + avc->code = code; + avc->subunit_type = subunit; + avc->opcode = opcode; + + memset(&msg, 0, sizeof(msg)); + msg.msg_iov = iov; + msg.msg_iovlen = 2; + + if (sendmsg(sk, &msg, 0) < 0) + err = -errno; + + return err; +} + +static int avctp_browsing_send(struct avctp_channel *browsing, + uint8_t transaction, uint8_t cr, + uint8_t *operands, size_t operand_count) +{ + struct avctp_header *avctp; + struct msghdr msg; + struct iovec iov[2]; + int sk, err = 0; + + iov[0].iov_base = browsing->buffer; + iov[0].iov_len = sizeof(*avctp); + iov[1].iov_base = operands; + iov[1].iov_len = operand_count; + + if (browsing->omtu < (iov[0].iov_len + iov[1].iov_len)) + return -EOVERFLOW; + + sk = g_io_channel_unix_get_fd(browsing->io); + + memset(browsing->buffer, 0, iov[0].iov_len); + + avctp = (void *) browsing->buffer; + + avctp->transaction = transaction; + avctp->packet_type = AVCTP_PACKET_SINGLE; + avctp->cr = cr; + avctp->pid = htons(AV_REMOTE_SVCLASS_ID); + + memset(&msg, 0, sizeof(msg)); + msg.msg_iov = iov; + msg.msg_iovlen = 2; + + if (sendmsg(sk, &msg, 0) < 0) + err = -errno; + + return err; +} + +static void control_req_destroy(void *data) +{ + struct avctp_control_req *req = data; + struct avctp_pending_req *p = req->p; + struct avctp *session = p->chan->session; + + if (p->err == 0 || req->func == NULL) + goto done; + + req->func(session, AVC_CTYPE_REJECTED, req->subunit, NULL, 0, + req->user_data); + +done: + g_free(req->operands); + g_free(req); +} + +static void browsing_req_destroy(void *data) +{ + struct avctp_browsing_req *req = data; + struct avctp_pending_req *p = req->p; + struct avctp *session = p->chan->session; + + if (p->err == 0 || req->func == NULL) + goto done; + + req->func(session, NULL, 0, req->user_data); + +done: + g_free(req->operands); + g_free(req); +} + +static gboolean req_timeout(gpointer user_data) +{ + struct avctp_channel *chan = user_data; + struct avctp_pending_req *p = chan->p; + + DBG("transaction %u", p->transaction); + + p->timeout = 0; + p->err = -ETIMEDOUT; + + pending_destroy(p, NULL); + chan->p = NULL; + + if (chan->process_id == 0) + chan->process_id = g_idle_add(process_queue, chan); + + return FALSE; +} + +static int process_control(void *data) +{ + struct avctp_control_req *req = data; + struct avctp_pending_req *p = req->p; + + return avctp_send(p->chan, p->transaction, AVCTP_COMMAND, req->code, + req->subunit, req->op, + req->operands, req->operand_count); +} + +static int process_browsing(void *data) +{ + struct avctp_browsing_req *req = data; + struct avctp_pending_req *p = req->p; + + return avctp_browsing_send(p->chan, p->transaction, AVCTP_COMMAND, + req->operands, req->operand_count); +} + +static gboolean process_queue(void *user_data) +{ + struct avctp_channel *chan = user_data; + struct avctp_pending_req *p = chan->p; + + chan->process_id = 0; + + if (p != NULL) + return FALSE; + + while ((p = g_queue_pop_head(chan->queue))) { + + if (p->process(p->data) == 0) + break; + + pending_destroy(p, NULL); + } + + if (p == NULL) + return FALSE; + + chan->p = p; + p->timeout = g_timeout_add_seconds(2, req_timeout, chan); + + return FALSE; + +} + +static void control_response(struct avctp_channel *control, + struct avctp_header *avctp, + struct avc_header *avc, + uint8_t *operands, + size_t operand_count) +{ + struct avctp_pending_req *p = control->p; + struct avctp_control_req *req; + GSList *l; + + if (p && p->transaction == avctp->transaction) { + control->processed = g_slist_prepend(control->processed, p); + + if (p->timeout > 0) { + g_source_remove(p->timeout); + p->timeout = 0; + } + + control->p = NULL; + + if (control->process_id == 0) + control->process_id = g_idle_add(process_queue, + control); + } + + for (l = control->processed; l; l = l->next) { + p = l->data; + req = p->data; + + if (p->transaction != avctp->transaction) + continue; + + if (req->func && req->func(control->session, avc->code, + avc->subunit_type, + operands, operand_count, + req->user_data)) + return; + + control->processed = g_slist_remove(control->processed, p); + pending_destroy(p, NULL); + + return; + } +} + +static void browsing_response(struct avctp_channel *browsing, + struct avctp_header *avctp, + uint8_t *operands, + size_t operand_count) +{ + struct avctp_pending_req *p = browsing->p; + struct avctp_browsing_req *req; + GSList *l; + + if (p && p->transaction == avctp->transaction) { + browsing->processed = g_slist_prepend(browsing->processed, p); + + if (p->timeout > 0) { + g_source_remove(p->timeout); + p->timeout = 0; + } + + browsing->p = NULL; + + if (browsing->process_id == 0) + browsing->process_id = g_idle_add(process_queue, + browsing); + } + + for (l = browsing->processed; l; l = l->next) { + p = l->data; + req = p->data; + + if (p->transaction != avctp->transaction) + continue; + + if (req->func && req->func(browsing->session, operands, + operand_count, req->user_data)) + return; + + browsing->processed = g_slist_remove(browsing->processed, p); + pending_destroy(p, NULL); + + return; + } +} + +static gboolean session_browsing_cb(GIOChannel *chan, GIOCondition cond, + gpointer data) +{ + struct avctp *session = data; + struct avctp_channel *browsing = session->browsing; + uint8_t *buf = browsing->buffer; + uint8_t *operands; + struct avctp_header *avctp; + int sock, ret, packet_size, operand_count; + struct avctp_browsing_pdu_handler *handler; + + if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) + goto failed; + + sock = g_io_channel_unix_get_fd(chan); + + ret = read(sock, buf, browsing->imtu); + if (ret <= 0) + goto failed; + + avctp = (struct avctp_header *) buf; + + if (avctp->packet_type != AVCTP_PACKET_SINGLE) + goto failed; + + operands = buf + AVCTP_HEADER_LENGTH; + ret -= AVCTP_HEADER_LENGTH; + operand_count = ret; + + if (avctp->cr == AVCTP_RESPONSE) { + browsing_response(browsing, avctp, operands, operand_count); + return TRUE; + } + + packet_size = AVCTP_HEADER_LENGTH; + avctp->cr = AVCTP_RESPONSE; + + handler = g_slist_nth_data(browsing->handlers, 0); + if (handler == NULL) { + DBG("handler not found"); + /* FIXME: Add general reject */ + /* packet_size += avrcp_browsing_general_reject(operands); */ + goto send; + } + + packet_size += handler->cb(session, avctp->transaction, + operands, operand_count, + handler->user_data); + +send: + if (packet_size != 0) { + ret = write(sock, buf, packet_size); + if (ret != packet_size) + goto failed; + } + + return TRUE; + +failed: + DBG("AVCTP Browsing: disconnected"); + + if (session->browsing) { + avctp_channel_destroy(session->browsing); + session->browsing = NULL; + } + + return FALSE; +} + +static gboolean session_cb(GIOChannel *chan, GIOCondition cond, gpointer data) +{ + struct avctp *session = data; + struct avctp_channel *control = session->control; + uint8_t *buf = control->buffer; + uint8_t *operands, code, subunit; + struct avctp_header *avctp; + struct avc_header *avc; + int packet_size, operand_count, sock; + struct avctp_pdu_handler *handler; + ssize_t ret; + + if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) + goto failed; + + sock = g_io_channel_unix_get_fd(chan); + + ret = read(sock, buf, control->imtu); + if (ret <= 0) + goto failed; + + if (ret < AVCTP_HEADER_LENGTH) { + error("Too small AVCTP packet"); + goto failed; + } + + avctp = (struct avctp_header *) buf; + + ret -= AVCTP_HEADER_LENGTH; + if (ret < AVC_HEADER_LENGTH) { + error("Too small AVC packet"); + goto failed; + } + + avc = (struct avc_header *) (buf + AVCTP_HEADER_LENGTH); + + ret -= AVC_HEADER_LENGTH; + + operands = (uint8_t *) avc + AVC_HEADER_LENGTH; + operand_count = ret; + + if (avctp->cr == AVCTP_RESPONSE) { + control_response(control, avctp, avc, operands, operand_count); + return TRUE; + } + + packet_size = AVCTP_HEADER_LENGTH + AVC_HEADER_LENGTH; + avctp->cr = AVCTP_RESPONSE; + + if (avctp->packet_type != AVCTP_PACKET_SINGLE) { + avc->code = AVC_CTYPE_NOT_IMPLEMENTED; + goto done; + } + + if (avctp->pid != htons(AV_REMOTE_SVCLASS_ID)) { + avctp->ipid = 1; + packet_size = AVCTP_HEADER_LENGTH; + goto done; + } + + handler = find_handler(control->handlers, avc->opcode); + if (!handler) { + DBG("handler not found for 0x%02x", avc->opcode); + avc->code = AVC_CTYPE_REJECTED; + goto done; + } + + code = avc->code; + subunit = avc->subunit_type; + + ret = handler->cb(session, avctp->transaction, &code, + &subunit, operands, operand_count, + handler->user_data); + if (ret < 0) { + if (ret == -EAGAIN) + return TRUE; + goto failed; + } + + packet_size += ret; + avc->code = code; + avc->subunit_type = subunit; + +done: + ret = write(sock, buf, packet_size); + if (ret != packet_size) + goto failed; + + return TRUE; + +failed: + DBG("AVCTP session %p got disconnected", session); + avctp_shutdown(session); + return FALSE; +} + +static int uinput_create(const char *name) +{ + struct uinput_dev dev; + int fd, err, i; + + fd = open("/dev/uinput", O_RDWR); + if (fd < 0) { + fd = open("/dev/input/uinput", O_RDWR); + if (fd < 0) { + fd = open("/dev/misc/uinput", O_RDWR); + if (fd < 0) { + err = -errno; + error("Can't open input device: %s (%d)", + strerror(-err), -err); + return err; + } + } + } + + memset(&dev, 0, sizeof(dev)); + if (name) + strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE - 1); + + dev.id.bustype = BUS_BLUETOOTH; + dev.id.vendor = 0x0000; + dev.id.product = 0x0000; + dev.id.version = 0x0000; + + if (write(fd, &dev, sizeof(dev)) < 0) { + err = -errno; + error("Can't write device information: %s (%d)", + strerror(-err), -err); + close(fd); + return err; + } + + ioctl(fd, UI_SET_EVBIT, EV_KEY); + ioctl(fd, UI_SET_EVBIT, EV_REL); + ioctl(fd, UI_SET_EVBIT, EV_REP); + ioctl(fd, UI_SET_EVBIT, EV_SYN); + + for (i = 0; key_map[i].name != NULL; i++) + ioctl(fd, UI_SET_KEYBIT, key_map[i].uinput); + + if (ioctl(fd, UI_DEV_CREATE, NULL) < 0) { + err = -errno; + error("Can't create uinput device: %s (%d)", + strerror(-err), -err); + close(fd); + return err; + } + + return fd; +} + +int avctp_init_uinput(struct avctp *session, const char *name, + const char *address) +{ + if (g_str_equal(name, "Nokia CK-20W")) { + session->key_quirks[AVC_FORWARD] |= QUIRK_NO_RELEASE; + session->key_quirks[AVC_BACKWARD] |= QUIRK_NO_RELEASE; + session->key_quirks[AVC_PLAY] |= QUIRK_NO_RELEASE; + session->key_quirks[AVC_PAUSE] |= QUIRK_NO_RELEASE; + } + + session->uinput = uinput_create(address); + if (session->uinput < 0) { + error("AVCTP: failed to init uinput for %s", address); + return session->uinput; + } + + return 0; +} + +static struct avctp_channel *avctp_channel_create(struct avctp *session, int fd, + size_t imtu, size_t omtu, + avctp_destroy_cb_t destroy) +{ + struct avctp_channel *chan; + + chan = g_new0(struct avctp_channel, 1); + chan->session = session; + chan->io = g_io_channel_unix_new(fd); + chan->queue = g_queue_new(); + chan->imtu = imtu; + chan->omtu = omtu; + chan->buffer = g_malloc0(MAX(imtu, omtu)); + chan->destroy = destroy; + + return chan; +} + +static void handler_free(void *data) +{ + struct avctp_browsing_pdu_handler *handler = data; + + if (handler->destroy) + handler->destroy(handler->user_data); + + g_free(data); +} + +static void avctp_destroy_browsing(void *data) +{ + struct avctp_channel *chan = data; + + g_slist_free_full(chan->handlers, handler_free); + + chan->handlers = NULL; +} + +static struct avctp_pending_req *pending_create(struct avctp_channel *chan, + avctp_process_cb process, + void *data, + avctp_destroy_cb_t destroy) +{ + struct avctp_pending_req *p; + GSList *l, *tmp; + + if (!chan->processed) + goto done; + + tmp = g_slist_copy(chan->processed); + + /* Find first unused transaction id */ + for (l = tmp; l; l = g_slist_next(l)) { + struct avctp_pending_req *req = l->data; + + if (req->transaction == chan->transaction) { + chan->transaction++; + chan->transaction %= 16; + tmp = g_slist_delete_link(tmp, l); + l = tmp; + } + } + + g_slist_free(tmp); + +done: + p = g_new0(struct avctp_pending_req, 1); + p->chan = chan; + p->transaction = chan->transaction; + p->process = process; + p->data = data; + p->destroy = destroy; + + chan->transaction++; + chan->transaction %= 16; + + return p; +} + +static int avctp_send_req(struct avctp *session, uint8_t code, + uint8_t subunit, uint8_t opcode, + uint8_t *operands, size_t operand_count, + avctp_rsp_cb func, void *user_data) +{ + struct avctp_channel *control = session->control; + struct avctp_pending_req *p; + struct avctp_control_req *req; + + if (control == NULL) + return -ENOTCONN; + + req = g_new0(struct avctp_control_req, 1); + req->code = code; + req->subunit = subunit; + req->op = opcode; + req->func = func; + req->operands = g_memdup(operands, operand_count); + req->operand_count = operand_count; + req->user_data = user_data; + + p = pending_create(control, process_control, req, control_req_destroy); + + req->p = p; + + g_queue_push_tail(control->queue, p); + + if (control->process_id == 0) + control->process_id = g_idle_add(process_queue, control); + + return 0; +} + +int avctp_send_browsing_req(struct avctp *session, + uint8_t *operands, size_t operand_count, + avctp_browsing_rsp_cb func, void *user_data) +{ + struct avctp_channel *browsing = session->browsing; + struct avctp_pending_req *p; + struct avctp_browsing_req *req; + + if (browsing == NULL) + return -ENOTCONN; + + req = g_new0(struct avctp_browsing_req, 1); + req->func = func; + req->operands = g_memdup(operands, operand_count); + req->operand_count = operand_count; + req->user_data = user_data; + + p = pending_create(browsing, process_browsing, req, + browsing_req_destroy); + + req->p = p; + + g_queue_push_tail(browsing->queue, p); + + /* Connection did not complete, delay process of the request */ + if (browsing->watch == 0) + return 0; + + if (browsing->process_id == 0) + browsing->process_id = g_idle_add(process_queue, browsing); + + return 0; +} + +static const char *op2str(uint8_t op) +{ + int i; + + for (i = 0; key_map[i].name != NULL; i++) { + if ((op & 0x7F) == key_map[i].avc) + return key_map[i].name; + } + + return "UNKNOWN"; +} + +static int avctp_passthrough_press(struct avctp *session, uint8_t op, + uint8_t *params, size_t params_len) +{ + uint8_t operands[7]; + size_t len; + + DBG("op 0x%02x %s params_len %zd", op, op2str(op), params_len); + + /* Button pressed */ + operands[0] = op & 0x7f; + + if (op == AVC_VENDOR_UNIQUE && params && + params_len == 5) { + memcpy(&operands[2], params, params_len); + len = params_len + 2; + operands[1] = params_len; + } else { + len = 2; + operands[1] = 0; + } + + return avctp_send_req(session, AVC_CTYPE_CONTROL, + AVC_SUBUNIT_PANEL, AVC_OP_PASSTHROUGH, + operands, len, + avctp_passthrough_rsp, NULL); +} + +static int avctp_passthrough_release(struct avctp *session, uint8_t op, + uint8_t *params, size_t params_len) +{ + uint8_t operands[7]; + size_t len; + + DBG("%s", op2str(op)); + + /* Button released */ + operands[0] = op | 0x80; + operands[1] = 0; + + if (op == AVC_VENDOR_UNIQUE && params && + params_len > sizeof(operands) - 2) { + memcpy(&operands[2], params, params_len); + len = params_len; + } else + len = 2; + + return avctp_send_req(session, AVC_CTYPE_CONTROL, + AVC_SUBUNIT_PANEL, AVC_OP_PASSTHROUGH, + operands, len, + NULL, NULL); +} + +static gboolean repeat_timeout(gpointer user_data) +{ + struct avctp *session = user_data; + + avctp_passthrough_release(session, session->key.op, session->key.params, + session->key.params_len); + avctp_passthrough_press(session, session->key.op, session->key.params, + session->key.params_len); + + return TRUE; +} + +static void release_pressed(struct avctp *session) +{ + avctp_passthrough_release(session, session->key.op, session->key.params, + session->key.params_len); + + if (session->key.timer > 0) + g_source_remove(session->key.timer); + + session->key.timer = 0; +} + +static bool set_pressed(struct avctp *session, uint8_t op, uint8_t *params, + size_t params_len) +{ + if (session->key.timer > 0) { + if (session->key.op == op) + return TRUE; + release_pressed(session); + } + + if (op != AVC_FAST_FORWARD && op != AVC_REWIND) + return FALSE; + + session->key.op = op; + session->key.params = params; + session->key.params_len = params_len; + session->key.timer = g_timeout_add_seconds(AVC_PRESS_TIMEOUT, + repeat_timeout, + session); + + return TRUE; +} + +static gboolean avctp_passthrough_rsp(struct avctp *session, uint8_t code, + uint8_t subunit, uint8_t *operands, + size_t operand_count, void *user_data) +{ + uint8_t *params; + size_t params_len; + + DBG("code 0x%02x operand_count %zd", code, operand_count); + + if (code != AVC_CTYPE_ACCEPTED) + return FALSE; + + if (operands[0] == AVC_VENDOR_UNIQUE) { + params = &operands[2]; + params_len = operand_count - 2; + } else { + params = NULL; + params_len = 0; + } + + if (set_pressed(session, operands[0], params, params_len)) + return FALSE; + + avctp_passthrough_release(session, operands[0], params, params_len); + + return FALSE; +} + +int avctp_send_passthrough(struct avctp *session, uint8_t op, uint8_t *params, + size_t params_len) +{ + /* Auto release if key pressed */ + if (session->key.timer > 0) + release_pressed(session); + + return avctp_passthrough_press(session, op, params, params_len); +} + +int avctp_send_vendordep(struct avctp *session, uint8_t transaction, + uint8_t code, uint8_t subunit, + uint8_t *operands, size_t operand_count) +{ + struct avctp_channel *control = session->control; + + if (control == NULL) + return -ENOTCONN; + + return avctp_send(control, transaction, AVCTP_RESPONSE, code, subunit, + AVC_OP_VENDORDEP, operands, operand_count); +} + +int avctp_send_vendordep_req(struct avctp *session, uint8_t code, + uint8_t subunit, uint8_t *operands, + size_t operand_count, + avctp_rsp_cb func, void *user_data) +{ + return avctp_send_req(session, code, subunit, AVC_OP_VENDORDEP, + operands, operand_count, + func, user_data); +} + +unsigned int avctp_register_passthrough_handler(struct avctp *session, + avctp_passthrough_cb cb, + void *user_data) +{ + struct avctp_channel *control = session->control; + struct avctp_passthrough_handler *handler; + static unsigned int id = 0; + + if (control == NULL || session->handler != NULL) + return 0; + + handler = g_new(struct avctp_passthrough_handler, 1); + handler->cb = cb; + handler->user_data = user_data; + handler->id = ++id; + + session->handler = handler; + + return handler->id; +} + +bool avctp_unregister_passthrough_handler(struct avctp *session, + unsigned int id) +{ + if (session->handler == NULL) + return false; + + if (session->handler->id != id) + return false; + + g_free(session->handler); + session->handler = NULL; + return true; +} + +unsigned int avctp_register_pdu_handler(struct avctp *session, uint8_t opcode, + avctp_control_pdu_cb cb, + void *user_data) +{ + struct avctp_channel *control = session->control; + struct avctp_pdu_handler *handler; + static unsigned int id = 0; + + if (control == NULL) + return 0; + + handler = find_handler(control->handlers, opcode); + if (handler) + return 0; + + handler = g_new(struct avctp_pdu_handler, 1); + handler->opcode = opcode; + handler->cb = cb; + handler->user_data = user_data; + handler->id = ++id; + + control->handlers = g_slist_append(control->handlers, handler); + + return handler->id; +} + +unsigned int avctp_register_browsing_pdu_handler(struct avctp *session, + avctp_browsing_pdu_cb cb, + void *user_data, + avctp_destroy_cb_t destroy) +{ + struct avctp_channel *browsing = session->browsing; + struct avctp_browsing_pdu_handler *handler; + static unsigned int id = 0; + + if (browsing == NULL) + return 0; + + if (browsing->handlers != NULL) + return 0; + + handler = g_new(struct avctp_browsing_pdu_handler, 1); + handler->cb = cb; + handler->user_data = user_data; + handler->id = ++id; + handler->destroy = destroy; + + browsing->handlers = g_slist_append(browsing->handlers, handler); + + return handler->id; +} + +bool avctp_unregister_pdu_handler(struct avctp *session, unsigned int id) +{ + struct avctp_channel *control = session->control; + GSList *l; + + if (!control) + return false; + + for (l = control->handlers; l; l = g_slist_next(l)) { + struct avctp_pdu_handler *handler = l->data; + + if (handler->id != id) + continue; + + control->handlers = g_slist_remove(control->handlers, handler); + g_free(handler); + return true; + } + + return false; +} + +bool avctp_unregister_browsing_pdu_handler(struct avctp *session, + unsigned int id) +{ + struct avctp_channel *browsing = session->browsing; + GSList *l; + + if (browsing == NULL) + return false; + + for (l = browsing->handlers; l; l = g_slist_next(l)) { + struct avctp_browsing_pdu_handler *handler = l->data; + + if (handler->id != id) + continue; + + browsing->handlers = g_slist_remove(browsing->handlers, + handler); + g_free(handler); + return true; + } + + return false; +} + +struct avctp *avctp_new(int fd, size_t imtu, size_t omtu, uint16_t version) +{ + struct avctp *session; + struct avctp_channel *control; + GIOCondition cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL; + + session = g_new0(struct avctp, 1); + session->version = version; + + control = avctp_channel_create(session, fd, imtu, omtu, NULL); + if (!control) { + g_free(session); + return NULL; + } + + session->uinput = -1; + session->control = control; + session->passthrough_id = avctp_register_pdu_handler(session, + AVC_OP_PASSTHROUGH, + handle_panel_passthrough, + NULL); + session->unit_id = avctp_register_pdu_handler(session, + AVC_OP_UNITINFO, + handle_unit_info, + NULL); + session->subunit_id = avctp_register_pdu_handler(session, + AVC_OP_SUBUNITINFO, + handle_subunit_info, + NULL); + + control->watch = g_io_add_watch(session->control->io, cond, + (GIOFunc) session_cb, session); + + return session; +} + +int avctp_connect_browsing(struct avctp *session, int fd, size_t imtu, + size_t omtu) +{ + struct avctp_channel *browsing; + GIOCondition cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL; + + if (session->browsing) + return -EISCONN; + + browsing = avctp_channel_create(session, fd, imtu, omtu, + avctp_destroy_browsing); + if (!browsing) + return -EINVAL; + + session->browsing = browsing; + browsing->watch = g_io_add_watch(session->browsing->io, cond, + (GIOFunc) session_browsing_cb, session); + + return 0; +} + +void avctp_set_destroy_cb(struct avctp *session, avctp_destroy_cb_t cb, + void *user_data) +{ + session->destroy = cb; + session->data = user_data; +} + +void avctp_shutdown(struct avctp *session) +{ + if (!session) + return; + + if (session->browsing) + avctp_channel_destroy(session->browsing); + + if (session->control) + avctp_channel_destroy(session->control); + + if (session->destroy) + session->destroy(session->data); + + g_free(session->handler); + + if (session->key.timer > 0) + g_source_remove(session->key.timer); + + if (session->uinput >= 0) { + DBG("AVCTP: closing uinput"); + + ioctl(session->uinput, UI_DEV_DESTROY); + close(session->uinput); + session->uinput = -1; + } + + g_free(session); +}
diff --git a/bluez/android/avctp.h b/bluez/android/avctp.h new file mode 100644 index 0000000..98c1142 --- /dev/null +++ b/bluez/android/avctp.h
@@ -0,0 +1,178 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2006-2010 Nokia Corporation + * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#define AVCTP_CONTROL_PSM 23 +#define AVCTP_BROWSING_PSM 27 + +#define AVC_MTU 512 + +/* ctype entries */ +#define AVC_CTYPE_CONTROL 0x0 +#define AVC_CTYPE_STATUS 0x1 +#define AVC_CTYPE_NOTIFY 0x3 +#define AVC_CTYPE_NOT_IMPLEMENTED 0x8 +#define AVC_CTYPE_ACCEPTED 0x9 +#define AVC_CTYPE_REJECTED 0xA +#define AVC_CTYPE_STABLE 0xC +#define AVC_CTYPE_CHANGED 0xD +#define AVC_CTYPE_INTERIM 0xF + +/* opcodes */ +#define AVC_OP_VENDORDEP 0x00 +#define AVC_OP_UNITINFO 0x30 +#define AVC_OP_SUBUNITINFO 0x31 +#define AVC_OP_PASSTHROUGH 0x7c + +/* subunits of interest */ +#define AVC_SUBUNIT_PANEL 0x09 + +/* operands in passthrough commands */ +#define AVC_SELECT 0x00 +#define AVC_UP 0x01 +#define AVC_DOWN 0x02 +#define AVC_LEFT 0x03 +#define AVC_RIGHT 0x04 +#define AVC_ROOT_MENU 0x09 +#define AVC_CONTENTS_MENU 0x0b +#define AVC_FAVORITE_MENU 0x0c +#define AVC_EXIT 0x0d +#define AVC_ON_DEMAND_MENU 0x0e +#define AVC_APPS_MENU 0x0f +#define AVC_0 0x20 +#define AVC_1 0x21 +#define AVC_2 0x22 +#define AVC_3 0x23 +#define AVC_4 0x24 +#define AVC_5 0x25 +#define AVC_6 0x26 +#define AVC_7 0x27 +#define AVC_8 0x28 +#define AVC_9 0x29 +#define AVC_DOT 0x2a +#define AVC_ENTER 0x2b +#define AVC_CHANNEL_UP 0x30 +#define AVC_CHANNEL_DOWN 0x31 +#define AVC_CHANNEL_PREVIOUS 0x32 +#define AVC_INPUT_SELECT 0x34 +#define AVC_INFO 0x35 +#define AVC_HELP 0x36 +#define AVC_PAGE_UP 0x37 +#define AVC_PAGE_DOWN 0x38 +#define AVC_LOCK 0x3a +#define AVC_POWER 0x40 +#define AVC_VOLUME_UP 0x41 +#define AVC_VOLUME_DOWN 0x42 +#define AVC_MUTE 0x43 +#define AVC_PLAY 0x44 +#define AVC_STOP 0x45 +#define AVC_PAUSE 0x46 +#define AVC_RECORD 0x47 +#define AVC_REWIND 0x48 +#define AVC_FAST_FORWARD 0x49 +#define AVC_EJECT 0x4a +#define AVC_FORWARD 0x4b +#define AVC_BACKWARD 0x4c +#define AVC_LIST 0x4d +#define AVC_F1 0x71 +#define AVC_F2 0x72 +#define AVC_F3 0x73 +#define AVC_F4 0x74 +#define AVC_F5 0x75 +#define AVC_F6 0x76 +#define AVC_F7 0x77 +#define AVC_F8 0x78 +#define AVC_F9 0x79 +#define AVC_RED 0x7a +#define AVC_GREEN 0x7b +#define AVC_BLUE 0x7c +#define AVC_YELLOW 0x7c + +#define AVC_VENDOR_UNIQUE 0x7e + +#define AVC_VENDOR_NEXT_GROUP 0x00 +#define AVC_VENDOR_PREV_GROUP 0x01 + +struct avctp; + +typedef bool (*avctp_passthrough_cb) (struct avctp *session, + uint8_t op, bool pressed, + void *user_data); +typedef ssize_t (*avctp_control_pdu_cb) (struct avctp *session, + uint8_t transaction, uint8_t *code, + uint8_t *subunit, uint8_t *operands, + size_t operand_count, void *user_data); +typedef gboolean (*avctp_rsp_cb) (struct avctp *session, uint8_t code, + uint8_t subunit, uint8_t *operands, + size_t operand_count, void *user_data); +typedef gboolean (*avctp_browsing_rsp_cb) (struct avctp *session, + uint8_t *operands, size_t operand_count, + void *user_data); +typedef size_t (*avctp_browsing_pdu_cb) (struct avctp *session, + uint8_t transaction, + uint8_t *operands, size_t operand_count, + void *user_data); + +typedef void (*avctp_destroy_cb_t) (void *user_data); + +struct avctp *avctp_new(int fd, size_t imtu, size_t omtu, uint16_t version); +void avctp_set_destroy_cb(struct avctp *session, avctp_destroy_cb_t cb, + void *user_data); + +int avctp_init_uinput(struct avctp *session, const char *name, + const char *address); +int avctp_connect_browsing(struct avctp *session, int fd, size_t imtu, + size_t omtu); + +void avctp_shutdown(struct avctp *session); + +unsigned int avctp_register_passthrough_handler(struct avctp *session, + avctp_passthrough_cb cb, + void *user_data); +bool avctp_unregister_passthrough_handler(struct avctp *session, + unsigned int id); + +unsigned int avctp_register_pdu_handler(struct avctp *session, uint8_t opcode, + avctp_control_pdu_cb cb, + void *user_data); +bool avctp_unregister_pdu_handler(struct avctp *session, unsigned int id); + +unsigned int avctp_register_browsing_pdu_handler(struct avctp *session, + avctp_browsing_pdu_cb cb, + void *user_data, + avctp_destroy_cb_t destroy); +bool avctp_unregister_browsing_pdu_handler(struct avctp *session, + unsigned int id); + +int avctp_send_passthrough(struct avctp *session, uint8_t op, uint8_t *params, + size_t params_len); +int avctp_send_vendordep(struct avctp *session, uint8_t transaction, + uint8_t code, uint8_t subunit, + uint8_t *operands, size_t operand_count); +int avctp_send_vendordep_req(struct avctp *session, uint8_t code, + uint8_t subunit, uint8_t *operands, + size_t operand_count, + avctp_rsp_cb func, void *user_data); +int avctp_send_browsing_req(struct avctp *session, + uint8_t *operands, size_t operand_count, + avctp_browsing_rsp_cb func, void *user_data);
diff --git a/bluez/android/avdtp.c b/bluez/android/avdtp.c new file mode 100644 index 0000000..2c49dcb --- /dev/null +++ b/bluez/android/avdtp.c
@@ -0,0 +1,3421 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2006-2010 Nokia Corporation + * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdlib.h> +#include <stdio.h> +#include <stdint.h> +#include <stdbool.h> +#include <errno.h> +#include <unistd.h> +#include <assert.h> +#include <string.h> +#include <sys/socket.h> +#include <netinet/in.h> + +#include <glib.h> + +#include "src/log.h" +#include "avdtp.h" + +#define AVDTP_PSM 25 + +#define MAX_SEID 0x3E + +#ifndef MAX +# define MAX(x, y) ((x) > (y) ? (x) : (y)) +#endif + +#define AVDTP_DISCOVER 0x01 +#define AVDTP_GET_CAPABILITIES 0x02 +#define AVDTP_SET_CONFIGURATION 0x03 +#define AVDTP_GET_CONFIGURATION 0x04 +#define AVDTP_RECONFIGURE 0x05 +#define AVDTP_OPEN 0x06 +#define AVDTP_START 0x07 +#define AVDTP_CLOSE 0x08 +#define AVDTP_SUSPEND 0x09 +#define AVDTP_ABORT 0x0A +#define AVDTP_SECURITY_CONTROL 0x0B +#define AVDTP_GET_ALL_CAPABILITIES 0x0C +#define AVDTP_DELAY_REPORT 0x0D + +#define AVDTP_PKT_TYPE_SINGLE 0x00 +#define AVDTP_PKT_TYPE_START 0x01 +#define AVDTP_PKT_TYPE_CONTINUE 0x02 +#define AVDTP_PKT_TYPE_END 0x03 + +#define AVDTP_MSG_TYPE_COMMAND 0x00 +#define AVDTP_MSG_TYPE_GEN_REJECT 0x01 +#define AVDTP_MSG_TYPE_ACCEPT 0x02 +#define AVDTP_MSG_TYPE_REJECT 0x03 + +#define REQ_TIMEOUT 6 +#define ABORT_TIMEOUT 2 +#define DISCONNECT_TIMEOUT 1 +#define START_TIMEOUT 1 + +#if __BYTE_ORDER == __LITTLE_ENDIAN + +struct avdtp_common_header { + uint8_t message_type:2; + uint8_t packet_type:2; + uint8_t transaction:4; +} __attribute__ ((packed)); + +struct avdtp_single_header { + uint8_t message_type:2; + uint8_t packet_type:2; + uint8_t transaction:4; + uint8_t signal_id:6; + uint8_t rfa0:2; +} __attribute__ ((packed)); + +struct avdtp_start_header { + uint8_t message_type:2; + uint8_t packet_type:2; + uint8_t transaction:4; + uint8_t no_of_packets; + uint8_t signal_id:6; + uint8_t rfa0:2; +} __attribute__ ((packed)); + +struct avdtp_continue_header { + uint8_t message_type:2; + uint8_t packet_type:2; + uint8_t transaction:4; +} __attribute__ ((packed)); + +struct seid_info { + uint8_t rfa0:1; + uint8_t inuse:1; + uint8_t seid:6; + uint8_t rfa2:3; + uint8_t type:1; + uint8_t media_type:4; +} __attribute__ ((packed)); + +struct seid { + uint8_t rfa0:2; + uint8_t seid:6; +} __attribute__ ((packed)); + +#elif __BYTE_ORDER == __BIG_ENDIAN + +struct avdtp_common_header { + uint8_t transaction:4; + uint8_t packet_type:2; + uint8_t message_type:2; +} __attribute__ ((packed)); + +struct avdtp_single_header { + uint8_t transaction:4; + uint8_t packet_type:2; + uint8_t message_type:2; + uint8_t rfa0:2; + uint8_t signal_id:6; +} __attribute__ ((packed)); + +struct avdtp_start_header { + uint8_t transaction:4; + uint8_t packet_type:2; + uint8_t message_type:2; + uint8_t no_of_packets; + uint8_t rfa0:2; + uint8_t signal_id:6; +} __attribute__ ((packed)); + +struct avdtp_continue_header { + uint8_t transaction:4; + uint8_t packet_type:2; + uint8_t message_type:2; +} __attribute__ ((packed)); + +struct seid_info { + uint8_t seid:6; + uint8_t inuse:1; + uint8_t rfa0:1; + uint8_t media_type:4; + uint8_t type:1; + uint8_t rfa2:3; +} __attribute__ ((packed)); + +struct seid { + uint8_t seid:6; + uint8_t rfa0:2; +} __attribute__ ((packed)); + +#else +#error "Unknown byte order" +#endif + +/* packets */ + +struct discover_resp { + struct seid_info seps[0]; +} __attribute__ ((packed)); + +struct getcap_resp { + uint8_t caps[0]; +} __attribute__ ((packed)); + +struct start_req { + struct seid first_seid; + struct seid other_seids[0]; +} __attribute__ ((packed)); + +struct suspend_req { + struct seid first_seid; + struct seid other_seids[0]; +} __attribute__ ((packed)); + +struct seid_rej { + uint8_t error; +} __attribute__ ((packed)); + +struct conf_rej { + uint8_t category; + uint8_t error; +} __attribute__ ((packed)); + +#if __BYTE_ORDER == __LITTLE_ENDIAN + +struct seid_req { + uint8_t rfa0:2; + uint8_t acp_seid:6; +} __attribute__ ((packed)); + +struct setconf_req { + uint8_t rfa0:2; + uint8_t acp_seid:6; + uint8_t rfa1:2; + uint8_t int_seid:6; + + uint8_t caps[0]; +} __attribute__ ((packed)); + +struct stream_rej { + uint8_t rfa0:2; + uint8_t acp_seid:6; + uint8_t error; +} __attribute__ ((packed)); + +struct reconf_req { + uint8_t rfa0:2; + uint8_t acp_seid:6; + + uint8_t serv_cap; + uint8_t serv_cap_len; + + uint8_t caps[0]; +} __attribute__ ((packed)); + +struct delay_req { + uint8_t rfa0:2; + uint8_t acp_seid:6; + uint16_t delay; +} __attribute__ ((packed)); + +#elif __BYTE_ORDER == __BIG_ENDIAN + +struct seid_req { + uint8_t acp_seid:6; + uint8_t rfa0:2; +} __attribute__ ((packed)); + +struct setconf_req { + uint8_t acp_seid:6; + uint8_t rfa0:2; + uint8_t int_seid:6; + uint8_t rfa1:2; + + uint8_t caps[0]; +} __attribute__ ((packed)); + +struct stream_rej { + uint8_t acp_seid:6; + uint8_t rfa0:2; + uint8_t error; +} __attribute__ ((packed)); + +struct reconf_req { + uint8_t acp_seid:6; + uint8_t rfa0:2; + + uint8_t serv_cap; + uint8_t serv_cap_len; + + uint8_t caps[0]; +} __attribute__ ((packed)); + +struct delay_req { + uint8_t acp_seid:6; + uint8_t rfa0:2; + uint16_t delay; +} __attribute__ ((packed)); + +#else +#error "Unknown byte order" +#endif + +struct in_buf { + gboolean active; + int no_of_packets; + uint8_t transaction; + uint8_t message_type; + uint8_t signal_id; + uint8_t buf[1024]; + uint8_t data_size; +}; + +struct pending_req { + uint8_t transaction; + uint8_t signal_id; + void *data; + size_t data_size; + struct avdtp_stream *stream; /* Set if the request targeted a stream */ + guint timeout; + gboolean collided; +}; + +struct avdtp_remote_sep { + uint8_t seid; + uint8_t type; + uint8_t media_type; + struct avdtp_service_capability *codec; + gboolean delay_reporting; + GSList *caps; /* of type struct avdtp_service_capability */ + struct avdtp_stream *stream; +}; + +struct avdtp_local_sep { + avdtp_state_t state; + struct avdtp_stream *stream; + struct seid_info info; + uint8_t codec; + gboolean delay_reporting; + GSList *caps; + struct avdtp_sep_ind *ind; + struct avdtp_sep_cfm *cfm; + void *user_data; +}; + +struct stream_callback { + avdtp_stream_state_cb cb; + void *user_data; + unsigned int id; +}; + +struct discover_callback { + unsigned int id; + avdtp_discover_cb_t cb; + void *user_data; +}; + +struct disconnect_callback { + unsigned int id; + avdtp_disconnect_cb_t cb; + void *user_data; +}; + +struct avdtp_stream { + GIOChannel *io; + uint16_t imtu; + uint16_t omtu; + struct avdtp *session; + struct avdtp_local_sep *lsep; + uint8_t rseid; + GSList *caps; + GSList *callbacks; + struct avdtp_service_capability *codec; + guint io_id; /* Transport GSource ID */ + guint timer; /* Waiting for other side to close or open + * the transport channel */ + gboolean open_acp; /* If we are in ACT role for Open */ + gboolean close_int; /* If we are in INT role for Close */ + gboolean abort_int; /* If we are in INT role for Abort */ + guint start_timer; /* Wait START command timer */ + gboolean delay_reporting; + uint16_t delay; /* AVDTP 1.3 Delay Reporting feature */ + gboolean starting; /* only valid while sep state == OPEN */ +}; + +/* Structure describing an AVDTP connection between two devices */ + +struct avdtp { + unsigned int ref; + + uint16_t version; + + struct avdtp_server *server; + + guint auth_id; + + GIOChannel *io; + guint io_id; + + GSList *seps; /* Elements of type struct avdtp_remote_sep * */ + + GSList *streams; /* Elements of type struct avdtp_stream * */ + + GSList *req_queue; /* Elements of type struct pending_req * */ + GSList *prio_queue; /* Same as req_queue but is processed before it */ + + struct avdtp_stream *pending_open; + + uint16_t imtu; + uint16_t omtu; + + struct in_buf in; + + char *buf; + + struct discover_callback *discover; + struct pending_req *req; + + GSList *disconnect; + + bool shutdown; +}; + +static GSList *lseps = NULL; + +static int send_request(struct avdtp *session, gboolean priority, + struct avdtp_stream *stream, uint8_t signal_id, + void *buffer, size_t size); +static gboolean avdtp_parse_resp(struct avdtp *session, + struct avdtp_stream *stream, + uint8_t transaction, uint8_t signal_id, + void *buf, int size); +static gboolean avdtp_parse_rej(struct avdtp *session, + struct avdtp_stream *stream, + uint8_t transaction, uint8_t signal_id, + void *buf, int size); +static int process_queue(struct avdtp *session); +static void avdtp_sep_set_state(struct avdtp *session, + struct avdtp_local_sep *sep, + avdtp_state_t state); + +static const char *avdtp_statestr(avdtp_state_t state) +{ + switch (state) { + case AVDTP_STATE_IDLE: + return "IDLE"; + case AVDTP_STATE_CONFIGURED: + return "CONFIGURED"; + case AVDTP_STATE_OPEN: + return "OPEN"; + case AVDTP_STATE_STREAMING: + return "STREAMING"; + case AVDTP_STATE_CLOSING: + return "CLOSING"; + case AVDTP_STATE_ABORTING: + return "ABORTING"; + default: + return "<unknown state>"; + } +} + +static gboolean try_send(int sk, void *data, size_t len) +{ + int err; + + do { + err = send(sk, data, len, 0); + } while (err < 0 && errno == EINTR); + + if (err < 0) { + error("send: %s (%d)", strerror(errno), errno); + return FALSE; + } else if ((size_t) err != len) { + error("try_send: complete buffer not sent (%d/%zu bytes)", + err, len); + return FALSE; + } + + return TRUE; +} + +static gboolean avdtp_send(struct avdtp *session, uint8_t transaction, + uint8_t message_type, uint8_t signal_id, + void *data, size_t len) +{ + unsigned int cont_fragments, sent; + struct avdtp_start_header start; + struct avdtp_continue_header cont; + int sock; + + if (session->io == NULL) { + error("avdtp_send: session is closed"); + return FALSE; + } + + sock = g_io_channel_unix_get_fd(session->io); + + /* Single packet - no fragmentation */ + if (sizeof(struct avdtp_single_header) + len <= session->omtu) { + struct avdtp_single_header single; + + memset(&single, 0, sizeof(single)); + + single.transaction = transaction; + single.packet_type = AVDTP_PKT_TYPE_SINGLE; + single.message_type = message_type; + single.signal_id = signal_id; + + memcpy(session->buf, &single, sizeof(single)); + memcpy(session->buf + sizeof(single), data, len); + + return try_send(sock, session->buf, sizeof(single) + len); + } + + /* Check if there is enough space to start packet */ + if (session->omtu < sizeof(start)) { + error("No enough space to fragment packet"); + return FALSE; + } + + /* Count the number of needed fragments */ + cont_fragments = (len - (session->omtu - sizeof(start))) / + (session->omtu - sizeof(cont)) + 1; + + DBG("%zu bytes split into %d fragments", len, cont_fragments + 1); + + /* Send the start packet */ + memset(&start, 0, sizeof(start)); + start.transaction = transaction; + start.packet_type = AVDTP_PKT_TYPE_START; + start.message_type = message_type; + start.no_of_packets = cont_fragments + 1; + start.signal_id = signal_id; + + memcpy(session->buf, &start, sizeof(start)); + memcpy(session->buf + sizeof(start), data, + session->omtu - sizeof(start)); + + if (!try_send(sock, session->buf, session->omtu)) + return FALSE; + + DBG("first packet with %zu bytes sent", session->omtu - sizeof(start)); + + sent = session->omtu - sizeof(start); + + /* Send the continue fragments and the end packet */ + while (sent < len) { + int left, to_copy; + + left = len - sent; + if (left + sizeof(cont) > session->omtu) { + cont.packet_type = AVDTP_PKT_TYPE_CONTINUE; + to_copy = session->omtu - sizeof(cont); + DBG("sending continue with %d bytes", to_copy); + } else { + cont.packet_type = AVDTP_PKT_TYPE_END; + to_copy = left; + DBG("sending end with %d bytes", to_copy); + } + + cont.transaction = transaction; + cont.message_type = message_type; + + memcpy(session->buf, &cont, sizeof(cont)); + memcpy(session->buf + sizeof(cont), data + sent, to_copy); + + if (!try_send(sock, session->buf, to_copy + sizeof(cont))) + return FALSE; + + sent += to_copy; + } + + return TRUE; +} + +static void pending_req_free(void *data) +{ + struct pending_req *req = data; + + if (req->timeout) + g_source_remove(req->timeout); + g_free(req->data); + g_free(req); +} + +static void close_stream(struct avdtp_stream *stream) +{ + int sock; + + if (stream->io == NULL) + return; + + sock = g_io_channel_unix_get_fd(stream->io); + + shutdown(sock, SHUT_RDWR); + + g_io_channel_shutdown(stream->io, FALSE, NULL); + + g_io_channel_unref(stream->io); + stream->io = NULL; +} + +static gboolean stream_close_timeout(gpointer user_data) +{ + struct avdtp_stream *stream = user_data; + + DBG("Timed out waiting for peer to close the transport channel"); + + stream->timer = 0; + + close_stream(stream); + + return FALSE; +} + +static gboolean stream_open_timeout(gpointer user_data) +{ + struct avdtp_stream *stream = user_data; + + DBG("Timed out waiting for peer to open the transport channel"); + + stream->timer = 0; + + stream->session->pending_open = NULL; + + avdtp_abort(stream->session, stream); + + return FALSE; +} + +void avdtp_error_init(struct avdtp_error *err, uint8_t category, int id) +{ + err->category = category; + + if (category == AVDTP_ERRNO) + err->err.posix_errno = id; + else + err->err.error_code = id; +} + +uint8_t avdtp_error_category(struct avdtp_error *err) +{ + return err->category; +} + +int avdtp_error_error_code(struct avdtp_error *err) +{ + assert(err->category != AVDTP_ERRNO); + return err->err.error_code; +} + +int avdtp_error_posix_errno(struct avdtp_error *err) +{ + assert(err->category == AVDTP_ERRNO); + return err->err.posix_errno; +} + +static struct avdtp_stream *find_stream_by_rseid(struct avdtp *session, + uint8_t rseid) +{ + GSList *l; + + for (l = session->streams; l != NULL; l = g_slist_next(l)) { + struct avdtp_stream *stream = l->data; + + if (stream->rseid == rseid) + return stream; + } + + return NULL; +} + +static struct avdtp_remote_sep *find_remote_sep(GSList *seps, uint8_t seid) +{ + GSList *l; + + for (l = seps; l != NULL; l = g_slist_next(l)) { + struct avdtp_remote_sep *sep = l->data; + + if (sep->seid == seid) + return sep; + } + + return NULL; +} + +static void stream_free(void *data) +{ + struct avdtp_stream *stream = data; + struct avdtp_remote_sep *rsep; + + stream->lsep->info.inuse = 0; + stream->lsep->stream = NULL; + + rsep = find_remote_sep(stream->session->seps, stream->rseid); + if (rsep) + rsep->stream = NULL; + + if (stream->timer) + g_source_remove(stream->timer); + + if (stream->start_timer > 0) + g_source_remove(stream->start_timer); + + if (stream->io) + close_stream(stream); + + if (stream->io_id) + g_source_remove(stream->io_id); + + g_slist_free_full(stream->callbacks, g_free); + g_slist_free_full(stream->caps, g_free); + + g_free(stream); +} + +static gboolean transport_cb(GIOChannel *chan, GIOCondition cond, + gpointer data) +{ + struct avdtp_stream *stream = data; + struct avdtp_local_sep *sep = stream->lsep; + + if (stream->close_int && sep->cfm && sep->cfm->close) + sep->cfm->close(stream->session, sep, stream, NULL, + sep->user_data); + + if (!(cond & G_IO_NVAL)) + close_stream(stream); + + stream->io_id = 0; + + if (!stream->abort_int) + avdtp_sep_set_state(stream->session, sep, AVDTP_STATE_IDLE); + + return FALSE; +} + +static void handle_transport_connect(struct avdtp *session, GIOChannel *io, + uint16_t imtu, uint16_t omtu) +{ + struct avdtp_stream *stream = session->pending_open; + struct avdtp_local_sep *sep = stream->lsep; + + session->pending_open = NULL; + + if (stream->timer) { + g_source_remove(stream->timer); + stream->timer = 0; + } + + if (io == NULL) + return; + + if (stream->io == NULL) + stream->io = g_io_channel_ref(io); + + stream->omtu = omtu; + stream->imtu = imtu; + + avdtp_sep_set_state(session, sep, AVDTP_STATE_OPEN); + + stream->io_id = g_io_add_watch(io, G_IO_ERR | G_IO_HUP | G_IO_NVAL, + (GIOFunc) transport_cb, stream); +} + +static int pending_req_cmp(gconstpointer a, gconstpointer b) +{ + const struct pending_req *req = a; + const struct avdtp_stream *stream = b; + + if (req->stream == stream) + return 0; + + return -1; +} + +static void cleanup_queue(struct avdtp *session, struct avdtp_stream *stream) +{ + GSList *l; + struct pending_req *req; + + while ((l = g_slist_find_custom(session->prio_queue, stream, + pending_req_cmp))) { + req = l->data; + pending_req_free(req); + session->prio_queue = g_slist_remove(session->prio_queue, req); + } + + while ((l = g_slist_find_custom(session->req_queue, stream, + pending_req_cmp))) { + req = l->data; + pending_req_free(req); + session->req_queue = g_slist_remove(session->req_queue, req); + } +} + +static void handle_unanswered_req(struct avdtp *session, + struct avdtp_stream *stream) +{ + struct pending_req *req; + struct avdtp_local_sep *lsep; + struct avdtp_error err; + + if (session->req->signal_id == AVDTP_ABORT) { + /* Avoid freeing the Abort request here */ + DBG("handle_unanswered_req: Abort req, returning"); + session->req->stream = NULL; + return; + } + + req = session->req; + session->req = NULL; + + avdtp_error_init(&err, AVDTP_ERRNO, EIO); + + lsep = stream->lsep; + + switch (req->signal_id) { + case AVDTP_RECONFIGURE: + error("No reply to Reconfigure request"); + if (lsep && lsep->cfm && lsep->cfm->reconfigure) + lsep->cfm->reconfigure(session, lsep, stream, &err, + lsep->user_data); + break; + case AVDTP_OPEN: + error("No reply to Open request"); + if (lsep && lsep->cfm && lsep->cfm->open) + lsep->cfm->open(session, lsep, stream, &err, + lsep->user_data); + break; + case AVDTP_START: + error("No reply to Start request"); + if (lsep && lsep->cfm && lsep->cfm->start) + lsep->cfm->start(session, lsep, stream, &err, + lsep->user_data); + break; + case AVDTP_SUSPEND: + error("No reply to Suspend request"); + if (lsep && lsep->cfm && lsep->cfm->suspend) + lsep->cfm->suspend(session, lsep, stream, &err, + lsep->user_data); + break; + case AVDTP_CLOSE: + error("No reply to Close request"); + if (lsep && lsep->cfm && lsep->cfm->close) + lsep->cfm->close(session, lsep, stream, &err, + lsep->user_data); + break; + case AVDTP_SET_CONFIGURATION: + error("No reply to SetConfiguration request"); + if (lsep && lsep->cfm && lsep->cfm->set_configuration) + lsep->cfm->set_configuration(session, lsep, stream, + &err, lsep->user_data); + } + + pending_req_free(req); +} + +static void avdtp_sep_set_state(struct avdtp *session, + struct avdtp_local_sep *sep, + avdtp_state_t state) +{ + struct avdtp_stream *stream = sep->stream; + avdtp_state_t old_state; + struct avdtp_error err, *err_ptr = NULL; + GSList *l; + + if (!stream) { + error("Error changing sep state: stream not available"); + return; + } + + if (sep->state == state) { + avdtp_error_init(&err, AVDTP_ERRNO, EIO); + DBG("stream state change failed: %s", avdtp_strerror(&err)); + err_ptr = &err; + } else { + err_ptr = NULL; + DBG("stream state changed: %s -> %s", + avdtp_statestr(sep->state), + avdtp_statestr(state)); + } + + old_state = sep->state; + sep->state = state; + + switch (state) { + case AVDTP_STATE_CONFIGURED: + if (sep->info.type == AVDTP_SEP_TYPE_SINK) + avdtp_delay_report(session, stream, stream->delay); + break; + case AVDTP_STATE_OPEN: + stream->starting = FALSE; + break; + case AVDTP_STATE_STREAMING: + if (stream->start_timer) { + g_source_remove(stream->start_timer); + stream->start_timer = 0; + } + stream->open_acp = FALSE; + break; + case AVDTP_STATE_CLOSING: + case AVDTP_STATE_ABORTING: + if (stream->start_timer) { + g_source_remove(stream->start_timer); + stream->start_timer = 0; + } + break; + case AVDTP_STATE_IDLE: + if (stream->start_timer) { + g_source_remove(stream->start_timer); + stream->start_timer = 0; + } + if (session->pending_open == stream) + handle_transport_connect(session, NULL, 0, 0); + if (session->req && session->req->stream == stream) + handle_unanswered_req(session, stream); + /* Remove pending commands for this stream from the queue */ + cleanup_queue(session, stream); + break; + default: + break; + } + + l = stream->callbacks; + while (l != NULL) { + struct stream_callback *cb = l->data; + l = g_slist_next(l); + cb->cb(stream, old_state, state, err_ptr, cb->user_data); + } + + if (state == AVDTP_STATE_IDLE && + g_slist_find(session->streams, stream)) { + session->streams = g_slist_remove(session->streams, stream); + stream_free(stream); + } + + if (session->io && session->shutdown && session->streams == NULL) { + int sock = g_io_channel_unix_get_fd(session->io); + shutdown(sock, SHUT_RDWR); + } +} + +static void finalize_discovery(struct avdtp *session, int err) +{ + struct discover_callback *discover = session->discover; + struct avdtp_error avdtp_err; + + if (!discover) + return; + + session->discover = NULL; + + avdtp_error_init(&avdtp_err, AVDTP_ERRNO, err); + + if (discover->id > 0) + g_source_remove(discover->id); + + if (discover->cb) + discover->cb(session, session->seps, err ? &avdtp_err : NULL, + discover->user_data); + g_free(discover); +} + +static void release_stream(struct avdtp_stream *stream, struct avdtp *session) +{ + struct avdtp_local_sep *sep = stream->lsep; + + if (sep->cfm && sep->cfm->abort && + (sep->state != AVDTP_STATE_ABORTING || + stream->abort_int)) + sep->cfm->abort(session, sep, stream, NULL, sep->user_data); + + avdtp_sep_set_state(session, sep, AVDTP_STATE_IDLE); +} + +static void sep_free(gpointer data) +{ + struct avdtp_remote_sep *sep = data; + + g_slist_free_full(sep->caps, g_free); + g_free(sep); +} + +static void avdtp_free(void *data) +{ + struct avdtp *session = data; + + DBG("%p", session); + + g_slist_free_full(session->streams, stream_free); + + if (session->io) { + g_io_channel_shutdown(session->io, FALSE, NULL); + g_io_channel_unref(session->io); + } + + if (session->io_id) { + g_source_remove(session->io_id); + session->io_id = 0; + } + + if (session->req) + pending_req_free(session->req); + + g_slist_free_full(session->req_queue, pending_req_free); + g_slist_free_full(session->prio_queue, pending_req_free); + g_slist_free_full(session->seps, sep_free); + g_slist_free_full(session->disconnect, g_free); + + g_free(session->buf); + + g_free(session); +} + +static void process_disconnect(void *data) +{ + struct disconnect_callback *callback = data; + + callback->cb(callback->user_data); + + g_free(callback); +} + +static void connection_lost(struct avdtp *session, int err) +{ + DBG("Disconnected: %s (%d)", strerror(err), err); + + g_slist_foreach(session->streams, (GFunc) release_stream, session); + session->streams = NULL; + + avdtp_ref(session); + + finalize_discovery(session, err); + + g_slist_free_full(session->disconnect, process_disconnect); + session->disconnect = NULL; + + avdtp_unref(session); +} + +void avdtp_unref(struct avdtp *session) +{ + if (!session) + return; + + session->ref--; + + DBG("%p: ref=%d", session, session->ref); + + if (session->ref > 0) + return; + + finalize_discovery(session, ECONNABORTED); + + avdtp_free(session); +} + +struct avdtp *avdtp_ref(struct avdtp *session) +{ + session->ref++; + + DBG("%p: ref=%d", session, session->ref); + + return session; +} + +static struct avdtp_local_sep *find_local_sep_by_seid(uint8_t seid) +{ + GSList *l; + + for (l = lseps; l != NULL; l = g_slist_next(l)) { + struct avdtp_local_sep *sep = l->data; + + if (sep->info.seid == seid) + return sep; + } + + return NULL; +} + +struct avdtp_remote_sep *avdtp_find_remote_sep(struct avdtp *session, + struct avdtp_local_sep *lsep) +{ + GSList *l; + + if (lsep->info.inuse) + return NULL; + + for (l = session->seps; l != NULL; l = g_slist_next(l)) { + struct avdtp_remote_sep *sep = l->data; + struct avdtp_service_capability *cap; + struct avdtp_media_codec_capability *codec_data; + + /* Type must be different: source <-> sink */ + if (sep->type == lsep->info.type) + continue; + + if (sep->media_type != lsep->info.media_type) + continue; + + if (!sep->codec) + continue; + + cap = sep->codec; + codec_data = (void *) cap->data; + + if (codec_data->media_codec_type != lsep->codec) + continue; + + if (sep->stream == NULL) + return sep; + } + + return NULL; +} + +static GSList *caps_to_list(uint8_t *data, int size, + struct avdtp_service_capability **codec, + gboolean *delay_reporting) +{ + GSList *caps; + int processed; + + if (delay_reporting) + *delay_reporting = FALSE; + + for (processed = 0, caps = NULL; processed + 2 <= size;) { + struct avdtp_service_capability *cap; + uint8_t length, category; + + category = data[0]; + length = data[1]; + + if (processed + 2 + length > size) { + error("Invalid capability data in getcap resp"); + break; + } + + cap = g_malloc(sizeof(struct avdtp_service_capability) + + length); + memcpy(cap, data, 2 + length); + + processed += 2 + length; + data += 2 + length; + + caps = g_slist_append(caps, cap); + + if (category == AVDTP_MEDIA_CODEC && + length >= + sizeof(struct avdtp_media_codec_capability)) + *codec = cap; + else if (category == AVDTP_DELAY_REPORTING && delay_reporting) + *delay_reporting = TRUE; + } + + return caps; +} + +static gboolean avdtp_unknown_cmd(struct avdtp *session, uint8_t transaction, + uint8_t signal_id) +{ + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_GEN_REJECT, + signal_id, NULL, 0); +} + +static gboolean avdtp_discover_cmd(struct avdtp *session, uint8_t transaction, + void *buf, int size) +{ + GSList *l; + unsigned int rsp_size, sep_count, i; + struct seid_info *seps; + gboolean ret; + + sep_count = g_slist_length(lseps); + + if (sep_count == 0) { + uint8_t err = AVDTP_NOT_SUPPORTED_COMMAND; + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_DISCOVER, &err, sizeof(err)); + } + + rsp_size = sep_count * sizeof(struct seid_info); + + seps = g_new0(struct seid_info, sep_count); + + for (l = lseps, i = 0; l != NULL; l = l->next, i++) { + struct avdtp_local_sep *sep = l->data; + + memcpy(&seps[i], &sep->info, sizeof(struct seid_info)); + } + + ret = avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_DISCOVER, seps, rsp_size); + g_free(seps); + + return ret; +} + +static gboolean avdtp_getcap_cmd(struct avdtp *session, uint8_t transaction, + struct seid_req *req, unsigned int size, + gboolean get_all) +{ + GSList *l, *caps; + struct avdtp_local_sep *sep = NULL; + unsigned int rsp_size; + uint8_t err, buf[1024], *ptr = buf; + uint8_t cmd; + + cmd = get_all ? AVDTP_GET_ALL_CAPABILITIES : AVDTP_GET_CAPABILITIES; + + if (size < sizeof(struct seid_req)) { + err = AVDTP_BAD_LENGTH; + goto failed; + } + + sep = find_local_sep_by_seid(req->acp_seid); + if (!sep) { + err = AVDTP_BAD_ACP_SEID; + goto failed; + } + + if (!sep->ind->get_capability(session, sep, &caps, &err, + sep->user_data)) + goto failed; + + for (l = caps, rsp_size = 0; l != NULL; l = g_slist_next(l)) { + struct avdtp_service_capability *cap = l->data; + + if (rsp_size + cap->length + 2 > sizeof(buf)) + break; + + memcpy(ptr, cap, cap->length + 2); + rsp_size += cap->length + 2; + ptr += cap->length + 2; + + g_free(cap); + } + + if (get_all && sep->delay_reporting) { + ptr[0] = AVDTP_DELAY_REPORTING; + ptr[1] = 0x00; + rsp_size += 2; + } + + g_slist_free(caps); + + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, cmd, + buf, rsp_size); + +failed: + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, cmd, + &err, sizeof(err)); +} + +static void setconf_cb(struct avdtp *session, struct avdtp_stream *stream, + struct avdtp_error *err) +{ + struct conf_rej rej; + struct avdtp_local_sep *sep; + + if (err != NULL) { + rej.error = AVDTP_UNSUPPORTED_CONFIGURATION; + rej.category = err->err.error_code; + avdtp_send(session, session->in.transaction, + AVDTP_MSG_TYPE_REJECT, AVDTP_SET_CONFIGURATION, + &rej, sizeof(rej)); + return; + } + + if (!avdtp_send(session, session->in.transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_SET_CONFIGURATION, NULL, 0)) { + stream_free(stream); + return; + } + + sep = stream->lsep; + sep->stream = stream; + sep->info.inuse = 1; + session->streams = g_slist_append(session->streams, stream); + + avdtp_sep_set_state(session, sep, AVDTP_STATE_CONFIGURED); +} + +static gboolean avdtp_setconf_cmd(struct avdtp *session, uint8_t transaction, + struct setconf_req *req, unsigned int size) +{ + struct conf_rej rej; + struct avdtp_local_sep *sep; + struct avdtp_stream *stream; + uint8_t err, category = 0x00; + GSList *l; + + if (size < sizeof(struct setconf_req)) { + error("Too short getcap request"); + return FALSE; + } + + sep = find_local_sep_by_seid(req->acp_seid); + if (!sep) { + err = AVDTP_BAD_ACP_SEID; + goto failed; + } + + if (sep->stream) { + err = AVDTP_SEP_IN_USE; + goto failed; + } + + stream = g_new0(struct avdtp_stream, 1); + stream->session = session; + stream->lsep = sep; + stream->rseid = req->int_seid; + stream->caps = caps_to_list(req->caps, + size - sizeof(struct setconf_req), + &stream->codec, + &stream->delay_reporting); + + /* Verify that the Media Transport capability's length = 0. + * Reject otherwise */ + for (l = stream->caps; l != NULL; l = g_slist_next(l)) { + struct avdtp_service_capability *cap = l->data; + + if (cap->category == AVDTP_MEDIA_TRANSPORT && + cap->length != 0) { + err = AVDTP_BAD_MEDIA_TRANSPORT_FORMAT; + goto failed_stream; + } + } + + if (stream->delay_reporting && session->version < 0x0103) + session->version = 0x0103; + + if (sep->ind && sep->ind->set_configuration) { + if (!sep->ind->set_configuration(session, sep, stream, + stream->caps, + setconf_cb, + sep->user_data)) { + err = AVDTP_UNSUPPORTED_CONFIGURATION; + category = 0x00; + goto failed_stream; + } + } else { + if (!avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_SET_CONFIGURATION, NULL, 0)) { + stream_free(stream); + return FALSE; + } + + sep->stream = stream; + sep->info.inuse = 1; + session->streams = g_slist_append(session->streams, stream); + + avdtp_sep_set_state(session, sep, AVDTP_STATE_CONFIGURED); + } + + return TRUE; + +failed_stream: + stream_free(stream); +failed: + rej.error = err; + rej.category = category; + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_SET_CONFIGURATION, &rej, sizeof(rej)); +} + +static gboolean avdtp_getconf_cmd(struct avdtp *session, uint8_t transaction, + struct seid_req *req, int size) +{ + GSList *l; + struct avdtp_local_sep *sep = NULL; + int rsp_size; + uint8_t err; + uint8_t buf[1024]; + uint8_t *ptr = buf; + + if (size < (int) sizeof(struct seid_req)) { + error("Too short getconf request"); + return FALSE; + } + + memset(buf, 0, sizeof(buf)); + + sep = find_local_sep_by_seid(req->acp_seid); + if (!sep) { + err = AVDTP_BAD_ACP_SEID; + goto failed; + } + if (!sep->stream || !sep->stream->caps) { + err = AVDTP_UNSUPPORTED_CONFIGURATION; + goto failed; + } + + for (l = sep->stream->caps, rsp_size = 0; l; l = g_slist_next(l)) { + struct avdtp_service_capability *cap = l->data; + + if (rsp_size + cap->length + 2 > (int) sizeof(buf)) + break; + + memcpy(ptr, cap, cap->length + 2); + rsp_size += cap->length + 2; + ptr += cap->length + 2; + } + + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_GET_CONFIGURATION, buf, rsp_size); + +failed: + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_GET_CONFIGURATION, &err, sizeof(err)); +} + +static gboolean avdtp_reconf_cmd(struct avdtp *session, uint8_t transaction, + struct seid_req *req, int size) +{ + struct conf_rej rej; + + rej.error = AVDTP_NOT_SUPPORTED_COMMAND; + rej.category = 0x00; + + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_RECONFIGURE, &rej, sizeof(rej)); +} + +static void check_seid_collision(struct pending_req *req, uint8_t id) +{ + struct seid_req *seid = req->data; + + if (seid->acp_seid == id) + req->collided = TRUE; +} + +static void check_start_collision(struct pending_req *req, uint8_t id) +{ + struct start_req *start = req->data; + struct seid *seid = &start->first_seid; + int count = 1 + req->data_size - sizeof(struct start_req); + int i; + + for (i = 0; i < count; i++, seid++) { + if (seid->seid == id) { + req->collided = TRUE; + return; + } + } +} + +static void check_suspend_collision(struct pending_req *req, uint8_t id) +{ + struct suspend_req *suspend = req->data; + struct seid *seid = &suspend->first_seid; + int count = 1 + req->data_size - sizeof(struct suspend_req); + int i; + + for (i = 0; i < count; i++, seid++) { + if (seid->seid == id) { + req->collided = TRUE; + return; + } + } +} + +static void avdtp_check_collision(struct avdtp *session, uint8_t cmd, + struct avdtp_stream *stream) +{ + struct pending_req *req = session->req; + + if (req == NULL || (req->signal_id != cmd && cmd != AVDTP_ABORT)) + return; + + if (cmd == AVDTP_ABORT) + cmd = req->signal_id; + + switch (cmd) { + case AVDTP_OPEN: + case AVDTP_CLOSE: + check_seid_collision(req, stream->rseid); + break; + case AVDTP_START: + check_start_collision(req, stream->rseid); + break; + case AVDTP_SUSPEND: + check_suspend_collision(req, stream->rseid); + break; + } +} + +static gboolean avdtp_open_cmd(struct avdtp *session, uint8_t transaction, + struct seid_req *req, unsigned int size) +{ + struct avdtp_local_sep *sep; + struct avdtp_stream *stream; + uint8_t err; + + if (size < sizeof(struct seid_req)) { + error("Too short abort request"); + return FALSE; + } + + sep = find_local_sep_by_seid(req->acp_seid); + if (!sep) { + err = AVDTP_BAD_ACP_SEID; + goto failed; + } + + if (sep->state != AVDTP_STATE_CONFIGURED) { + err = AVDTP_BAD_STATE; + goto failed; + } + + stream = sep->stream; + + if (sep->ind && sep->ind->open) { + if (!sep->ind->open(session, sep, stream, &err, + sep->user_data)) + goto failed; + } + + avdtp_check_collision(session, AVDTP_OPEN, stream); + + if (!avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_OPEN, NULL, 0)) + return FALSE; + + stream->open_acp = TRUE; + session->pending_open = stream; + stream->timer = g_timeout_add_seconds(REQ_TIMEOUT, + stream_open_timeout, + stream); + + return TRUE; + +failed: + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_OPEN, &err, sizeof(err)); +} + +static gboolean avdtp_start_cmd(struct avdtp *session, uint8_t transaction, + struct start_req *req, unsigned int size) +{ + struct avdtp_local_sep *sep; + struct avdtp_stream *stream; + struct stream_rej rej; + struct seid *seid; + uint8_t err, failed_seid; + int seid_count, i; + + if (size < sizeof(struct start_req)) { + error("Too short start request"); + return FALSE; + } + + seid_count = 1 + size - sizeof(struct start_req); + + seid = &req->first_seid; + + for (i = 0; i < seid_count; i++, seid++) { + failed_seid = seid->seid; + + sep = find_local_sep_by_seid(req->first_seid.seid); + if (!sep || !sep->stream) { + err = AVDTP_BAD_ACP_SEID; + goto failed; + } + + stream = sep->stream; + + /* Also reject start cmd if state is not open */ + if (sep->state != AVDTP_STATE_OPEN) { + err = AVDTP_BAD_STATE; + goto failed; + } + stream->starting = TRUE; + + if (sep->ind && sep->ind->start) { + if (!sep->ind->start(session, sep, stream, &err, + sep->user_data)) + goto failed; + } + + avdtp_check_collision(session, AVDTP_START, stream); + + avdtp_sep_set_state(session, sep, AVDTP_STATE_STREAMING); + } + + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_START, NULL, 0); + +failed: + DBG("Rejecting (%d)", err); + memset(&rej, 0, sizeof(rej)); + rej.acp_seid = failed_seid; + rej.error = err; + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_START, &rej, sizeof(rej)); +} + +static gboolean avdtp_close_cmd(struct avdtp *session, uint8_t transaction, + struct seid_req *req, unsigned int size) +{ + struct avdtp_local_sep *sep; + struct avdtp_stream *stream; + uint8_t err; + + if (size < sizeof(struct seid_req)) { + error("Too short close request"); + return FALSE; + } + + sep = find_local_sep_by_seid(req->acp_seid); + if (!sep || !sep->stream) { + err = AVDTP_BAD_ACP_SEID; + goto failed; + } + + if (sep->state != AVDTP_STATE_OPEN && + sep->state != AVDTP_STATE_STREAMING) { + err = AVDTP_BAD_STATE; + goto failed; + } + + stream = sep->stream; + + if (sep->ind && sep->ind->close) { + if (!sep->ind->close(session, sep, stream, &err, + sep->user_data)) + goto failed; + } + + avdtp_check_collision(session, AVDTP_CLOSE, stream); + + avdtp_sep_set_state(session, sep, AVDTP_STATE_CLOSING); + + if (!avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_CLOSE, NULL, 0)) + return FALSE; + + stream->timer = g_timeout_add_seconds(REQ_TIMEOUT, + stream_close_timeout, + stream); + + return TRUE; + +failed: + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_CLOSE, &err, sizeof(err)); +} + +static gboolean avdtp_suspend_cmd(struct avdtp *session, uint8_t transaction, + struct suspend_req *req, unsigned int size) +{ + struct avdtp_local_sep *sep; + struct avdtp_stream *stream; + struct stream_rej rej; + struct seid *seid; + uint8_t err, failed_seid; + int seid_count, i; + + if (size < sizeof(struct suspend_req)) { + error("Too short suspend request"); + return FALSE; + } + + seid_count = 1 + size - sizeof(struct suspend_req); + + seid = &req->first_seid; + + for (i = 0; i < seid_count; i++, seid++) { + failed_seid = seid->seid; + + sep = find_local_sep_by_seid(req->first_seid.seid); + if (!sep || !sep->stream) { + err = AVDTP_BAD_ACP_SEID; + goto failed; + } + + stream = sep->stream; + + if (sep->state != AVDTP_STATE_STREAMING) { + err = AVDTP_BAD_STATE; + goto failed; + } + + if (sep->ind && sep->ind->suspend) { + if (!sep->ind->suspend(session, sep, stream, &err, + sep->user_data)) + goto failed; + } + + avdtp_check_collision(session, AVDTP_SUSPEND, stream); + + avdtp_sep_set_state(session, sep, AVDTP_STATE_OPEN); + } + + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_SUSPEND, NULL, 0); + +failed: + memset(&rej, 0, sizeof(rej)); + rej.acp_seid = failed_seid; + rej.error = err; + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_SUSPEND, &rej, sizeof(rej)); +} + +static gboolean avdtp_abort_cmd(struct avdtp *session, uint8_t transaction, + struct seid_req *req, unsigned int size) +{ + struct avdtp_local_sep *sep; + uint8_t err; + gboolean ret; + + if (size < sizeof(struct seid_req)) { + error("Too short abort request"); + return FALSE; + } + + sep = find_local_sep_by_seid(req->acp_seid); + if (!sep || !sep->stream) + return TRUE; + + if (sep->ind && sep->ind->abort) + sep->ind->abort(session, sep, sep->stream, &err, + sep->user_data); + + avdtp_check_collision(session, AVDTP_ABORT, sep->stream); + + ret = avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_ABORT, NULL, 0); + if (ret) + avdtp_sep_set_state(session, sep, AVDTP_STATE_ABORTING); + + return ret; +} + +static gboolean avdtp_secctl_cmd(struct avdtp *session, uint8_t transaction, + struct seid_req *req, int size) +{ + return avdtp_unknown_cmd(session, transaction, AVDTP_SECURITY_CONTROL); +} + +static gboolean avdtp_delayreport_cmd(struct avdtp *session, + uint8_t transaction, + struct delay_req *req, + unsigned int size) +{ + struct avdtp_local_sep *sep; + struct avdtp_stream *stream; + uint8_t err; + + if (size < sizeof(struct delay_req)) { + error("Too short delay report request"); + return FALSE; + } + + sep = find_local_sep_by_seid(req->acp_seid); + if (!sep || !sep->stream) { + err = AVDTP_BAD_ACP_SEID; + goto failed; + } + + stream = sep->stream; + + switch (sep->state) { + case AVDTP_STATE_IDLE: + case AVDTP_STATE_ABORTING: + case AVDTP_STATE_CLOSING: + err = AVDTP_BAD_STATE; + goto failed; + default: + break; + } + + stream->delay = ntohs(req->delay); + + if (sep->ind && sep->ind->delayreport) { + if (!sep->ind->delayreport(session, sep, stream->rseid, + stream->delay, &err, + sep->user_data)) + goto failed; + } + + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_ACCEPT, + AVDTP_DELAY_REPORT, NULL, 0); + +failed: + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_DELAY_REPORT, &err, sizeof(err)); +} + +static gboolean avdtp_parse_cmd(struct avdtp *session, uint8_t transaction, + uint8_t signal_id, void *buf, int size) +{ + switch (signal_id) { + case AVDTP_DISCOVER: + DBG("Received DISCOVER_CMD"); + return avdtp_discover_cmd(session, transaction, buf, size); + case AVDTP_GET_CAPABILITIES: + DBG("Received GET_CAPABILITIES_CMD"); + return avdtp_getcap_cmd(session, transaction, buf, size, + FALSE); + case AVDTP_GET_ALL_CAPABILITIES: + DBG("Received GET_ALL_CAPABILITIES_CMD"); + return avdtp_getcap_cmd(session, transaction, buf, size, TRUE); + case AVDTP_SET_CONFIGURATION: + DBG("Received SET_CONFIGURATION_CMD"); + return avdtp_setconf_cmd(session, transaction, buf, size); + case AVDTP_GET_CONFIGURATION: + DBG("Received GET_CONFIGURATION_CMD"); + return avdtp_getconf_cmd(session, transaction, buf, size); + case AVDTP_RECONFIGURE: + DBG("Received RECONFIGURE_CMD"); + return avdtp_reconf_cmd(session, transaction, buf, size); + case AVDTP_OPEN: + DBG("Received OPEN_CMD"); + return avdtp_open_cmd(session, transaction, buf, size); + case AVDTP_START: + DBG("Received START_CMD"); + return avdtp_start_cmd(session, transaction, buf, size); + case AVDTP_CLOSE: + DBG("Received CLOSE_CMD"); + return avdtp_close_cmd(session, transaction, buf, size); + case AVDTP_SUSPEND: + DBG("Received SUSPEND_CMD"); + return avdtp_suspend_cmd(session, transaction, buf, size); + case AVDTP_ABORT: + DBG("Received ABORT_CMD"); + return avdtp_abort_cmd(session, transaction, buf, size); + case AVDTP_SECURITY_CONTROL: + DBG("Received SECURITY_CONTROL_CMD"); + return avdtp_secctl_cmd(session, transaction, buf, size); + case AVDTP_DELAY_REPORT: + DBG("Received DELAY_REPORT_CMD"); + return avdtp_delayreport_cmd(session, transaction, buf, size); + default: + DBG("Received unknown request id %u", signal_id); + return avdtp_unknown_cmd(session, transaction, signal_id); + } +} + +enum avdtp_parse_result { PARSE_ERROR, PARSE_FRAGMENT, PARSE_SUCCESS }; + +static enum avdtp_parse_result avdtp_parse_data(struct avdtp *session, + void *buf, size_t size) +{ + struct avdtp_common_header *header = buf; + struct avdtp_single_header *single = (void *) session->buf; + struct avdtp_start_header *start = (void *) session->buf; + void *payload; + gsize payload_size; + + switch (header->packet_type) { + case AVDTP_PKT_TYPE_SINGLE: + if (size < sizeof(*single)) { + error("Received too small single packet (%zu bytes)", + size); + return PARSE_ERROR; + } + if (session->in.active) { + error("SINGLE: Invalid AVDTP packet fragmentation"); + return PARSE_ERROR; + } + + payload = session->buf + sizeof(*single); + payload_size = size - sizeof(*single); + + session->in.active = TRUE; + session->in.data_size = 0; + session->in.no_of_packets = 1; + session->in.transaction = header->transaction; + session->in.message_type = header->message_type; + session->in.signal_id = single->signal_id; + + break; + case AVDTP_PKT_TYPE_START: + if (size < sizeof(*start)) { + error("Received too small start packet (%zu bytes)", + size); + return PARSE_ERROR; + } + if (session->in.active) { + error("START: Invalid AVDTP packet fragmentation"); + return PARSE_ERROR; + } + + session->in.active = TRUE; + session->in.data_size = 0; + session->in.transaction = header->transaction; + session->in.message_type = header->message_type; + session->in.no_of_packets = start->no_of_packets; + session->in.signal_id = start->signal_id; + + payload = session->buf + sizeof(*start); + payload_size = size - sizeof(*start); + + break; + case AVDTP_PKT_TYPE_CONTINUE: + if (size < sizeof(struct avdtp_continue_header)) { + error("Received too small continue packet (%zu bytes)", + size); + return PARSE_ERROR; + } + if (!session->in.active) { + error("CONTINUE: Invalid AVDTP packet fragmentation"); + return PARSE_ERROR; + } + if (session->in.transaction != header->transaction) { + error("Continue transaction id doesn't match"); + return PARSE_ERROR; + } + if (session->in.no_of_packets <= 1) { + error("Too few continue packets"); + return PARSE_ERROR; + } + + payload = session->buf + sizeof(struct avdtp_continue_header); + payload_size = size - sizeof(struct avdtp_continue_header); + + break; + case AVDTP_PKT_TYPE_END: + if (size < sizeof(struct avdtp_continue_header)) { + error("Received too small end packet (%zu bytes)", + size); + return PARSE_ERROR; + } + if (!session->in.active) { + error("END: Invalid AVDTP packet fragmentation"); + return PARSE_ERROR; + } + if (session->in.transaction != header->transaction) { + error("End transaction id doesn't match"); + return PARSE_ERROR; + } + if (session->in.no_of_packets > 1) { + error("Got an end packet too early"); + return PARSE_ERROR; + } + + payload = session->buf + sizeof(struct avdtp_continue_header); + payload_size = size - sizeof(struct avdtp_continue_header); + + break; + default: + error("Invalid AVDTP packet type 0x%02X", header->packet_type); + return PARSE_ERROR; + } + + if (session->in.data_size + payload_size > + sizeof(session->in.buf)) { + error("Not enough incoming buffer space!"); + return PARSE_ERROR; + } + + memcpy(session->in.buf + session->in.data_size, payload, payload_size); + session->in.data_size += payload_size; + + if (session->in.no_of_packets > 1) { + session->in.no_of_packets--; + DBG("Received AVDTP fragment. %d to go", + session->in.no_of_packets); + return PARSE_FRAGMENT; + } + + session->in.active = FALSE; + + return PARSE_SUCCESS; +} + +static gboolean session_cb(GIOChannel *chan, GIOCondition cond, + gpointer data) +{ + struct avdtp *session = data; + struct avdtp_common_header *header; + ssize_t size; + int fd; + + DBG(""); + + if (cond & G_IO_NVAL) + return FALSE; + + header = (void *) session->buf; + + if (cond & (G_IO_HUP | G_IO_ERR)) + goto failed; + + fd = g_io_channel_unix_get_fd(chan); + size = read(fd, session->buf, session->imtu); + if (size < 0) { + error("IO Channel read error"); + goto failed; + } + + if ((size_t) size < sizeof(struct avdtp_common_header)) { + error("Received too small packet (%zu bytes)", size); + goto failed; + } + + switch (avdtp_parse_data(session, session->buf, size)) { + case PARSE_ERROR: + goto failed; + case PARSE_FRAGMENT: + return TRUE; + case PARSE_SUCCESS: + break; + } + + if (session->in.message_type == AVDTP_MSG_TYPE_COMMAND) { + if (!avdtp_parse_cmd(session, session->in.transaction, + session->in.signal_id, + session->in.buf, + session->in.data_size)) { + error("Unable to handle command. Disconnecting"); + goto failed; + } + + if (session->req && session->req->collided) { + DBG("Collision detected"); + goto next; + } + + return TRUE; + } + + if (session->req == NULL) { + error("No pending request, ignoring message"); + return TRUE; + } + + if (header->transaction != session->req->transaction) { + error("Transaction label doesn't match"); + return TRUE; + } + + if (session->in.signal_id != session->req->signal_id) { + error("Response signal doesn't match"); + return TRUE; + } + + g_source_remove(session->req->timeout); + session->req->timeout = 0; + + switch (header->message_type) { + case AVDTP_MSG_TYPE_ACCEPT: + if (!avdtp_parse_resp(session, session->req->stream, + session->in.transaction, + session->in.signal_id, + session->in.buf, + session->in.data_size)) { + error("Unable to parse accept response"); + goto failed; + } + break; + case AVDTP_MSG_TYPE_REJECT: + if (!avdtp_parse_rej(session, session->req->stream, + session->in.transaction, + session->in.signal_id, + session->in.buf, + session->in.data_size)) { + error("Unable to parse reject response"); + goto failed; + } + break; + case AVDTP_MSG_TYPE_GEN_REJECT: + error("Received a General Reject message"); + break; + default: + error("Unknown message type 0x%02X", header->message_type); + break; + } + +next: + pending_req_free(session->req); + session->req = NULL; + + process_queue(session); + + return TRUE; + +failed: + connection_lost(session, EIO); + + return FALSE; +} + +static int set_priority(int fd, int priority) +{ + int err; + + err = setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &priority, + sizeof(priority)); + if (err == 0 || errno == ENOTSOCK) + return 0; + + err = -errno; + error("setsockopt(SO_PRIORITY): %s (%d)", strerror(-err), -err); + + return err; +} + +struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version) +{ + struct avdtp *session; + GIOCondition cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL; + int new_fd; + + new_fd = dup(fd); + if (new_fd < 0) { + error("dup(): %s (%d)", strerror(errno), errno); + return NULL; + } + + if (set_priority(new_fd, 6) < 0) + return NULL; + + session = g_new0(struct avdtp, 1); + session->io = g_io_channel_unix_new(new_fd); + session->version = version; + session->imtu = imtu; + session->omtu = omtu; + session->buf = g_malloc0(MAX(session->imtu, session->omtu)); + + /* This watch should be low priority since otherwise the + * connect callback might be dispatched before the session + * callback if the kernel wakes us up at the same time for + * them. This could happen if a headset is very quick in + * sending the Start command after connecting the stream + * transport channel. + */ + session->io_id = g_io_add_watch_full(session->io, G_PRIORITY_LOW, cond, + (GIOFunc) session_cb, session, + NULL); + + return avdtp_ref(session); +} + +unsigned int avdtp_add_disconnect_cb(struct avdtp *session, + avdtp_disconnect_cb_t cb, + void *user_data) +{ + struct disconnect_callback *callback; + static unsigned int id = 0; + + callback = g_new0(struct disconnect_callback, 1); + callback->id = ++id; + callback->cb = cb; + callback->user_data = user_data; + session->disconnect = g_slist_append(session->disconnect, callback); + + return id; +} + +gboolean avdtp_remove_disconnect_cb(struct avdtp *session, unsigned int id) +{ + GSList *l; + + for (l = session->disconnect; l; l = g_slist_next(l)) { + struct disconnect_callback *callback = l->data; + + if (callback->id != id) + continue; + + session->disconnect = g_slist_remove(session->disconnect, + callback); + g_free(callback); + return TRUE; + } + + return FALSE; +} + +void avdtp_shutdown(struct avdtp *session) +{ + GSList *l; + bool aborting = false; + + if (!session->io) + return; + + for (l = session->streams; l; l = g_slist_next(l)) { + struct avdtp_stream *stream = l->data; + + if (stream->abort_int || avdtp_abort(session, stream) == 0) + aborting = true; + } + + if (aborting) { + /* defer shutdown until all streams are aborted properly */ + session->shutdown = true; + } else { + int sock = g_io_channel_unix_get_fd(session->io); + + shutdown(sock, SHUT_RDWR); + } +} + +static void queue_request(struct avdtp *session, struct pending_req *req, + gboolean priority) +{ + if (priority) + session->prio_queue = g_slist_append(session->prio_queue, req); + else + session->req_queue = g_slist_append(session->req_queue, req); +} + +static uint8_t req_get_seid(struct pending_req *req) +{ + if (req->signal_id == AVDTP_DISCOVER) + return 0; + + return ((struct seid_req *) (req->data))->acp_seid; +} + +static int cancel_request(struct avdtp *session, int err) +{ + struct pending_req *req; + struct seid_req sreq; + struct avdtp_local_sep *lsep; + struct avdtp_stream *stream; + uint8_t seid; + struct avdtp_error averr; + + req = session->req; + session->req = NULL; + + avdtp_error_init(&averr, AVDTP_ERRNO, err); + + seid = req_get_seid(req); + if (seid) + stream = find_stream_by_rseid(session, seid); + else + stream = NULL; + + if (stream) { + stream->abort_int = TRUE; + lsep = stream->lsep; + } else + lsep = NULL; + + switch (req->signal_id) { + case AVDTP_RECONFIGURE: + error("Reconfigure: %s (%d)", strerror(err), err); + if (lsep && lsep->cfm && lsep->cfm->reconfigure) + lsep->cfm->reconfigure(session, lsep, stream, &averr, + lsep->user_data); + break; + case AVDTP_OPEN: + error("Open: %s (%d)", strerror(err), err); + if (lsep && lsep->cfm && lsep->cfm->open) + lsep->cfm->open(session, lsep, stream, &averr, + lsep->user_data); + break; + case AVDTP_START: + error("Start: %s (%d)", strerror(err), err); + if (lsep && lsep->cfm && lsep->cfm->start) { + lsep->cfm->start(session, lsep, stream, &averr, + lsep->user_data); + if (stream) + stream->starting = FALSE; + } + break; + case AVDTP_SUSPEND: + error("Suspend: %s (%d)", strerror(err), err); + if (lsep && lsep->cfm && lsep->cfm->suspend) + lsep->cfm->suspend(session, lsep, stream, &averr, + lsep->user_data); + break; + case AVDTP_CLOSE: + error("Close: %s (%d)", strerror(err), err); + if (lsep && lsep->cfm && lsep->cfm->close) { + lsep->cfm->close(session, lsep, stream, &averr, + lsep->user_data); + if (stream) + stream->close_int = FALSE; + } + break; + case AVDTP_SET_CONFIGURATION: + error("SetConfiguration: %s (%d)", strerror(err), err); + if (lsep && lsep->cfm && lsep->cfm->set_configuration) + lsep->cfm->set_configuration(session, lsep, stream, + &averr, lsep->user_data); + goto failed; + case AVDTP_DISCOVER: + error("Discover: %s (%d)", strerror(err), err); + goto failed; + case AVDTP_GET_CAPABILITIES: + error("GetCapabilities: %s (%d)", strerror(err), err); + goto failed; + case AVDTP_ABORT: + error("Abort: %s (%d)", strerror(err), err); + goto failed; + } + + if (!stream) + goto failed; + + memset(&sreq, 0, sizeof(sreq)); + sreq.acp_seid = seid; + + err = send_request(session, TRUE, stream, AVDTP_ABORT, &sreq, + sizeof(sreq)); + if (err < 0) { + error("Unable to send abort request"); + goto failed; + } + + goto done; + +failed: + connection_lost(session, err); +done: + pending_req_free(req); + return err; +} + +static gboolean request_timeout(gpointer user_data) +{ + struct avdtp *session = user_data; + + cancel_request(session, ETIMEDOUT); + + return FALSE; +} + +static int send_req(struct avdtp *session, gboolean priority, + struct pending_req *req) +{ + static int transaction = 0; + int err; + + if (session->req != NULL) { + queue_request(session, req, priority); + return 0; + } + + req->transaction = transaction++; + transaction %= 16; + + /* FIXME: Should we retry to send if the buffer + was not totally sent or in case of EINTR? */ + if (!avdtp_send(session, req->transaction, AVDTP_MSG_TYPE_COMMAND, + req->signal_id, req->data, req->data_size)) { + err = -EIO; + goto failed; + } + + session->req = req; + + req->timeout = g_timeout_add_seconds(req->signal_id == AVDTP_ABORT ? + ABORT_TIMEOUT : REQ_TIMEOUT, + request_timeout, + session); + return 0; + +failed: + g_free(req->data); + g_free(req); + return err; +} + +static int send_request(struct avdtp *session, gboolean priority, + struct avdtp_stream *stream, uint8_t signal_id, + void *buffer, size_t size) +{ + struct pending_req *req; + + if (size > 0 && !buffer) { + DBG("Invalid buffer %p", buffer); + return -EINVAL; + } + + if (stream && stream->abort_int && signal_id != AVDTP_ABORT) { + DBG("Unable to send requests while aborting"); + return -EINVAL; + } + + req = g_new0(struct pending_req, 1); + req->signal_id = signal_id; + req->data_size = size; + req->stream = stream; + + if (size > 0) { + req->data = g_malloc(size); + memcpy(req->data, buffer, size); + } + + return send_req(session, priority, req); +} + +static gboolean avdtp_discover_resp(struct avdtp *session, + struct discover_resp *resp, int size) +{ + int sep_count, i; + uint8_t getcap_cmd; + int ret = 0; + gboolean getcap_pending = FALSE; + + if (session->version >= 0x0103) + getcap_cmd = AVDTP_GET_ALL_CAPABILITIES; + else + getcap_cmd = AVDTP_GET_CAPABILITIES; + + sep_count = size / sizeof(struct seid_info); + + for (i = 0; i < sep_count; i++) { + struct avdtp_remote_sep *sep; + struct avdtp_stream *stream; + struct seid_req req; + + DBG("seid %d type %d media %d in use %d", + resp->seps[i].seid, resp->seps[i].type, + resp->seps[i].media_type, resp->seps[i].inuse); + + stream = find_stream_by_rseid(session, resp->seps[i].seid); + + sep = find_remote_sep(session->seps, resp->seps[i].seid); + if (!sep) { + if (resp->seps[i].inuse && !stream) + continue; + sep = g_new0(struct avdtp_remote_sep, 1); + session->seps = g_slist_append(session->seps, sep); + } + + sep->stream = stream; + sep->seid = resp->seps[i].seid; + sep->type = resp->seps[i].type; + sep->media_type = resp->seps[i].media_type; + + memset(&req, 0, sizeof(req)); + req.acp_seid = sep->seid; + + ret = send_request(session, TRUE, NULL, getcap_cmd, + &req, sizeof(req)); + if (ret < 0) + break; + getcap_pending = TRUE; + } + + if (!getcap_pending) + finalize_discovery(session, -ret); + + return TRUE; +} + +static gboolean avdtp_get_capabilities_resp(struct avdtp *session, + struct getcap_resp *resp, + unsigned int size) +{ + struct avdtp_remote_sep *sep; + uint8_t seid; + + /* Check for minimum required packet size includes: + * 1. getcap resp header + * 2. media transport capability (2 bytes) + * 3. media codec capability type + length (2 bytes) + * 4. the actual media codec elements + * */ + if (size < (sizeof(struct getcap_resp) + 4 + + sizeof(struct avdtp_media_codec_capability))) { + error("Too short getcap resp packet"); + return FALSE; + } + + seid = ((struct seid_req *) session->req->data)->acp_seid; + + sep = find_remote_sep(session->seps, seid); + + DBG("seid %d type %d media %d", sep->seid, + sep->type, sep->media_type); + + if (sep->caps) { + g_slist_free_full(sep->caps, g_free); + sep->caps = NULL; + sep->codec = NULL; + sep->delay_reporting = FALSE; + } + + sep->caps = caps_to_list(resp->caps, size - sizeof(struct getcap_resp), + &sep->codec, &sep->delay_reporting); + + return TRUE; +} + +static gboolean avdtp_set_configuration_resp(struct avdtp *session, + struct avdtp_stream *stream, + struct avdtp_single_header *resp, + int size) +{ + struct avdtp_local_sep *sep = stream->lsep; + + if (sep->cfm && sep->cfm->set_configuration) + sep->cfm->set_configuration(session, sep, stream, NULL, + sep->user_data); + + avdtp_sep_set_state(session, sep, AVDTP_STATE_CONFIGURED); + + return TRUE; +} + +static gboolean avdtp_reconfigure_resp(struct avdtp *session, + struct avdtp_stream *stream, + struct avdtp_single_header *resp, + int size) +{ + return TRUE; +} + +static gboolean avdtp_open_resp(struct avdtp *session, + struct avdtp_stream *stream, + struct seid_rej *resp, int size) +{ + struct avdtp_local_sep *sep = stream->lsep; + + session->pending_open = stream; + + if (!stream->open_acp && sep->cfm && sep->cfm->open) + sep->cfm->open(session, sep, stream, NULL, sep->user_data); + + return TRUE; +} + +static gboolean avdtp_start_resp(struct avdtp *session, + struct avdtp_stream *stream, + struct seid_rej *resp, int size) +{ + struct avdtp_local_sep *sep = stream->lsep; + + /* We might be in STREAMING already if both sides send START_CMD at the + * same time and the one in SNK role doesn't reject it as it should */ + if (sep->state != AVDTP_STATE_STREAMING) + avdtp_sep_set_state(session, sep, AVDTP_STATE_STREAMING); + + if (sep->cfm && sep->cfm->start) + sep->cfm->start(session, sep, stream, NULL, sep->user_data); + + return TRUE; +} + +static gboolean avdtp_close_resp(struct avdtp *session, + struct avdtp_stream *stream, + struct seid_rej *resp, int size) +{ + struct avdtp_local_sep *sep = stream->lsep; + + avdtp_sep_set_state(session, sep, AVDTP_STATE_CLOSING); + + close_stream(stream); + + return TRUE; +} + +static gboolean avdtp_suspend_resp(struct avdtp *session, + struct avdtp_stream *stream, + void *data, int size) +{ + struct avdtp_local_sep *sep = stream->lsep; + + avdtp_sep_set_state(session, sep, AVDTP_STATE_OPEN); + + if (sep->cfm && sep->cfm->suspend) + sep->cfm->suspend(session, sep, stream, NULL, sep->user_data); + + return TRUE; +} + +static gboolean avdtp_abort_resp(struct avdtp *session, + struct avdtp_stream *stream, + struct seid_rej *resp, int size) +{ + struct avdtp_local_sep *sep = stream->lsep; + + avdtp_sep_set_state(session, sep, AVDTP_STATE_ABORTING); + + if (sep->cfm && sep->cfm->abort) + sep->cfm->abort(session, sep, stream, NULL, sep->user_data); + + avdtp_sep_set_state(session, sep, AVDTP_STATE_IDLE); + + return TRUE; +} + +static gboolean avdtp_delay_report_resp(struct avdtp *session, + struct avdtp_stream *stream, + void *data, int size) +{ + struct avdtp_local_sep *sep = stream->lsep; + + if (sep->cfm && sep->cfm->delay_report) + sep->cfm->delay_report(session, sep, stream, NULL, + sep->user_data); + + return TRUE; +} + +static gboolean avdtp_parse_resp(struct avdtp *session, + struct avdtp_stream *stream, + uint8_t transaction, uint8_t signal_id, + void *buf, int size) +{ + struct pending_req *next; + const char *get_all = ""; + + if (session->prio_queue) + next = session->prio_queue->data; + else if (session->req_queue) + next = session->req_queue->data; + else + next = NULL; + + switch (signal_id) { + case AVDTP_DISCOVER: + DBG("DISCOVER request succeeded"); + return avdtp_discover_resp(session, buf, size); + case AVDTP_GET_ALL_CAPABILITIES: + get_all = "ALL_"; + case AVDTP_GET_CAPABILITIES: + DBG("GET_%sCAPABILITIES request succeeded", get_all); + if (!avdtp_get_capabilities_resp(session, buf, size)) + return FALSE; + if (!(next && (next->signal_id == AVDTP_GET_CAPABILITIES || + next->signal_id == AVDTP_GET_ALL_CAPABILITIES))) + finalize_discovery(session, 0); + return TRUE; + } + + /* The remaining commands require an existing stream so bail out + * here if the stream got unexpectedly disconnected */ + if (!stream) { + DBG("AVDTP: stream was closed while waiting for reply"); + return TRUE; + } + + switch (signal_id) { + case AVDTP_SET_CONFIGURATION: + DBG("SET_CONFIGURATION request succeeded"); + return avdtp_set_configuration_resp(session, stream, + buf, size); + case AVDTP_RECONFIGURE: + DBG("RECONFIGURE request succeeded"); + return avdtp_reconfigure_resp(session, stream, buf, size); + case AVDTP_OPEN: + DBG("OPEN request succeeded"); + return avdtp_open_resp(session, stream, buf, size); + case AVDTP_SUSPEND: + DBG("SUSPEND request succeeded"); + return avdtp_suspend_resp(session, stream, buf, size); + case AVDTP_START: + DBG("START request succeeded"); + return avdtp_start_resp(session, stream, buf, size); + case AVDTP_CLOSE: + DBG("CLOSE request succeeded"); + return avdtp_close_resp(session, stream, buf, size); + case AVDTP_ABORT: + DBG("ABORT request succeeded"); + return avdtp_abort_resp(session, stream, buf, size); + case AVDTP_DELAY_REPORT: + DBG("DELAY_REPORT request succeeded"); + return avdtp_delay_report_resp(session, stream, buf, size); + } + + error("Unknown signal id in accept response: %u", signal_id); + return TRUE; +} + +static gboolean seid_rej_to_err(struct seid_rej *rej, unsigned int size, + struct avdtp_error *err) +{ + if (size < sizeof(struct seid_rej)) { + error("Too small packet for seid_rej"); + return FALSE; + } + + avdtp_error_init(err, 0x00, rej->error); + + return TRUE; +} + +static gboolean conf_rej_to_err(struct conf_rej *rej, unsigned int size, + struct avdtp_error *err) +{ + if (size < sizeof(struct conf_rej)) { + error("Too small packet for conf_rej"); + return FALSE; + } + + avdtp_error_init(err, rej->category, rej->error); + + return TRUE; +} + +static gboolean stream_rej_to_err(struct stream_rej *rej, unsigned int size, + struct avdtp_error *err, + uint8_t *acp_seid) +{ + if (size < sizeof(struct stream_rej)) { + error("Too small packet for stream_rej"); + return FALSE; + } + + avdtp_error_init(err, 0x00, rej->error); + + if (acp_seid) + *acp_seid = rej->acp_seid; + + return TRUE; +} + +static gboolean avdtp_parse_rej(struct avdtp *session, + struct avdtp_stream *stream, + uint8_t transaction, uint8_t signal_id, + void *buf, int size) +{ + struct avdtp_error err; + uint8_t acp_seid; + struct avdtp_local_sep *sep = stream ? stream->lsep : NULL; + + switch (signal_id) { + case AVDTP_DISCOVER: + case AVDTP_GET_CAPABILITIES: + case AVDTP_GET_ALL_CAPABILITIES: + if (!seid_rej_to_err(buf, size, &err)) + return FALSE; + error("%s request rejected: %s (%d)", + signal_id == AVDTP_DISCOVER ? "DISCOVER" : + signal_id == AVDTP_GET_CAPABILITIES ? + "GET_CAPABILITIES" : "GET_ALL_CAPABILITIES", + avdtp_strerror(&err), err.err.error_code); + if (session->discover) { + session->discover->cb(session, session->seps, &err, + session->discover->user_data); + g_free(session->discover); + session->discover = NULL; + } + return TRUE; + case AVDTP_OPEN: + if (!seid_rej_to_err(buf, size, &err)) + return FALSE; + error("OPEN request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->open) + sep->cfm->open(session, sep, stream, &err, + sep->user_data); + return TRUE; + case AVDTP_SET_CONFIGURATION: + if (!conf_rej_to_err(buf, size, &err)) + return FALSE; + error("SET_CONFIGURATION request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->set_configuration) + sep->cfm->set_configuration(session, sep, stream, + &err, sep->user_data); + return TRUE; + case AVDTP_GET_CONFIGURATION: + if (!seid_rej_to_err(buf, size, &err)) + return FALSE; + error("GET_CONFIGURATION request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->get_configuration) + sep->cfm->get_configuration(session, sep, stream, &err, + sep->user_data); + return TRUE; + case AVDTP_RECONFIGURE: + if (!conf_rej_to_err(buf, size, &err)) + return FALSE; + error("RECONFIGURE request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->reconfigure) + sep->cfm->reconfigure(session, sep, stream, &err, + sep->user_data); + return TRUE; + case AVDTP_START: + if (!stream_rej_to_err(buf, size, &err, &acp_seid)) + return FALSE; + error("START request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->start) { + sep->cfm->start(session, sep, stream, &err, + sep->user_data); + stream->starting = FALSE; + } + return TRUE; + case AVDTP_SUSPEND: + if (!stream_rej_to_err(buf, size, &err, &acp_seid)) + return FALSE; + error("SUSPEND request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->suspend) + sep->cfm->suspend(session, sep, stream, &err, + sep->user_data); + return TRUE; + case AVDTP_CLOSE: + if (!stream_rej_to_err(buf, size, &err, &acp_seid)) + return FALSE; + error("CLOSE request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->close) { + sep->cfm->close(session, sep, stream, &err, + sep->user_data); + stream->close_int = FALSE; + } + return TRUE; + case AVDTP_ABORT: + if (!stream_rej_to_err(buf, size, &err, &acp_seid)) + return FALSE; + error("ABORT request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->abort) + sep->cfm->abort(session, sep, stream, &err, + sep->user_data); + return FALSE; + case AVDTP_DELAY_REPORT: + if (!stream_rej_to_err(buf, size, &err, &acp_seid)) + return FALSE; + error("DELAY_REPORT request rejected: %s (%d)", + avdtp_strerror(&err), err.err.error_code); + if (sep && sep->cfm && sep->cfm->delay_report) + sep->cfm->delay_report(session, sep, stream, &err, + sep->user_data); + return TRUE; + default: + error("Unknown reject response signal id: %u", signal_id); + return TRUE; + } +} + +struct avdtp_service_capability *avdtp_stream_get_codec( + struct avdtp_stream *stream) +{ + GSList *l; + + for (l = stream->caps; l; l = l->next) { + struct avdtp_service_capability *cap = l->data; + + if (cap->category == AVDTP_MEDIA_CODEC) + return cap; + } + + return NULL; +} + +static gboolean avdtp_stream_has_capability(struct avdtp_stream *stream, + struct avdtp_service_capability *cap) +{ + GSList *l; + struct avdtp_service_capability *stream_cap; + + for (l = stream->caps; l; l = g_slist_next(l)) { + stream_cap = l->data; + + if (stream_cap->category != cap->category || + stream_cap->length != cap->length) + continue; + + if (memcmp(stream_cap->data, cap->data, cap->length) == 0) + return TRUE; + } + + return FALSE; +} + +gboolean avdtp_stream_has_capabilities(struct avdtp_stream *stream, + GSList *caps) +{ + for (; caps; caps = g_slist_next(caps)) { + struct avdtp_service_capability *cap = caps->data; + + if (!avdtp_stream_has_capability(stream, cap)) + return FALSE; + } + + return TRUE; +} + +struct avdtp_remote_sep *avdtp_stream_get_remote_sep( + struct avdtp_stream *stream) +{ + GSList *l; + + for (l = stream->session->seps; l; l = l->next) { + struct avdtp_remote_sep *sep = l->data; + + if (sep->seid == stream->rseid) + return sep; + } + + return NULL; +} + +gboolean avdtp_stream_set_transport(struct avdtp_stream *stream, int fd, + size_t imtu, size_t omtu) +{ + GIOChannel *io; + + if (stream != stream->session->pending_open) + return FALSE; + + if (set_priority(fd, 5) < 0) + return FALSE; + + io = g_io_channel_unix_new(fd); + + handle_transport_connect(stream->session, io, imtu, omtu); + + g_io_channel_unref(io); + + return TRUE; + +} + +gboolean avdtp_stream_get_transport(struct avdtp_stream *stream, int *sock, + uint16_t *imtu, uint16_t *omtu, + GSList **caps) +{ + if (stream->io == NULL) + return FALSE; + + if (sock) + *sock = g_io_channel_unix_get_fd(stream->io); + + if (omtu) + *omtu = stream->omtu; + + if (imtu) + *imtu = stream->imtu; + + if (caps) + *caps = stream->caps; + + return TRUE; +} + +static int process_queue(struct avdtp *session) +{ + GSList **queue, *l; + struct pending_req *req; + + if (session->req) + return 0; + + if (session->prio_queue) + queue = &session->prio_queue; + else + queue = &session->req_queue; + + if (!*queue) + return 0; + + l = *queue; + req = l->data; + + *queue = g_slist_remove(*queue, req); + + return send_req(session, FALSE, req); +} + +struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep) +{ + return sep->codec; +} + +struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category, + void *data, int length) +{ + struct avdtp_service_capability *cap; + + if (category < AVDTP_MEDIA_TRANSPORT || + category > AVDTP_DELAY_REPORTING) + return NULL; + + if (length > 0 && !data) + return NULL; + + cap = g_malloc(sizeof(struct avdtp_service_capability) + length); + cap->category = category; + cap->length = length; + + if (length > 0) + memcpy(cap->data, data, length); + + return cap; +} + +static gboolean process_discover(gpointer data) +{ + struct avdtp *session = data; + + session->discover->id = 0; + + finalize_discovery(session, 0); + + return FALSE; +} + +int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb, + void *user_data) +{ + int err; + + if (session->discover) + return -EBUSY; + + session->discover = g_new0(struct discover_callback, 1); + + if (session->seps) { + session->discover->cb = cb; + session->discover->user_data = user_data; + session->discover->id = g_idle_add(process_discover, session); + return 0; + } + + err = send_request(session, FALSE, NULL, AVDTP_DISCOVER, NULL, 0); + if (err == 0) { + session->discover->cb = cb; + session->discover->user_data = user_data; + } + + return err; +} + +gboolean avdtp_stream_remove_cb(struct avdtp *session, + struct avdtp_stream *stream, + unsigned int id) +{ + GSList *l; + struct stream_callback *cb; + + if (!stream) + return FALSE; + + for (cb = NULL, l = stream->callbacks; l != NULL; l = l->next) { + struct stream_callback *tmp = l->data; + if (tmp && tmp->id == id) { + cb = tmp; + break; + } + } + + if (!cb) + return FALSE; + + stream->callbacks = g_slist_remove(stream->callbacks, cb); + g_free(cb); + + return TRUE; +} + +unsigned int avdtp_stream_add_cb(struct avdtp *session, + struct avdtp_stream *stream, + avdtp_stream_state_cb cb, void *data) +{ + struct stream_callback *stream_cb; + static unsigned int id = 0; + + stream_cb = g_new(struct stream_callback, 1); + stream_cb->cb = cb; + stream_cb->user_data = data; + stream_cb->id = ++id; + + stream->callbacks = g_slist_append(stream->callbacks, stream_cb); + + return stream_cb->id; +} + +int avdtp_get_configuration(struct avdtp *session, struct avdtp_stream *stream) +{ + struct seid_req req; + + memset(&req, 0, sizeof(req)); + req.acp_seid = stream->rseid; + + return send_request(session, FALSE, stream, AVDTP_GET_CONFIGURATION, + &req, sizeof(req)); +} + +static void copy_capabilities(gpointer data, gpointer user_data) +{ + struct avdtp_service_capability *src_cap = data; + struct avdtp_service_capability *dst_cap; + GSList **l = user_data; + + dst_cap = avdtp_service_cap_new(src_cap->category, src_cap->data, + src_cap->length); + + *l = g_slist_append(*l, dst_cap); +} + +int avdtp_set_configuration(struct avdtp *session, + struct avdtp_remote_sep *rsep, + struct avdtp_local_sep *lsep, + GSList *caps, + struct avdtp_stream **stream) +{ + struct setconf_req *req; + struct avdtp_stream *new_stream; + unsigned char *ptr; + int err, caps_len; + struct avdtp_service_capability *cap; + GSList *l; + + if (!(lsep && rsep)) + return -EINVAL; + + DBG("%p: int_seid=%u, acp_seid=%u", session, + lsep->info.seid, rsep->seid); + + new_stream = g_new0(struct avdtp_stream, 1); + new_stream->session = session; + new_stream->lsep = lsep; + new_stream->rseid = rsep->seid; + + if (rsep->delay_reporting && lsep->delay_reporting) { + struct avdtp_service_capability *delay_reporting; + + delay_reporting = avdtp_service_cap_new(AVDTP_DELAY_REPORTING, + NULL, 0); + caps = g_slist_append(caps, delay_reporting); + new_stream->delay_reporting = TRUE; + } + + g_slist_foreach(caps, copy_capabilities, &new_stream->caps); + + /* Calculate total size of request */ + for (l = caps, caps_len = 0; l != NULL; l = g_slist_next(l)) { + cap = l->data; + caps_len += cap->length + 2; + } + + req = g_malloc0(sizeof(struct setconf_req) + caps_len); + + req->int_seid = lsep->info.seid; + req->acp_seid = rsep->seid; + + /* Copy the capabilities into the request */ + for (l = caps, ptr = req->caps; l != NULL; l = g_slist_next(l)) { + cap = l->data; + memcpy(ptr, cap, cap->length + 2); + ptr += cap->length + 2; + } + + err = send_request(session, FALSE, new_stream, + AVDTP_SET_CONFIGURATION, req, + sizeof(struct setconf_req) + caps_len); + if (err < 0) + stream_free(new_stream); + else { + lsep->info.inuse = 1; + lsep->stream = new_stream; + rsep->stream = new_stream; + session->streams = g_slist_append(session->streams, new_stream); + if (stream) + *stream = new_stream; + } + + g_free(req); + + return err; +} + +int avdtp_open(struct avdtp *session, struct avdtp_stream *stream) +{ + struct seid_req req; + + if (!g_slist_find(session->streams, stream)) + return -EINVAL; + + if (stream->lsep->state > AVDTP_STATE_CONFIGURED) + return -EINVAL; + + memset(&req, 0, sizeof(req)); + req.acp_seid = stream->rseid; + + return send_request(session, FALSE, stream, AVDTP_OPEN, + &req, sizeof(req)); +} + +static gboolean start_timeout(gpointer user_data) +{ + struct avdtp_stream *stream = user_data; + struct avdtp *session = stream->session; + + stream->open_acp = FALSE; + + if (avdtp_start(session, stream) < 0) + error("wait_timeout: avdtp_start failed"); + + stream->start_timer = 0; + + return FALSE; +} + +int avdtp_start(struct avdtp *session, struct avdtp_stream *stream) +{ + struct start_req req; + int ret; + + if (!g_slist_find(session->streams, stream)) + return -EINVAL; + + if (stream->lsep->state != AVDTP_STATE_OPEN) + return -EINVAL; + + /* Recommendation 12: + * If the RD has configured and opened a stream it is also responsible + * to start the streaming via GAVDP_START. + */ + if (stream->open_acp) { + /* If timer already active wait it */ + if (stream->start_timer) + return 0; + + stream->start_timer = g_timeout_add_seconds(START_TIMEOUT, + start_timeout, + stream); + return 0; + } + + if (stream->close_int == TRUE) { + error("avdtp_start: rejecting start since close is initiated"); + return -EINVAL; + } + + if (stream->starting == TRUE) { + DBG("stream already started"); + return -EINPROGRESS; + } + + memset(&req, 0, sizeof(req)); + req.first_seid.seid = stream->rseid; + + ret = send_request(session, FALSE, stream, AVDTP_START, + &req, sizeof(req)); + if (ret == 0) + stream->starting = TRUE; + + return ret; +} + +int avdtp_close(struct avdtp *session, struct avdtp_stream *stream, + gboolean immediate) +{ + struct seid_req req; + int ret; + + if (!g_slist_find(session->streams, stream)) + return -EINVAL; + + if (stream->lsep->state < AVDTP_STATE_OPEN) + return -EINVAL; + + if (stream->close_int == TRUE) { + error("avdtp_close: rejecting since close is already initiated"); + return -EINVAL; + } + + if (immediate && session->req && stream == session->req->stream) + return avdtp_abort(session, stream); + + memset(&req, 0, sizeof(req)); + req.acp_seid = stream->rseid; + + ret = send_request(session, FALSE, stream, AVDTP_CLOSE, + &req, sizeof(req)); + if (ret == 0) + stream->close_int = TRUE; + + return ret; +} + +int avdtp_suspend(struct avdtp *session, struct avdtp_stream *stream) +{ + struct seid_req req; + + if (!g_slist_find(session->streams, stream)) + return -EINVAL; + + if (stream->lsep->state <= AVDTP_STATE_OPEN || stream->close_int) + return -EINVAL; + + memset(&req, 0, sizeof(req)); + req.acp_seid = stream->rseid; + + return send_request(session, FALSE, stream, AVDTP_SUSPEND, + &req, sizeof(req)); +} + +int avdtp_abort(struct avdtp *session, struct avdtp_stream *stream) +{ + struct seid_req req; + int ret; + + if (!g_slist_find(session->streams, stream)) + return -EINVAL; + + if (stream->lsep->state == AVDTP_STATE_ABORTING) + return -EINVAL; + + if (session->req && session->req->timeout > 0 && + stream == session->req->stream) + return cancel_request(session, ECANCELED); + + memset(&req, 0, sizeof(req)); + req.acp_seid = stream->rseid; + + ret = send_request(session, TRUE, stream, AVDTP_ABORT, + &req, sizeof(req)); + if (ret == 0) + stream->abort_int = TRUE; + + return ret; +} + +int avdtp_delay_report(struct avdtp *session, struct avdtp_stream *stream, + uint16_t delay) +{ + struct delay_req req; + + if (!g_slist_find(session->streams, stream)) + return -EINVAL; + + if (stream->lsep->state != AVDTP_STATE_CONFIGURED && + stream->lsep->state != AVDTP_STATE_STREAMING) + return -EINVAL; + + if (!stream->delay_reporting || session->version < 0x0103) + return -EINVAL; + + stream->delay = delay; + + memset(&req, 0, sizeof(req)); + req.acp_seid = stream->rseid; + req.delay = htons(delay); + + return send_request(session, TRUE, stream, AVDTP_DELAY_REPORT, + &req, sizeof(req)); +} + +struct avdtp_local_sep *avdtp_register_sep(uint8_t type, uint8_t media_type, + uint8_t codec_type, + gboolean delay_reporting, + struct avdtp_sep_ind *ind, + struct avdtp_sep_cfm *cfm, + void *user_data) +{ + struct avdtp_local_sep *sep; + + if (g_slist_length(lseps) > MAX_SEID) + return NULL; + + sep = g_new0(struct avdtp_local_sep, 1); + + sep->state = AVDTP_STATE_IDLE; + sep->info.seid = g_slist_length(lseps) + 1; + sep->info.type = type; + sep->info.media_type = media_type; + sep->codec = codec_type; + sep->ind = ind; + sep->cfm = cfm; + sep->user_data = user_data; + sep->delay_reporting = delay_reporting; + + DBG("SEP %p registered: type:%d codec:%d seid:%d", sep, + sep->info.type, sep->codec, sep->info.seid); + lseps = g_slist_append(lseps, sep); + + return sep; +} + +int avdtp_unregister_sep(struct avdtp_local_sep *sep) +{ + if (!sep) + return -EINVAL; + + lseps = g_slist_remove(lseps, sep); + + if (sep->stream) + release_stream(sep->stream, sep->stream->session); + + DBG("SEP %p unregistered: type:%d codec:%d seid:%d", sep, + sep->info.type, sep->codec, sep->info.seid); + + g_free(sep); + + return 0; +} + +const char *avdtp_strerror(struct avdtp_error *err) +{ + if (err->category == AVDTP_ERRNO) + return strerror(err->err.posix_errno); + + switch (err->err.error_code) { + case AVDTP_BAD_HEADER_FORMAT: + return "Bad Header Format"; + case AVDTP_BAD_LENGTH: + return "Bad Packet Length"; + case AVDTP_BAD_ACP_SEID: + return "Bad Acceptor SEID"; + case AVDTP_SEP_IN_USE: + return "Stream End Point in Use"; + case AVDTP_SEP_NOT_IN_USE: + return "Stream End Point Not in Use"; + case AVDTP_BAD_SERV_CATEGORY: + return "Bad Service Category"; + case AVDTP_BAD_PAYLOAD_FORMAT: + return "Bad Payload format"; + case AVDTP_NOT_SUPPORTED_COMMAND: + return "Command Not Supported"; + case AVDTP_INVALID_CAPABILITIES: + return "Invalid Capabilities"; + case AVDTP_BAD_RECOVERY_TYPE: + return "Bad Recovery Type"; + case AVDTP_BAD_MEDIA_TRANSPORT_FORMAT: + return "Bad Media Transport Format"; + case AVDTP_BAD_RECOVERY_FORMAT: + return "Bad Recovery Format"; + case AVDTP_BAD_ROHC_FORMAT: + return "Bad Header Compression Format"; + case AVDTP_BAD_CP_FORMAT: + return "Bad Content Protection Format"; + case AVDTP_BAD_MULTIPLEXING_FORMAT: + return "Bad Multiplexing Format"; + case AVDTP_UNSUPPORTED_CONFIGURATION: + return "Configuration not supported"; + case AVDTP_BAD_STATE: + return "Bad State"; + default: + return "Unknown error"; + } +} + +avdtp_state_t avdtp_sep_get_state(struct avdtp_local_sep *sep) +{ + return sep->state; +} + +gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream) +{ + return g_slist_find(session->streams, stream) ? TRUE : FALSE; +}
diff --git a/bluez/android/avdtp.h b/bluez/android/avdtp.h new file mode 100644 index 0000000..e8d1907 --- /dev/null +++ b/bluez/android/avdtp.h
@@ -0,0 +1,282 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2006-2010 Nokia Corporation + * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +struct avdtp; +struct avdtp_stream; +struct avdtp_local_sep; +struct avdtp_remote_sep; +struct avdtp_error { + uint8_t category; + union { + uint8_t error_code; + int posix_errno; + } err; +}; + +/* SEP capability categories */ +#define AVDTP_MEDIA_TRANSPORT 0x01 +#define AVDTP_REPORTING 0x02 +#define AVDTP_RECOVERY 0x03 +#define AVDTP_CONTENT_PROTECTION 0x04 +#define AVDTP_HEADER_COMPRESSION 0x05 +#define AVDTP_MULTIPLEXING 0x06 +#define AVDTP_MEDIA_CODEC 0x07 +#define AVDTP_DELAY_REPORTING 0x08 +#define AVDTP_ERRNO 0xff + +/* AVDTP error definitions */ +#define AVDTP_BAD_HEADER_FORMAT 0x01 +#define AVDTP_BAD_LENGTH 0x11 +#define AVDTP_BAD_ACP_SEID 0x12 +#define AVDTP_SEP_IN_USE 0x13 +#define AVDTP_SEP_NOT_IN_USE 0x14 +#define AVDTP_BAD_SERV_CATEGORY 0x17 +#define AVDTP_BAD_PAYLOAD_FORMAT 0x18 +#define AVDTP_NOT_SUPPORTED_COMMAND 0x19 +#define AVDTP_INVALID_CAPABILITIES 0x1A +#define AVDTP_BAD_RECOVERY_TYPE 0x22 +#define AVDTP_BAD_MEDIA_TRANSPORT_FORMAT 0x23 +#define AVDTP_BAD_RECOVERY_FORMAT 0x25 +#define AVDTP_BAD_ROHC_FORMAT 0x26 +#define AVDTP_BAD_CP_FORMAT 0x27 +#define AVDTP_BAD_MULTIPLEXING_FORMAT 0x28 +#define AVDTP_UNSUPPORTED_CONFIGURATION 0x29 +#define AVDTP_BAD_STATE 0x31 + +/* SEP types definitions */ +#define AVDTP_SEP_TYPE_SOURCE 0x00 +#define AVDTP_SEP_TYPE_SINK 0x01 + +/* Media types definitions */ +#define AVDTP_MEDIA_TYPE_AUDIO 0x00 +#define AVDTP_MEDIA_TYPE_VIDEO 0x01 +#define AVDTP_MEDIA_TYPE_MULTIMEDIA 0x02 + +typedef enum { + AVDTP_STATE_IDLE, + AVDTP_STATE_CONFIGURED, + AVDTP_STATE_OPEN, + AVDTP_STATE_STREAMING, + AVDTP_STATE_CLOSING, + AVDTP_STATE_ABORTING, +} avdtp_state_t; + +struct avdtp_service_capability { + uint8_t category; + uint8_t length; + uint8_t data[0]; +} __attribute__ ((packed)); + +#if __BYTE_ORDER == __LITTLE_ENDIAN + +struct avdtp_media_codec_capability { + uint8_t rfa0:4; + uint8_t media_type:4; + uint8_t media_codec_type; + uint8_t data[0]; +} __attribute__ ((packed)); + +#elif __BYTE_ORDER == __BIG_ENDIAN + +struct avdtp_media_codec_capability { + uint8_t media_type:4; + uint8_t rfa0:4; + uint8_t media_codec_type; + uint8_t data[0]; +} __attribute__ ((packed)); + +#else +#error "Unknown byte order" +#endif + +typedef void (*avdtp_stream_state_cb) (struct avdtp_stream *stream, + avdtp_state_t old_state, + avdtp_state_t new_state, + struct avdtp_error *err, + void *user_data); + +typedef void (*avdtp_set_configuration_cb) (struct avdtp *session, + struct avdtp_stream *stream, + struct avdtp_error *err); + +/* Callbacks for when a reply is received to a command that we sent */ +struct avdtp_sep_cfm { + void (*set_configuration) (struct avdtp *session, + struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, + struct avdtp_error *err, + void *user_data); + void (*get_configuration) (struct avdtp *session, + struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, + struct avdtp_error *err, + void *user_data); + void (*open) (struct avdtp *session, struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, struct avdtp_error *err, + void *user_data); + void (*start) (struct avdtp *session, struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, struct avdtp_error *err, + void *user_data); + void (*suspend) (struct avdtp *session, struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, + struct avdtp_error *err, void *user_data); + void (*close) (struct avdtp *session, struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, + struct avdtp_error *err, void *user_data); + void (*abort) (struct avdtp *session, struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, + struct avdtp_error *err, void *user_data); + void (*reconfigure) (struct avdtp *session, + struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, + struct avdtp_error *err, void *user_data); + void (*delay_report) (struct avdtp *session, struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, + struct avdtp_error *err, void *user_data); +}; + +/* Callbacks for indicating when we received a new command. The return value + * indicates whether the command should be rejected or accepted */ +struct avdtp_sep_ind { + gboolean (*get_capability) (struct avdtp *session, + struct avdtp_local_sep *sep, + GSList **caps, uint8_t *err, + void *user_data); + gboolean (*set_configuration) (struct avdtp *session, + struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, + GSList *caps, + avdtp_set_configuration_cb cb, + void *user_data); + gboolean (*get_configuration) (struct avdtp *session, + struct avdtp_local_sep *lsep, + uint8_t *err, void *user_data); + gboolean (*open) (struct avdtp *session, struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, uint8_t *err, + void *user_data); + gboolean (*start) (struct avdtp *session, struct avdtp_local_sep *lsep, + struct avdtp_stream *stream, uint8_t *err, + void *user_data); + gboolean (*suspend) (struct avdtp *session, + struct avdtp_local_sep *sep, + struct avdtp_stream *stream, uint8_t *err, + void *user_data); + gboolean (*close) (struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, uint8_t *err, + void *user_data); + void (*abort) (struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, uint8_t *err, + void *user_data); + gboolean (*reconfigure) (struct avdtp *session, + struct avdtp_local_sep *lsep, + uint8_t *err, void *user_data); + gboolean (*delayreport) (struct avdtp *session, + struct avdtp_local_sep *lsep, + uint8_t rseid, uint16_t delay, + uint8_t *err, void *user_data); +}; + +typedef void (*avdtp_discover_cb_t) (struct avdtp *session, GSList *seps, + struct avdtp_error *err, void *user_data); +typedef void (*avdtp_disconnect_cb_t) (void *user_data); + +struct avdtp *avdtp_new(int fd, size_t imtu, size_t omtu, uint16_t version); + +unsigned int avdtp_add_disconnect_cb(struct avdtp *session, + avdtp_disconnect_cb_t cb, + void *user_data); +gboolean avdtp_remove_disconnect_cb(struct avdtp *session, unsigned int id); + +void avdtp_shutdown(struct avdtp *session); + +void avdtp_unref(struct avdtp *session); +struct avdtp *avdtp_ref(struct avdtp *session); + +struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category, + void *data, int size); + +struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep); + +int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb, + void *user_data); + +gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream); + +unsigned int avdtp_stream_add_cb(struct avdtp *session, + struct avdtp_stream *stream, + avdtp_stream_state_cb cb, void *data); +gboolean avdtp_stream_remove_cb(struct avdtp *session, + struct avdtp_stream *stream, + unsigned int id); + +gboolean avdtp_stream_set_transport(struct avdtp_stream *stream, int fd, + size_t imtu, size_t omtu); +gboolean avdtp_stream_get_transport(struct avdtp_stream *stream, int *sock, + uint16_t *imtu, uint16_t *omtu, + GSList **caps); +struct avdtp_service_capability *avdtp_stream_get_codec( + struct avdtp_stream *stream); +gboolean avdtp_stream_has_capabilities(struct avdtp_stream *stream, + GSList *caps); +struct avdtp_remote_sep *avdtp_stream_get_remote_sep( + struct avdtp_stream *stream); + +int avdtp_set_configuration(struct avdtp *session, + struct avdtp_remote_sep *rsep, + struct avdtp_local_sep *lsep, + GSList *caps, + struct avdtp_stream **stream); + +int avdtp_get_configuration(struct avdtp *session, + struct avdtp_stream *stream); + +int avdtp_open(struct avdtp *session, struct avdtp_stream *stream); +int avdtp_start(struct avdtp *session, struct avdtp_stream *stream); +int avdtp_suspend(struct avdtp *session, struct avdtp_stream *stream); +int avdtp_close(struct avdtp *session, struct avdtp_stream *stream, + gboolean immediate); +int avdtp_abort(struct avdtp *session, struct avdtp_stream *stream); +int avdtp_delay_report(struct avdtp *session, struct avdtp_stream *stream, + uint16_t delay); + +struct avdtp_local_sep *avdtp_register_sep(uint8_t type, uint8_t media_type, + uint8_t codec_type, + gboolean delay_reporting, + struct avdtp_sep_ind *ind, + struct avdtp_sep_cfm *cfm, + void *user_data); + +/* Find a matching pair of local and remote SEP ID's */ +struct avdtp_remote_sep *avdtp_find_remote_sep(struct avdtp *session, + struct avdtp_local_sep *lsep); + +int avdtp_unregister_sep(struct avdtp_local_sep *sep); + +avdtp_state_t avdtp_sep_get_state(struct avdtp_local_sep *sep); + +void avdtp_error_init(struct avdtp_error *err, uint8_t type, int id); +const char *avdtp_strerror(struct avdtp_error *err); +uint8_t avdtp_error_category(struct avdtp_error *err); +int avdtp_error_error_code(struct avdtp_error *err); +int avdtp_error_posix_errno(struct avdtp_error *err);
diff --git a/bluez/android/avrcp-lib.c b/bluez/android/avrcp-lib.c new file mode 100644 index 0000000..c7b8b6a --- /dev/null +++ b/bluez/android/avrcp-lib.c
@@ -0,0 +1,1023 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdbool.h> +#include <glib.h> +#include <errno.h> + +#include "lib/bluetooth.h" + +#include "src/shared/util.h" +#include "src/log.h" + +#include "avctp.h" +#include "avrcp-lib.h" + + +/* Packet types */ +#define AVRCP_PACKET_TYPE_SINGLE 0x00 +#define AVRCP_PACKET_TYPE_START 0x01 +#define AVRCP_PACKET_TYPE_CONTINUING 0x02 +#define AVRCP_PACKET_TYPE_END 0x03 + +#define AVRCP_CHARSET_UTF8 106 + +#if __BYTE_ORDER == __LITTLE_ENDIAN + +struct avrcp_header { + uint8_t company_id[3]; + uint8_t pdu_id; + uint8_t packet_type:2; + uint8_t rsvd:6; + uint16_t params_len; + uint8_t params[0]; +} __attribute__ ((packed)); +#define AVRCP_HEADER_LENGTH 7 + +#elif __BYTE_ORDER == __BIG_ENDIAN + +struct avrcp_header { + uint8_t company_id[3]; + uint8_t pdu_id; + uint8_t rsvd:6; + uint8_t packet_type:2; + uint16_t params_len; + uint8_t params[0]; +} __attribute__ ((packed)); +#define AVRCP_HEADER_LENGTH 7 + +#else +#error "Unknown byte order" +#endif + +struct avrcp { + struct avctp *conn; + struct avrcp_player *player; + + size_t tx_mtu; + uint8_t *tx_buf; + + const struct avrcp_control_handler *control_handlers; + void *control_data; + unsigned int control_id; + + const struct avrcp_passthrough_handler *passthrough_handlers; + void *passthrough_data; + unsigned int passthrough_id; + + avrcp_destroy_cb_t destroy; + void *destroy_data; +}; + +struct avrcp_player { + const struct avrcp_control_ind *ind; + const struct avrcp_control_cfm *cfm; + + void *user_data; +}; + +static inline uint32_t ntoh24(const uint8_t src[3]) +{ + return src[0] << 16 | src[1] << 8 | src[2]; +} + +static inline void hton24(uint8_t dst[3], uint32_t src) +{ + dst[0] = (src & 0xff0000) >> 16; + dst[1] = (src & 0x00ff00) >> 8; + dst[2] = (src & 0x0000ff); +} + +void avrcp_shutdown(struct avrcp *session) +{ + if (session->conn) { + if (session->control_id > 0) + avctp_unregister_pdu_handler(session->conn, + session->control_id); + if (session->passthrough_id > 0) + avctp_unregister_passthrough_handler(session->conn, + session->passthrough_id); + + /* clear destroy callback that would call shutdown again */ + avctp_set_destroy_cb(session->conn, NULL, NULL); + avctp_shutdown(session->conn); + } + + if (session->destroy) + session->destroy(session->destroy_data); + + g_free(session->player); + g_free(session->tx_buf); + g_free(session); +} + +static ssize_t handle_vendordep_pdu(struct avctp *conn, uint8_t transaction, + uint8_t *code, uint8_t *subunit, + uint8_t *operands, size_t operand_count, + void *user_data) +{ + struct avrcp *session = user_data; + const struct avrcp_control_handler *handler; + struct avrcp_header *pdu = (void *) operands; + uint32_t company_id = ntoh24(pdu->company_id); + uint16_t params_len = ntohs(pdu->params_len); + ssize_t ret; + + if (company_id != IEEEID_BTSIG) { + *code = AVC_CTYPE_NOT_IMPLEMENTED; + return 0; + } + + DBG("AVRCP PDU 0x%02X, len 0x%04X", pdu->pdu_id, params_len); + + pdu->packet_type = 0; + pdu->rsvd = 0; + + if (operand_count < AVRCP_HEADER_LENGTH) { + pdu->params[0] = AVRCP_STATUS_INVALID_COMMAND; + goto reject; + } + + if (!session->control_handlers) + goto reject; + + for (handler = session->control_handlers; handler->id; handler++) { + if (handler->id == pdu->pdu_id) + break; + } + + if (handler->id != pdu->pdu_id || handler->code != *code) { + pdu->params[0] = AVRCP_STATUS_INVALID_COMMAND; + goto reject; + } + + if (!handler->func) { + pdu->params[0] = AVRCP_STATUS_INVALID_PARAM; + goto reject; + } + + ret = handler->func(session, transaction, params_len, pdu->params, + session->control_data); + if (ret < 0) { + switch (ret) { + case -EAGAIN: + return ret; + case -ENOSYS: + pdu->params[0] = AVRCP_STATUS_INVALID_COMMAND; + goto reject; + case -EINVAL: + pdu->params[0] = AVRCP_STATUS_INVALID_PARAM; + goto reject; + default: + pdu->params[0] = AVRCP_STATUS_INTERNAL_ERROR; + goto reject; + } + } + + *code = handler->rsp; + pdu->params_len = htons(ret); + + return AVRCP_HEADER_LENGTH + ret; + +reject: + pdu->params_len = htons(1); + *code = AVC_CTYPE_REJECTED; + + return AVRCP_HEADER_LENGTH + 1; +} + +static bool handle_passthrough_pdu(struct avctp *conn, uint8_t op, + bool pressed, void *user_data) +{ + struct avrcp *session = user_data; + const struct avrcp_passthrough_handler *handler; + + if (!session->passthrough_handlers) + return false; + + for (handler = session->passthrough_handlers; handler->func; + handler++) { + if (handler->op == op) + break; + } + + if (handler->func == NULL) + return false; + + return handler->func(session, pressed, session->passthrough_data); +} + +static void disconnect_cb(void *data) +{ + struct avrcp *session = data; + + session->conn = NULL; + + avrcp_shutdown(session); +} + +struct avrcp *avrcp_new(int fd, size_t imtu, size_t omtu, uint16_t version) +{ + struct avrcp *session; + + session = g_new0(struct avrcp, 1); + + session->conn = avctp_new(fd, imtu, omtu, version); + if (!session->conn) { + g_free(session); + return NULL; + } + + session->tx_mtu = omtu; + session->tx_buf = g_malloc(omtu); + + session->passthrough_id = avctp_register_passthrough_handler( + session->conn, + handle_passthrough_pdu, + session); + session->control_id = avctp_register_pdu_handler(session->conn, + AVC_OP_VENDORDEP, + handle_vendordep_pdu, + session); + + avctp_set_destroy_cb(session->conn, disconnect_cb, session); + + return session; +} + +void avrcp_set_destroy_cb(struct avrcp *session, avrcp_destroy_cb_t cb, + void *user_data) +{ + session->destroy = cb; + session->destroy_data = user_data; +} + +static ssize_t get_capabilities(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + + if (!params || params_len != 1) + return -EINVAL; + + switch (params[0]) { + case CAP_COMPANY_ID: + params[1] = 1; + hton24(¶ms[2], IEEEID_BTSIG); + return 5; + case CAP_EVENTS_SUPPORTED: + if (!player->ind || !player->ind->get_capabilities) + return -ENOSYS; + return player->ind->get_capabilities(session, transaction, + player->user_data); + } + + return -EINVAL; +} + +static ssize_t list_attributes(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + + DBG(""); + + if (!player->ind || !player->ind->list_attributes) + return -ENOSYS; + + return player->ind->list_attributes(session, transaction, + player->user_data); +} + +static bool check_attributes(uint8_t number, const uint8_t *attrs) +{ + int i; + + for (i = 0; i < number; i++) { + if (attrs[i] > AVRCP_ATTRIBUTE_LAST || + attrs[i] == AVRCP_ATTRIBUTE_ILEGAL) + return false; + } + + return true; +} + +static ssize_t get_attribute_text(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + + DBG(""); + + if (!params || params_len != 1 + params[0]) + return -EINVAL; + + if (!check_attributes(params[0], ¶ms[1])) + return -EINVAL; + + if (!player->ind || !player->ind->get_attribute_text) + return -ENOSYS; + + return player->ind->get_attribute_text(session, transaction, params[0], + ¶ms[1], player->user_data); +} + +static ssize_t list_values(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + + DBG(""); + + if (!params || params_len != 1) + return -EINVAL; + + if (params[0] > AVRCP_ATTRIBUTE_LAST || + params[0] == AVRCP_ATTRIBUTE_ILEGAL) + return -EINVAL; + + if (!player->ind || !player->ind->list_values) + return -ENOSYS; + + return player->ind->list_values(session, transaction, params[0], + player->user_data); +} + +static bool check_value(uint8_t attr, uint8_t number, const uint8_t *values) +{ + int i; + + for (i = 0; i < number; i++) { + /* Check for invalid value */ + switch (attr) { + case AVRCP_ATTRIBUTE_EQUALIZER: + if (values[i] < AVRCP_EQUALIZER_OFF || + values[i] > AVRCP_EQUALIZER_ON) + return false; + case AVRCP_ATTRIBUTE_REPEAT_MODE: + if (values[i] < AVRCP_REPEAT_MODE_OFF || + values[i] > AVRCP_REPEAT_MODE_GROUP) + return false; + case AVRCP_ATTRIBUTE_SHUFFLE: + if (values[i] < AVRCP_SHUFFLE_OFF || + values[i] > AVRCP_SHUFFLE_GROUP) + return false; + case AVRCP_ATTRIBUTE_SCAN: + if (values[i] < AVRCP_SCAN_OFF || + values[i] > AVRCP_SCAN_GROUP) + return false; + } + } + + return true; +} + +static ssize_t get_value_text(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + + DBG(""); + + if (params_len != 2 + params[1]) + return -EINVAL; + + if (params[0] > AVRCP_ATTRIBUTE_LAST || + params[0] == AVRCP_ATTRIBUTE_ILEGAL) + return -EINVAL; + + if (!check_value(params[0], params[1], ¶ms[2])) + return -EINVAL; + + if (!player->ind || !player->ind->get_value_text) + return -ENOSYS; + + return player->ind->get_value_text(session, transaction, params[0], + params[1], ¶ms[2], + player->user_data); +} + +static ssize_t get_value(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + + DBG(""); + + if (!params || params_len < 1 + params[0]) + return -EINVAL; + + if (!check_attributes(params[0], ¶ms[1])) + return -EINVAL; + + if (!player->ind || !player->ind->get_value) + return -ENOSYS; + + return player->ind->get_value(session, transaction, params[0], + ¶ms[1], player->user_data); +} + +static ssize_t set_value(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + int i; + + DBG(""); + + if (!params || params_len != params[0] * 2 + 1) + return -EINVAL; + + for (i = 0; i < params[0]; i++) { + uint8_t attr = params[i * 2 + 1]; + uint8_t val = params[i * 2 + 2]; + + if (!check_value(attr, 1, &val)) + return -EINVAL; + } + + if (!player->ind || !player->ind->set_value) + return -ENOSYS; + + return player->ind->set_value(session, transaction, params[0], + ¶ms[1], player->user_data); +} + +static ssize_t get_play_status(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + + DBG(""); + + if (!player->ind || !player->ind->get_play_status) + return -ENOSYS; + + return player->ind->get_play_status(session, transaction, + player->user_data); +} + +static ssize_t get_element_attributes(struct avrcp *session, + uint8_t transaction, + uint16_t params_len, + uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + uint64_t uid; + uint8_t number; + uint32_t attrs[AVRCP_MEDIA_ATTRIBUTE_LAST]; + int i; + + DBG(""); + + if (!params || params_len != 9 + params[8] * 4) + return -EINVAL; + + uid = get_be64(params); + number = params[8]; + + for (i = 0; i < number; i++) { + attrs[i] = get_be32(¶ms[9 + i * 4]); + + if (attrs[i] == AVRCP_MEDIA_ATTRIBUTE_ILLEGAL || + attrs[i] > AVRCP_MEDIA_ATTRIBUTE_LAST) + return -EINVAL; + } + + if (!player->ind || !player->ind->get_element_attributes) + return -ENOSYS; + + return player->ind->get_element_attributes(session, transaction, uid, + number, attrs, + player->user_data); +} + +static ssize_t register_notification(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + uint32_t interval; + + DBG(""); + + if (!params || params_len != 5) + return -EINVAL; + + if (!player->ind || !player->ind->register_notification) + return -ENOSYS; + + interval = get_be32(¶ms[1]); + + return player->ind->register_notification(session, transaction, + params[0], interval, + player->user_data); +} + +static ssize_t set_addressed(struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, + void *user_data) +{ + struct avrcp_player *player = user_data; + uint16_t id; + + DBG(""); + + if (!params || params_len != 2) + return -EINVAL; + + if (!player->ind || !player->ind->set_addressed) + return -ENOSYS; + + id = get_be16(params); + + return player->ind->set_addressed(session, transaction, id, + player->user_data); +} + +static const struct avrcp_control_handler player_handlers[] = { + { AVRCP_GET_CAPABILITIES, + AVC_CTYPE_STATUS, AVC_CTYPE_STABLE, + get_capabilities }, + { AVRCP_LIST_PLAYER_ATTRIBUTES, + AVC_CTYPE_STATUS, AVC_CTYPE_STABLE, + list_attributes }, + { AVRCP_GET_PLAYER_ATTRIBUTE_TEXT, + AVC_CTYPE_STATUS, AVC_CTYPE_STABLE, + get_attribute_text }, + { AVRCP_LIST_PLAYER_VALUES, + AVC_CTYPE_STATUS, AVC_CTYPE_STABLE, + list_values }, + { AVRCP_GET_PLAYER_VALUE_TEXT, + AVC_CTYPE_STATUS, AVC_CTYPE_STABLE, + get_value_text }, + { AVRCP_GET_CURRENT_PLAYER_VALUE, + AVC_CTYPE_STATUS, AVC_CTYPE_STABLE, + get_value }, + { AVRCP_SET_PLAYER_VALUE, + AVC_CTYPE_CONTROL, AVC_CTYPE_STABLE, + set_value }, + { AVRCP_GET_PLAY_STATUS, + AVC_CTYPE_STATUS, AVC_CTYPE_STABLE, + get_play_status }, + { AVRCP_GET_ELEMENT_ATTRIBUTES, + AVC_CTYPE_STATUS, AVC_CTYPE_STABLE, + get_element_attributes }, + { AVRCP_REGISTER_NOTIFICATION, + AVC_CTYPE_NOTIFY, AVC_CTYPE_INTERIM, + register_notification }, + { AVRCP_SET_ADDRESSED_PLAYER, + AVC_CTYPE_CONTROL, AVC_CTYPE_STABLE, + set_addressed }, + { }, +}; + +static void avrcp_set_control_handlers(struct avrcp *session, + const struct avrcp_control_handler *handlers, + void *user_data) +{ + session->control_handlers = handlers; + session->control_data = user_data; +} + +void avrcp_register_player(struct avrcp *session, + const struct avrcp_control_ind *ind, + const struct avrcp_control_cfm *cfm, + void *user_data) +{ + struct avrcp_player *player; + + player = g_new0(struct avrcp_player, 1); + player->ind = ind; + player->cfm = cfm; + player->user_data = user_data; + + avrcp_set_control_handlers(session, player_handlers, player); + session->player = player; +} + +void avrcp_set_passthrough_handlers(struct avrcp *session, + const struct avrcp_passthrough_handler *handlers, + void *user_data) +{ + session->passthrough_handlers = handlers; + session->passthrough_data = user_data; +} + +int avrcp_init_uinput(struct avrcp *session, const char *name, + const char *address) +{ + return avctp_init_uinput(session->conn, name, address); +} + +int avrcp_send(struct avrcp *session, uint8_t transaction, uint8_t code, + uint8_t subunit, uint8_t pdu_id, + uint8_t *params, size_t params_len) +{ + struct avrcp_header *pdu = (void *) session->tx_buf; + size_t len = sizeof(*pdu); + + memset(pdu, 0, len); + + hton24(pdu->company_id, IEEEID_BTSIG); + pdu->pdu_id = pdu_id; + pdu->packet_type = AVRCP_PACKET_TYPE_SINGLE; + + if (params_len > 0) { + len += params_len; + + if (len > session->tx_mtu) + return -ENOBUFS; + + memcpy(pdu->params, params, params_len); + pdu->params_len = htons(params_len); + } + + return avctp_send_vendordep(session->conn, transaction, code, subunit, + session->tx_buf, len); +} + +static int avrcp_send_req(struct avrcp *session, uint8_t code, uint8_t subunit, + uint8_t pdu_id, uint8_t *params, + size_t params_len, avctp_rsp_cb func, + void *user_data) +{ + struct avrcp_header *pdu = (void *) session->tx_buf; + size_t len = sizeof(*pdu); + + memset(pdu, 0, len); + + hton24(pdu->company_id, IEEEID_BTSIG); + pdu->pdu_id = pdu_id; + pdu->packet_type = AVRCP_PACKET_TYPE_SINGLE; + + if (params_len > 0) { + len += params_len; + + if (len > session->tx_mtu) + return -ENOBUFS; + + memcpy(pdu->params, params, params_len); + pdu->params_len = htons(params_len); + } + + return avctp_send_vendordep_req(session->conn, code, subunit, + session->tx_buf, len, func, user_data); +} + +int avrcp_get_capabilities(struct avrcp *session, uint8_t param, + avctp_rsp_cb func, void *user_data) +{ + return avrcp_send_req(session, AVC_CTYPE_STATUS, AVC_SUBUNIT_PANEL, + AVRCP_GET_CAPABILITIES, ¶m, sizeof(param), + func, user_data); +} + +int avrcp_register_notification(struct avrcp *session, uint8_t event, + uint32_t interval, avctp_rsp_cb func, + void *user_data) +{ + uint8_t params[5]; + + params[0] = event; + put_be32(interval, ¶ms[1]); + + return avrcp_send_req(session, AVC_CTYPE_NOTIFY, AVC_SUBUNIT_PANEL, + AVRCP_REGISTER_NOTIFICATION, + params, sizeof(params), + func, user_data); +} + +int avrcp_list_player_attributes(struct avrcp *session, avctp_rsp_cb func, + void *user_data) +{ + return avrcp_send_req(session, AVC_CTYPE_STATUS, AVC_SUBUNIT_PANEL, + AVRCP_LIST_PLAYER_ATTRIBUTES, NULL, 0, + func, user_data); +} + +int avrcp_get_player_attribute_text(struct avrcp *session, uint8_t *attributes, + uint8_t attr_len, avctp_rsp_cb func, + void *user_data) +{ + return avrcp_send_req(session, AVC_CTYPE_STATUS, AVC_SUBUNIT_PANEL, + AVRCP_GET_PLAYER_ATTRIBUTE_TEXT, attributes, + attr_len, func, user_data); +} + +int avrcp_get_current_player_value(struct avrcp *session, uint8_t *attrs, + uint8_t attr_count, avctp_rsp_cb func, + void *user_data) + +{ + uint8_t buf[AVRCP_ATTRIBUTE_LAST + 1]; + + if (attr_count > AVRCP_ATTRIBUTE_LAST) + return -EINVAL; + + if (attrs && attr_count) { + buf[0] = attr_count; + memcpy(buf + 1, attrs, attr_count); + } + + return avrcp_send_req(session, AVC_CTYPE_STATUS, AVC_SUBUNIT_PANEL, + AVRCP_GET_CURRENT_PLAYER_VALUE, buf, + attr_count + 1, func, user_data); +} + +int avrcp_set_player_value(struct avrcp *session, uint8_t *attributes, + uint8_t attr_count, uint8_t *values, + avctp_rsp_cb func, void *user_data) +{ + uint8_t buf[2 * AVRCP_ATTRIBUTE_LAST + 1]; + int i; + + if (attr_count > AVRCP_ATTRIBUTE_LAST) + return -EINVAL; + + buf[0] = attr_count; + + for (i = 0; i < attr_count; i++) { + buf[i * 2 + 1] = attributes[i]; + buf[i * 2 + 2] = values[i]; + } + + return avrcp_send_req(session, AVC_CTYPE_CONTROL, AVC_SUBUNIT_PANEL, + AVRCP_SET_PLAYER_VALUE, buf, 2 * attr_count + 1, + func, user_data); +} + +int avrcp_get_play_status(struct avrcp *session, avctp_rsp_cb func, + void *user_data) +{ + return avrcp_send_req(session, AVC_CTYPE_STATUS, AVC_SUBUNIT_PANEL, + AVRCP_GET_PLAY_STATUS, NULL, 0, func, + user_data); +} + +int avrcp_set_volume(struct avrcp *session, uint8_t volume, avctp_rsp_cb func, + void *user_data) +{ + return avrcp_send_req(session, AVC_CTYPE_CONTROL, AVC_SUBUNIT_PANEL, + AVRCP_SET_ABSOLUTE_VOLUME, + &volume, sizeof(volume), + func, user_data); +} + +int avrcp_get_element_attributes(struct avrcp *session, avctp_rsp_cb func, + void *user_data) +{ + uint8_t buf[9]; + + /* This returns all attributes */ + memset(buf, 0, sizeof(buf)); + + return avrcp_send_req(session, AVC_CTYPE_STATUS, AVC_SUBUNIT_PANEL, + AVRCP_GET_ELEMENT_ATTRIBUTES, buf, sizeof(buf), + func, user_data); +} + +int avrcp_set_addressed_player(struct avrcp *session, uint16_t player_id, + avctp_rsp_cb func, void *user_data) +{ + uint8_t params[2]; + + put_be16(player_id, params); + + return avrcp_send_req(session, AVC_CTYPE_CONTROL, AVC_SUBUNIT_PANEL, + AVRCP_SET_ADDRESSED_PLAYER, params, + sizeof(params), func, user_data); +} + +int avrcp_get_capabilities_rsp(struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *events) +{ + uint8_t pdu[AVRCP_EVENT_LAST + 1]; + + if (number > AVRCP_EVENT_LAST) + return -EINVAL; + + pdu[0] = number; + memcpy(&pdu[1], events, number); + + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_GET_CAPABILITIES, + pdu, number + 1); +} + +int avrcp_list_player_attributes_rsp(struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *attrs) +{ + uint8_t pdu[AVRCP_ATTRIBUTE_LAST + 1]; + + if (number > AVRCP_ATTRIBUTE_LAST) + return -EINVAL; + + pdu[0] = number; + + if (number > 0) + memcpy(&pdu[1], attrs, number); + + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_LIST_PLAYER_ATTRIBUTES, + pdu, number + 1); +} + +int avrcp_get_player_attribute_text_rsp(struct avrcp *session, + uint8_t transaction, uint8_t number, + uint8_t *attrs, const char **text) +{ + uint8_t pdu[AVRCP_ATTRIBUTE_LAST * (4 + 255)]; + uint8_t *ptr; + uint16_t length; + int i; + + if (number > AVRCP_ATTRIBUTE_LAST) + return -EINVAL; + + pdu[0] = number; + length = 1; + for (i = 0, ptr = &pdu[1]; i < number; i++) { + uint8_t len = 0; + + if (attrs[i] > AVRCP_ATTRIBUTE_LAST || + attrs[i] == AVRCP_ATTRIBUTE_ILEGAL) + return -EINVAL; + + if (text[i]) + len = strlen(text[i]); + + ptr[0] = attrs[i]; + put_be16(AVRCP_CHARSET_UTF8, &ptr[1]); + ptr[3] = len; + memcpy(&ptr[4], text[i], len); + ptr += 4 + len; + length += 4 + len; + } + + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_GET_PLAYER_ATTRIBUTE_TEXT, + pdu, length); +} + +int avrcp_list_player_values_rsp(struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *values) +{ + uint8_t pdu[AVRCP_ATTRIBUTE_LAST + 1]; + + if (number > AVRCP_ATTRIBUTE_LAST) + return -EINVAL; + + pdu[0] = number; + memcpy(&pdu[1], values, number); + + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_LIST_PLAYER_VALUES, + pdu, number + 1); +} + +int avrcp_get_play_status_rsp(struct avrcp *session, uint8_t transaction, + uint32_t position, uint32_t duration, + uint8_t status) +{ + uint8_t pdu[9]; + + put_be32(position, &pdu[0]); + put_be32(duration, &pdu[4]); + pdu[8] = status; + + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_GET_PLAY_STATUS, + pdu, sizeof(pdu)); +} + +int avrcp_get_player_values_text_rsp(struct avrcp *session, + uint8_t transaction, uint8_t number, + uint8_t *values, const char **text) +{ + uint8_t pdu[AVRCP_ATTRIBUTE_LAST * (4 + 255)]; + uint8_t *ptr; + uint16_t length; + int i; + + if (number > AVRCP_ATTRIBUTE_LAST) + return -EINVAL; + + pdu[0] = number; + length = 1; + for (i = 0, ptr = &pdu[1]; i < number; i++) { + uint8_t len = 0; + + if (text[i]) + len = strlen(text[i]); + + ptr[0] = values[i]; + put_be16(AVRCP_CHARSET_UTF8, &ptr[1]); + ptr[3] = len; + memcpy(&ptr[4], text[i], len); + ptr += 4 + len; + length += 4 + len; + } + + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_GET_PLAYER_VALUE_TEXT, + pdu, length); +} + +int avrcp_get_current_player_value_rsp(struct avrcp *session, + uint8_t transaction, uint8_t number, + uint8_t *attrs, uint8_t *values) +{ + uint8_t pdu[AVRCP_ATTRIBUTE_LAST * 2 + 1]; + uint8_t *ptr; + uint16_t length; + int i; + + if (number > AVRCP_ATTRIBUTE_LAST) + return -EINVAL; + + pdu[0] = number; + length = 1; + for (i = 0, ptr = &pdu[1]; i < number; i++) { + ptr[0] = attrs[i]; + ptr[1] = values[i]; + ptr += 2; + length += 2; + } + + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_GET_CURRENT_PLAYER_VALUE, + pdu, length); +} + +int avrcp_get_element_attrs_rsp(struct avrcp *session, uint8_t transaction, + uint8_t *params, size_t params_len) +{ + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_GET_ELEMENT_ATTRIBUTES, + params, params_len); +} + +int avrcp_register_notification_rsp(struct avrcp *session, uint8_t transaction, + uint8_t code, uint8_t *params, + size_t params_len) +{ + return avrcp_send(session, transaction, code, + AVC_SUBUNIT_PANEL, AVRCP_REGISTER_NOTIFICATION, + params, params_len); +} + +int avrcp_set_addressed_player_rsp(struct avrcp *session, uint8_t transaction, + uint8_t status) +{ + return avrcp_send(session, transaction, AVC_CTYPE_STABLE, + AVC_SUBUNIT_PANEL, AVRCP_SET_ADDRESSED_PLAYER, + &status, sizeof(status)); +} + +int avrcp_send_passthrough(struct avrcp *session, uint32_t vendor, uint8_t op) +{ + uint8_t params[5]; + + if (!vendor) + return avctp_send_passthrough(session->conn, op, NULL, 0); + + hton24(params, vendor); + put_be16(op, ¶ms[3]); + + return avctp_send_passthrough(session->conn, AVC_VENDOR_UNIQUE, params, + sizeof(params)); +}
diff --git a/bluez/android/avrcp-lib.h b/bluez/android/avrcp-lib.h new file mode 100644 index 0000000..d9acb7d --- /dev/null +++ b/bluez/android/avrcp-lib.h
@@ -0,0 +1,243 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* Control PDU ids */ +#define AVRCP_GET_CAPABILITIES 0x10 +#define AVRCP_LIST_PLAYER_ATTRIBUTES 0X11 +#define AVRCP_LIST_PLAYER_VALUES 0x12 +#define AVRCP_GET_CURRENT_PLAYER_VALUE 0x13 +#define AVRCP_SET_PLAYER_VALUE 0x14 +#define AVRCP_GET_PLAYER_ATTRIBUTE_TEXT 0x15 +#define AVRCP_GET_PLAYER_VALUE_TEXT 0x16 +#define AVRCP_DISPLAYABLE_CHARSET 0x17 +#define AVRCP_CT_BATTERY_STATUS 0x18 +#define AVRCP_GET_ELEMENT_ATTRIBUTES 0x20 +#define AVRCP_GET_PLAY_STATUS 0x30 +#define AVRCP_REGISTER_NOTIFICATION 0x31 +#define AVRCP_REQUEST_CONTINUING 0x40 +#define AVRCP_ABORT_CONTINUING 0x41 +#define AVRCP_SET_ABSOLUTE_VOLUME 0x50 +#define AVRCP_SET_ADDRESSED_PLAYER 0x60 +#define AVRCP_SET_BROWSED_PLAYER 0x70 +#define AVRCP_GET_FOLDER_ITEMS 0x71 +#define AVRCP_CHANGE_PATH 0x72 +#define AVRCP_GET_ITEM_ATTRIBUTES 0x73 +#define AVRCP_PLAY_ITEM 0x74 +#define AVRCP_SEARCH 0x80 +#define AVRCP_ADD_TO_NOW_PLAYING 0x90 +#define AVRCP_GENERAL_REJECT 0xA0 + +/* Notification events */ +#define AVRCP_EVENT_STATUS_CHANGED 0x01 +#define AVRCP_EVENT_TRACK_CHANGED 0x02 +#define AVRCP_EVENT_TRACK_REACHED_END 0x03 +#define AVRCP_EVENT_TRACK_REACHED_START 0x04 +#define AVRCP_EVENT_PLAYBACK_POS_CHANGED 0x05 +#define AVRCP_EVENT_SETTINGS_CHANGED 0x08 +#define AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED 0x0a +#define AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED 0x0b +#define AVRCP_EVENT_UIDS_CHANGED 0x0c +#define AVRCP_EVENT_VOLUME_CHANGED 0x0d +#define AVRCP_EVENT_LAST AVRCP_EVENT_VOLUME_CHANGED + +/* Status codes */ +#define AVRCP_STATUS_INVALID_COMMAND 0x00 +#define AVRCP_STATUS_INVALID_PARAM 0x01 +#define AVRCP_STATUS_PARAM_NOT_FOUND 0x02 +#define AVRCP_STATUS_INTERNAL_ERROR 0x03 +#define AVRCP_STATUS_SUCCESS 0x04 +#define AVRCP_STATUS_OUT_OF_BOUNDS 0x0b +#define AVRCP_STATUS_INVALID_PLAYER_ID 0x11 +#define AVRCP_STATUS_PLAYER_NOT_BROWSABLE 0x12 +#define AVRCP_STATUS_NO_AVAILABLE_PLAYERS 0x15 +#define AVRCP_STATUS_ADDRESSED_PLAYER_CHANGED 0x16 + +/* Capabilities for AVRCP_GET_CAPABILITIES pdu */ +#define CAP_COMPANY_ID 0x02 +#define CAP_EVENTS_SUPPORTED 0x03 + +/* Player Attributes */ +#define AVRCP_ATTRIBUTE_ILEGAL 0x00 +#define AVRCP_ATTRIBUTE_EQUALIZER 0x01 +#define AVRCP_ATTRIBUTE_REPEAT_MODE 0x02 +#define AVRCP_ATTRIBUTE_SHUFFLE 0x03 +#define AVRCP_ATTRIBUTE_SCAN 0x04 +#define AVRCP_ATTRIBUTE_LAST AVRCP_ATTRIBUTE_SCAN + +/* equalizer values */ +#define AVRCP_EQUALIZER_OFF 0x01 +#define AVRCP_EQUALIZER_ON 0x02 + +/* repeat mode values */ +#define AVRCP_REPEAT_MODE_OFF 0x01 +#define AVRCP_REPEAT_MODE_SINGLE 0x02 +#define AVRCP_REPEAT_MODE_ALL 0x03 +#define AVRCP_REPEAT_MODE_GROUP 0x04 + +/* shuffle values */ +#define AVRCP_SHUFFLE_OFF 0x01 +#define AVRCP_SHUFFLE_ALL 0x02 +#define AVRCP_SHUFFLE_GROUP 0x03 + +/* scan values */ +#define AVRCP_SCAN_OFF 0x01 +#define AVRCP_SCAN_ALL 0x02 +#define AVRCP_SCAN_GROUP 0x03 + +/* media attributes */ +#define AVRCP_MEDIA_ATTRIBUTE_ILLEGAL 0x00 +#define AVRCP_MEDIA_ATTRIBUTE_TITLE 0x01 +#define AVRCP_MEDIA_ATTRIBUTE_ARTIST 0x02 +#define AVRCP_MEDIA_ATTRIBUTE_ALBUM 0x03 +#define AVRCP_MEDIA_ATTRIBUTE_TRACK 0x04 +#define AVRCP_MEDIA_ATTRIBUTE_N_TRACKS 0x05 +#define AVRCP_MEDIA_ATTRIBUTE_GENRE 0x06 +#define AVRCP_MEDIA_ATTRIBUTE_DURATION 0x07 +#define AVRCP_MEDIA_ATTRIBUTE_LAST AVRCP_MEDIA_ATTRIBUTE_DURATION + +/* Company IDs for vendor dependent commands */ +#define IEEEID_BTSIG 0x001958 + +/* Parameters legths */ +#define AVRCP_REGISTER_NOTIFICATION_PARAM_LENGTH 5 + +struct avrcp; + +struct avrcp_control_handler { + uint8_t id; + uint8_t code; + uint8_t rsp; + ssize_t (*func) (struct avrcp *session, uint8_t transaction, + uint16_t params_len, uint8_t *params, void *user_data); +}; + +struct avrcp_control_ind { + int (*get_capabilities) (struct avrcp *session, uint8_t transaction, + void *user_data); + int (*list_attributes) (struct avrcp *session, uint8_t transaction, + void *user_data); + int (*get_attribute_text) (struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *attrs, + void *user_data); + int (*list_values) (struct avrcp *session, uint8_t transaction, + uint8_t attr, void *user_data); + int (*get_value_text) (struct avrcp *session, uint8_t transaction, + uint8_t attr, uint8_t number, + uint8_t *values, void *user_data); + int (*get_value) (struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *attrs, + void *user_data); + int (*set_value) (struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *attrs, + void *user_data); + int (*get_play_status) (struct avrcp *session, uint8_t transaction, + void *user_data); + int (*get_element_attributes) (struct avrcp *session, + uint8_t transaction, uint64_t uid, + uint8_t number, uint32_t *attrs, + void *user_data); + int (*register_notification) (struct avrcp *session, + uint8_t transaction, uint8_t event, + uint32_t interval, void *user_data); + int (*set_addressed) (struct avrcp *session, uint8_t transaction, + uint16_t id, void *user_data); +}; + +struct avrcp_control_cfm { +}; + +struct avrcp_passthrough_handler { + uint8_t op; + bool (*func) (struct avrcp *session, bool pressed, void *user_data); +}; + +typedef void (*avrcp_destroy_cb_t) (void *user_data); + +struct avrcp *avrcp_new(int fd, size_t imtu, size_t omtu, uint16_t version); +void avrcp_shutdown(struct avrcp *session); +void avrcp_set_destroy_cb(struct avrcp *session, avrcp_destroy_cb_t cb, + void *user_data); + +void avrcp_register_player(struct avrcp *session, + const struct avrcp_control_ind *ind, + const struct avrcp_control_cfm *cfm, + void *user_data); +void avrcp_set_passthrough_handlers(struct avrcp *session, + const struct avrcp_passthrough_handler *handlers, + void *user_data); +int avrcp_init_uinput(struct avrcp *session, const char *name, + const char *address); +int avrcp_send(struct avrcp *session, uint8_t transaction, uint8_t code, + uint8_t subunit, uint8_t pdu_id, + uint8_t *params, size_t params_len); +int avrcp_get_capabilities(struct avrcp *session, uint8_t param, + avctp_rsp_cb func, void *user_data); +int avrcp_register_notification(struct avrcp *session, uint8_t event, + uint32_t interval, avctp_rsp_cb func, + void *user_data); +int avrcp_list_player_attributes(struct avrcp *session, avctp_rsp_cb func, + void *user_data); +int avrcp_get_player_attribute_text(struct avrcp *session, uint8_t *attributes, + uint8_t attr_len, avctp_rsp_cb func, + void *user_data); +int avrcp_set_player_value(struct avrcp *session, uint8_t *attributes, + uint8_t attr_count, uint8_t *values, + avctp_rsp_cb func, void *user_data); +int avrcp_get_current_player_value(struct avrcp *session, uint8_t *attrs, + uint8_t attr_count, avctp_rsp_cb func, + void *user_data); +int avrcp_get_play_status(struct avrcp *session, avctp_rsp_cb func, + void *user_data); +int avrcp_set_volume(struct avrcp *session, uint8_t volume, avctp_rsp_cb func, + void *user_data); +int avrcp_get_element_attributes(struct avrcp *session, avctp_rsp_cb func, + void *user_data); +int avrcp_set_addressed_player(struct avrcp *session, uint16_t player_id, + avctp_rsp_cb func, void *user_data); + +int avrcp_get_capabilities_rsp(struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *events); +int avrcp_list_player_attributes_rsp(struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *attrs); +int avrcp_get_player_attribute_text_rsp(struct avrcp *session, + uint8_t transaction, uint8_t number, + uint8_t *attrs, const char **text); +int avrcp_list_player_values_rsp(struct avrcp *session, uint8_t transaction, + uint8_t number, uint8_t *values); +int avrcp_get_play_status_rsp(struct avrcp *session, uint8_t transaction, + uint32_t position, uint32_t duration, + uint8_t status); +int avrcp_get_player_values_text_rsp(struct avrcp *session, + uint8_t transaction, uint8_t number, + uint8_t *values, const char **text); +int avrcp_get_current_player_value_rsp(struct avrcp *session, + uint8_t transaction, uint8_t number, + uint8_t *attrs, uint8_t *values); +int avrcp_get_element_attrs_rsp(struct avrcp *session, uint8_t transaction, + uint8_t *params, size_t params_len); +int avrcp_register_notification_rsp(struct avrcp *session, uint8_t transaction, + uint8_t code, uint8_t *params, + size_t params_len); +int avrcp_set_addressed_player_rsp(struct avrcp *session, uint8_t transaction, + uint8_t status); +int avrcp_send_passthrough(struct avrcp *session, uint32_t vendor, uint8_t op);
diff --git a/bluez/android/avrcp.c b/bluez/android/avrcp.c new file mode 100644 index 0000000..ec98139 --- /dev/null +++ b/bluez/android/avrcp.c
@@ -0,0 +1,1112 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdlib.h> +#include <stdbool.h> +#include <errno.h> +#include <glib.h> + +#include "btio/btio.h" +#include "lib/bluetooth.h" +#include "lib/sdp.h" +#include "lib/sdp_lib.h" +#include "src/sdp-client.h" +#include "src/shared/util.h" +#include "src/log.h" + +#include "avctp.h" +#include "avrcp-lib.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "ipc.h" +#include "bluetooth.h" +#include "avrcp.h" +#include "utils.h" + +#define L2CAP_PSM_AVCTP 0x17 + +#define AVRCP_FEATURE_CATEGORY_1 0x0001 +#define AVRCP_FEATURE_CATEGORY_2 0x0002 +#define AVRCP_FEATURE_CATEGORY_3 0x0004 +#define AVRCP_FEATURE_CATEGORY_4 0x0008 + +static bdaddr_t adapter_addr; +static uint32_t record_id = 0; +static GSList *devices = NULL; +static GIOChannel *server = NULL; +static struct ipc *hal_ipc = NULL; + +struct avrcp_request { + struct avrcp_device *dev; + uint8_t pdu_id; + uint8_t event_id; + uint8_t transaction; +}; + +struct avrcp_device { + bdaddr_t dst; + uint16_t version; + uint16_t features; + struct avrcp *session; + GIOChannel *io; + GQueue *queue; +}; + +static struct avrcp_request *pop_request(uint8_t pdu_id, uint8_t event_id, + bool peek) +{ + GSList *l; + + for (l = devices; l; l = g_slist_next(l)) { + struct avrcp_device *dev = l->data; + GList *reqs = g_queue_peek_head_link(dev->queue); + int i; + + for (i = 0; reqs; reqs = g_list_next(reqs), i++) { + struct avrcp_request *req = reqs->data; + + if (req->pdu_id != pdu_id || req->event_id != event_id) + continue; + + if (!peek) + g_queue_pop_nth(dev->queue, i); + + return req; + } + } + + return NULL; +} + +static void handle_get_play_status(const void *buf, uint16_t len) +{ + const struct hal_cmd_avrcp_get_play_status *cmd = buf; + uint8_t status; + struct avrcp_request *req; + int ret; + + DBG(""); + + req = pop_request(AVRCP_GET_PLAY_STATUS, 0, false); + if (!req) { + status = HAL_STATUS_FAILED; + goto done; + } + + ret = avrcp_get_play_status_rsp(req->dev->session, req->transaction, + cmd->position, cmd->duration, + cmd->status); + if (ret < 0) { + status = HAL_STATUS_FAILED; + g_free(req); + goto done; + } + + status = HAL_STATUS_SUCCESS; + g_free(req); + +done: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_PLAY_STATUS, status); +} + +static void handle_list_player_attrs(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_LIST_PLAYER_ATTRS, HAL_STATUS_FAILED); +} + +static void handle_list_player_values(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_LIST_PLAYER_VALUES, HAL_STATUS_FAILED); +} + +static void handle_get_player_attrs(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_PLAYER_ATTRS, HAL_STATUS_FAILED); +} + +static void handle_get_player_attrs_text(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_PLAYER_ATTRS_TEXT, HAL_STATUS_FAILED); +} + +static void handle_get_player_values_text(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_PLAYER_VALUES_TEXT, HAL_STATUS_FAILED); +} + +static size_t write_element_text(uint8_t id, uint8_t text_len, uint8_t *text, + uint8_t *pdu) +{ + uint16_t charset = 106; + size_t len = 0; + + put_be32(id, pdu); + pdu += 4; + len += 4; + + put_be16(charset, pdu); + pdu += 2; + len += 2; + + put_be16(text_len, pdu); + pdu += 2; + len += 2; + + memcpy(pdu, text, text_len); + len += text_len; + + return len; +} + +static void write_element_attrs(uint8_t *ptr, uint8_t number, uint8_t *pdu, + size_t *len) +{ + int i; + + *pdu = number; + pdu++; + *len += 1; + + for (i = 0; i < number; i++) { + struct hal_avrcp_player_setting_text *text = (void *) ptr; + size_t ret; + + ret = write_element_text(text->id, text->len, text->text, pdu); + + ptr += sizeof(*text) + text->len; + pdu += ret; + *len += ret; + } +} + +static void handle_get_element_attrs_text(const void *buf, uint16_t len) +{ + struct hal_cmd_avrcp_get_element_attrs_text *cmd = (void *) buf; + uint8_t status; + struct avrcp_request *req; + uint8_t pdu[IPC_MTU]; + uint8_t *ptr; + size_t pdu_len; + int ret; + + DBG(""); + + req = pop_request(AVRCP_GET_ELEMENT_ATTRIBUTES, 0, false); + if (!req) { + status = HAL_STATUS_FAILED; + goto done; + } + + ptr = (uint8_t *) &cmd->values[0]; + pdu_len = 0; + write_element_attrs(ptr, cmd->number, pdu, &pdu_len); + + ret = avrcp_get_element_attrs_rsp(req->dev->session, req->transaction, + pdu, pdu_len); + if (ret < 0) { + status = HAL_STATUS_FAILED; + g_free(req); + goto done; + } + + status = HAL_STATUS_SUCCESS; + g_free(req); + +done: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_ELEMENT_ATTRS_TEXT, status); +} + +static void handle_set_player_attrs_value(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_SET_PLAYER_ATTRS_VALUE, HAL_STATUS_FAILED); +} + +static void handle_register_notification(const void *buf, uint16_t len) +{ + struct hal_cmd_avrcp_register_notification *cmd = (void *) buf; + uint8_t status; + struct avrcp_request *req; + uint8_t pdu[IPC_MTU]; + size_t pdu_len; + uint8_t code; + bool peek = false; + int ret; + + DBG(""); + + switch (cmd->type) { + case HAL_AVRCP_EVENT_TYPE_INTERIM: + code = AVC_CTYPE_INTERIM; + peek = true; + break; + case HAL_AVRCP_EVENT_TYPE_CHANGED: + code = AVC_CTYPE_CHANGED; + break; + default: + status = HAL_STATUS_FAILED; + goto done; + } + + req = pop_request(AVRCP_REGISTER_NOTIFICATION, cmd->event, peek); + if (!req) { + status = HAL_STATUS_FAILED; + goto done; + } + + pdu[0] = cmd->event; + pdu_len = 1; + + switch (cmd->event) { + case AVRCP_EVENT_STATUS_CHANGED: + case AVRCP_EVENT_TRACK_CHANGED: + case AVRCP_EVENT_PLAYBACK_POS_CHANGED: + memcpy(&pdu[1], cmd->data, cmd->len); + pdu_len += cmd->len; + break; + default: + status = HAL_STATUS_FAILED; + goto done; + } + + ret = avrcp_register_notification_rsp(req->dev->session, + req->transaction, code, + pdu, pdu_len); + if (ret < 0) { + status = HAL_STATUS_FAILED; + if (!peek) + g_free(req); + goto done; + } + + status = HAL_STATUS_SUCCESS; + if (!peek) + g_free(req); + +done: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_REGISTER_NOTIFICATION, status); +} + +static gboolean set_volume_rsp(struct avctp *conn, + uint8_t code, uint8_t subunit, + uint8_t *operands, size_t operand_count, + void *user_data) +{ + struct hal_ev_avrcp_volume_changed ev; + uint8_t *params; + + if (code != AVC_CTYPE_ACCEPTED) { + ev.volume = 0; + ev.type = code; + goto done; + } + + if (operands == NULL || operand_count < 7) + return FALSE; + + params = &operands[7]; + + ev.volume = params[0] & 0x7F; + ev.type = code; + +done: + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_EV_AVRCP_VOLUME_CHANGED, + sizeof(ev), &ev); + + return FALSE; +} + +static void handle_set_volume(const void *buf, uint16_t len) +{ + struct hal_cmd_avrcp_set_volume *cmd = (void *) buf; + struct avrcp_device *dev; + uint8_t status; + int ret; + + DBG(""); + + if (!devices) { + error("AVRCP: No device found to set volume"); + status = HAL_STATUS_FAILED; + goto done; + } + + /* Peek the first device since the HAL cannot really address a specific + * device it might mean there could only be one connected. + */ + dev = devices->data; + + ret = avrcp_set_volume(dev->session, cmd->value & 0x7f, set_volume_rsp, + dev); + if (ret < 0) { + status = HAL_STATUS_FAILED; + goto done; + } + + status = HAL_STATUS_SUCCESS; + +done: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_AVRCP, HAL_OP_AVRCP_SET_VOLUME, + status); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_AVRCP_GET_PLAY_STATUS */ + { handle_get_play_status, false, + sizeof(struct hal_cmd_avrcp_get_play_status) }, + /* HAL_OP_AVRCP_LIST_PLAYER_ATTRS */ + { handle_list_player_attrs, true, + sizeof(struct hal_cmd_avrcp_list_player_attrs) }, + /* HAL_OP_AVRCP_LIST_PLAYER_VALUES */ + { handle_list_player_values, true, + sizeof(struct hal_cmd_avrcp_list_player_values) }, + /* HAL_OP_AVRCP_GET_PLAYER_ATTRS */ + { handle_get_player_attrs, true, + sizeof(struct hal_cmd_avrcp_get_player_attrs) }, + /* HAL_OP_AVRCP_GET_PLAYER_ATTRS_TEXT */ + { handle_get_player_attrs_text, true, + sizeof(struct hal_cmd_avrcp_get_player_attrs_text) }, + /* HAL_OP_AVRCP_GET_PLAYER_VALUES_TEXT */ + { handle_get_player_values_text, true, + sizeof(struct hal_cmd_avrcp_get_player_values_text) }, + /* HAL_OP_AVRCP_GET_ELEMENT_ATTRS_TEXT */ + { handle_get_element_attrs_text, true, + sizeof(struct hal_cmd_avrcp_get_element_attrs_text) }, + /* HAL_OP_AVRCP_SET_PLAYER_ATTRS_VALUE */ + { handle_set_player_attrs_value, true, + sizeof(struct hal_cmd_avrcp_set_player_attrs_value) }, + /* HAL_OP_AVRCP_REGISTER_NOTIFICATION */ + { handle_register_notification, true, + sizeof(struct hal_cmd_avrcp_register_notification) }, + /* HAL_OP_AVRCP_SET_VOLUME */ + { handle_set_volume, false, sizeof(struct hal_cmd_avrcp_set_volume) }, +}; + +static sdp_record_t *avrcp_record(void) +{ + sdp_list_t *svclass_id, *pfseq, *apseq, *root; + uuid_t root_uuid, l2cap, avctp, avrtg; + sdp_profile_desc_t profile[1]; + sdp_list_t *aproto_control, *proto_control[2]; + sdp_record_t *record; + sdp_data_t *psm, *version, *features; + uint16_t lp = L2CAP_PSM_AVCTP; + uint16_t avrcp_ver = 0x0105, avctp_ver = 0x0104; + uint16_t feat = (AVRCP_FEATURE_CATEGORY_1 | + AVRCP_FEATURE_CATEGORY_2 | + AVRCP_FEATURE_CATEGORY_3 | + AVRCP_FEATURE_CATEGORY_4); + + record = sdp_record_alloc(); + if (!record) + return NULL; + + sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP); + root = sdp_list_append(NULL, &root_uuid); + sdp_set_browse_groups(record, root); + + /* Service Class ID List */ + sdp_uuid16_create(&avrtg, AV_REMOTE_TARGET_SVCLASS_ID); + svclass_id = sdp_list_append(NULL, &avrtg); + sdp_set_service_classes(record, svclass_id); + + /* Protocol Descriptor List */ + sdp_uuid16_create(&l2cap, L2CAP_UUID); + proto_control[0] = sdp_list_append(NULL, &l2cap); + psm = sdp_data_alloc(SDP_UINT16, &lp); + proto_control[0] = sdp_list_append(proto_control[0], psm); + apseq = sdp_list_append(NULL, proto_control[0]); + + sdp_uuid16_create(&avctp, AVCTP_UUID); + proto_control[1] = sdp_list_append(NULL, &avctp); + version = sdp_data_alloc(SDP_UINT16, &avctp_ver); + proto_control[1] = sdp_list_append(proto_control[1], version); + apseq = sdp_list_append(apseq, proto_control[1]); + + aproto_control = sdp_list_append(NULL, apseq); + sdp_set_access_protos(record, aproto_control); + + /* Bluetooth Profile Descriptor List */ + sdp_uuid16_create(&profile[0].uuid, AV_REMOTE_PROFILE_ID); + profile[0].version = avrcp_ver; + pfseq = sdp_list_append(NULL, &profile[0]); + sdp_set_profile_descs(record, pfseq); + + features = sdp_data_alloc(SDP_UINT16, &feat); + sdp_attr_add(record, SDP_ATTR_SUPPORTED_FEATURES, features); + + sdp_set_info_attr(record, "AVRCP TG", NULL, NULL); + + sdp_data_free(psm); + sdp_data_free(version); + sdp_list_free(proto_control[0], NULL); + sdp_list_free(proto_control[1], NULL); + sdp_list_free(apseq, NULL); + sdp_list_free(aproto_control, NULL); + sdp_list_free(pfseq, NULL); + sdp_list_free(root, NULL); + sdp_list_free(svclass_id, NULL); + + return record; +} + +static void avrcp_device_free(void *data) +{ + struct avrcp_device *dev = data; + + if (dev->queue) { + g_queue_foreach(dev->queue, (GFunc) g_free, NULL); + g_queue_free(dev->queue); + } + + if (dev->session) + avrcp_shutdown(dev->session); + + if (dev->io) { + g_io_channel_shutdown(dev->io, FALSE, NULL); + g_io_channel_unref(dev->io); + } + + g_free(dev); +} + +static void avrcp_device_remove(struct avrcp_device *dev) +{ + devices = g_slist_remove(devices, dev); + avrcp_device_free(dev); +} + +static struct avrcp_device *avrcp_device_new(const bdaddr_t *dst) +{ + struct avrcp_device *dev; + + dev = g_new0(struct avrcp_device, 1); + bacpy(&dev->dst, dst); + devices = g_slist_prepend(devices, dev); + + return dev; +} + +static int device_cmp(gconstpointer s, gconstpointer user_data) +{ + const struct avrcp_device *dev = s; + const bdaddr_t *dst = user_data; + + return bacmp(&dev->dst, dst); +} + +static struct avrcp_device *avrcp_device_find(const bdaddr_t *dst) +{ + GSList *l; + + l = g_slist_find_custom(devices, dst, device_cmp); + if (!l) + return NULL; + + return l->data; +} + +static void disconnect_cb(void *data) +{ + struct avrcp_device *dev = data; + + DBG(""); + + dev->session = NULL; + + avrcp_device_remove(dev); +} + +static bool handle_fast_forward(struct avrcp *session, bool pressed, + void *user_data) +{ + struct hal_ev_avrcp_passthrough_cmd ev; + + DBG("pressed %s", pressed ? "true" : "false"); + + ev.id = AVC_FAST_FORWARD; + ev.state = pressed; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_EV_AVRCP_PASSTHROUGH_CMD, sizeof(ev), &ev); + + return true; +} + +static bool handle_rewind(struct avrcp *session, bool pressed, + void *user_data) +{ + struct hal_ev_avrcp_passthrough_cmd ev; + + DBG("pressed %s", pressed ? "true" : "false"); + + ev.id = AVC_REWIND; + ev.state = pressed; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_EV_AVRCP_PASSTHROUGH_CMD, sizeof(ev), &ev); + + return true; +} + +static const struct avrcp_passthrough_handler passthrough_handlers[] = { + { AVC_FAST_FORWARD, handle_fast_forward }, + { AVC_REWIND, handle_rewind }, + { }, +}; + +static int handle_get_capabilities_cmd(struct avrcp *session, + uint8_t transaction, void *user_data) +{ + uint8_t events[] = { AVRCP_EVENT_STATUS_CHANGED, + AVRCP_EVENT_TRACK_CHANGED, + AVRCP_EVENT_PLAYBACK_POS_CHANGED }; + + DBG(""); + + /* Android do not provide this info via HAL so the list most + * be hardcoded according to what RegisterNotification can + * actually handle */ + avrcp_get_capabilities_rsp(session, transaction, sizeof(events), + events); + + return -EAGAIN; +} + +static void push_request(struct avrcp_device *dev, uint8_t pdu_id, + uint8_t event_id, uint8_t transaction) +{ + struct avrcp_request *req; + + req = g_new0(struct avrcp_request, 1); + req->dev = dev; + req->pdu_id = pdu_id; + req->event_id = event_id; + req->transaction = transaction; + + g_queue_push_tail(dev->queue, req); +} + +static int handle_get_play_status_cmd(struct avrcp *session, + uint8_t transaction, void *user_data) +{ + struct avrcp_device *dev = user_data; + + DBG(""); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_EV_AVRCP_GET_PLAY_STATUS, 0, NULL); + + push_request(dev, AVRCP_GET_PLAY_STATUS, 0, transaction); + + return -EAGAIN; +} + +static int handle_get_element_attrs_cmd(struct avrcp *session, + uint8_t transaction, uint64_t uid, + uint8_t number, uint32_t *attrs, + void *user_data) +{ + struct avrcp_device *dev = user_data; + uint8_t buf[IPC_MTU]; + struct hal_ev_avrcp_get_element_attrs *ev = (void *) buf; + int i; + + DBG(""); + + ev->number = number; + /* Set everything in case of empty list */ + if (ev->number == 0) { + for (i = 0; i < HAL_AVRCP_MEDIA_ATTR_DURATION; i++) { + /* Skip 0x00 as the attributes start with 0x01 */ + ev->attrs[i] = i + 1; + } + ev->number = i; + goto done; + } + + for (i = 0; i < number; i++) + ev->attrs[i] = attrs[i]; + +done: + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_EV_AVRCP_GET_ELEMENT_ATTRS, + sizeof(*ev) + ev->number, ev); + + push_request(dev, AVRCP_GET_ELEMENT_ATTRIBUTES, 0, transaction); + + return -EAGAIN; + +} + +static int handle_register_notification_cmd(struct avrcp *session, + uint8_t transaction, + uint8_t event, + uint32_t interval, + void *user_data) +{ + struct avrcp_device *dev = user_data; + struct hal_ev_avrcp_register_notification ev; + + DBG(""); + + /* TODO: Add any missing events supported by Android */ + switch (event) { + case AVRCP_EVENT_STATUS_CHANGED: + case AVRCP_EVENT_TRACK_CHANGED: + case AVRCP_EVENT_PLAYBACK_POS_CHANGED: + break; + default: + return -EINVAL; + } + + ev.event = event; + ev.param = interval; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_EV_AVRCP_REGISTER_NOTIFICATION, + sizeof(ev), &ev); + + push_request(dev, AVRCP_REGISTER_NOTIFICATION, event, transaction); + + return -EAGAIN; +} + +static const struct avrcp_control_ind control_ind = { + .get_capabilities = handle_get_capabilities_cmd, + .get_play_status = handle_get_play_status_cmd, + .get_element_attributes = handle_get_element_attrs_cmd, + .register_notification = handle_register_notification_cmd, +}; + +static gboolean register_notification_rsp(struct avctp *conn, + uint8_t code, uint8_t subunit, + uint8_t *operands, size_t operand_count, + void *user_data) +{ + struct avrcp_device *dev = user_data; + struct hal_ev_avrcp_volume_changed ev; + uint8_t *params; + + if (code != AVC_CTYPE_INTERIM && code != AVC_CTYPE_CHANGED) + return FALSE; + + if (operands == NULL || operand_count < 7) + return FALSE; + + params = &operands[7]; + + if (params == NULL || params[0] != AVRCP_EVENT_VOLUME_CHANGED) + return FALSE; + + ev.type = code; + ev.volume = params[1] & 0x7F; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_EV_AVRCP_VOLUME_CHANGED, + sizeof(ev), &ev); + + if (code == AVC_CTYPE_INTERIM) + return TRUE; + + avrcp_register_notification(dev->session, params[0], 0, + register_notification_rsp, dev); + return FALSE; +} + +static gboolean get_capabilities_rsp(struct avctp *conn, + uint8_t code, uint8_t subunit, + uint8_t *operands, size_t operand_count, + void *user_data) +{ + struct avrcp_device *dev = user_data; + uint8_t *params; + uint8_t count; + + if (operands == NULL || operand_count < 7) + return FALSE; + + params = &operands[7]; + + if (params == NULL || params[0] != CAP_EVENTS_SUPPORTED) + return FALSE; + + for (count = params[1]; count > 0; count--) { + uint8_t event = params[1 + count]; + + if (event != AVRCP_EVENT_VOLUME_CHANGED) + continue; + + avrcp_register_notification(dev->session, event, 0, + register_notification_rsp, + dev); + return FALSE; + } + + return FALSE; +} + +static int avrcp_device_add_session(struct avrcp_device *dev, int fd, + uint16_t imtu, uint16_t omtu) +{ + struct hal_ev_avrcp_remote_features ev; + char address[18]; + + dev->session = avrcp_new(fd, imtu, omtu, dev->version); + if (!dev->session) + return -EINVAL; + + avrcp_set_destroy_cb(dev->session, disconnect_cb, dev); + avrcp_set_passthrough_handlers(dev->session, passthrough_handlers, + dev); + avrcp_register_player(dev->session, &control_ind, NULL, dev); + + dev->queue = g_queue_new(); + + ba2str(&dev->dst, address); + + /* FIXME: get the real name of the device */ + avrcp_init_uinput(dev->session, "bluetooth", address); + + bdaddr2android(&dev->dst, ev.bdaddr); + ev.features = HAL_AVRCP_FEATURE_NONE; + + DBG("version 0x%02x", dev->version); + + if (dev->version < 0x0103) + goto done; + + ev.features |= HAL_AVRCP_FEATURE_METADATA; + + if (dev->version < 0x0104) + goto done; + + ev.features |= HAL_AVRCP_FEATURE_ABSOLUTE_VOLUME; + + avrcp_get_capabilities(dev->session, CAP_EVENTS_SUPPORTED, + get_capabilities_rsp, dev); + +done: + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_AVRCP, + HAL_EV_AVRCP_REMOTE_FEATURES, + sizeof(ev), &ev); + + return 0; +} + +static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data) +{ + struct avrcp_device *dev = user_data; + uint16_t imtu, omtu; + char address[18]; + GError *gerr = NULL; + int fd; + + if (err) { + error("%s", err->message); + return; + } + + bt_io_get(chan, &gerr, + BT_IO_OPT_DEST, address, + BT_IO_OPT_IMTU, &imtu, + BT_IO_OPT_OMTU, &omtu, + BT_IO_OPT_INVALID); + if (gerr) { + error("%s", gerr->message); + g_error_free(gerr); + g_io_channel_shutdown(chan, TRUE, NULL); + return; + } + + fd = g_io_channel_unix_get_fd(chan); + if (avrcp_device_add_session(dev, fd, imtu, omtu) < 0) { + avrcp_device_free(dev); + return; + } + + g_io_channel_set_close_on_unref(chan, FALSE); + + if (dev->io) { + g_io_channel_unref(dev->io); + dev->io = NULL; + } + + DBG("%s connected", address); +} + +static bool avrcp_device_connect(struct avrcp_device *dev, BtIOConnect cb) +{ + GError *err = NULL; + + dev->io = bt_io_connect(cb, dev, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_DEST_BDADDR, &dev->dst, + BT_IO_OPT_PSM, L2CAP_PSM_AVCTP, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_INVALID); + if (err) { + error("%s", err->message); + g_error_free(err); + return false; + } + + return true; +} + +static void search_cb(sdp_list_t *recs, int err, gpointer data) +{ + struct avrcp_device *dev = data; + sdp_list_t *list; + + DBG(""); + + if (err < 0) { + error("Unable to get AV_REMOTE_SVCLASS_ID SDP record: %s", + strerror(-err)); + goto fail; + } + + if (!recs || !recs->data) { + error("No AVRCP records found"); + goto fail; + } + + for (list = recs; list; list = list->next) { + sdp_record_t *rec = list->data; + sdp_list_t *l; + sdp_profile_desc_t *desc; + int features; + + if (sdp_get_profile_descs(rec, &l) < 0) + continue; + + desc = l->data; + dev->version = desc->version; + + if (sdp_get_int_attr(rec, SDP_ATTR_SUPPORTED_FEATURES, + &features) == 0) + dev->features = features; + + sdp_list_free(l, free); + break; + } + + if (dev->io) { + GError *gerr = NULL; + if (!bt_io_accept(dev->io, connect_cb, dev, NULL, &gerr)) { + error("bt_io_accept: %s", gerr->message); + g_error_free(gerr); + goto fail; + } + return; + } + + if (!avrcp_device_connect(dev, connect_cb)) { + error("Unable to connect to AVRCP"); + goto fail; + } + + return; + +fail: + avrcp_device_remove(dev); +} + +static int avrcp_device_search(struct avrcp_device *dev) +{ + uuid_t uuid; + + sdp_uuid16_create(&uuid, AV_REMOTE_SVCLASS_ID); + + return bt_search_service(&adapter_addr, &dev->dst, &uuid, search_cb, + dev, NULL, 0); +} + +static void confirm_cb(GIOChannel *chan, gpointer data) +{ + struct avrcp_device *dev; + char address[18]; + bdaddr_t src, dst; + GError *err = NULL; + + bt_io_get(chan, &err, + BT_IO_OPT_SOURCE_BDADDR, &src, + BT_IO_OPT_DEST_BDADDR, &dst, + BT_IO_OPT_DEST, address, + BT_IO_OPT_INVALID); + if (err) { + error("%s", err->message); + g_error_free(err); + g_io_channel_shutdown(chan, TRUE, NULL); + return; + } + + DBG("incoming connect from %s", address); + + dev = avrcp_device_find(&dst); + if (dev && dev->session) { + error("AVRCP: Refusing unexpected connect"); + g_io_channel_shutdown(chan, TRUE, NULL); + return; + } + + dev = avrcp_device_new(&dst); + if (avrcp_device_search(dev) < 0) { + error("AVRCP: Failed to search SDP details"); + avrcp_device_free(dev); + g_io_channel_shutdown(chan, TRUE, NULL); + } + + dev->io = g_io_channel_ref(chan); +} + +bool bt_avrcp_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode) +{ + GError *err = NULL; + sdp_record_t *rec; + + DBG(""); + + bacpy(&adapter_addr, addr); + + server = bt_io_listen(NULL, confirm_cb, NULL, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_PSM, L2CAP_PSM_AVCTP, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_INVALID); + if (!server) { + error("Failed to listen on AVDTP channel: %s", err->message); + g_error_free(err); + return false; + } + + rec = avrcp_record(); + if (!rec) { + error("Failed to allocate AVRCP record"); + goto fail; + } + + if (bt_adapter_add_record(rec, 0) < 0) { + error("Failed to register AVRCP record"); + sdp_record_free(rec); + goto fail; + } + record_id = rec->handle; + + hal_ipc = ipc; + + ipc_register(hal_ipc, HAL_SERVICE_ID_AVRCP, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); + + return true; +fail: + g_io_channel_shutdown(server, TRUE, NULL); + g_io_channel_unref(server); + server = NULL; + + return false; +} + +void bt_avrcp_unregister(void) +{ + DBG(""); + + g_slist_free_full(devices, avrcp_device_free); + devices = NULL; + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_AVRCP); + hal_ipc = NULL; + + bt_adapter_remove_record(record_id); + record_id = 0; + + if (server) { + g_io_channel_shutdown(server, TRUE, NULL); + g_io_channel_unref(server); + server = NULL; + } +} + +void bt_avrcp_connect(const bdaddr_t *dst) +{ + struct avrcp_device *dev; + char addr[18]; + + DBG(""); + + if (avrcp_device_find(dst)) + return; + + dev = avrcp_device_new(dst); + if (avrcp_device_search(dev) < 0) { + error("AVRCP: Failed to search SDP details"); + avrcp_device_free(dev); + } + + ba2str(&dev->dst, addr); + DBG("connecting to %s", addr); +} + +void bt_avrcp_disconnect(const bdaddr_t *dst) +{ + struct avrcp_device *dev; + + DBG(""); + + dev = avrcp_device_find(dst); + if (!dev) + return; + + if (dev->session) { + avrcp_shutdown(dev->session); + return; + } + + avrcp_device_remove(dev); +}
diff --git a/bluez/android/avrcp.h b/bluez/android/avrcp.h new file mode 100644 index 0000000..11e79b7 --- /dev/null +++ b/bluez/android/avrcp.h
@@ -0,0 +1,28 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +bool bt_avrcp_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode); +void bt_avrcp_unregister(void); + +void bt_avrcp_connect(const bdaddr_t *dst); +void bt_avrcp_disconnect(const bdaddr_t *dst);
diff --git a/bluez/android/bluetooth.c b/bluez/android/bluetooth.c new file mode 100644 index 0000000..adf7c56 --- /dev/null +++ b/bluez/android/bluetooth.c
@@ -0,0 +1,3749 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <errno.h> +#include <stdlib.h> +#include <unistd.h> +#include <inttypes.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include <glib.h> + +#include "lib/bluetooth.h" +#include "lib/sdp.h" +#include "lib/mgmt.h" +#include "src/shared/util.h" +#include "src/shared/mgmt.h" +#include "src/uuid-helper.h" +#include "src/eir.h" +#include "lib/sdp.h" +#include "lib/sdp_lib.h" +#include "src/sdp-client.h" +#include "src/sdpd.h" +#include "src/log.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "ipc.h" +#include "utils.h" +#include "bluetooth.h" + +#define DEFAULT_ADAPTER_NAME "BlueZ for Android" + +#define DUT_MODE_FILE "/sys/kernel/debug/bluetooth/hci%u/dut_mode" + +#define SETTINGS_FILE ANDROID_STORAGEDIR"/settings" +#define DEVICES_FILE ANDROID_STORAGEDIR"/devices" +#define CACHE_FILE ANDROID_STORAGEDIR"/cache" + +#define DEVICE_ID_SOURCE 0x0002 /* USB */ +#define DEVICE_ID_VENDOR 0x1d6b /* Linux Foundation */ +#define DEVICE_ID_PRODUCT 0x0247 /* BlueZ for Android */ + +#define ADAPTER_MAJOR_CLASS 0x02 /* Phone */ +#define ADAPTER_MINOR_CLASS 0x03 /* Smartphone */ + +/* Default to DisplayYesNo */ +#define DEFAULT_IO_CAPABILITY 0x01 + +/* Default discoverable timeout 120sec as in Android */ +#define DEFAULT_DISCOVERABLE_TIMEOUT 120 + +#define DEVICES_CACHE_MAX 300 + +#define BASELEN_PROP_CHANGED (sizeof(struct hal_ev_adapter_props_changed) \ + + sizeof(struct hal_property)) + +#define BASELEN_REMOTE_DEV_PROP (sizeof(struct hal_ev_remote_device_props) \ + + sizeof(struct hal_property)) + +#define SCAN_TYPE_NONE 0 +#define SCAN_TYPE_BREDR (1 << BDADDR_BREDR) +#define SCAN_TYPE_LE ((1 << BDADDR_LE_PUBLIC) | (1 << BDADDR_LE_RANDOM)) +#define SCAN_TYPE_DUAL (SCAN_TYPE_BREDR | SCAN_TYPE_LE) + +#define BDADDR_LE (BDADDR_LE_RANDOM | BDADDR_LE_PUBLIC) + +struct device { + bdaddr_t bdaddr; + uint8_t bdaddr_type; + + bool le; + bool bredr; + + int bond_state; + + char *name; + char *friendly_name; + + uint32_t class; + int32_t rssi; + + uint32_t timestamp; + + GSList *uuids; + + bool found; /* if device is found in current discovery session */ + unsigned int confirm_id; /* mgtm command id if command pending */ + +}; + +struct browse_req { + bdaddr_t bdaddr; + GSList *uuids; + int search_uuid; + int reconnect_attempt; +}; + +static struct { + uint16_t index; + + bdaddr_t bdaddr; + uint32_t dev_class; + + char *name; + + uint32_t current_settings; + + uint8_t cur_discovery_type; + uint8_t exp_discovery_type; + uint32_t discoverable_timeout; + + GSList *uuids; +} adapter = { + .index = MGMT_INDEX_NONE, + .dev_class = 0, + .name = NULL, + .current_settings = 0, + .cur_discovery_type = SCAN_TYPE_NONE, + .exp_discovery_type = SCAN_TYPE_NONE, + .discoverable_timeout = DEFAULT_DISCOVERABLE_TIMEOUT, + .uuids = NULL, +}; + +static const uint16_t uuid_list[] = { + L2CAP_UUID, + PNP_INFO_SVCLASS_ID, + PUBLIC_BROWSE_GROUP, + 0 +}; + +static uint16_t option_index = MGMT_INDEX_NONE; +static struct mgmt *mgmt_if = NULL; + +static GSList *bonded_devices = NULL; +static GSList *cached_devices = NULL; + +static bt_le_device_found gatt_device_found_cb = NULL; +static bt_le_discovery_stopped gatt_discovery_stopped_cb = NULL; + +/* This list contains addresses which are asked for records */ +static GSList *browse_reqs; + +static struct ipc *hal_ipc = NULL; + +static void mgmt_debug(const char *str, void *user_data) +{ + const char *prefix = user_data; + info("%s%s", prefix, str); +} + +static void store_adapter_config(void) +{ + GKeyFile *key_file; + gsize length = 0; + char addr[18]; + char *data; + + key_file = g_key_file_new(); + + g_key_file_load_from_file(key_file, SETTINGS_FILE, 0, NULL); + + ba2str(&adapter.bdaddr, addr); + + g_key_file_set_string(key_file, "General", "Address", addr); + g_key_file_set_string(key_file, "General", "Name", adapter.name); + g_key_file_set_integer(key_file, "General", "DiscoverableTimeout", + adapter.discoverable_timeout); + + data = g_key_file_to_data(key_file, &length, NULL); + + g_file_set_contents(SETTINGS_FILE, data, length, NULL); + + g_free(data); + g_key_file_free(key_file); +} + +static void load_adapter_config(void) +{ + GError *gerr = NULL; + GKeyFile *key_file; + char *str; + + key_file = g_key_file_new(); + g_key_file_load_from_file(key_file, SETTINGS_FILE, 0, NULL); + + str = g_key_file_get_string(key_file, "General", "Address", NULL); + if (!str) { + g_key_file_free(key_file); + return; + } + + str2ba(str, &adapter.bdaddr); + g_free(str); + + adapter.name = g_key_file_get_string(key_file, "General", "Name", NULL); + + adapter.discoverable_timeout = g_key_file_get_integer(key_file, + "General", "DiscoverableTimeout", &gerr); + if (gerr) { + adapter.discoverable_timeout = DEFAULT_DISCOVERABLE_TIMEOUT; + g_error_free(gerr); + gerr = NULL; + } + + g_key_file_free(key_file); +} + +static void store_device_info(struct device *dev, const char *path) +{ + GKeyFile *key_file; + char addr[18]; + gsize length = 0; + char **uuids = NULL; + char *str; + + ba2str(&dev->bdaddr, addr); + + key_file = g_key_file_new(); + g_key_file_load_from_file(key_file, path, 0, NULL); + + g_key_file_set_boolean(key_file, addr, "BREDR", dev->bredr); + + if (dev->le) + g_key_file_set_integer(key_file, addr, "AddressType", + dev->bdaddr_type); + + g_key_file_set_string(key_file, addr, "Name", dev->name); + + if (dev->friendly_name) + g_key_file_set_string(key_file, addr, "FriendlyName", + dev->friendly_name); + else + g_key_file_remove_key(key_file, addr, "FriendlyName", NULL); + + if (dev->class) + g_key_file_set_integer(key_file, addr, "Class", dev->class); + else + g_key_file_remove_key(key_file, addr, "Class", NULL); + + g_key_file_set_integer(key_file, addr, "Timestamp", dev->timestamp); + + if (dev->uuids) { + GSList *l; + int i; + + uuids = g_new0(char *, g_slist_length(dev->uuids) + 1); + + for (i = 0, l = dev->uuids; l; l = g_slist_next(l), i++) { + int j; + uint8_t *u = l->data; + char *uuid_str = g_malloc0(33); + + for (j = 0; j < 16; j++) + sprintf(uuid_str + (j * 2), "%2.2X", u[j]); + + uuids[i] = uuid_str; + } + + g_key_file_set_string_list(key_file, addr, "Services", + (const char **)uuids, i); + } else { + g_key_file_remove_key(key_file, addr, "Services", NULL); + } + + str = g_key_file_to_data(key_file, &length, NULL); + g_file_set_contents(path, str, length, NULL); + g_free(str); + + g_key_file_free(key_file); + g_strfreev(uuids); +} + +static void remove_device_info(struct device *dev, const char *path) +{ + GKeyFile *key_file; + gsize length = 0; + char addr[18]; + char *str; + + ba2str(&dev->bdaddr, addr); + + key_file = g_key_file_new(); + g_key_file_load_from_file(key_file, path, 0, NULL); + + g_key_file_remove_group(key_file, addr, NULL); + + str = g_key_file_to_data(key_file, &length, NULL); + g_file_set_contents(path, str, length, NULL); + g_free(str); + + g_key_file_free(key_file); +} + +static int device_match(gconstpointer a, gconstpointer b) +{ + const struct device *dev = a; + const bdaddr_t *bdaddr = b; + + return bacmp(&dev->bdaddr, bdaddr); +} + +static struct device *find_device(const bdaddr_t *bdaddr) +{ + GSList *l; + + l = g_slist_find_custom(bonded_devices, bdaddr, device_match); + if (l) + return l->data; + + l = g_slist_find_custom(cached_devices, bdaddr, device_match); + if (l) + return l->data; + + return NULL; +} + +static void free_device(struct device *dev) +{ + if (dev->confirm_id) + mgmt_cancel(mgmt_if, dev->confirm_id); + + g_free(dev->name); + g_free(dev->friendly_name); + g_slist_free_full(dev->uuids, g_free); + g_free(dev); +} + +static void cache_device(struct device *new_dev) +{ + struct device *dev; + GSList *l; + + l = g_slist_find(cached_devices, new_dev); + if (l) { + cached_devices = g_slist_remove(cached_devices, new_dev); + goto cache; + } + + if (g_slist_length(cached_devices) < DEVICES_CACHE_MAX) + goto cache; + + l = g_slist_last(cached_devices); + dev = l->data; + + cached_devices = g_slist_remove(cached_devices, dev); + remove_device_info(dev, CACHE_FILE); + free_device(dev); + +cache: + cached_devices = g_slist_prepend(cached_devices, new_dev); + new_dev->timestamp = time(NULL); + store_device_info(new_dev, CACHE_FILE); +} + +static struct device *create_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type) +{ + struct device *dev; + char addr[18]; + + ba2str(bdaddr, addr); + DBG("%s", addr); + + dev = g_new0(struct device, 1); + + bacpy(&dev->bdaddr, bdaddr); + + if (bdaddr_type == BDADDR_BREDR) { + dev->bredr = true; + } else { + dev->le = true; + dev->bdaddr_type = bdaddr_type; + } + + dev->bond_state = HAL_BOND_STATE_NONE; + dev->timestamp = time(NULL); + + /* use address for name, will be change if one is present + * eg. in EIR or set by set_property. */ + dev->name = g_strdup(addr); + + return dev; +} + +static struct device *get_device(const bdaddr_t *bdaddr, uint8_t type) +{ + struct device *dev; + + dev = find_device(bdaddr); + if (dev) + return dev; + + dev = create_device(bdaddr, type); + + cache_device(dev); + + return dev; +} + +static void send_adapter_property(uint8_t type, uint16_t len, const void *val) +{ + uint8_t buf[BASELEN_PROP_CHANGED + len]; + struct hal_ev_adapter_props_changed *ev = (void *) buf; + + ev->status = HAL_STATUS_SUCCESS; + ev->num_props = 1; + ev->props[0].type = type; + ev->props[0].len = len; + memcpy(ev->props[0].val, val, len); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_ADAPTER_PROPS_CHANGED, sizeof(buf), buf); +} + +static void adapter_name_changed(const uint8_t *name) +{ + /* Android expects string value without NULL terminator */ + send_adapter_property(HAL_PROP_ADAPTER_NAME, + strlen((const char *) name), name); +} + +static void adapter_set_name(const uint8_t *name) +{ + if (!g_strcmp0(adapter.name, (const char *) name)) + return; + + DBG("%s", name); + + g_free(adapter.name); + adapter.name = g_strdup((const char *) name); + + store_adapter_config(); + + adapter_name_changed(name); +} + +static void mgmt_local_name_changed_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_cp_set_local_name *rp = param; + + if (length < sizeof(*rp)) { + error("Wrong size of local name changed parameters"); + return; + } + + adapter_set_name(rp->name); + + /* TODO Update services if needed */ +} + +static void powered_changed(void) +{ + struct hal_ev_adapter_state_changed ev; + + ev.state = (adapter.current_settings & MGMT_SETTING_POWERED) ? + HAL_POWER_ON : HAL_POWER_OFF; + + DBG("%u", ev.state); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_ADAPTER_STATE_CHANGED, sizeof(ev), &ev); +} + +static uint8_t settings2scan_mode(void) +{ + bool connectable, discoverable; + + connectable = adapter.current_settings & MGMT_SETTING_CONNECTABLE; + discoverable = adapter.current_settings & MGMT_SETTING_DISCOVERABLE; + + if (connectable && discoverable) + return HAL_ADAPTER_SCAN_MODE_CONN_DISC; + + if (connectable) + return HAL_ADAPTER_SCAN_MODE_CONN; + + return HAL_ADAPTER_SCAN_MODE_NONE; +} + +static void scan_mode_changed(void) +{ + uint8_t mode; + + mode = settings2scan_mode(); + + DBG("mode %u", mode); + + send_adapter_property(HAL_PROP_ADAPTER_SCAN_MODE, sizeof(mode), &mode); +} + +static void adapter_class_changed(void) +{ + send_adapter_property(HAL_PROP_ADAPTER_CLASS, sizeof(adapter.dev_class), + &adapter.dev_class); +} + +static void settings_changed(uint32_t settings) +{ + uint32_t changed_mask; + uint32_t scan_mode_mask; + + changed_mask = adapter.current_settings ^ settings; + + adapter.current_settings = settings; + + DBG("0x%08x", changed_mask); + + if (changed_mask & MGMT_SETTING_POWERED) + powered_changed(); + + scan_mode_mask = MGMT_SETTING_CONNECTABLE | + MGMT_SETTING_DISCOVERABLE; + + /* + * Only when powered, the connectable and discoverable + * state changes should be communicated. + */ + if (adapter.current_settings & MGMT_SETTING_POWERED) + if (changed_mask & scan_mode_mask) + scan_mode_changed(); +} + +static void new_settings_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + uint32_t settings; + + if (length < sizeof(settings)) { + error("Wrong size of new settings parameters"); + return; + } + + settings = get_le32(param); + + DBG("settings: 0x%8.8x -> 0x%8.8x", adapter.current_settings, + settings); + + if (settings == adapter.current_settings) + return; + + settings_changed(settings); +} + +static void mgmt_dev_class_changed_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_cod *rp = param; + uint32_t dev_class; + + if (length < sizeof(*rp)) { + error("Wrong size of class of device changed parameters"); + return; + } + + dev_class = rp->val[0] | (rp->val[1] << 8) | (rp->val[2] << 16); + + if (dev_class == adapter.dev_class) + return; + + DBG("Class: 0x%06x", dev_class); + + adapter.dev_class = dev_class; + + adapter_class_changed(); + + /* TODO: Gatt attrib set*/ +} + +static void store_link_key(const bdaddr_t *dst, const uint8_t *key, + uint8_t type, uint8_t pin_length) +{ + GKeyFile *key_file; + char key_str[33]; + gsize length = 0; + char addr[18]; + char *data; + int i; + + key_file = g_key_file_new(); + + if (!g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL)) { + g_key_file_free(key_file); + return; + } + + ba2str(dst, addr); + + DBG("%s type %u pin_len %u", addr, type, pin_length); + + for (i = 0; i < 16; i++) + sprintf(key_str + (i * 2), "%2.2X", key[i]); + + g_key_file_set_string(key_file, addr, "LinkKey", key_str); + g_key_file_set_integer(key_file, addr, "LinkKeyType", type); + g_key_file_set_integer(key_file, addr, "LinkKeyPinLength", pin_length); + + data = g_key_file_to_data(key_file, &length, NULL); + g_file_set_contents(DEVICES_FILE, data, length, NULL); + g_free(data); + + g_key_file_free(key_file); +} + +static void send_bond_state_change(const bdaddr_t *addr, uint8_t status, + uint8_t state) +{ + struct hal_ev_bond_state_changed ev; + + ev.status = status; + ev.state = state; + bdaddr2android(addr, ev.bdaddr); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_BOND_STATE_CHANGED, sizeof(ev), &ev); +} + +static void set_device_bond_state(const bdaddr_t *addr, uint8_t status, + int state) +{ + struct device *dev; + + dev = find_device(addr); + if (!dev) + return; + + if (dev->bond_state == state) + return; + + switch (state) { + case HAL_BOND_STATE_NONE: + if (dev->bond_state == HAL_BOND_STATE_BONDED) { + bonded_devices = g_slist_remove(bonded_devices, dev); + remove_device_info(dev, DEVICES_FILE); + cache_device(dev); + } + break; + case HAL_BOND_STATE_BONDED: + cached_devices = g_slist_remove(cached_devices, dev); + bonded_devices = g_slist_prepend(bonded_devices, dev); + remove_device_info(dev, CACHE_FILE); + store_device_info(dev, DEVICES_FILE); + break; + case HAL_BOND_STATE_BONDING: + default: + break; + } + + dev->bond_state = state; + + send_bond_state_change(&dev->bdaddr, status, state); +} + +static void send_device_property(const bdaddr_t *bdaddr, uint8_t type, + uint16_t len, const void *val) +{ + uint8_t buf[BASELEN_REMOTE_DEV_PROP + len]; + struct hal_ev_remote_device_props *ev = (void *) buf; + + ev->status = HAL_STATUS_SUCCESS; + bdaddr2android(bdaddr, ev->bdaddr); + ev->num_props = 1; + ev->props[0].type = type; + ev->props[0].len = len; + memcpy(ev->props[0].val, val, len); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_REMOTE_DEVICE_PROPS, sizeof(buf), buf); +} + +static void send_device_uuids_notif(struct device *dev) +{ + uint8_t buf[sizeof(uint128_t) * g_slist_length(dev->uuids)]; + uint8_t *ptr = buf; + GSList *l; + + for (l = dev->uuids; l; l = g_slist_next(l)) { + memcpy(ptr, l->data, sizeof(uint128_t)); + ptr += sizeof(uint128_t); + } + + send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_UUIDS, sizeof(buf), + buf); +} + +static void set_device_uuids(struct device *dev, GSList *uuids) +{ + g_slist_free_full(dev->uuids, g_free); + dev->uuids = uuids; + + if (dev->bond_state == HAL_BOND_STATE_BONDED) + store_device_info(dev, DEVICES_FILE); + else + store_device_info(dev, CACHE_FILE); + + send_device_uuids_notif(dev); +} + +static void browse_req_free(struct browse_req *req) +{ + g_slist_free_full(req->uuids, g_free); + g_free(req); +} + +static int uuid_128_cmp(gconstpointer a, gconstpointer b) +{ + return memcmp(a, b, sizeof(uint128_t)); +} + +static void update_records(struct browse_req *req, sdp_list_t *recs) +{ + for (; recs; recs = recs->next) { + sdp_record_t *rec = (sdp_record_t *) recs->data; + sdp_list_t *svcclass = NULL; + uuid_t uuid128; + uuid_t *tmp; + uint8_t *new_uuid; + + if (!rec) + break; + + if (sdp_get_service_classes(rec, &svcclass) < 0) + continue; + + if (!svcclass) + continue; + + tmp = svcclass->data; + + switch (tmp->type) { + case SDP_UUID16: + sdp_uuid16_to_uuid128(&uuid128, tmp); + break; + case SDP_UUID32: + sdp_uuid32_to_uuid128(&uuid128, tmp); + break; + case SDP_UUID128: + memcpy(&uuid128, tmp, sizeof(uuid_t)); + break; + default: + sdp_list_free(svcclass, free); + continue; + } + + new_uuid = g_malloc(16);/* size of 128 bit uuid */ + memcpy(new_uuid, &uuid128.value.uuid128, + sizeof(uuid128.value.uuid128)); + + /* Check if uuid is already added */ + if (g_slist_find_custom(req->uuids, new_uuid, uuid_128_cmp)) + g_free(new_uuid); + else + req->uuids = g_slist_append(req->uuids, new_uuid); + + sdp_list_free(svcclass, free); + } +} + +static void browse_cb(sdp_list_t *recs, int err, gpointer user_data) +{ + struct browse_req *req = user_data; + struct device *dev; + uuid_t uuid; + + /* If we have a valid response and req->search_uuid == 2, then L2CAP + * UUID & PNP searching was successful -- we are done */ + if (err < 0 || req->search_uuid == 2) { + if (err == -ECONNRESET && req->reconnect_attempt < 1) { + req->search_uuid--; + req->reconnect_attempt++; + } else { + goto done; + } + } + + update_records(req, recs); + + /* Search for mandatory uuids */ + if (uuid_list[req->search_uuid]) { + sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]); + bt_search_service(&adapter.bdaddr, &req->bdaddr, &uuid, + browse_cb, user_data, NULL, 0); + return; + } + +done: + dev = find_device(&req->bdaddr); + if (dev) { + set_device_uuids(dev, req->uuids); + req->uuids = NULL; + } + + browse_reqs = g_slist_remove(browse_reqs, req); + browse_req_free(req); +} + +static int req_cmp(gconstpointer a, gconstpointer b) +{ + const struct browse_req *req = a; + const bdaddr_t *bdaddr = b; + + return bacmp(&req->bdaddr, bdaddr); +} + +static uint8_t browse_remote_sdp(const bdaddr_t *addr) +{ + struct browse_req *req; + uuid_t uuid; + + if (g_slist_find_custom(browse_reqs, addr, req_cmp)) + return HAL_STATUS_SUCCESS; + + req = g_new0(struct browse_req, 1); + bacpy(&req->bdaddr, addr); + sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]); + + if (bt_search_service(&adapter.bdaddr, + &req->bdaddr, &uuid, browse_cb, req, NULL , 0) < 0) { + browse_req_free(req); + return HAL_STATUS_FAILED; + } + + browse_reqs = g_slist_append(browse_reqs, req); + + return HAL_STATUS_SUCCESS; +} + +static void new_link_key_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_new_link_key *ev = param; + const struct mgmt_addr_info *addr = &ev->key.addr; + char dst[18]; + + if (length < sizeof(*ev)) { + error("Too small new link key event"); + return; + } + + ba2str(&addr->bdaddr, dst); + + DBG("new key for %s type %u pin_len %u", + dst, ev->key.type, ev->key.pin_len); + + if (ev->key.pin_len > 16) { + error("Invalid PIN length (%u) in new_key event", + ev->key.pin_len); + return; + } + + set_device_bond_state(&addr->bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_BONDED); + + if (ev->store_hint) { + const struct mgmt_link_key_info *key = &ev->key; + + store_link_key(&addr->bdaddr, key->val, key->type, + key->pin_len); + } + + browse_remote_sdp(&addr->bdaddr); +} + +static uint8_t get_device_name(struct device *dev) +{ + send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_NAME, + strlen(dev->name), dev->name); + + return HAL_STATUS_SUCCESS; +} + +static void pin_code_request_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_pin_code_request *ev = param; + struct hal_ev_pin_request hal_ev; + struct device *dev; + char dst[18]; + + if (length < sizeof(*ev)) { + error("Too small PIN code request event"); + return; + } + + ba2str(&ev->addr.bdaddr, dst); + + dev = get_device(&ev->addr.bdaddr, BDADDR_BREDR); + + /* Workaround for Android Bluetooth.apk issue: send remote + * device property */ + get_device_name(dev); + + set_device_bond_state(&ev->addr.bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_BONDING); + + DBG("%s type %u secure %u", dst, ev->addr.type, ev->secure); + + /* Name already sent in remote device prop */ + memset(&hal_ev, 0, sizeof(hal_ev)); + bdaddr2android(&ev->addr.bdaddr, hal_ev.bdaddr); + hal_ev.class_of_dev = dev->class; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_EV_PIN_REQUEST, + sizeof(hal_ev), &hal_ev); +} + +static void send_ssp_request(const bdaddr_t *addr, uint8_t variant, + uint32_t passkey) +{ + struct hal_ev_ssp_request ev; + + /* It is ok to have empty name and CoD of remote devices here since + * those information has been already provided on device_connected event + * or during device scaning. Android will use that instead. + */ + memset(&ev, 0, sizeof(ev)); + bdaddr2android(addr, ev.bdaddr); + ev.pairing_variant = variant; + ev.passkey = passkey; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_EV_SSP_REQUEST, + sizeof(ev), &ev); +} + +static void user_confirm_request_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_user_confirm_request *ev = param; + char dst[18]; + + if (length < sizeof(*ev)) { + error("Too small user confirm request event"); + return; + } + + ba2str(&ev->addr.bdaddr, dst); + DBG("%s confirm_hint %u", dst, ev->confirm_hint); + + set_device_bond_state(&ev->addr.bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_BONDING); + + if (ev->confirm_hint) + send_ssp_request(&ev->addr.bdaddr, HAL_SSP_VARIANT_CONSENT, 0); + else + send_ssp_request(&ev->addr.bdaddr, HAL_SSP_VARIANT_CONFIRM, + ev->value); +} + +static void user_passkey_request_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_user_passkey_request *ev = param; + char dst[18]; + + if (length < sizeof(*ev)) { + error("Too small passkey request event"); + return; + } + + ba2str(&ev->addr.bdaddr, dst); + DBG("%s", dst); + + set_device_bond_state(&ev->addr.bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_BONDING); + + send_ssp_request(&ev->addr.bdaddr, HAL_SSP_VARIANT_ENTRY, 0); +} + +static void user_passkey_notify_callback(uint16_t index, uint16_t length, + const void *param, + void *user_data) +{ + const struct mgmt_ev_passkey_notify *ev = param; + char dst[18]; + + if (length < sizeof(*ev)) { + error("Too small passkey notify event"); + return; + } + + ba2str(&ev->addr.bdaddr, dst); + DBG("%s entered %u", dst, ev->entered); + + /* HAL seems to not support entered characters */ + if (ev->entered) + return; + + set_device_bond_state(&ev->addr.bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_BONDING); + + send_ssp_request(&ev->addr.bdaddr, HAL_SSP_VARIANT_NOTIF, ev->passkey); +} + +static void clear_device_found(gpointer data, gpointer user_data) +{ + struct device *dev = data; + + dev->found = false; +} + +static uint8_t get_adapter_discovering_type(void) +{ + uint8_t type; + + if (adapter.current_settings & MGMT_SETTING_BREDR) + type = SCAN_TYPE_BREDR; + else + type = 0; + + if (adapter.current_settings & MGMT_SETTING_LE) + type |= SCAN_TYPE_LE; + + return type; +} + +static bool start_discovery(uint8_t type) +{ + struct mgmt_cp_start_discovery cp; + + cp.type = get_adapter_discovering_type() & type; + + DBG("type=0x%x", cp.type); + + if (mgmt_send(mgmt_if, MGMT_OP_START_DISCOVERY, adapter.index, + sizeof(cp), &cp, NULL, NULL, NULL) > 0) + return true; + + error("Failed to start discovery"); + + return false; +} + +static void mgmt_discovering_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_discovering *ev = param; + struct hal_ev_discovery_state_changed cp; + bool is_discovering = adapter.cur_discovery_type; + + if (length < sizeof(*ev)) { + error("Too small discovering event"); + return; + } + + DBG("hci%u type %u discovering %u", index, ev->type, + ev->discovering); + + if (is_discovering == !!ev->discovering) + return; + + adapter.cur_discovery_type = ev->discovering ? + ev->type : SCAN_TYPE_NONE; + + DBG("new discovering state %u", ev->discovering); + + if (adapter.cur_discovery_type != SCAN_TYPE_NONE) { + cp.state = HAL_DISCOVERY_STATE_STARTED; + } else { + g_slist_foreach(bonded_devices, clear_device_found, NULL); + g_slist_foreach(cached_devices, clear_device_found, NULL); + cp.state = HAL_DISCOVERY_STATE_STOPPED; + } + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_DISCOVERY_STATE_CHANGED, sizeof(cp), &cp); + + if (gatt_discovery_stopped_cb && + (adapter.cur_discovery_type == SCAN_TYPE_NONE)) { + /* One shot notification about discovery stopped send to gatt*/ + gatt_discovery_stopped_cb(); + gatt_discovery_stopped_cb = NULL; + } + + /* If discovery is ON or there is no expected next discovery session + * then just return + */ + if ((adapter.cur_discovery_type != SCAN_TYPE_NONE) || + (adapter.exp_discovery_type == SCAN_TYPE_NONE)) + return; + + start_discovery(adapter.exp_discovery_type); + + /* Maintain expected discovery type if there is gatt client + * registered + */ + adapter.exp_discovery_type = gatt_device_found_cb ? + SCAN_TYPE_LE : SCAN_TYPE_NONE; +} + +static void confirm_device_name_cb(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_rp_confirm_name *rp = param; + struct device *dev; + + DBG("Confirm name status: %s (0x%02x)", mgmt_errstr(status), status); + + if (length < sizeof(*rp)) { + error("Wrong size of confirm name response"); + return; + } + + dev = find_device(&rp->addr.bdaddr); + if (!dev) + return; + + dev->confirm_id = 0; +} + +static unsigned int confirm_device_name(const bdaddr_t *addr, uint8_t addr_type, + bool resolve_name) +{ + struct mgmt_cp_confirm_name cp; + unsigned int res; + + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.addr.bdaddr, addr); + cp.addr.type = addr_type; + + if (!resolve_name) + cp.name_known = 1; + + res = mgmt_send(mgmt_if, MGMT_OP_CONFIRM_NAME, adapter.index, + sizeof(cp), &cp, confirm_device_name_cb, + NULL, NULL); + if (!res) + error("Failed to send confirm name request"); + + return res; +} + +static int fill_hal_prop(void *buf, uint8_t type, uint16_t len, + const void *val) +{ + struct hal_property *prop = buf; + + prop->type = type; + prop->len = len; + memcpy(prop->val, val, len); + + return sizeof(*prop) + len; +} + +static uint8_t get_device_android_type(struct device *dev) +{ + if (dev->bredr && dev->le) + return HAL_TYPE_DUAL; + + if (dev->le) + return HAL_TYPE_LE; + + return HAL_TYPE_BREDR; +} + +static bool rssi_above_threshold(int old, int new) +{ + /* only 8 dBm or more */ + return abs(old - new) >= 8; +} + +static void update_new_device(struct device *dev, int8_t rssi, + const struct eir_data *eir) +{ + uint8_t buf[IPC_MTU]; + struct hal_ev_device_found *ev = (void *) buf; + bdaddr_t android_bdaddr; + uint8_t android_type; + int size; + + memset(buf, 0, sizeof(buf)); + + if (adapter.cur_discovery_type) + dev->found = true; + + size = sizeof(*ev); + + bdaddr2android(&dev->bdaddr, &android_bdaddr); + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_ADDR, + sizeof(android_bdaddr), + &android_bdaddr); + ev->num_props++; + + android_type = get_device_android_type(dev); + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_TYPE, + sizeof(android_type), &android_type); + ev->num_props++; + + if (eir->class) + dev->class = eir->class; + + if (dev->class) { + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_CLASS, + sizeof(dev->class), &dev->class); + ev->num_props++; + } + + if (rssi && rssi_above_threshold(dev->rssi, rssi)) + dev->rssi = rssi; + + if (dev->rssi) { + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_RSSI, + sizeof(dev->rssi), &dev->rssi); + ev->num_props++; + } + + if (eir->name && strlen(eir->name)) { + g_free(dev->name); + dev->name = g_strdup(eir->name); + } + + if (dev->name) { + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_NAME, + strlen(dev->name), dev->name); + ev->num_props++; + } + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_EV_DEVICE_FOUND, + size, buf); +} + +static void update_device(struct device *dev, int8_t rssi, + const struct eir_data *eir, uint8_t bdaddr_type) +{ + uint8_t buf[IPC_MTU]; + struct hal_ev_remote_device_props *ev = (void *) buf; + uint8_t android_type; + int size; + + memset(buf, 0, sizeof(buf)); + + size = sizeof(*ev); + + ev->status = HAL_STATUS_SUCCESS; + bdaddr2android(&dev->bdaddr, ev->bdaddr); + + if (dev->bdaddr_type != bdaddr_type) { + bool type_changed = false; + + dev->bdaddr_type = bdaddr_type; + if (bdaddr_type == BDADDR_BREDR) { + type_changed = !dev->bredr; + dev->bredr = true; + } else { + type_changed = !dev->le; + dev->le = true; + } + + if (type_changed) { + android_type = get_device_android_type(dev); + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_TYPE, + sizeof(android_type), + &android_type); + ev->num_props++; + } + } + + if (eir->class && dev->class != eir->class) { + dev->class = eir->class; + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_CLASS, + sizeof(dev->class), &dev->class); + ev->num_props++; + } + + if (rssi && rssi_above_threshold(dev->rssi, rssi)) { + dev->rssi = rssi; + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_RSSI, + sizeof(dev->rssi), &dev->rssi); + ev->num_props++; + } + + if (eir->name && strlen(eir->name) && strcmp(dev->name, eir->name)) { + g_free(dev->name); + dev->name = g_strdup(eir->name); + size += fill_hal_prop(buf + size, HAL_PROP_DEVICE_NAME, + strlen(dev->name), dev->name); + ev->num_props++; + } + + if (ev->num_props) + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_REMOTE_DEVICE_PROPS, size, buf); +} + +static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type, + int8_t rssi, bool confirm, + const uint8_t *data, uint8_t data_len) +{ + struct eir_data eir; + struct device *dev; + + memset(&eir, 0, sizeof(eir)); + + eir_parse(&eir, data, data_len); + + dev = find_device(bdaddr); + + if (bdaddr_type != BDADDR_BREDR) { + /* Notify Gatt if its registered for LE events */ + if (gatt_device_found_cb) + gatt_device_found_cb(bdaddr, bdaddr_type, rssi, + sizeof(eir), &eir); + + if (!dev && adapter.cur_discovery_type != SCAN_TYPE_NONE && + !(eir.flags & (EIR_LIM_DISC | EIR_GEN_DISC))) { + eir_data_free(&eir); + return; + } + } + + /* Device found event needs to be send also for known device if this is + * new discovery session. Otherwise framework will ignore it. + */ + if (!dev || !dev->found) { + if (!dev) + dev = create_device(bdaddr, bdaddr_type); + + update_new_device(dev, rssi, &eir); + } else { + update_device(dev, rssi, &eir, bdaddr_type); + } + + eir_data_free(&eir); + + if (dev->bond_state != HAL_BOND_STATE_BONDED) + cache_device(dev); + + if (confirm) { + char addr[18]; + bool resolve_name = true; + + ba2str(bdaddr, addr); + + /* Don't need to confirm name if we have it already in cache + * Just check if device name is different than bdaddr */ + if (g_strcmp0(dev->name, addr)) { + get_device_name(dev); + resolve_name = false; + } + + info("Device %s needs name confirmation (resolve_name=%d)", + addr, resolve_name); + dev->confirm_id = confirm_device_name(bdaddr, bdaddr_type, + resolve_name); + } +} + +static void mgmt_device_found_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_device_found *ev = param; + const uint8_t *eir; + uint16_t eir_len; + uint32_t flags; + bool confirm_name; + char addr[18]; + + if (length < sizeof(*ev)) { + error("Too short device found event (%u bytes)", length); + return; + } + + eir_len = btohs(ev->eir_len); + if (length != sizeof(*ev) + eir_len) { + error("Device found event size mismatch (%u != %zu)", + length, sizeof(*ev) + eir_len); + return; + } + + if (eir_len == 0) + eir = NULL; + else + eir = ev->eir; + + flags = btohl(ev->flags); + + ba2str(&ev->addr.bdaddr, addr); + DBG("hci%u addr %s, rssi %d flags 0x%04x eir_len %u", + index, addr, ev->rssi, flags, eir_len); + + confirm_name = flags & MGMT_DEV_FOUND_CONFIRM_NAME; + + update_found_device(&ev->addr.bdaddr, ev->addr.type, ev->rssi, + confirm_name, eir, eir_len); +} + +static void mgmt_device_connected_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_device_connected *ev = param; + struct hal_ev_acl_state_changed hal_ev; + + if (length < sizeof(*ev)) { + error("Too short device connected event (%u bytes)", length); + return; + } + + update_found_device(&ev->addr.bdaddr, ev->addr.type, 0, false, + &ev->eir[0], btohs(ev->eir_len)); + + hal_ev.status = HAL_STATUS_SUCCESS; + hal_ev.state = HAL_ACL_STATE_CONNECTED; + bdaddr2android(&ev->addr.bdaddr, hal_ev.bdaddr); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_ACL_STATE_CHANGED, sizeof(hal_ev), &hal_ev); +} + +static void mgmt_device_disconnected_event(uint16_t index, uint16_t length, + const void *param, + void *user_data) +{ + const struct mgmt_ev_device_disconnected *ev = param; + struct hal_ev_acl_state_changed hal_ev; + + if (length < sizeof(*ev)) { + error("Too short device disconnected event (%u bytes)", length); + return; + } + + hal_ev.status = HAL_STATUS_SUCCESS; + hal_ev.state = HAL_ACL_STATE_DISCONNECTED; + bdaddr2android(&ev->addr.bdaddr, hal_ev.bdaddr); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_ACL_STATE_CHANGED, sizeof(hal_ev), &hal_ev); +} + +static uint8_t status_mgmt2hal(uint8_t mgmt) +{ + switch (mgmt) { + case MGMT_STATUS_SUCCESS: + return HAL_STATUS_SUCCESS; + case MGMT_STATUS_NO_RESOURCES: + return HAL_STATUS_NOMEM; + case MGMT_STATUS_BUSY: + return HAL_STATUS_BUSY; + case MGMT_STATUS_NOT_SUPPORTED: + return HAL_STATUS_UNSUPPORTED; + case MGMT_STATUS_INVALID_PARAMS: + return HAL_STATUS_INVALID; + case MGMT_STATUS_AUTH_FAILED: + return HAL_STATUS_AUTH_FAILURE; + case MGMT_STATUS_NOT_CONNECTED: + return HAL_STATUS_REMOTE_DEVICE_DOWN; + default: + return HAL_STATUS_FAILED; + } +} + +static void mgmt_connect_failed_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_connect_failed *ev = param; + struct device *dev; + + if (length < sizeof(*ev)) { + error("Too short connect failed event (%u bytes)", length); + return; + } + + DBG(""); + + dev = find_device(&ev->addr.bdaddr); + + /* In case security mode 3 pairing we will get connect failed event + * in case e.g wrong PIN code entered. Let's check if device is + * bonding, if so update bond state */ + + if (dev && dev->bond_state == HAL_BOND_STATE_BONDING) + set_device_bond_state(&ev->addr.bdaddr, + status_mgmt2hal(ev->status), + HAL_BOND_STATE_NONE); +} + +static void mgmt_auth_failed_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_auth_failed *ev = param; + struct device *dev; + + if (length < sizeof(*ev)) { + error("Too small auth failed mgmt event (%u bytes)", length); + return; + } + + DBG(""); + + dev = find_device(&ev->addr.bdaddr); + + if (dev && dev->bond_state == HAL_BOND_STATE_BONDING) + set_device_bond_state(&ev->addr.bdaddr, + status_mgmt2hal(ev->status), + HAL_BOND_STATE_NONE); +} + +static void mgmt_device_unpaired_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_device_unpaired *ev = param; + + if (length < sizeof(*ev)) { + error("Too small device unpaired event (%u bytes)", length); + return; + } + + DBG(""); + + /* TODO should device be disconnected ? */ + + set_device_bond_state(&ev->addr.bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_NONE); +} + +static void store_ltk(const bdaddr_t *dst, uint8_t bdaddr_type, bool master, + const uint8_t *key, uint8_t key_type, uint8_t enc_size, + uint16_t ediv, uint64_t rand) +{ + const char *key_s, *keytype_s, *encsize_s, *ediv_s, *rand_s; + GKeyFile *key_file; + char key_str[33]; + gsize length = 0; + char addr[18]; + char *data; + int i; + + key_file = g_key_file_new(); + if (!g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL)) { + g_key_file_free(key_file); + return; + } + + ba2str(dst, addr); + + key_s = master ? "LongTermKey" : "SlaveLongTermKey"; + keytype_s = master ? "LongTermKeyType" : "SlaveLongTermKeyType"; + encsize_s = master ? "LongTermKeyEncSize" : "SlaveLongTermKeyEncSize"; + ediv_s = master ? "LongTermKeyEDiv" : "SlaveLongTermKeyEDiv"; + rand_s = master ? "LongTermKeyRand" : "SlaveLongTermKeyRand"; + + for (i = 0; i < 16; i++) + sprintf(key_str + (i * 2), "%2.2X", key[i]); + + g_key_file_set_string(key_file, addr, key_s, key_str); + + g_key_file_set_integer(key_file, addr, keytype_s, key_type); + + g_key_file_set_integer(key_file, addr, encsize_s, enc_size); + + g_key_file_set_integer(key_file, addr, ediv_s, ediv); + + g_key_file_set_uint64(key_file, addr, rand_s, rand); + + data = g_key_file_to_data(key_file, &length, NULL); + g_file_set_contents(DEVICES_FILE, data, length, NULL); + g_free(data); + + g_key_file_free(key_file); +} + +static void new_long_term_key_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_ev_new_long_term_key *ev = param; + const struct mgmt_addr_info *addr = &ev->key.addr; + char dst[18]; + + if (length < sizeof(*ev)) { + error("Too small long term key event (%u bytes)", length); + return; + } + + ba2str(&addr->bdaddr, dst); + + DBG("new LTK for %s type %u enc_size %u store_hint %u", + dst, ev->key.type, ev->key.enc_size, ev->store_hint); + + set_device_bond_state(&addr->bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_BONDED); + + if (ev->store_hint) { + const struct mgmt_ltk_info *key = &ev->key; + uint16_t ediv; + uint64_t rand; + + ediv = le16_to_cpu(key->ediv); + rand = le64_to_cpu(key->rand); + + store_ltk(&key->addr.bdaddr, key->addr.type, key->master, + key->val, key->type, key->enc_size, ediv, rand); + } + + /* TODO browse services here? */ +} + +static void register_mgmt_handlers(void) +{ + mgmt_register(mgmt_if, MGMT_EV_NEW_SETTINGS, adapter.index, + new_settings_callback, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_CLASS_OF_DEV_CHANGED, adapter.index, + mgmt_dev_class_changed_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_LOCAL_NAME_CHANGED, adapter.index, + mgmt_local_name_changed_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_NEW_LINK_KEY, adapter.index, + new_link_key_callback, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_PIN_CODE_REQUEST, adapter.index, + pin_code_request_callback, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_USER_CONFIRM_REQUEST, adapter.index, + user_confirm_request_callback, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_USER_PASSKEY_REQUEST, adapter.index, + user_passkey_request_callback, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_PASSKEY_NOTIFY, adapter.index, + user_passkey_notify_callback, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_DISCOVERING, adapter.index, + mgmt_discovering_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_DEVICE_FOUND, adapter.index, + mgmt_device_found_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_DEVICE_CONNECTED, adapter.index, + mgmt_device_connected_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_DEVICE_DISCONNECTED, adapter.index, + mgmt_device_disconnected_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_CONNECT_FAILED, adapter.index, + mgmt_connect_failed_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_AUTH_FAILED, adapter.index, + mgmt_auth_failed_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_DEVICE_UNPAIRED, adapter.index, + mgmt_device_unpaired_event, NULL, NULL); + + mgmt_register(mgmt_if, MGMT_EV_NEW_LONG_TERM_KEY, adapter.index, + new_long_term_key_event, NULL, NULL); +} + +static void load_link_keys_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + bt_bluetooth_ready cb = user_data; + int err; + + if (status) { + error("Failed to load link keys for index %u: %s (0x%02x)", + adapter.index, mgmt_errstr(status), status); + err = -EIO; + goto failed; + } + + DBG("status %u", status); + + cb(0, &adapter.bdaddr); + return; + +failed: + cb(err, NULL); +} + +static void load_link_keys(GSList *keys, bt_bluetooth_ready cb) +{ + struct mgmt_cp_load_link_keys *cp; + struct mgmt_link_key_info *key; + size_t key_count, cp_size; + unsigned int id; + + key_count = g_slist_length(keys); + + DBG("keys %zu ", key_count); + + cp_size = sizeof(*cp) + (key_count * sizeof(*key)); + + cp = g_malloc0(cp_size); + + /* + * Even if the list of stored keys is empty, it is important to + * load an empty list into the kernel. That way it is ensured + * that no old keys from a previous daemon are present. + */ + cp->key_count = htobs(key_count); + + for (key = cp->keys; keys != NULL; keys = g_slist_next(keys), key++) + memcpy(key, keys->data, sizeof(*key)); + + id = mgmt_send(mgmt_if, MGMT_OP_LOAD_LINK_KEYS, adapter.index, + cp_size, cp, load_link_keys_complete, cb, NULL); + + g_free(cp); + + if (id == 0) { + error("Failed to load link keys"); + cb(-EIO, NULL); + } +} + +static void load_ltks(GSList *ltks) +{ + struct mgmt_cp_load_long_term_keys *cp; + struct mgmt_ltk_info *ltk; + size_t ltk_count, cp_size; + GSList *l; + + ltk_count = g_slist_length(ltks); + + DBG("ltks %zu", ltk_count); + + cp_size = sizeof(*cp) + (ltk_count * sizeof(*ltk)); + + cp = g_malloc0(cp_size); + + /* Even if the list of stored keys is empty, it is important to load + * an empty list into the kernel. That way it is ensured that no old + * keys from a previous daemon are present. + */ + cp->key_count = htobs(ltk_count); + + for (l = ltks, ltk = cp->keys; l != NULL; l = g_slist_next(l), ltk++) + memcpy(ltk, ltks->data, sizeof(*ltk)); + + if (mgmt_send(mgmt_if, MGMT_OP_LOAD_LONG_TERM_KEYS, adapter.index, + cp_size, cp, NULL, NULL, NULL) == 0) + error("Failed to load LTKs"); + + g_free(cp); +} + +static uint8_t get_adapter_uuids(void) +{ + struct hal_ev_adapter_props_changed *ev; + GSList *list = adapter.uuids; + unsigned int uuid_count = g_slist_length(list); + int len = uuid_count * sizeof(uint128_t); + uint8_t buf[BASELEN_PROP_CHANGED + len]; + uint8_t *p; + + memset(buf, 0, sizeof(buf)); + ev = (void *) buf; + + ev->num_props = 1; + ev->status = HAL_STATUS_SUCCESS; + + ev->props[0].type = HAL_PROP_ADAPTER_UUIDS; + ev->props[0].len = len; + p = ev->props->val; + + for (; list; list = g_slist_next(list)) { + uuid_t *uuid = list->data; + + memcpy(p, &uuid->value.uuid128, sizeof(uint128_t)); + + p += sizeof(uint128_t); + } + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_EV_ADAPTER_PROPS_CHANGED, sizeof(buf), ev); + + return HAL_STATUS_SUCCESS; +} + +static void remove_uuid_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + if (status != MGMT_STATUS_SUCCESS) { + error("Failed to remove UUID: %s (0x%02x)", + mgmt_errstr(status), status); + return; + } + + mgmt_dev_class_changed_event(adapter.index, length, param, NULL); + + get_adapter_uuids(); +} + +static void remove_uuid(uuid_t *uuid) +{ + uint128_t uint128; + struct mgmt_cp_remove_uuid cp; + + ntoh128((uint128_t *) uuid->value.uuid128.data, &uint128); + htob128(&uint128, (uint128_t *) cp.uuid); + + mgmt_send(mgmt_if, MGMT_OP_REMOVE_UUID, adapter.index, sizeof(cp), &cp, + remove_uuid_complete, NULL, NULL); +} + +static void add_uuid_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + if (status != MGMT_STATUS_SUCCESS) { + error("Failed to add UUID: %s (0x%02x)", + mgmt_errstr(status), status); + return; + } + + mgmt_dev_class_changed_event(adapter.index, length, param, NULL); + + get_adapter_uuids(); +} + +static void add_uuid(uint8_t svc_hint, uuid_t *uuid) +{ + uint128_t uint128; + struct mgmt_cp_add_uuid cp; + + ntoh128((uint128_t *) uuid->value.uuid128.data, &uint128); + htob128(&uint128, (uint128_t *) cp.uuid); + + cp.svc_hint = svc_hint; + + mgmt_send(mgmt_if, MGMT_OP_ADD_UUID, adapter.index, sizeof(cp), &cp, + add_uuid_complete, NULL, NULL); +} + +int bt_adapter_add_record(sdp_record_t *rec, uint8_t svc_hint) +{ + uuid_t *uuid; + + uuid = sdp_uuid_to_uuid128(&rec->svclass); + + if (g_slist_find_custom(adapter.uuids, uuid, sdp_uuid_cmp)) { + char uuid_str[32]; + + sdp_uuid2strn(uuid, uuid_str, sizeof(uuid_str)); + DBG("UUID %s already added", uuid_str); + + bt_free(uuid); + return -EALREADY; + } + + adapter.uuids = g_slist_prepend(adapter.uuids, uuid); + + add_uuid(svc_hint, uuid); + + return add_record_to_server(&adapter.bdaddr, rec); +} + +void bt_adapter_remove_record(uint32_t handle) +{ + sdp_record_t *rec; + GSList *uuid_found; + + rec = sdp_record_find(handle); + if (!rec) + return; + + uuid_found = g_slist_find_custom(adapter.uuids, &rec->svclass, + sdp_uuid_cmp); + if (uuid_found) { + uuid_t *uuid = uuid_found->data; + + remove_uuid(uuid); + + adapter.uuids = g_slist_remove(adapter.uuids, uuid); + + free(uuid); + } + + remove_record_from_server(handle); +} + +static void set_mode_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + if (status != MGMT_STATUS_SUCCESS) { + error("Failed to set mode: %s (0x%02x)", + mgmt_errstr(status), status); + return; + } + + /* + * The parameters are identical and also the task that is + * required in both cases. So it is safe to just call the + * event handling functions here. + */ + new_settings_callback(adapter.index, length, param, NULL); +} + +static bool set_mode(uint16_t opcode, uint8_t mode) +{ + struct mgmt_mode cp; + + memset(&cp, 0, sizeof(cp)); + cp.val = mode; + + DBG("opcode=0x%x mode=0x%x", opcode, mode); + + if (mgmt_send(mgmt_if, opcode, adapter.index, sizeof(cp), &cp, + set_mode_complete, NULL, NULL) > 0) + return true; + + error("Failed to set mode"); + + return false; +} + +static void set_io_capability(void) +{ + struct mgmt_cp_set_io_capability cp; + + memset(&cp, 0, sizeof(cp)); + cp.io_capability = DEFAULT_IO_CAPABILITY; + + if (mgmt_send(mgmt_if, MGMT_OP_SET_IO_CAPABILITY, adapter.index, + sizeof(cp), &cp, NULL, NULL, NULL) == 0) + error("Failed to set IO capability"); +} + +static void set_device_id(void) +{ + struct mgmt_cp_set_device_id cp; + uint8_t major, minor; + uint16_t version; + + if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2) + return; + + version = major << 8 | minor; + + memset(&cp, 0, sizeof(cp)); + cp.source = htobs(DEVICE_ID_SOURCE); + cp.vendor = htobs(DEVICE_ID_VENDOR); + cp.product = htobs(DEVICE_ID_PRODUCT); + cp.version = htobs(version); + + if (mgmt_send(mgmt_if, MGMT_OP_SET_DEVICE_ID, adapter.index, + sizeof(cp), &cp, NULL, NULL, NULL) == 0) + error("Failed to set device id"); + + register_device_id(DEVICE_ID_SOURCE, DEVICE_ID_VENDOR, + DEVICE_ID_PRODUCT, version); + + bt_adapter_add_record(sdp_record_find(0x10000), 0x00); +} + +static void set_adapter_name_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_cp_set_local_name *rp = param; + + if (status != MGMT_STATUS_SUCCESS) { + error("Failed to set name: %s (0x%02x)", + mgmt_errstr(status), status); + return; + } + + adapter_set_name(rp->name); +} + +static uint8_t set_adapter_name(const uint8_t *name, uint16_t len) +{ + struct mgmt_cp_set_local_name cp; + + memset(&cp, 0, sizeof(cp)); + memcpy(cp.name, name, len); + + if (mgmt_send(mgmt_if, MGMT_OP_SET_LOCAL_NAME, adapter.index, + sizeof(cp), &cp, set_adapter_name_complete, + NULL, NULL) > 0) + return HAL_STATUS_SUCCESS; + + error("Failed to set name"); + + return HAL_STATUS_FAILED; +} + +static uint8_t set_adapter_discoverable_timeout(const void *buf, uint16_t len) +{ + const uint32_t *timeout = buf; + + if (len != sizeof(*timeout)) { + error("Invalid set disc timeout size (%u bytes), terminating", + len); + raise(SIGTERM); + return HAL_STATUS_FAILED; + } + + /* Android handles discoverable timeout in Settings app. + * There is no need to use kernel feature for that. + * Just need to store this value here */ + + memcpy(&adapter.discoverable_timeout, timeout, sizeof(uint32_t)); + + store_adapter_config(); + + send_adapter_property(HAL_PROP_ADAPTER_DISC_TIMEOUT, + sizeof(adapter.discoverable_timeout), + &adapter.discoverable_timeout); + + return HAL_STATUS_SUCCESS; +} + +static void clear_uuids(void) +{ + struct mgmt_cp_remove_uuid cp; + + memset(&cp, 0, sizeof(cp)); + + mgmt_send(mgmt_if, MGMT_OP_REMOVE_UUID, adapter.index, + sizeof(cp), &cp, NULL, NULL, NULL); +} + +static struct device *create_device_from_info(GKeyFile *key_file, + const char *peer) +{ + struct device *dev; + uint8_t type; + bdaddr_t bdaddr; + char **uuids; + char *str; + + DBG("%s", peer); + + /* BREDR if not present */ + type = g_key_file_get_integer(key_file, peer, "AddressType", NULL); + + str2ba(peer, &bdaddr); + dev = create_device(&bdaddr, type); + + if (type != BDADDR_BREDR) + dev->bredr = g_key_file_get_boolean(key_file, peer, "BREDR", + NULL); + + str = g_key_file_get_string(key_file, peer, "LinkKey", NULL); + if (str) { + g_free(str); + dev->bond_state = HAL_BOND_STATE_BONDED; + } + + str = g_key_file_get_string(key_file, peer, "LongTermKey", NULL); + if (str) { + g_free(str); + dev->bond_state = HAL_BOND_STATE_BONDED; + } + + str = g_key_file_get_string(key_file, peer, "SlaveLongTermKey", NULL); + if (str) { + g_free(str); + dev->bond_state = HAL_BOND_STATE_BONDED; + } + + str = g_key_file_get_string(key_file, peer, "Name", NULL); + if (str) { + g_free(dev->name); + dev->name = str; + } + + str = g_key_file_get_string(key_file, peer, "FriendlyName", NULL); + if (str) { + g_free(dev->friendly_name); + dev->friendly_name = str; + } + + dev->class = g_key_file_get_integer(key_file, peer, "Class", NULL); + + dev->timestamp = g_key_file_get_integer(key_file, peer, "Timestamp", + NULL); + + uuids = g_key_file_get_string_list(key_file, peer, "Services", NULL, + NULL); + if (uuids) { + char **uuid; + + for (uuid = uuids; *uuid; uuid++) { + uint8_t *u = g_malloc0(16); + int i; + + for (i = 0; i < 16; i++) + sscanf((*uuid) + (i * 2), "%02hhX", &u[i]); + + dev->uuids = g_slist_append(dev->uuids, u); + } + + g_strfreev(uuids); + } + + return dev; +} + +static struct mgmt_link_key_info *get_key_info(GKeyFile *key_file, + const char *peer) +{ + struct mgmt_link_key_info *info = NULL; + char *str; + unsigned int i; + + str = g_key_file_get_string(key_file, peer, "LinkKey", NULL); + if (!str || strlen(str) != 32) + goto failed; + + info = g_new0(struct mgmt_link_key_info, 1); + + str2ba(peer, &info->addr.bdaddr); + + info->addr.type = g_key_file_get_integer(key_file, peer, "Type", NULL); + + for (i = 0; i < sizeof(info->val); i++) + sscanf(str + (i * 2), "%02hhX", &info->val[i]); + + info->type = g_key_file_get_integer(key_file, peer, "LinkKeyType", + NULL); + info->pin_len = g_key_file_get_integer(key_file, peer, + "LinkKeyPinLength", NULL); + +failed: + g_free(str); + + return info; +} + +static struct mgmt_ltk_info *get_ltk_info(GKeyFile *key_file, const char *peer, + bool master) +{ + const char *key_s, *keytype_s, *encsize_s, *ediv_s, *rand_s; + struct mgmt_ltk_info *info = NULL; + char *key; + unsigned int i; + + key_s = master ? "LongTermKey" : "SlaveLongTermKey"; + keytype_s = master ? "LongTermKeyType" : "SlaveLongTermKeyType"; + encsize_s = master ? "LongTermKeyEncSize" : "SlaveLongTermKeyEncSize"; + ediv_s = master ? "LongTermKeyEDiv" : "SlaveLongTermKeyEDiv"; + rand_s = master ? "LongTermKeyRand" : "SlaveLongTermKeyRand"; + + key = g_key_file_get_string(key_file, peer, key_s, NULL); + if (!key || strlen(key) != 32) + goto failed; + + info = g_new0(struct mgmt_ltk_info, 1); + + str2ba(peer, &info->addr.bdaddr); + + info->addr.type = g_key_file_get_integer(key_file, peer, "Type", NULL); + + for (i = 0; i < sizeof(info->val); i++) + sscanf(key + (i * 2), "%02hhX", &info->val[i]); + + info->type = g_key_file_get_integer(key_file, peer, keytype_s, NULL); + + info->enc_size = g_key_file_get_integer(key_file, peer, encsize_s, NULL); + + info->rand = g_key_file_get_uint64(key_file, peer, rand_s, NULL); + info->rand = cpu_to_le64(info->rand); + + info->ediv = g_key_file_get_integer(key_file, peer, ediv_s, NULL); + info->ediv = cpu_to_le16(info->ediv); + + info->master = master; + +failed: + g_free(key); + + return info; +} + +static int device_timestamp_cmp(gconstpointer a, gconstpointer b) +{ + const struct device *deva = a; + const struct device *devb = b; + + return deva->timestamp < devb->timestamp; +} + +static void load_devices_cache(void) +{ + GKeyFile *key_file; + gchar **devs; + gsize len = 0; + unsigned int i; + + key_file = g_key_file_new(); + + g_key_file_load_from_file(key_file, CACHE_FILE, 0, NULL); + + devs = g_key_file_get_groups(key_file, &len); + + for (i = 0; i < len; i++) { + struct device *dev; + + dev = create_device_from_info(key_file, devs[i]); + cached_devices = g_slist_prepend(cached_devices, dev); + } + + cached_devices = g_slist_sort(cached_devices, device_timestamp_cmp); + + g_strfreev(devs); + g_key_file_free(key_file); +} + +static void load_devices_info(bt_bluetooth_ready cb) +{ + GKeyFile *key_file; + gchar **devs; + gsize len = 0; + unsigned int i; + GSList *keys = NULL; + GSList *ltks = NULL; + + key_file = g_key_file_new(); + + g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL); + + devs = g_key_file_get_groups(key_file, &len); + + for (i = 0; i < len; i++) { + struct mgmt_link_key_info *key_info; + struct mgmt_ltk_info *ltk_info; + struct mgmt_ltk_info *slave_ltk_info; + struct device *dev; + + key_info = get_key_info(key_file, devs[i]); + ltk_info = get_ltk_info(key_file, devs[i], true); + slave_ltk_info = get_ltk_info(key_file, devs[i], false); + + if (!key_info && !ltk_info && !slave_ltk_info) { + error("Failed to load keys for %s, skipping", devs[i]); + + continue; + } + + if (key_info) + keys = g_slist_prepend(keys, key_info); + + if (ltk_info) + ltks = g_slist_prepend(ltks, ltk_info); + + if (slave_ltk_info) + ltks = g_slist_prepend(ltks, slave_ltk_info); + + dev = create_device_from_info(key_file, devs[i]); + + bonded_devices = g_slist_prepend(bonded_devices, dev); + } + + load_ltks(ltks); + g_slist_free_full(ltks, g_free); + + load_link_keys(keys, cb); + g_slist_free_full(keys, g_free); + + g_strfreev(devs); + g_key_file_free(key_file); +} + +static void set_adapter_class(void) +{ + struct mgmt_cp_set_dev_class cp; + + memset(&cp, 0, sizeof(cp)); + + /* + * kernel assign the major and minor numbers straight to dev_class[0] + * and dev_class[1] without considering the proper bit shifting. + */ + cp.major = ADAPTER_MAJOR_CLASS & 0x1f; + cp.minor = ADAPTER_MINOR_CLASS << 2; + + if (mgmt_send(mgmt_if, MGMT_OP_SET_DEV_CLASS, adapter.index, + sizeof(cp), &cp, NULL, NULL, NULL) > 0) + return; + + error("Failed to set class of device"); +} + +static void read_info_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_rp_read_info *rp = param; + bt_bluetooth_ready cb = user_data; + uint32_t missing_settings, supported_settings; + int err; + + DBG(""); + + if (status) { + error("Failed to read info for index %u: %s (0x%02x)", + adapter.index, mgmt_errstr(status), status); + err = -EIO; + goto failed; + } + + if (length < sizeof(*rp)) { + error("Too small read info complete response"); + err = -EIO; + goto failed; + } + + if (!bacmp(&rp->bdaddr, BDADDR_ANY)) { + error("No Bluetooth address"); + err = -ENODEV; + goto failed; + } + + load_adapter_config(); + + if (!bacmp(&adapter.bdaddr, BDADDR_ANY)) { + bacpy(&adapter.bdaddr, &rp->bdaddr); + adapter.name = g_strdup(DEFAULT_ADAPTER_NAME); + store_adapter_config(); + } else if (bacmp(&adapter.bdaddr, &rp->bdaddr)) { + error("Bluetooth address mismatch"); + err = -ENODEV; + goto failed; + } + + if (g_strcmp0(adapter.name, (const char *) rp->name)) + set_adapter_name((uint8_t *)adapter.name, strlen(adapter.name)); + + set_adapter_class(); + + /* Store adapter information */ + adapter.dev_class = rp->dev_class[0] | (rp->dev_class[1] << 8) | + (rp->dev_class[2] << 16); + + supported_settings = btohs(rp->supported_settings); + adapter.current_settings = btohs(rp->current_settings); + + /* TODO: Register all event notification handlers */ + register_mgmt_handlers(); + + clear_uuids(); + + set_io_capability(); + set_device_id(); + + missing_settings = adapter.current_settings ^ supported_settings; + + if (missing_settings & MGMT_SETTING_SSP) + set_mode(MGMT_OP_SET_SSP, 0x01); + + if (missing_settings & MGMT_SETTING_SECURE_CONN) + set_mode(MGMT_OP_SET_SECURE_CONN, 0x01); + + if (missing_settings & MGMT_SETTING_PAIRABLE) + set_mode(MGMT_OP_SET_PAIRABLE, 0x01); + + if (missing_settings & MGMT_SETTING_LE) + set_mode(MGMT_OP_SET_LE, 0x01); + + load_devices_info(cb); + load_devices_cache(); + + return; + +failed: + cb(err, NULL); +} + +static void mgmt_index_added_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + bt_bluetooth_ready cb = user_data; + + DBG("index %u", index); + + if (adapter.index != MGMT_INDEX_NONE) { + DBG("skip event for index %u", index); + return; + } + + if (option_index != MGMT_INDEX_NONE && option_index != index) { + DBG("skip event for index %u (option %u)", index, option_index); + return; + } + + adapter.index = index; + + if (mgmt_send(mgmt_if, MGMT_OP_READ_INFO, index, 0, NULL, + read_info_complete, cb, NULL) == 0) { + cb(-EIO, NULL); + return; + } +} + +static void mgmt_index_removed_event(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + DBG("index %u", index); + + if (index != adapter.index) + return; + + error("Adapter was removed. Exiting."); + raise(SIGTERM); +} + +static void read_index_list_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_rp_read_index_list *rp = param; + bt_bluetooth_ready cb = user_data; + uint16_t num; + int i; + + DBG(""); + + if (status) { + error("%s: Failed to read index list: %s (0x%02x)", + __func__, mgmt_errstr(status), status); + goto failed; + } + + if (length < sizeof(*rp)) { + error("%s: Wrong size of read index list response", __func__); + goto failed; + } + + num = btohs(rp->num_controllers); + + DBG("Number of controllers: %u", num); + + if (num * sizeof(uint16_t) + sizeof(*rp) != length) { + error("%s: Incorrect pkt size for index list rsp", __func__); + goto failed; + } + + if (adapter.index != MGMT_INDEX_NONE) + return; + + for (i = 0; i < num; i++) { + uint16_t index = btohs(rp->index[i]); + + if (option_index != MGMT_INDEX_NONE && option_index != index) + continue; + + if (mgmt_send(mgmt_if, MGMT_OP_READ_INFO, index, 0, NULL, + read_info_complete, cb, NULL) == 0) + goto failed; + + adapter.index = index; + return; + } + + return; + +failed: + cb(-EIO, NULL); +} + +static void read_version_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_rp_read_version *rp = param; + uint8_t mgmt_version, mgmt_revision; + bt_bluetooth_ready cb = user_data; + + DBG(""); + + if (status) { + error("Failed to read version information: %s (0x%02x)", + mgmt_errstr(status), status); + goto failed; + } + + if (length < sizeof(*rp)) { + error("Wrong size response"); + goto failed; + } + + mgmt_version = rp->version; + mgmt_revision = btohs(rp->revision); + + info("Bluetooth management interface %u.%u initialized", + mgmt_version, mgmt_revision); + + if (MGMT_VERSION(mgmt_version, mgmt_revision) < MGMT_VERSION(1, 3)) { + error("Version 1.3 or later of management interface required"); + goto failed; + } + + mgmt_register(mgmt_if, MGMT_EV_INDEX_ADDED, MGMT_INDEX_NONE, + mgmt_index_added_event, cb, NULL); + mgmt_register(mgmt_if, MGMT_EV_INDEX_REMOVED, MGMT_INDEX_NONE, + mgmt_index_removed_event, NULL, NULL); + + if (mgmt_send(mgmt_if, MGMT_OP_READ_INDEX_LIST, MGMT_INDEX_NONE, 0, + NULL, read_index_list_complete, cb, NULL) > 0) + return; + + error("Failed to read controller index list"); + +failed: + cb(-EIO, NULL); +} + +bool bt_bluetooth_start(int index, bool mgmt_dbg, bt_bluetooth_ready cb) +{ + DBG("index %d", index); + + mgmt_if = mgmt_new_default(); + if (!mgmt_if) { + error("Failed to access management interface"); + return false; + } + + if (mgmt_dbg) + mgmt_set_debug(mgmt_if, mgmt_debug, "mgmt_if: ", NULL); + + if (mgmt_send(mgmt_if, MGMT_OP_READ_VERSION, MGMT_INDEX_NONE, 0, NULL, + read_version_complete, cb, NULL) == 0) { + error("Error sending READ_VERSION mgmt command"); + + mgmt_unref(mgmt_if); + mgmt_if = NULL; + + return false; + } + + if (index >= 0) + option_index = index; + + return true; +} + +static void shutdown_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + bt_bluetooth_stopped cb = user_data; + + if (status != MGMT_STATUS_SUCCESS) + error("Clean controller shutdown failed"); + + cb(); +} + +bool bt_bluetooth_stop(bt_bluetooth_stopped cb) +{ + struct mgmt_mode cp; + + if (adapter.index == MGMT_INDEX_NONE) + return false; + + info("Switching controller off"); + + memset(&cp, 0, sizeof(cp)); + + return mgmt_send(mgmt_if, MGMT_OP_SET_POWERED, adapter.index, + sizeof(cp), &cp, shutdown_complete, (void *)cb, + NULL) > 0; +} + +void bt_bluetooth_cleanup(void) +{ + g_free(adapter.name); + adapter.name = NULL; + + mgmt_unref(mgmt_if); + mgmt_if = NULL; +} + +static bool set_discoverable(uint8_t mode, uint16_t timeout) +{ + struct mgmt_cp_set_discoverable cp; + + memset(&cp, 0, sizeof(cp)); + cp.val = mode; + cp.timeout = htobs(timeout); + + DBG("mode %u timeout %u", mode, timeout); + + if (mgmt_send(mgmt_if, MGMT_OP_SET_DISCOVERABLE, adapter.index, + sizeof(cp), &cp, set_mode_complete, NULL, NULL) > 0) + return true; + + error("Failed to set mode discoverable"); + + return false; +} + +static uint8_t get_adapter_address(void) +{ + uint8_t buf[6]; + + bdaddr2android(&adapter.bdaddr, buf); + + send_adapter_property(HAL_PROP_ADAPTER_ADDR, sizeof(buf), buf); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_adapter_name(void) +{ + if (!adapter.name) + return HAL_STATUS_FAILED; + + adapter_name_changed((uint8_t *) adapter.name); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_adapter_class(void) +{ + DBG(""); + + adapter_class_changed(); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t settings2type(void) +{ + bool bredr, le; + + bredr = adapter.current_settings & MGMT_SETTING_BREDR; + le = adapter.current_settings & MGMT_SETTING_LE; + + if (bredr && le) + return HAL_TYPE_DUAL; + + if (bredr && !le) + return HAL_TYPE_BREDR; + + if (!bredr && le) + return HAL_TYPE_LE; + + return 0; +} + +static uint8_t get_adapter_type(void) +{ + uint8_t type; + + DBG(""); + + type = settings2type(); + + if (!type) + return HAL_STATUS_FAILED; + + send_adapter_property(HAL_PROP_ADAPTER_TYPE, sizeof(type), &type); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_adapter_service_rec(void) +{ + DBG("Not implemented"); + + /* TODO: Add implementation */ + + return HAL_STATUS_FAILED; +} + +static uint8_t get_adapter_scan_mode(void) +{ + DBG(""); + + scan_mode_changed(); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_adapter_bonded_devices(void) +{ + uint8_t buf[sizeof(bdaddr_t) * g_slist_length(bonded_devices)]; + int i = 0; + GSList *l; + + DBG(""); + + for (l = bonded_devices; l; l = g_slist_next(l)) { + struct device *dev = l->data; + + bdaddr2android(&dev->bdaddr, buf + (i * sizeof(bdaddr_t))); + i++; + } + + send_adapter_property(HAL_PROP_ADAPTER_BONDED_DEVICES, + i * sizeof(bdaddr_t), buf); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_adapter_discoverable_timeout(void) +{ + send_adapter_property(HAL_PROP_ADAPTER_DISC_TIMEOUT, + sizeof(adapter.discoverable_timeout), + &adapter.discoverable_timeout); + + return HAL_STATUS_SUCCESS; +} + +static void handle_get_adapter_prop_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_get_adapter_prop *cmd = buf; + uint8_t status; + + switch (cmd->type) { + case HAL_PROP_ADAPTER_ADDR: + status = get_adapter_address(); + break; + case HAL_PROP_ADAPTER_NAME: + status = get_adapter_name(); + break; + case HAL_PROP_ADAPTER_UUIDS: + status = get_adapter_uuids(); + break; + case HAL_PROP_ADAPTER_CLASS: + status = get_adapter_class(); + break; + case HAL_PROP_ADAPTER_TYPE: + status = get_adapter_type(); + break; + case HAL_PROP_ADAPTER_SERVICE_REC: + status = get_adapter_service_rec(); + break; + case HAL_PROP_ADAPTER_SCAN_MODE: + status = get_adapter_scan_mode(); + break; + case HAL_PROP_ADAPTER_BONDED_DEVICES: + status = get_adapter_bonded_devices(); + break; + case HAL_PROP_ADAPTER_DISC_TIMEOUT: + status = get_adapter_discoverable_timeout(); + break; + default: + status = HAL_STATUS_FAILED; + break; + } + + if (status != HAL_STATUS_SUCCESS) + error("Failed to get adapter property (type %u status %u)", + cmd->type, status); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_GET_ADAPTER_PROP, + status); +} + +static void get_adapter_properties(void) +{ + get_adapter_address(); + get_adapter_name(); + get_adapter_uuids(); + get_adapter_class(); + get_adapter_type(); + get_adapter_service_rec(); + get_adapter_scan_mode(); + get_adapter_bonded_devices(); + get_adapter_discoverable_timeout(); +} + +static void cancel_pending_confirm_name(gpointer data, gpointer user_data) +{ + struct device *dev = data; + + mgmt_cancel(mgmt_if, dev->confirm_id); + dev->confirm_id = 0; +} + +static bool stop_discovery(uint8_t type) +{ + struct mgmt_cp_stop_discovery cp; + + cp.type = get_adapter_discovering_type() & type; + + DBG("type=0x%x", cp.type); + + /* Lets drop all confirm name request as we don't need it anymore */ + g_slist_foreach(cached_devices, cancel_pending_confirm_name, NULL); + + if (mgmt_send(mgmt_if, MGMT_OP_STOP_DISCOVERY, adapter.index, + sizeof(cp), &cp, NULL, NULL, NULL) > 0) + return true; + + error("Failed to stop discovery"); + return false; +} + +bool bt_le_discovery_stop(bt_le_discovery_stopped cb) +{ + if (!adapter.cur_discovery_type) { + if (cb) + cb(); + return true; + } + + gatt_discovery_stopped_cb = cb; + /* Remove device found callback */ + gatt_device_found_cb = NULL; + adapter.exp_discovery_type &= ~SCAN_TYPE_LE; + + return stop_discovery(adapter.cur_discovery_type); +} + +bool bt_le_discovery_start(bt_le_device_found cb) +{ + if (!(adapter.current_settings & MGMT_SETTING_POWERED)) + return false; + + gatt_device_found_cb = cb; + + adapter.exp_discovery_type |= SCAN_TYPE_LE; + + /* If core is discovering, don't bother */ + if (adapter.cur_discovery_type) + return true; + + return start_discovery(adapter.exp_discovery_type); +} + +static uint8_t set_adapter_scan_mode(const void *buf, uint16_t len) +{ + const uint8_t *mode = buf; + bool conn, disc, cur_conn, cur_disc; + + if (len != sizeof(*mode)) { + error("Invalid set scan mode size (%u bytes), terminating", + len); + raise(SIGTERM); + return HAL_STATUS_FAILED; + } + + cur_conn = adapter.current_settings & MGMT_SETTING_CONNECTABLE; + cur_disc = adapter.current_settings & MGMT_SETTING_DISCOVERABLE; + + DBG("connectable %u discoverable %d mode %u", cur_conn, cur_disc, + *mode); + + switch (*mode) { + case HAL_ADAPTER_SCAN_MODE_NONE: + if (!cur_conn && !cur_disc) + goto done; + + conn = false; + disc = false; + break; + case HAL_ADAPTER_SCAN_MODE_CONN: + if (cur_conn && !cur_disc) + goto done; + + conn = true; + disc = false; + break; + case HAL_ADAPTER_SCAN_MODE_CONN_DISC: + if (cur_conn && cur_disc) + goto done; + + conn = true; + disc = true; + break; + default: + return HAL_STATUS_FAILED; + } + + if (cur_conn != conn) { + if (!set_mode(MGMT_OP_SET_CONNECTABLE, conn ? 0x01 : 0x00)) + return HAL_STATUS_FAILED; + } + + if (cur_disc != disc && conn) { + if (!set_discoverable(disc ? 0x01 : 0x00, 0)) + return HAL_STATUS_FAILED; + } + + return HAL_STATUS_SUCCESS; + +done: + /* Android expects property changed callback */ + scan_mode_changed(); + + return HAL_STATUS_SUCCESS; +} + +static void handle_set_adapter_prop_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_set_adapter_prop *cmd = buf; + uint8_t status; + + if (len != sizeof(*cmd) + cmd->len) { + error("Invalid set adapter prop cmd (0x%x), terminating", + cmd->type); + raise(SIGTERM); + return; + } + + switch (cmd->type) { + case HAL_PROP_ADAPTER_SCAN_MODE: + status = set_adapter_scan_mode(cmd->val, cmd->len); + break; + case HAL_PROP_ADAPTER_NAME: + status = set_adapter_name(cmd->val, cmd->len); + break; + case HAL_PROP_ADAPTER_DISC_TIMEOUT: + status = set_adapter_discoverable_timeout(cmd->val, cmd->len); + break; + default: + DBG("Unhandled property type 0x%x", cmd->type); + status = HAL_STATUS_FAILED; + break; + } + + if (status != HAL_STATUS_SUCCESS) + error("Failed to set adapter property (type %u status %u)", + cmd->type, status); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_SET_ADAPTER_PROP, + status); +} + +static void pair_device_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_rp_pair_device *rp = param; + + DBG("status %u", status); + + /* On success bond state change will be send when new link key or LTK + * event is received */ + if (status == MGMT_STATUS_SUCCESS) + return; + + set_device_bond_state(&rp->addr.bdaddr, status_mgmt2hal(status), + HAL_BOND_STATE_NONE); +} + +static void handle_create_bond_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_create_bond *cmd = buf; + struct device *dev; + uint8_t status; + struct mgmt_cp_pair_device cp; + + cp.io_cap = DEFAULT_IO_CAPABILITY; + android2bdaddr(cmd->bdaddr, &cp.addr.bdaddr); + + dev = find_device(&cp.addr.bdaddr); + + if (dev) { + if (dev->bond_state != HAL_BOND_STATE_NONE) { + status = HAL_STATUS_FAILED; + goto fail; + } + + cp.addr.type = dev->bredr ? BDADDR_BREDR : dev->bdaddr_type; + } else { + /* Fallback to BREDR if device is unknown eg. OOB */ + cp.addr.type = BDADDR_BREDR; + } + + if (mgmt_send(mgmt_if, MGMT_OP_PAIR_DEVICE, adapter.index, sizeof(cp), + &cp, pair_device_complete, NULL, NULL) == 0) { + status = HAL_STATUS_FAILED; + goto fail; + } + + status = HAL_STATUS_SUCCESS; + + set_device_bond_state(&cp.addr.bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_BONDING); + +fail: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_CREATE_BOND, + status); +} + +static void handle_cancel_bond_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_cancel_bond *cmd = buf; + struct mgmt_addr_info cp; + struct device *dev; + uint8_t status; + + android2bdaddr(cmd->bdaddr, &cp.bdaddr); + + dev = find_device(&cp.bdaddr); + if (!dev) { + status = HAL_STATUS_FAILED; + goto failed; + } + + cp.type = dev->bredr ? BDADDR_BREDR : dev->bdaddr_type; + + + if (mgmt_reply(mgmt_if, MGMT_OP_CANCEL_PAIR_DEVICE, + adapter.index, sizeof(cp), &cp, + NULL, NULL, NULL) == 0) { + status = HAL_STATUS_FAILED; + goto failed; + } + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_CANCEL_BOND, + status); +} + +static void unpair_device_complete(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + const struct mgmt_rp_unpair_device *rp = param; + + DBG("status %u", status); + + if (status != MGMT_STATUS_SUCCESS && status != MGMT_STATUS_NOT_PAIRED) + return; + + set_device_bond_state(&rp->addr.bdaddr, HAL_STATUS_SUCCESS, + HAL_BOND_STATE_NONE); +} + +static void handle_remove_bond_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_remove_bond *cmd = buf; + struct mgmt_cp_unpair_device cp; + struct device *dev; + uint8_t status; + + cp.disconnect = 1; + android2bdaddr(cmd->bdaddr, &cp.addr.bdaddr); + + dev = find_device(&cp.addr.bdaddr); + if (!dev) { + status = HAL_STATUS_FAILED; + goto failed; + } + + cp.addr.type = dev->bredr ? BDADDR_BREDR : dev->bdaddr_type; + + if (mgmt_send(mgmt_if, MGMT_OP_UNPAIR_DEVICE, adapter.index, + sizeof(cp), &cp, unpair_device_complete, + NULL, NULL) == 0) { + status = HAL_STATUS_FAILED; + goto failed; + } + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_REMOVE_BOND, + status); +} + +static void handle_pin_reply_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_pin_reply *cmd = buf; + uint8_t status; + bdaddr_t bdaddr; + char addr[18]; + + android2bdaddr(cmd->bdaddr, &bdaddr); + ba2str(&bdaddr, addr); + + DBG("%s accept %u pin_len %u", addr, cmd->accept, cmd->pin_len); + + if (!cmd->accept && cmd->pin_len) { + status = HAL_STATUS_INVALID; + goto failed; + } + + if (cmd->accept) { + struct mgmt_cp_pin_code_reply rp; + + memset(&rp, 0, sizeof(rp)); + + bacpy(&rp.addr.bdaddr, &bdaddr); + rp.addr.type = BDADDR_BREDR; + rp.pin_len = cmd->pin_len; + memcpy(rp.pin_code, cmd->pin_code, rp.pin_len); + + if (mgmt_reply(mgmt_if, MGMT_OP_PIN_CODE_REPLY, adapter.index, + sizeof(rp), &rp, NULL, NULL, NULL) == 0) { + status = HAL_STATUS_FAILED; + goto failed; + } + } else { + struct mgmt_cp_pin_code_neg_reply rp; + + bacpy(&rp.addr.bdaddr, &bdaddr); + rp.addr.type = BDADDR_BREDR; + + if (mgmt_reply(mgmt_if, MGMT_OP_PIN_CODE_NEG_REPLY, + adapter.index, sizeof(rp), &rp, + NULL, NULL, NULL) == 0) { + status = HAL_STATUS_FAILED; + goto failed; + } + } + + status = HAL_STATUS_SUCCESS; +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_PIN_REPLY, + status); +} + +static uint8_t user_confirm_reply(const bdaddr_t *bdaddr, bool accept) +{ + struct mgmt_addr_info cp; + uint16_t opcode; + + if (accept) + opcode = MGMT_OP_USER_CONFIRM_REPLY; + else + opcode = MGMT_OP_USER_CONFIRM_NEG_REPLY; + + bacpy(&cp.bdaddr, bdaddr); + cp.type = BDADDR_BREDR; + + if (mgmt_reply(mgmt_if, opcode, adapter.index, sizeof(cp), &cp, + NULL, NULL, NULL) > 0) + return HAL_STATUS_SUCCESS; + + return HAL_STATUS_FAILED; +} + +static uint8_t user_passkey_reply(const bdaddr_t *bdaddr, bool accept, + uint32_t passkey) +{ + unsigned int id; + + if (accept) { + struct mgmt_cp_user_passkey_reply cp; + + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.addr.bdaddr, bdaddr); + cp.addr.type = BDADDR_BREDR; + cp.passkey = htobl(passkey); + + id = mgmt_reply(mgmt_if, MGMT_OP_USER_PASSKEY_REPLY, + adapter.index, sizeof(cp), &cp, + NULL, NULL, NULL); + } else { + struct mgmt_cp_user_passkey_neg_reply cp; + + memset(&cp, 0, sizeof(cp)); + bacpy(&cp.addr.bdaddr, bdaddr); + cp.addr.type = BDADDR_BREDR; + + id = mgmt_reply(mgmt_if, MGMT_OP_USER_PASSKEY_NEG_REPLY, + adapter.index, sizeof(cp), &cp, + NULL, NULL, NULL); + } + + if (id == 0) + return HAL_STATUS_FAILED; + + return HAL_STATUS_SUCCESS; +} + +static void handle_ssp_reply_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_ssp_reply *cmd = buf; + bdaddr_t bdaddr; + uint8_t status; + char addr[18]; + + /* TODO should parameters sanity be verified here? */ + + android2bdaddr(cmd->bdaddr, &bdaddr); + ba2str(&bdaddr, addr); + + DBG("%s variant %u accept %u", addr, cmd->ssp_variant, cmd->accept); + + switch (cmd->ssp_variant) { + case HAL_SSP_VARIANT_CONFIRM: + case HAL_SSP_VARIANT_CONSENT: + status = user_confirm_reply(&bdaddr, cmd->accept); + break; + case HAL_SSP_VARIANT_ENTRY: + status = user_passkey_reply(&bdaddr, cmd->accept, + cmd->passkey); + break; + case HAL_SSP_VARIANT_NOTIF: + status = HAL_STATUS_SUCCESS; + break; + default: + status = HAL_STATUS_INVALID; + break; + } + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_SSP_REPLY, + status); +} + +static void handle_get_remote_services_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_get_remote_services *cmd = buf; + uint8_t status; + bdaddr_t addr; + + android2bdaddr(&cmd->bdaddr, &addr); + + status = browse_remote_sdp(&addr); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_SERVICES, status); +} + +static uint8_t get_device_uuids(struct device *dev) +{ + send_device_uuids_notif(dev); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_device_class(struct device *dev) +{ + send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_CLASS, + sizeof(dev->class), &dev->class); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_device_type(struct device *dev) +{ + uint8_t type = get_device_android_type(dev); + + send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_TYPE, + sizeof(type), &type); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_device_service_rec(struct device *dev) +{ + DBG("Not implemented"); + + /* TODO */ + + return HAL_STATUS_FAILED; +} + +static uint8_t get_device_friendly_name(struct device *dev) +{ + if (!dev->friendly_name) + return HAL_STATUS_FAILED; + + send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_FRIENDLY_NAME, + strlen(dev->friendly_name), dev->friendly_name); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_device_rssi(struct device *dev) +{ + if (!dev->rssi) + return HAL_STATUS_FAILED; + + send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_RSSI, + sizeof(dev->rssi), &dev->rssi); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t get_device_version_info(struct device *dev) +{ + DBG("Not implemented"); + + /* TODO */ + + return HAL_STATUS_FAILED; +} + +static uint8_t get_device_timestamp(struct device *dev) +{ + send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_TIMESTAMP, + sizeof(dev->timestamp), &dev->timestamp); + + return HAL_STATUS_SUCCESS; +} + +static void get_remote_device_props(struct device *dev) +{ + get_device_name(dev); + get_device_uuids(dev); + get_device_class(dev); + get_device_type(dev); + get_device_service_rec(dev); + get_device_friendly_name(dev); + get_device_rssi(dev); + get_device_version_info(dev); + get_device_timestamp(dev); +} + +static void send_bonded_devices_props(void) +{ + GSList *l; + + for (l = bonded_devices; l; l = g_slist_next(l)) { + struct device *dev = l->data; + + get_remote_device_props(dev); + } +} + +static void handle_enable_cmd(const void *buf, uint16_t len) +{ + uint8_t status; + + /* Framework expects all properties to be emitted while + * enabling adapter */ + get_adapter_properties(); + + /* Sent also properties of bonded devices */ + send_bonded_devices_props(); + + if (adapter.current_settings & MGMT_SETTING_POWERED) { + status = HAL_STATUS_SUCCESS; + goto reply; + } + + if (!set_mode(MGMT_OP_SET_POWERED, 0x01)) { + status = HAL_STATUS_FAILED; + goto reply; + } + + status = HAL_STATUS_SUCCESS; +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_ENABLE, status); +} + +static void handle_disable_cmd(const void *buf, uint16_t len) +{ + uint8_t status; + + if (!(adapter.current_settings & MGMT_SETTING_POWERED)) { + status = HAL_STATUS_SUCCESS; + goto reply; + } + + /* Cancel all pending requests. Need it in case of ongoing paring */ + mgmt_cancel_index(mgmt_if, adapter.index); + + if (!set_mode(MGMT_OP_SET_POWERED, 0x00)) { + status = HAL_STATUS_FAILED; + goto reply; + } + + status = HAL_STATUS_SUCCESS; +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_DISABLE, status); +} + +static void handle_get_adapter_props_cmd(const void *buf, uint16_t len) +{ + get_adapter_properties(); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_ADAPTER_PROPS, HAL_STATUS_SUCCESS); +} + +static void handle_get_remote_device_props_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_get_remote_device_props *cmd = buf; + struct device *dev; + uint8_t status; + bdaddr_t addr; + + android2bdaddr(cmd->bdaddr, &addr); + + dev = find_device(&addr); + if (!dev) { + status = HAL_STATUS_INVALID; + goto failed; + } + + get_remote_device_props(dev); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_DEVICE_PROPS, status); +} + +static void handle_get_remote_device_prop_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_get_remote_device_prop *cmd = buf; + struct device *dev; + uint8_t status; + bdaddr_t addr; + + android2bdaddr(cmd->bdaddr, &addr); + + dev = find_device(&addr); + if (!dev) { + status = HAL_STATUS_INVALID; + goto failed; + } + + switch (cmd->type) { + case HAL_PROP_DEVICE_NAME: + status = get_device_name(dev); + break; + case HAL_PROP_DEVICE_UUIDS: + status = get_device_uuids(dev); + break; + case HAL_PROP_DEVICE_CLASS: + status = get_device_class(dev); + break; + case HAL_PROP_DEVICE_TYPE: + status = get_device_type(dev); + break; + case HAL_PROP_DEVICE_SERVICE_REC: + status = get_device_service_rec(dev); + break; + case HAL_PROP_DEVICE_FRIENDLY_NAME: + status = get_device_friendly_name(dev); + break; + case HAL_PROP_DEVICE_RSSI: + status = get_device_rssi(dev); + break; + case HAL_PROP_DEVICE_VERSION_INFO: + status = get_device_version_info(dev); + break; + case HAL_PROP_DEVICE_TIMESTAMP: + status = get_device_timestamp(dev); + break; + default: + status = HAL_STATUS_FAILED; + break; + } + + if (status != HAL_STATUS_SUCCESS) + error("Failed to get device property (type %u status %u)", + cmd->type, status); + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_DEVICE_PROP, status); +} + +static uint8_t set_device_friendly_name(struct device *dev, const uint8_t *val, + uint16_t len) +{ + DBG(""); + + g_free(dev->friendly_name); + dev->friendly_name = g_strndup((const char *) val, len); + + if (dev->bond_state == HAL_BOND_STATE_BONDED) + store_device_info(dev, DEVICES_FILE); + else + store_device_info(dev, CACHE_FILE); + + send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_FRIENDLY_NAME, + strlen(dev->friendly_name), dev->friendly_name); + + return HAL_STATUS_SUCCESS; +} + +static uint8_t set_device_version_info(struct device *dev) +{ + DBG("Not implemented"); + + /* TODO */ + + return HAL_STATUS_FAILED; +} + +static void handle_set_remote_device_prop_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_set_remote_device_prop *cmd = buf; + struct device *dev; + uint8_t status; + bdaddr_t addr; + + if (len != sizeof(*cmd) + cmd->len) { + error("Invalid set remote device prop cmd (0x%x), terminating", + cmd->type); + raise(SIGTERM); + return; + } + + android2bdaddr(cmd->bdaddr, &addr); + + dev = find_device(&addr); + if (!dev) { + status = HAL_STATUS_INVALID; + goto failed; + } + + switch (cmd->type) { + case HAL_PROP_DEVICE_FRIENDLY_NAME: + status = set_device_friendly_name(dev, cmd->val, cmd->len); + break; + case HAL_PROP_DEVICE_VERSION_INFO: + status = set_device_version_info(dev); + break; + default: + status = HAL_STATUS_FAILED; + break; + } + + if (status != HAL_STATUS_SUCCESS) + error("Failed to set device property (type %u status %u)", + cmd->type, status); + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_SET_REMOTE_DEVICE_PROP, status); +} + +static void handle_get_remote_service_rec_cmd(const void *buf, uint16_t len) +{ + /* TODO */ + + error("get_remote_service_record not supported"); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_SERVICE_REC, HAL_STATUS_FAILED); +} + +static void handle_start_discovery_cmd(const void *buf, uint16_t len) +{ + uint8_t status; + + /* Check if there is discovery with BREDR type */ + if (adapter.cur_discovery_type & SCAN_TYPE_BREDR) { + status = HAL_STATUS_SUCCESS; + goto reply; + } + + if (!(adapter.current_settings & MGMT_SETTING_POWERED)) { + status = HAL_STATUS_NOT_READY; + goto reply; + } + + adapter.exp_discovery_type |= SCAN_TYPE_DUAL; + + /* If there is no discovery ongoing, try to start discovery */ + if (!adapter.cur_discovery_type) { + if (!start_discovery(adapter.exp_discovery_type)) + status = HAL_STATUS_FAILED; + else + status = HAL_STATUS_SUCCESS; + + goto reply; + } + + /* Stop discovery here. Once it is stop we will restart it + * with exp_discovery_settings */ + if (!stop_discovery(adapter.cur_discovery_type)) { + status = HAL_STATUS_FAILED; + goto reply; + } + + status = HAL_STATUS_SUCCESS; + +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_START_DISCOVERY, + status); +} + +static void handle_cancel_discovery_cmd(const void *buf, uint16_t len) +{ + uint8_t status; + + if (!adapter.cur_discovery_type) { + status = HAL_STATUS_SUCCESS; + goto reply; + } + + if (!(adapter.current_settings & MGMT_SETTING_POWERED)) { + status = HAL_STATUS_NOT_READY; + goto reply; + } + + /* Take into account that gatt might want to keep discover */ + adapter.exp_discovery_type = gatt_device_found_cb ? SCAN_TYPE_LE : 0; + + if (!stop_discovery(adapter.cur_discovery_type)) { + status = HAL_STATUS_FAILED; + goto reply; + } + + status = HAL_STATUS_SUCCESS; + +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_CANCEL_DISCOVERY, + status); +} + +static void handle_dut_mode_conf_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_dut_mode_conf *cmd = buf; + char path[FILENAME_MAX]; + uint8_t status; + int fd, ret; + + DBG("enable %u", cmd->enable); + + snprintf(path, sizeof(path), DUT_MODE_FILE, adapter.index); + + fd = open(path, O_WRONLY); + if (fd < 0) { + status = HAL_STATUS_FAILED; + goto failed; + } + + if (cmd->enable) + ret = write(fd, "1", sizeof("1")); + else + ret = write(fd, "0", sizeof("0")); + + if (ret < 0) + status = HAL_STATUS_FAILED; + else + status = HAL_STATUS_SUCCESS; + + close(fd); + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_DUT_MODE_CONF, + status); +} + +static void handle_dut_mode_send_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_dut_mode_send *cmd = buf; + + if (len != sizeof(*cmd) + cmd->len) { + error("Invalid dut mode send cmd, terminating"); + raise(SIGTERM); + return; + } + + error("dut_mode_send not supported (cmd opcode %u)", cmd->opcode); + + /* TODO */ + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_DUT_MODE_SEND, + HAL_STATUS_FAILED); +} + +static void handle_le_test_mode_cmd(const void *buf, uint16_t len) +{ + const struct hal_cmd_le_test_mode *cmd = buf; + + if (len != sizeof(*cmd) + cmd->len) { + error("Invalid le test mode cmd, terminating"); + raise(SIGTERM); + return; + } + + error("le_test_mode not supported (cmd opcode %u)", cmd->opcode); + + /* TODO */ + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, HAL_OP_LE_TEST_MODE, + HAL_STATUS_FAILED); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_ENABLE */ + { handle_enable_cmd, false, 0 }, + /* HAL_OP_DISABLE */ + { handle_disable_cmd, false, 0 }, + /* HAL_OP_GET_ADAPTER_PROPS */ + { handle_get_adapter_props_cmd, false, 0 }, + /* HAL_OP_GET_ADAPTER_PROP */ + { handle_get_adapter_prop_cmd, false, + sizeof(struct hal_cmd_get_adapter_prop) }, + /* HAL_OP_SET_ADAPTER_PROP */ + { handle_set_adapter_prop_cmd, true, + sizeof(struct hal_cmd_set_adapter_prop) }, + /* HAL_OP_GET_REMOTE_DEVICE_PROPS */ + { handle_get_remote_device_props_cmd, false, + sizeof(struct hal_cmd_get_remote_device_props) }, + /* HAL_OP_GET_REMOTE_DEVICE_PROP */ + { handle_get_remote_device_prop_cmd, false, + sizeof(struct hal_cmd_get_remote_device_prop) }, + /* HAL_OP_SET_REMOTE_DEVICE_PROP */ + { handle_set_remote_device_prop_cmd, true, + sizeof(struct hal_cmd_set_remote_device_prop) }, + /* HAL_OP_GET_REMOTE_SERVICE_REC */ + { handle_get_remote_service_rec_cmd, false, + sizeof(struct hal_cmd_get_remote_service_rec) }, + /* HAL_OP_GET_REMOTE_SERVICES */ + { handle_get_remote_services_cmd, false, + sizeof(struct hal_cmd_get_remote_services) }, + /* HAL_OP_START_DISCOVERY */ + { handle_start_discovery_cmd, false, 0 }, + /* HAL_OP_CANCEL_DISCOVERY */ + { handle_cancel_discovery_cmd, false, 0 }, + /* HAL_OP_CREATE_BOND */ + { handle_create_bond_cmd, false, sizeof(struct hal_cmd_create_bond) }, + /* HAL_OP_REMOVE_BOND */ + { handle_remove_bond_cmd, false, sizeof(struct hal_cmd_remove_bond) }, + /* HAL_OP_CANCEL_BOND */ + {handle_cancel_bond_cmd, false, sizeof(struct hal_cmd_cancel_bond) }, + /* HAL_OP_PIN_REPLY */ + { handle_pin_reply_cmd, false, sizeof(struct hal_cmd_pin_reply) }, + /* HAL_OP_SSP_REPLY */ + { handle_ssp_reply_cmd, false, sizeof(struct hal_cmd_ssp_reply) }, + /* HAL_OP_DUT_MODE_CONF */ + { handle_dut_mode_conf_cmd, false, + sizeof(struct hal_cmd_dut_mode_conf) }, + /* HAL_OP_DUT_MODE_SEND */ + { handle_dut_mode_send_cmd, true, + sizeof(struct hal_cmd_dut_mode_send) }, + /* HAL_OP_LE_TEST_MODE */ + { handle_le_test_mode_cmd, true, sizeof(struct hal_cmd_le_test_mode) }, +}; + +void bt_bluetooth_register(struct ipc *ipc, uint8_t mode) +{ + DBG(""); + + hal_ipc = ipc; + + ipc_register(hal_ipc, HAL_SERVICE_ID_BLUETOOTH, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); +} + +void bt_bluetooth_unregister(void) +{ + DBG(""); + + g_slist_free_full(bonded_devices, (GDestroyNotify) free_device); + bonded_devices = NULL; + + g_slist_free_full(cached_devices, (GDestroyNotify) free_device); + cached_devices = NULL; + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_CORE); + hal_ipc = NULL; +}
diff --git a/bluez/android/bluetooth.h b/bluez/android/bluetooth.h new file mode 100644 index 0000000..8dbc623 --- /dev/null +++ b/bluez/android/bluetooth.h
@@ -0,0 +1,44 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +typedef void (*bt_bluetooth_ready)(int err, const bdaddr_t *addr); +bool bt_bluetooth_start(int index, bool mgmt_dbg, bt_bluetooth_ready cb); + +typedef void (*bt_bluetooth_stopped)(void); +bool bt_bluetooth_stop(bt_bluetooth_stopped cb); + +void bt_bluetooth_cleanup(void); + +void bt_bluetooth_register(struct ipc *ipc, uint8_t mode); +void bt_bluetooth_unregister(void); + +int bt_adapter_add_record(sdp_record_t *rec, uint8_t svc_hint); +void bt_adapter_remove_record(uint32_t handle); + +typedef void (*bt_le_device_found)(const bdaddr_t *addr, uint8_t addr_type, + int rssi, uint16_t eir_len, + const void *eir); +bool bt_le_discovery_start(bt_le_device_found cb); + +typedef void (*bt_le_discovery_stopped)(void); +bool bt_le_discovery_stop(bt_le_discovery_stopped cb);
diff --git a/bluez/android/bluetoothd-snoop.c b/bluez/android/bluetoothd-snoop.c new file mode 100644 index 0000000..844de83 --- /dev/null +++ b/bluez/android/bluetoothd-snoop.c
@@ -0,0 +1,250 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <ctype.h> +#include <stdlib.h> +#include <unistd.h> +#if defined(ANDROID) +#include <sys/capability.h> +#endif + +#include "lib/bluetooth.h" +#include "lib/hci.h" +#include "lib/mgmt.h" + +#include "monitor/mainloop.h" +#include "src/shared/btsnoop.h" + +#define DEFAULT_SNOOP_FILE "/sdcard/btsnoop_hci.log" + +#define MAX_PACKET_SIZE (1486 + 4) + +static struct btsnoop *snoop = NULL; +static uint8_t monitor_buf[MAX_PACKET_SIZE]; +static int monitor_fd = -1; + +static void signal_callback(int signum, void *user_data) +{ + switch (signum) { + case SIGINT: + case SIGTERM: + mainloop_quit(); + break; + } +} + +static uint32_t get_flags_from_opcode(uint16_t opcode) +{ + switch (opcode) { + case BTSNOOP_OPCODE_NEW_INDEX: + case BTSNOOP_OPCODE_DEL_INDEX: + break; + case BTSNOOP_OPCODE_COMMAND_PKT: + return 0x02; + case BTSNOOP_OPCODE_EVENT_PKT: + return 0x03; + case BTSNOOP_OPCODE_ACL_TX_PKT: + return 0x00; + case BTSNOOP_OPCODE_ACL_RX_PKT: + return 0x01; + case BTSNOOP_OPCODE_SCO_TX_PKT: + case BTSNOOP_OPCODE_SCO_RX_PKT: + break; + } + + return 0xff; +} + +static void data_callback(int fd, uint32_t events, void *user_data) +{ + unsigned char control[32]; + struct mgmt_hdr hdr; + struct msghdr msg; + struct iovec iov[2]; + + if (events & (EPOLLERR | EPOLLHUP)) { + mainloop_remove_fd(monitor_fd); + return; + } + + iov[0].iov_base = &hdr; + iov[0].iov_len = MGMT_HDR_SIZE; + iov[1].iov_base = monitor_buf; + iov[1].iov_len = sizeof(monitor_buf); + + memset(&msg, 0, sizeof(msg)); + msg.msg_iov = iov; + msg.msg_iovlen = 2; + msg.msg_control = control; + msg.msg_controllen = sizeof(control); + + while (true) { + struct cmsghdr *cmsg; + struct timeval *tv = NULL; + struct timeval ctv; + uint16_t opcode, index, pktlen; + uint32_t flags; + ssize_t len; + + len = recvmsg(monitor_fd, &msg, MSG_DONTWAIT); + if (len < 0) + break; + + if (len < MGMT_HDR_SIZE) + break; + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level != SOL_SOCKET) + continue; + + if (cmsg->cmsg_type == SCM_TIMESTAMP) { + memcpy(&ctv, CMSG_DATA(cmsg), sizeof(ctv)); + tv = &ctv; + } + } + + opcode = btohs(hdr.opcode); + index = btohs(hdr.index); + pktlen = btohs(hdr.len); + + if (index) + continue; + + flags = get_flags_from_opcode(opcode); + if (flags != 0xff) + btsnoop_write(snoop, tv, flags, monitor_buf, pktlen); + } +} + +static int open_monitor(const char *path) +{ + struct sockaddr_hci addr; + int opt = 1; + + snoop = btsnoop_create(path, BTSNOOP_TYPE_HCI); + if (!snoop) + return -1; + + monitor_fd = socket(AF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC, BTPROTO_HCI); + if (monitor_fd < 0) + goto failed; + + memset(&addr, 0, sizeof(addr)); + addr.hci_family = AF_BLUETOOTH; + addr.hci_dev = HCI_DEV_NONE; + addr.hci_channel = HCI_CHANNEL_MONITOR; + + if (bind(monitor_fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) + goto failed_close; + + if (setsockopt(monitor_fd, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)) + < 0) + goto failed_close; + + mainloop_add_fd(monitor_fd, EPOLLIN, data_callback, NULL, NULL); + + return 0; + +failed_close: + close(monitor_fd); + monitor_fd = -1; + +failed: + btsnoop_unref(snoop); + snoop = NULL; + + return -1; +} + +static void close_monitor(void) +{ + btsnoop_unref(snoop); + snoop = NULL; + + close(monitor_fd); + monitor_fd = -1; +} + +static void set_capabilities(void) +{ +#if defined(ANDROID) + struct __user_cap_header_struct header; + struct __user_cap_data_struct cap; + + header.version = _LINUX_CAPABILITY_VERSION; + header.pid = 0; + + /* CAP_NET_RAW: for snooping + * CAP_DAC_READ_SEARCH: override path search permissions + */ + cap.effective = cap.permitted = + CAP_TO_MASK(CAP_NET_RAW) | + CAP_TO_MASK(CAP_DAC_READ_SEARCH); + cap.inheritable = 0; + + /* TODO: Move to cap_set_proc once bionic support it */ + if (capset(&header, &cap) < 0) + exit(EXIT_FAILURE); +#endif +} + +int main(int argc, char *argv[]) +{ + const char *path; + sigset_t mask; + + set_capabilities(); + + if (argc > 1) + path = argv[1]; + else + path = DEFAULT_SNOOP_FILE; + + mainloop_init(); + + sigemptyset(&mask); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGTERM); + + mainloop_set_signal(&mask, signal_callback, NULL, NULL); + + if (!strcmp(DEFAULT_SNOOP_FILE, path)) + rename(DEFAULT_SNOOP_FILE, DEFAULT_SNOOP_FILE ".old"); + + if (open_monitor(path) < 0) { + printf("Failed to start bluetoothd_snoop\n"); + return EXIT_FAILURE; + } + + mainloop_run(); + + close_monitor(); + + return EXIT_SUCCESS; +}
diff --git a/bluez/android/client/haltest.c b/bluez/android/client/haltest.c new file mode 100644 index 0000000..114fe31 --- /dev/null +++ b/bluez/android/client/haltest.c
@@ -0,0 +1,440 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdlib.h> +#include <stdbool.h> +#include <string.h> +#include <stdio.h> +#include <stdarg.h> +#include <unistd.h> +#include <poll.h> +#include <unistd.h> +#include <getopt.h> + +#include "if-main.h" +#include "terminal.h" +#include "pollhandler.h" +#include "history.h" + +const struct interface *interfaces[] = { + &audio_if, + &bluetooth_if, + &av_if, + &rc_if, + &gatt_if, + &gatt_client_if, + &gatt_server_if, + &hf_if, + &hh_if, + &pan_if, + &sock_if, + NULL +}; + +static struct method commands[]; + +struct method *get_method(struct method *methods, const char *name) +{ + while (strcmp(methods->name, "") != 0) { + if (strcmp(methods->name, name) == 0) + return methods; + methods++; + } + + return NULL; +} + +/* function returns interface of given name or NULL if not found */ +const struct interface *get_interface(const char *name) +{ + int i; + + for (i = 0; interfaces[i] != NULL; ++i) { + if (strcmp(interfaces[i]->name, name) == 0) + break; + } + + return interfaces[i]; +} + +int haltest_error(const char *format, ...) +{ + va_list args; + int ret; + va_start(args, format); + ret = terminal_vprint(format, args); + va_end(args); + return ret; +} + +int haltest_info(const char *format, ...) +{ + va_list args; + int ret; + va_start(args, format); + ret = terminal_vprint(format, args); + va_end(args); + return ret; +} + +int haltest_warn(const char *format, ...) +{ + va_list args; + int ret; + va_start(args, format); + ret = terminal_vprint(format, args); + va_end(args); + return ret; +} + +static void help_print_interface(const struct interface *i) +{ + struct method *m; + + for (m = i->methods; strcmp(m->name, "") != 0; m++) + haltest_info("%s %s %s\n", i->name, m->name, + (m->help ? m->help : "")); +} + +/* Help completion */ +static void help_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 2) + *enum_func = interface_name; +} + +/* Help execution */ +static void help_p(int argc, const char **argv) +{ + const struct method *m = commands; + const struct interface **ip = interfaces; + const struct interface *i; + + if (argc == 1) { + terminal_print("haltest allows to call Android HAL methods.\n"); + terminal_print("\nAvailable commands:\n"); + while (0 != strcmp(m->name, "")) { + terminal_print("\t%s %s\n", m->name, + (m->help ? m->help : "")); + m++; + } + + terminal_print("\nAvailable interfaces to use:\n"); + while (NULL != *ip) { + terminal_print("\t%s\n", (*ip)->name); + ip++; + } + + terminal_print("\nTo get help on methods for each interface type:\n"); + terminal_print("\n\thelp <inerface>\n"); + terminal_print("\nBasic scenario:\n\tbluetooth init\n"); + terminal_print("\tbluetooth enable\n\tbluetooth start_discovery\n"); + terminal_print("\tbluetooth get_profile_interface handsfree\n"); + terminal_print("\thandsfree init\n\n"); + return; + } + + i = get_interface(argv[1]); + if (i == NULL) { + haltest_error("No such interface\n"); + return; + } + + help_print_interface(i); +} + +/* quit/exit execution */ +static void quit_p(int argc, const char **argv) +{ + exit(0); +} + +static int fd_stack[10]; +static int fd_stack_pointer = 0; + +static void stdin_handler(struct pollfd *pollfd); + +static void process_file(const char *name) +{ + int fd = open(name, O_RDONLY); + + if (fd < 0) { + haltest_error("Can't open file: %s for reading\n", name); + return; + } + + if (fd_stack_pointer >= 10) { + haltest_error("To many open files\n"); + close(fd); + return; + } + + fd_stack[fd_stack_pointer++] = fd; + poll_unregister_fd(fd_stack[fd_stack_pointer - 2], stdin_handler); + poll_register_fd(fd_stack[fd_stack_pointer - 1], POLLIN, stdin_handler); +} + +static void source_p(int argc, const char **argv) +{ + if (argc < 2) { + haltest_error("No file specified"); + return; + } + + process_file(argv[1]); +} + +/* Commands available without interface */ +static struct method commands[] = { + STD_METHODCH(help, "[<interface>]"), + STD_METHOD(quit), + METHOD("exit", quit_p, NULL, NULL), + STD_METHODH(source, "<file>"), + END_METHOD +}; + +/* Gets comman by name */ +struct method *get_command(const char *name) +{ + return get_method(commands, name); +} + +/* Function to enumerate interface names */ +const char *interface_name(void *v, int i) +{ + return interfaces[i] ? interfaces[i]->name : NULL; +} + +/* Function to enumerate command and interface names */ +const char *command_name(void *v, int i) +{ + int cmd_cnt = NELEM(commands); + + if (i >= cmd_cnt) + return interface_name(v, i - cmd_cnt); + else + return commands[i].name; +} + +/* + * This function changes input parameter line_buffer so it has + * null termination after each token (due to strtok) + * Output argv is filled with pointers to arguments + * returns number of tokens parsed - argc + */ +static int command_line_to_argv(char *line_buffer, char *argv[], int argv_size) +{ + static const char *token_breaks = "\r\n\t "; + char *token; + int argc = 0; + + token = strtok(line_buffer, token_breaks); + while (token != NULL && argc < (int) argv_size) { + argv[argc++] = token; + token = strtok(NULL, token_breaks); + } + + return argc; +} + +static void process_line(char *line_buffer) +{ + char *argv[10]; + int argc; + int i = 0; + struct method *m; + + argc = command_line_to_argv(line_buffer, argv, 10); + if (argc < 1) + return; + + while (interfaces[i] != NULL) { + if (strcmp(interfaces[i]->name, argv[0])) { + i++; + continue; + } + + if (argc < 2 || strcmp(argv[1], "?") == 0) { + help_print_interface(interfaces[i]); + return; + } + + m = get_method(interfaces[i]->methods, argv[1]); + if (m != NULL) { + m->func(argc, (const char **) argv); + return; + } + + haltest_error("No function %s found\n", argv[1]); + return; + } + /* No interface, try commands */ + m = get_command(argv[0]); + if (m == NULL) + haltest_error("No such command %s\n", argv[0]); + else + m->func(argc, (const char **) argv); +} + +/* called when there is something on stdin */ +static void stdin_handler(struct pollfd *pollfd) +{ + char buf[10]; + + if (pollfd->revents & POLLIN) { + int count = read(fd_stack[fd_stack_pointer - 1], buf, 10); + + if (count > 0) { + int i; + + for (i = 0; i < count; ++i) + terminal_process_char(buf[i], process_line); + return; + } + } + + if (fd_stack_pointer > 1) + poll_register_fd(fd_stack[fd_stack_pointer - 2], POLLIN, + stdin_handler); + if (fd_stack_pointer > 0) { + poll_unregister_fd(fd_stack[--fd_stack_pointer], stdin_handler); + + if (fd_stack[fd_stack_pointer]) + close(fd_stack[fd_stack_pointer]); + } +} + +static void usage(void) +{ + printf("haltest Android Bluetooth HAL testing tool\n" + "Usage:\n"); + printf("\thaltest [options]\n"); + printf("options:\n" + "\t-n, --no-init Don't call init for interfaces\n" + "\t --version Print version\n" + "\t-h, --help Show help options\n"); +} + +enum { + PRINT_VERSION = 1000 +}; + +int version = 1; +int revision = 0; + +static void print_version(void) +{ + printf("haltest version %d.%d\n", version, revision); +} + +static const struct option main_options[] = { + { "no-init", no_argument, NULL, 'n' }, + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, PRINT_VERSION }, + { NULL } +}; + +static bool no_init = false; + +static void parse_command_line(int argc, char *argv[]) +{ + for (;;) { + int opt; + + opt = getopt_long(argc, argv, "nh", main_options, NULL); + if (opt < 0) + break; + + switch (opt) { + case 'n': + no_init = true; + break; + case 'h': + usage(); + exit(0); + case PRINT_VERSION: + print_version(); + exit(0); + default: + putchar('\n'); + exit(-1); + break; + } + } +} + +static void init(void) +{ + static const char * const inames[] = { + BT_PROFILE_HANDSFREE_ID, + BT_PROFILE_ADVANCED_AUDIO_ID, + BT_PROFILE_AV_RC_ID, + BT_PROFILE_HEALTH_ID, + BT_PROFILE_HIDHOST_ID, + BT_PROFILE_PAN_ID, + BT_PROFILE_GATT_ID, + BT_PROFILE_SOCKETS_ID + }; + const struct method *m; + const char *argv[4]; + char init_audio[] = "audio init"; + char init_bt[] = "bluetooth init"; + uint32_t i; + + process_line(init_audio); + process_line(init_bt); + + m = get_interface_method("bluetooth", "get_profile_interface"); + + for (i = 0; i < NELEM(inames); ++i) { + argv[2] = inames[i]; + m->func(3, argv); + } + + /* Init what is available to init */ + for (i = 2; i < NELEM(interfaces) - 1; ++i) { + m = get_interface_method(interfaces[i]->name, "init"); + if (m != NULL) + m->func(2, argv); + } +} + +int main(int argc, char **argv) +{ + struct stat rcstat; + + parse_command_line(argc, argv); + + terminal_setup(); + + if (!no_init) + init(); + + history_restore(".haltest_history"); + + fd_stack[fd_stack_pointer++] = 0; + /* Register command line handler */ + poll_register_fd(0, POLLIN, stdin_handler); + + if (stat(".haltestrc", &rcstat) == 0 && (rcstat.st_mode & S_IFREG) != 0) + process_file(".haltestrc"); + + poll_dispatch_loop(); + + return 0; +}
diff --git a/bluez/android/client/history.c b/bluez/android/client/history.c new file mode 100644 index 0000000..ee285da --- /dev/null +++ b/bluez/android/client/history.c
@@ -0,0 +1,100 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <ctype.h> + +#include "history.h" + +/* + * Very simple history storage for easy usage of tool + */ + +#define HISTORY_DEPTH 20 +#define LINE_SIZE 100 +static char lines[HISTORY_DEPTH][LINE_SIZE]; +static int last_line = 0; +static int history_size = 0; + +/* TODO: Storing history not implemented yet */ +void history_store(const char *filename) +{ +} + +/* Restoring history from file */ +void history_restore(const char *filename) +{ + char line[1000]; + FILE *f = fopen(filename, "rt"); + + if (f == NULL) + return; + + for (;;) { + if (fgets(line, 1000, f) != NULL) { + int l = strlen(line); + + while (l > 0 && isspace(line[--l])) + line[l] = 0; + + if (l > 0) + history_add_line(line); + } else + break; + } + + fclose(f); +} + +/* Add new line to history buffer */ +void history_add_line(const char *line) +{ + if (line == NULL || strlen(line) == 0) + return; + + if (strcmp(line, lines[last_line]) == 0) + return; + + last_line = (last_line + 1) % HISTORY_DEPTH; + strncpy(&lines[last_line][0], line, LINE_SIZE - 1); + if (history_size < HISTORY_DEPTH) + history_size++; +} + +/* + * Get n-th line from history + * 0 - means latest + * -1 - means oldest + * return -1 if there is no such line + */ +int history_get_line(int n, char *buf, int buf_size) +{ + if (n == -1) + n = history_size - 1; + + if (n >= history_size || buf_size == 0 || n < 0) + return -1; + + strncpy(buf, + &lines[(HISTORY_DEPTH + last_line - n) % HISTORY_DEPTH][0], + buf_size - 1); + buf[buf_size - 1] = 0; + + return n; +}
diff --git a/bluez/android/client/history.h b/bluez/android/client/history.h new file mode 100644 index 0000000..26085b5 --- /dev/null +++ b/bluez/android/client/history.h
@@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +void history_store(const char *filename); +void history_restore(const char *filename); +void history_add_line(const char *line); +int history_get_line(int n, char *buf, int buf_size);
diff --git a/bluez/android/client/if-audio.c b/bluez/android/client/if-audio.c new file mode 100644 index 0000000..ce9e534 --- /dev/null +++ b/bluez/android/client/if-audio.c
@@ -0,0 +1,522 @@ +/* + * Copyright (C) 2014 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "if-main.h" +#include "../hal-utils.h" +#include "pthread.h" +#include "unistd.h" +#include <math.h> + +audio_hw_device_t *if_audio = NULL; +struct audio_stream_out *stream_out = NULL; + +static size_t buffer_size = 0; +static pthread_t play_thread = 0; +static pthread_mutex_t outstream_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t state_mutex = PTHREAD_MUTEX_INITIALIZER; + +enum state { + STATE_STOPPED, + STATE_STOPPING, + STATE_PLAYING, + STATE_SUSPENDED, + STATE_MAX +}; + +SINTMAP(audio_channel_mask_t, -1, "(AUDIO_CHANNEL_INVALID)") + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_RIGHT), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_CENTER), + DELEMENT(AUDIO_CHANNEL_OUT_LOW_FREQUENCY), + DELEMENT(AUDIO_CHANNEL_OUT_BACK_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_BACK_RIGHT), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER), + DELEMENT(AUDIO_CHANNEL_OUT_BACK_CENTER), + DELEMENT(AUDIO_CHANNEL_OUT_SIDE_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_SIDE_RIGHT), + DELEMENT(AUDIO_CHANNEL_OUT_TOP_CENTER), + DELEMENT(AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER), + DELEMENT(AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT), + DELEMENT(AUDIO_CHANNEL_OUT_TOP_BACK_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_TOP_BACK_CENTER), + DELEMENT(AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT), + DELEMENT(AUDIO_CHANNEL_OUT_MONO), + DELEMENT(AUDIO_CHANNEL_OUT_STEREO), + DELEMENT(AUDIO_CHANNEL_OUT_QUAD), + DELEMENT(AUDIO_CHANNEL_OUT_SURROUND), + DELEMENT(AUDIO_CHANNEL_OUT_5POINT1), + DELEMENT(AUDIO_CHANNEL_OUT_7POINT1), + DELEMENT(AUDIO_CHANNEL_OUT_ALL), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_LEFT), + DELEMENT(AUDIO_CHANNEL_OUT_FRONT_LEFT), +ENDMAP + +SINTMAP(audio_format_t, -1, "(AUDIO_FORMAT_INVALID)") + DELEMENT(AUDIO_FORMAT_DEFAULT), + DELEMENT(AUDIO_FORMAT_PCM), + DELEMENT(AUDIO_FORMAT_MP3), + DELEMENT(AUDIO_FORMAT_AMR_NB), + DELEMENT(AUDIO_FORMAT_AMR_WB), + DELEMENT(AUDIO_FORMAT_AAC), + DELEMENT(AUDIO_FORMAT_HE_AAC_V1), + DELEMENT(AUDIO_FORMAT_HE_AAC_V2), + DELEMENT(AUDIO_FORMAT_VORBIS), + DELEMENT(AUDIO_FORMAT_MAIN_MASK), + DELEMENT(AUDIO_FORMAT_SUB_MASK), + DELEMENT(AUDIO_FORMAT_PCM_16_BIT), + DELEMENT(AUDIO_FORMAT_PCM_8_BIT), + DELEMENT(AUDIO_FORMAT_PCM_32_BIT), + DELEMENT(AUDIO_FORMAT_PCM_8_24_BIT), +ENDMAP + +static int current_state = STATE_STOPPED; + +#define SAMPLERATE 44100 +static short sample[SAMPLERATE]; +static uint16_t sample_pos; + +static void init_p(int argc, const char **argv) +{ + int err; + const hw_module_t *module; + audio_hw_device_t *device; + + err = hw_get_module_by_class(AUDIO_HARDWARE_MODULE_ID, + AUDIO_HARDWARE_MODULE_ID_A2DP, &module); + if (err) { + haltest_error("hw_get_module_by_class returned %d\n", err); + return; + } + + err = audio_hw_device_open(module, &device); + if (err) { + haltest_error("audio_hw_device_open returned %d\n", err); + return; + } + + if_audio = device; +} + +static void playthread_cleanup(void *arg) +{ + pthread_mutex_lock(&state_mutex); + current_state = STATE_STOPPED; + pthread_mutex_unlock(&state_mutex); + + haltest_info("Done playing.\n"); +} + +static int feed_from_file(short *buffer, void *data) +{ + FILE *in = data; + return fread(buffer, buffer_size, 1, in); +} + +static int feed_from_generator(short *buffer, void *data) +{ + size_t i = 0; + float volume = 0.5; + float *freq = data; + float f = 1; + + if (freq) + f = *freq; + + /* buffer_size is in bytes but we are using buffer of shorts (2 bytes)*/ + for (i = 0; i < buffer_size / sizeof(*buffer) - 1;) { + if (sample_pos >= SAMPLERATE) + sample_pos = sample_pos % SAMPLERATE; + + /* Use the same sample for both channels */ + buffer[i++] = sample[sample_pos] * volume; + buffer[i++] = sample[sample_pos] * volume; + + sample_pos += f; + } + + return buffer_size; +} + +static void prepare_sample(void) +{ + int x; + double s; + + haltest_info("Preparing audio sample...\n"); + + for (x = 0; x < SAMPLERATE; x++) { + /* prepare sinusoidal 1Hz sample */ + s = (2.0 * 3.14159) * ((double)x / SAMPLERATE); + s = sin(s); + + /* remap <-1, 1> to signed 16bit PCM range */ + sample[x] = s * 32767; + } + + sample_pos = 0; +} + +static void *playback_thread(void *data) +{ + int (*filbuff_cb) (short*, void*); + short buffer[buffer_size / sizeof(short)]; + size_t len = 0; + ssize_t w_len = 0; + FILE *in = data; + void *cb_data = NULL; + float freq = 440.0; + + pthread_cleanup_push(playthread_cleanup, NULL); + + /* Use file or fall back to generator */ + if (in) { + filbuff_cb = feed_from_file; + cb_data = in; + } else { + prepare_sample(); + filbuff_cb = feed_from_generator; + cb_data = &freq; + } + + pthread_mutex_lock(&state_mutex); + current_state = STATE_PLAYING; + pthread_mutex_unlock(&state_mutex); + + do { + pthread_mutex_lock(&state_mutex); + if (current_state == STATE_STOPPING) { + pthread_mutex_unlock(&state_mutex); + break; + } else if (current_state == STATE_SUSPENDED) { + pthread_mutex_unlock(&state_mutex); + usleep(500); + continue; + } + pthread_mutex_unlock(&state_mutex); + + len = filbuff_cb(buffer, cb_data); + + pthread_mutex_lock(&outstream_mutex); + if (!stream_out) { + pthread_mutex_unlock(&outstream_mutex); + break; + } + + w_len = stream_out->write(stream_out, buffer, buffer_size); + pthread_mutex_unlock(&outstream_mutex); + } while (len && w_len > 0); + + if (in) + fclose(in); + + pthread_cleanup_pop(1); + return NULL; +} + +static void play_p(int argc, const char **argv) +{ + const char *fname = NULL; + FILE *in = NULL; + + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + if (argc < 3) { + haltest_error("Invalid audio file path.\n"); + haltest_info("Using sound generator.\n"); + } else { + fname = argv[2]; + in = fopen(fname, "r"); + + if (in == NULL) { + haltest_error("Cannot open file: %s\n", fname); + return; + } + haltest_info("Playing file: %s\n", fname); + } + + if (buffer_size == 0) { + haltest_error("Invalid buffer size. Was stream_out opened?\n"); + goto fail; + } + + pthread_mutex_lock(&state_mutex); + if (current_state != STATE_STOPPED) { + haltest_error("Already playing or stream suspended!\n"); + pthread_mutex_unlock(&state_mutex); + goto fail; + } + pthread_mutex_unlock(&state_mutex); + + if (pthread_create(&play_thread, NULL, playback_thread, in) != 0) { + haltest_error("Cannot create playback thread!\n"); + goto fail; + } + + return; +fail: + if (in) + fclose(in); +} + +static void stop_p(int argc, const char **argv) +{ + pthread_mutex_lock(&state_mutex); + if (current_state == STATE_STOPPED || current_state == STATE_STOPPING) { + pthread_mutex_unlock(&state_mutex); + return; + } + + current_state = STATE_STOPPING; + pthread_mutex_unlock(&state_mutex); + + pthread_mutex_lock(&outstream_mutex); + stream_out->common.standby(&stream_out->common); + pthread_mutex_unlock(&outstream_mutex); +} + +static void open_output_stream_p(int argc, const char **argv) +{ + int err; + + RETURN_IF_NULL(if_audio); + + pthread_mutex_lock(&state_mutex); + if (current_state == STATE_PLAYING) { + haltest_error("Already playing!\n"); + pthread_mutex_unlock(&state_mutex); + return; + } + pthread_mutex_unlock(&state_mutex); + + err = if_audio->open_output_stream(if_audio, + 0, + AUDIO_DEVICE_OUT_ALL_A2DP, + AUDIO_OUTPUT_FLAG_NONE, + NULL, + &stream_out); + if (err < 0) { + haltest_error("open output stream returned %d\n", err); + return; + } + + buffer_size = stream_out->common.get_buffer_size(&stream_out->common); + if (buffer_size == 0) + haltest_error("Invalid buffer size received!\n"); + else + haltest_info("Using buffer size: %zu\n", buffer_size); +} + +static void close_output_stream_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + stop_p(argc, argv); + + haltest_info("Waiting for playback thread...\n"); + pthread_join(play_thread, NULL); + + if_audio->close_output_stream(if_audio, stream_out); + + stream_out = NULL; + buffer_size = 0; +} + +static void cleanup_p(int argc, const char **argv) +{ + int err; + + RETURN_IF_NULL(if_audio); + + pthread_mutex_lock(&state_mutex); + if (current_state != STATE_STOPPED) { + pthread_mutex_unlock(&state_mutex); + close_output_stream_p(0, NULL); + } else { + pthread_mutex_unlock(&state_mutex); + } + + err = audio_hw_device_close(if_audio); + if (err < 0) { + haltest_error("audio_hw_device_close returned %d\n", err); + return; + } + + if_audio = NULL; +} + +static void suspend_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + pthread_mutex_lock(&state_mutex); + if (current_state != STATE_PLAYING) { + pthread_mutex_unlock(&state_mutex); + return; + } + current_state = STATE_SUSPENDED; + pthread_mutex_unlock(&state_mutex); + + pthread_mutex_lock(&outstream_mutex); + stream_out->common.standby(&stream_out->common); + pthread_mutex_unlock(&outstream_mutex); +} + +static void resume_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + pthread_mutex_lock(&state_mutex); + if (current_state == STATE_SUSPENDED) + current_state = STATE_PLAYING; + pthread_mutex_unlock(&state_mutex); +} + +static void get_latency_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + haltest_info("Output audio stream latency: %d\n", + stream_out->get_latency(stream_out)); +} + +static void get_buffer_size_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + haltest_info("Current output buffer size: %zu\n", + stream_out->common.get_buffer_size(&stream_out->common)); +} + +static void get_channels_p(int argc, const char **argv) +{ + audio_channel_mask_t channels; + + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + channels = stream_out->common.get_channels(&stream_out->common); + + haltest_info("Channels: %s\n", audio_channel_mask_t2str(channels)); +} + +static void get_format_p(int argc, const char **argv) +{ + audio_format_t format; + + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + format = stream_out->common.get_format(&stream_out->common); + + haltest_info("Format: %s\n", audio_format_t2str(format)); +} + +static void get_sample_rate_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + haltest_info("Current sample rate: %d\n", + stream_out->common.get_sample_rate(&stream_out->common)); +} + +static void get_parameters_p(int argc, const char **argv) +{ + const char *keystr; + + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + if (argc < 3) { + haltest_info("No keys given.\n"); + keystr = ""; + } else { + keystr = argv[2]; + } + + haltest_info("Current parameters: %s\n", + stream_out->common.get_parameters(&stream_out->common, + keystr)); +} + +static void set_parameters_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + if (argc < 3) { + haltest_error("No key=value; pairs given.\n"); + return; + } + + stream_out->common.set_parameters(&stream_out->common, argv[2]); +} + +static void set_sample_rate_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + RETURN_IF_NULL(stream_out); + + if (argc < 3) + return; + + stream_out->common.set_sample_rate(&stream_out->common, atoi(argv[2])); +} + +static void init_check_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_audio); + + haltest_info("Init check result: %d\n", if_audio->init_check(if_audio)); +} + +static struct method methods[] = { + STD_METHOD(init), + STD_METHOD(cleanup), + STD_METHOD(open_output_stream), + STD_METHOD(close_output_stream), + STD_METHODH(play, "<path to pcm file>"), + STD_METHOD(stop), + STD_METHOD(suspend), + STD_METHOD(resume), + STD_METHOD(get_latency), + STD_METHOD(get_buffer_size), + STD_METHOD(get_channels), + STD_METHOD(get_format), + STD_METHOD(get_sample_rate), + STD_METHODH(get_parameters, "<A2dpSuspended;closing>"), + STD_METHODH(set_parameters, "<A2dpSuspended=value;closing=value>"), + STD_METHODH(set_sample_rate, "<sample rate>"), + STD_METHOD(init_check), + END_METHOD +}; + +const struct interface audio_if = { + .name = "audio", + .methods = methods +};
diff --git a/bluez/android/client/if-av.c b/bluez/android/client/if-av.c new file mode 100644 index 0000000..8d1f69b --- /dev/null +++ b/bluez/android/client/if-av.c
@@ -0,0 +1,131 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "if-main.h" +#include "../hal-utils.h" + +const btav_interface_t *if_av = NULL; + +SINTMAP(btav_connection_state_t, -1, "(unknown)") + DELEMENT(BTAV_CONNECTION_STATE_DISCONNECTED), + DELEMENT(BTAV_CONNECTION_STATE_CONNECTING), + DELEMENT(BTAV_CONNECTION_STATE_CONNECTED), + DELEMENT(BTAV_CONNECTION_STATE_DISCONNECTING), +ENDMAP + +SINTMAP(btav_audio_state_t, -1, "(unknown)") + DELEMENT(BTAV_AUDIO_STATE_REMOTE_SUSPEND), + DELEMENT(BTAV_AUDIO_STATE_STOPPED), + DELEMENT(BTAV_AUDIO_STATE_STARTED), +ENDMAP + +static char last_addr[MAX_ADDR_STR_LEN]; + +static void connection_state(btav_connection_state_t state, + bt_bdaddr_t *bd_addr) +{ + haltest_info("%s: connection_state=%s remote_bd_addr=%s\n", __func__, + btav_connection_state_t2str(state), + bt_bdaddr_t2str(bd_addr, last_addr)); +} + +static void audio_state(btav_audio_state_t state, bt_bdaddr_t *bd_addr) +{ + haltest_info("%s: audio_state=%s remote_bd_addr=%s\n", __func__, + btav_audio_state_t2str(state), + bt_bdaddr_t2str(bd_addr, last_addr)); +} + +static btav_callbacks_t av_cbacks = { + .size = sizeof(av_cbacks), + .connection_state_cb = connection_state, + .audio_state_cb = audio_state +}; + +/* init */ + +static void init_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_av); + + EXEC(if_av->init, &av_cbacks); +} + +/* connect */ + +static void connect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = NULL; + *enum_func = enum_devices; + } +} + +static void connect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_av); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_av->connect, &addr); +} + +/* disconnect */ + +static void disconnect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = last_addr; + *enum_func = enum_one_string; + } +} + +static void disconnect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_av); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_av->disconnect, &addr); +} + +/* cleanup */ + +static void cleanup_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_av); + + EXECV(if_av->cleanup); + if_av = NULL; +} + +static struct method methods[] = { + STD_METHOD(init), + STD_METHODCH(connect, "<addr>"), + STD_METHODCH(disconnect, "<addr>"), + STD_METHOD(cleanup), + END_METHOD +}; + +const struct interface av_if = { + .name = "av", + .methods = methods +};
diff --git a/bluez/android/client/if-bt.c b/bluez/android/client/if-bt.c new file mode 100644 index 0000000..8dcffea --- /dev/null +++ b/bluez/android/client/if-bt.c
@@ -0,0 +1,850 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "if-main.h" +#include "terminal.h" +#include "../hal-utils.h" + +const bt_interface_t *if_bluetooth; + +#define VERIFY_PROP_TYPE_ARG(n, typ) \ + do { \ + if (n < argc) \ + typ = str2btpropertytype(argv[n]); \ + else { \ + haltest_error("No property type specified\n"); \ + return;\ + } \ + } while (0) + +static bt_scan_mode_t str2btscanmode(const char *str) +{ + bt_scan_mode_t v = str2bt_scan_mode_t(str); + + if ((int) v != -1) + return v; + + haltest_warn("WARN: %s cannot convert %s\n", __func__, str); + return (bt_scan_mode_t) atoi(str); +} + +static bt_ssp_variant_t str2btsspvariant(const char *str) +{ + bt_ssp_variant_t v = str2bt_ssp_variant_t(str); + + if ((int) v != -1) + return v; + + haltest_warn("WARN: %s cannot convert %s\n", __func__, str); + return (bt_ssp_variant_t) atoi(str); +} + +static bt_property_type_t str2btpropertytype(const char *str) +{ + bt_property_type_t v = str2bt_property_type_t(str); + + if ((int) v != -1) + return v; + + haltest_warn("WARN: %s cannot convert %s\n", __func__, str); + return (bt_property_type_t) atoi(str); +} + +static void dump_properties(int num_properties, bt_property_t *properties) +{ + int i; + + for (i = 0; i < num_properties; i++) { + /* + * properities sometimes come unaligned hence memcp to + * aligned buffer + */ + bt_property_t prop; + memcpy(&prop, properties + i, sizeof(prop)); + + haltest_info("prop: %s\n", btproperty2str(&prop)); + } +} + +/* + * Cache for remote devices, stored in sorted array + */ +static bt_bdaddr_t *remote_devices = NULL; +static int remote_devices_cnt = 0; +static int remote_devices_capacity = 0; + +/* Adds address to remote device set so it can be used in tab completion */ +void add_remote_device(const bt_bdaddr_t *addr) +{ + int i; + + if (remote_devices == NULL) { + remote_devices = malloc(4 * sizeof(bt_bdaddr_t)); + remote_devices_cnt = 0; + if (remote_devices == NULL) { + remote_devices_capacity = 0; + return; + } + + remote_devices_capacity = 4; + } + + /* Array is sorted, search for right place */ + for (i = 0; i < remote_devices_cnt; ++i) { + int res = memcmp(&remote_devices[i], addr, sizeof(*addr)); + + if (res == 0) + return; /* Already added */ + else if (res > 0) + break; + } + + /* Realloc space if needed */ + if (remote_devices_cnt >= remote_devices_capacity) { + remote_devices_capacity *= 2; + remote_devices = realloc(remote_devices, sizeof(bt_bdaddr_t) * + remote_devices_capacity); + if (remote_devices == NULL) { + remote_devices_capacity = 0; + remote_devices_cnt = 0; + return; + } + } + + if (i < remote_devices_cnt) + memmove(remote_devices + i + 1, remote_devices + i, + (remote_devices_cnt - i) * sizeof(bt_bdaddr_t)); + remote_devices[i] = *addr; + remote_devices_cnt++; +} + +const char *enum_devices(void *v, int i) +{ + static char buf[MAX_ADDR_STR_LEN]; + + if (i >= remote_devices_cnt) + return NULL; + + bt_bdaddr_t2str(&remote_devices[i], buf); + return buf; +} + +static void add_remote_device_from_props(int num_properties, + const bt_property_t *properties) +{ + int i; + + for (i = 0; i < num_properties; i++) { + /* + * properities sometimes come unaligned hence memcp to + * aligned buffer + */ + bt_property_t property; + + memcpy(&property, properties + i, sizeof(property)); + if (property.type == BT_PROPERTY_BDADDR) + add_remote_device((bt_bdaddr_t *) property.val); + } +} + +static void adapter_state_changed_cb(bt_state_t state) +{ + haltest_info("%s: state=%s\n", __func__, bt_state_t2str(state)); +} + +static void adapter_properties_cb(bt_status_t status, int num_properties, + bt_property_t *properties) +{ + haltest_info("%s: status=%s num_properties=%d\n", __func__, + bt_status_t2str(status), num_properties); + + dump_properties(num_properties, properties); +} + +static void remote_device_properties_cb(bt_status_t status, + bt_bdaddr_t *bd_addr, + int num_properties, + bt_property_t *properties) +{ + haltest_info("%s: status=%s bd_addr=%s num_properties=%d\n", __func__, + bt_status_t2str(status), bdaddr2str(bd_addr), + num_properties); + + add_remote_device(bd_addr); + + dump_properties(num_properties, properties); +} + +static void device_found_cb(int num_properties, bt_property_t *properties) +{ + haltest_info("%s: num_properties=%d\n", __func__, num_properties); + + add_remote_device_from_props(num_properties, properties); + + dump_properties(num_properties, properties); +} + +static void discovery_state_changed_cb(bt_discovery_state_t state) +{ + haltest_info("%s: state=%s\n", __func__, + bt_discovery_state_t2str(state)); +} + +/* + * Buffer for remote addres that came from one of bind request. + * It's stored for command completion. + */ +static char last_remote_addr[MAX_ADDR_STR_LEN]; +static bt_ssp_variant_t last_ssp_variant = (bt_ssp_variant_t) -1; + +static bt_bdaddr_t pin_request_addr; +static void pin_request_answer(char *reply) +{ + bt_pin_code_t pin; + int accept = 0; + int pin_len = strlen(reply); + + if (pin_len > 0) { + accept = 1; + if (pin_len > 16) + pin_len = 16; + memcpy(&pin.pin, reply, pin_len); + } + + EXEC(if_bluetooth->pin_reply, &pin_request_addr, accept, pin_len, &pin); +} + +static void pin_request_cb(bt_bdaddr_t *remote_bd_addr, bt_bdname_t *bd_name, + uint32_t cod) +{ + /* Store for command completion */ + bt_bdaddr_t2str(remote_bd_addr, last_remote_addr); + pin_request_addr = *remote_bd_addr; + + haltest_info("%s: remote_bd_addr=%s bd_name=%s cod=%06x\n", __func__, + last_remote_addr, bd_name->name, cod); + terminal_prompt_for("Enter pin: ", pin_request_answer); +} + +/* Variables to store information from ssp_request_cb used for ssp_reply */ +static bt_bdaddr_t ssp_request_addr; +static bt_ssp_variant_t ssp_request_variant; +static uint32_t ssp_request_pask_key; + +/* Called when user hit enter on prompt for confirmation */ +static void ssp_request_yes_no_answer(char *reply) +{ + int accept = *reply == 0 || *reply == 'y' || *reply == 'Y'; + + if_bluetooth->ssp_reply(&ssp_request_addr, ssp_request_variant, accept, + ssp_request_pask_key); +} + +static void ssp_request_cb(bt_bdaddr_t *remote_bd_addr, bt_bdname_t *bd_name, + uint32_t cod, bt_ssp_variant_t pairing_variant, + uint32_t pass_key) +{ + static char prompt[50]; + + /* Store for command completion */ + bt_bdaddr_t2str(remote_bd_addr, last_remote_addr); + last_ssp_variant = pairing_variant; + + haltest_info("%s: remote_bd_addr=%s bd_name=%s cod=%06x pairing_variant=%s pass_key=%d\n", + __func__, last_remote_addr, bd_name->name, cod, + bt_ssp_variant_t2str(pairing_variant), pass_key); + + if (pairing_variant == BT_SSP_VARIANT_PASSKEY_CONFIRMATION) { + sprintf(prompt, "Does other device show %d [Y/n] ?", pass_key); + + ssp_request_addr = *remote_bd_addr; + ssp_request_variant = pairing_variant; + ssp_request_pask_key = pass_key; + + terminal_prompt_for(prompt, ssp_request_yes_no_answer); + } +} + +static void bond_state_changed_cb(bt_status_t status, + bt_bdaddr_t *remote_bd_addr, + bt_bond_state_t state) +{ + haltest_info("%s: status=%s remote_bd_addr=%s state=%s\n", __func__, + bt_status_t2str(status), bdaddr2str(remote_bd_addr), + bt_bond_state_t2str(state)); +} + +static void acl_state_changed_cb(bt_status_t status, + bt_bdaddr_t *remote_bd_addr, + bt_acl_state_t state) +{ + haltest_info("%s: status=%s remote_bd_addr=%s state=%s\n", __func__, + bt_status_t2str(status), bdaddr2str(remote_bd_addr), + bt_acl_state_t2str(state)); +} + +static void thread_evt_cb(bt_cb_thread_evt evt) +{ + haltest_info("%s: evt=%s\n", __func__, bt_cb_thread_evt2str(evt)); +} + +static void dut_mode_recv_cb(uint16_t opcode, uint8_t *buf, uint8_t len) +{ + haltest_info("%s\n", __func__); +} + +static void le_test_mode_cb(bt_status_t status, uint16_t num_packets) +{ + haltest_info("%s %s %d\n", __func__, bt_status_t2str(status), + num_packets); +} + +static bt_callbacks_t bt_callbacks = { + .size = sizeof(bt_callbacks), + .adapter_state_changed_cb = adapter_state_changed_cb, + .adapter_properties_cb = adapter_properties_cb, + .remote_device_properties_cb = remote_device_properties_cb, + .device_found_cb = device_found_cb, + .discovery_state_changed_cb = discovery_state_changed_cb, + .pin_request_cb = pin_request_cb, + .ssp_request_cb = ssp_request_cb, + .bond_state_changed_cb = bond_state_changed_cb, + .acl_state_changed_cb = acl_state_changed_cb, + .thread_evt_cb = thread_evt_cb, + .dut_mode_recv_cb = dut_mode_recv_cb, + .le_test_mode_cb = le_test_mode_cb +}; + +static void init_p(int argc, const char **argv) +{ + int err; + const hw_module_t *module; + hw_device_t *device; + + err = hw_get_module(BT_HARDWARE_MODULE_ID, &module); + if (err) { + haltest_error("he_get_module returned %d\n", err); + return; + } + + err = module->methods->open(module, BT_HARDWARE_MODULE_ID, &device); + if (err) { + haltest_error("module->methods->open returned %d\n", err); + return; + } + + if_bluetooth = + ((bluetooth_device_t *) device)->get_bluetooth_interface(); + if (!if_bluetooth) { + haltest_error("get_bluetooth_interface returned NULL\n"); + return; + } + + EXEC(if_bluetooth->init, &bt_callbacks); +} + +static void cleanup_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_bluetooth); + + EXECV(if_bluetooth->cleanup); + + if_bluetooth = NULL; +} + +static void enable_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_bluetooth); + + EXEC(if_bluetooth->enable); +} + +static void disable_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_bluetooth); + + EXEC(if_bluetooth->disable); +} + +static void get_adapter_properties_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_bluetooth); + + EXEC(if_bluetooth->get_adapter_properties); +} + +static void get_adapter_property_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = TYPE_ENUM(bt_property_type_t); + *enum_func = enum_defines; + } +} + +static void get_adapter_property_p(int argc, const char **argv) +{ + int type; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_PROP_TYPE_ARG(2, type); + + EXEC(if_bluetooth->get_adapter_property, type); +} + +static const char * const names[] = { + "BT_PROPERTY_BDNAME", + "BT_PROPERTY_ADAPTER_SCAN_MODE", + "BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT", + NULL +}; + +static void set_adapter_property_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = (void *) names; + *enum_func = enum_strings; + } else if (argc == 4) { + if (0 == strcmp(argv[2], "BT_PROPERTY_ADAPTER_SCAN_MODE")) { + *user = TYPE_ENUM(bt_scan_mode_t); + *enum_func = enum_defines; + } + } +} + +static void set_adapter_property_p(int argc, const char **argv) +{ + bt_property_t property; + bt_scan_mode_t mode; + int timeout; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_PROP_TYPE_ARG(2, property.type); + + if (argc <= 3) { + haltest_error("No property value specified\n"); + return; + } + switch (property.type) { + case BT_PROPERTY_BDNAME: + property.len = strlen(argv[3]) + 1; + property.val = (char *) argv[3]; + break; + + case BT_PROPERTY_ADAPTER_SCAN_MODE: + mode = str2btscanmode(argv[3]); + property.len = sizeof(bt_scan_mode_t); + property.val = &mode; + break; + + case BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT: + timeout = atoi(argv[3]); + property.val = &timeout; + property.len = sizeof(timeout); + break; + + default: + haltest_error("Invalid property %s\n", argv[3]); + return; + } + + EXEC(if_bluetooth->set_adapter_property, &property); +} + +/* + * This function is to be used for completion methods that need only address + */ +static void complete_addr_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = NULL; + *enum_func = enum_devices; + } +} + +/* Just addres to complete, use complete_addr_c */ +#define get_remote_device_properties_c complete_addr_c + +static void get_remote_device_properties_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_bluetooth->get_remote_device_properties, &addr); +} + +static void get_remote_device_property_c(int argc, const char **argv, + enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = NULL; + *enum_func = enum_devices; + } else if (argc == 4) { + *user = TYPE_ENUM(bt_property_type_t); + *enum_func = enum_defines; + } +} + +static void get_remote_device_property_p(int argc, const char **argv) +{ + bt_property_type_t type; + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + VERIFY_PROP_TYPE_ARG(3, type); + + EXEC(if_bluetooth->get_remote_device_property, &addr, type); +} + +/* + * Same completion as for get_remote_device_property_c can be used for + * set_remote_device_property_c. No need to create separate function. + */ +#define set_remote_device_property_c get_remote_device_property_c + +static void set_remote_device_property_p(int argc, const char **argv) +{ + bt_property_t property; + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + VERIFY_PROP_TYPE_ARG(3, property.type); + + switch (property.type) { + case BT_PROPERTY_REMOTE_FRIENDLY_NAME: + property.len = strlen(argv[4]); + property.val = (char *) argv[4]; + break; + default: + return; + } + + EXEC(if_bluetooth->set_remote_device_property, &addr, &property); +} + +/* + * For now uuid is not autocompleted. Use routine for complete_addr_c + */ +#define get_remote_service_record_c complete_addr_c + +static void get_remote_service_record_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + bt_uuid_t uuid; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + + if (argc <= 3) { + haltest_error("No uuid specified\n"); + return; + } + + str2bt_uuid_t(argv[3], &uuid); + + EXEC(if_bluetooth->get_remote_service_record, &addr, &uuid); +} + +/* Just addres to complete, use complete_addr_c */ +#define get_remote_services_c complete_addr_c + +static void get_remote_services_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_bluetooth->get_remote_services, &addr); +} + +static void start_discovery_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_bluetooth); + + EXEC(if_bluetooth->start_discovery); +} + +static void cancel_discovery_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_bluetooth); + + EXEC(if_bluetooth->cancel_discovery); +} + +/* Just addres to complete, use complete_addr_c */ +#define create_bond_c complete_addr_c + +static void create_bond_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_bluetooth->create_bond, &addr); +} + +/* Just addres to complete, use complete_addr_c */ +#define remove_bond_c complete_addr_c + +static void remove_bond_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_bluetooth->remove_bond, &addr); +} + +/* Just addres to complete, use complete_addr_c */ +#define cancel_bond_c complete_addr_c + +static void cancel_bond_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_bluetooth->cancel_bond, &addr); +} + +static void pin_reply_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + static const char *const completions[] = { last_remote_addr, NULL }; + + if (argc == 3) { + *user = (void *) completions; + *enum_func = enum_strings; + } +} + +static void pin_reply_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + bt_pin_code_t pin; + int pin_len = 0; + int accept = 0; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + + if (argc > 3) { + accept = 1; + pin_len = strlen(argv[3]); + memcpy(pin.pin, argv[3], pin_len); + } + + EXEC(if_bluetooth->pin_reply, &addr, accept, pin_len, &pin); +} + +static void ssp_reply_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = last_remote_addr; + *enum_func = enum_one_string; + } else if (argc == 5) { + *user = "1"; + *enum_func = enum_one_string; + } else if (argc == 4) { + if (-1 != (int) last_ssp_variant) { + *user = (void *) bt_ssp_variant_t2str(last_ssp_variant); + *enum_func = enum_one_string; + } else { + *user = TYPE_ENUM(bt_ssp_variant_t); + *enum_func = enum_defines; + } + } +} + +static void ssp_reply_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + bt_ssp_variant_t var; + int accept; + int passkey; + + RETURN_IF_NULL(if_bluetooth); + VERIFY_ADDR_ARG(2, &addr); + + if (argc < 4) { + haltest_error("No ssp variant specified\n"); + return; + } + + var = str2btsspvariant(argv[3]); + if (argc < 5) { + haltest_error("No accept value specified\n"); + return; + } + + accept = atoi(argv[4]); + passkey = 0; + + if (accept && var == BT_SSP_VARIANT_PASSKEY_ENTRY && argc >= 5) + passkey = atoi(argv[4]); + + EXEC(if_bluetooth->ssp_reply, &addr, var, accept, passkey); +} + +static void get_profile_interface_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + static const char *const profile_ids[] = { + BT_PROFILE_HANDSFREE_ID, + BT_PROFILE_ADVANCED_AUDIO_ID, + BT_PROFILE_HEALTH_ID, + BT_PROFILE_SOCKETS_ID, + BT_PROFILE_HIDHOST_ID, + BT_PROFILE_PAN_ID, + BT_PROFILE_GATT_ID, + BT_PROFILE_AV_RC_ID, + NULL + }; + + if (argc == 3) { + *user = (void *) profile_ids; + *enum_func = enum_strings; + } +} + +static void get_profile_interface_p(int argc, const char **argv) +{ + const char *id; + const void **pif = NULL; + const void *dummy = NULL; + + RETURN_IF_NULL(if_bluetooth); + if (argc <= 2) { + haltest_error("No interface specified\n"); + return; + } + + id = argv[2]; + + if (strcmp(BT_PROFILE_HANDSFREE_ID, id) == 0) + pif = (const void **) &if_hf; + else if (strcmp(BT_PROFILE_ADVANCED_AUDIO_ID, id) == 0) + pif = (const void **) &if_av; + else if (strcmp(BT_PROFILE_HEALTH_ID, id) == 0) + pif = &dummy; /* TODO: change when if_hl is there */ + else if (strcmp(BT_PROFILE_SOCKETS_ID, id) == 0) + pif = (const void **) &if_sock; + else if (strcmp(BT_PROFILE_HIDHOST_ID, id) == 0) + pif = (const void **) &if_hh; + else if (strcmp(BT_PROFILE_PAN_ID, id) == 0) + pif = (const void **) &if_pan; + else if (strcmp(BT_PROFILE_AV_RC_ID, id) == 0) + pif = (const void **) &if_rc; + else if (strcmp(BT_PROFILE_GATT_ID, id) == 0) + pif = (const void **) &if_gatt; + else + haltest_error("%s is not correct for get_profile_interface\n", + id); + + if (pif != NULL) { + *pif = if_bluetooth->get_profile_interface(id); + haltest_info("get_profile_interface(%s) : %p\n", id, *pif); + } +} + +static void dut_mode_configure_p(int argc, const char **argv) +{ + uint8_t mode; + + RETURN_IF_NULL(if_bluetooth); + + if (argc <= 2) { + haltest_error("No dut mode specified\n"); + return; + } + + mode = strtol(argv[2], NULL, 0); + + EXEC(if_bluetooth->dut_mode_configure, mode); +} + +static void dut_mode_send_p(int argc, const char **argv) +{ + haltest_error("not implemented\n"); +} + +static void le_test_mode_p(int argc, const char **argv) +{ + haltest_error("not implemented\n"); +} + +static void config_hci_snoop_log_p(int argc, const char **argv) +{ + uint8_t mode; + + RETURN_IF_NULL(if_bluetooth); + + if (argc <= 2) { + haltest_error("No mode specified\n"); + return; + } + + mode = strtol(argv[2], NULL, 0); + + EXEC(if_bluetooth->config_hci_snoop_log, mode); +} + +static struct method methods[] = { + STD_METHOD(init), + STD_METHOD(cleanup), + STD_METHOD(enable), + STD_METHOD(disable), + STD_METHOD(get_adapter_properties), + STD_METHODCH(get_adapter_property, "<prop_type>"), + STD_METHODCH(set_adapter_property, "<prop_type> <prop_value>"), + STD_METHODCH(get_remote_device_properties, "<addr>"), + STD_METHODCH(get_remote_device_property, "<addr> <property_type>"), + STD_METHODCH(set_remote_device_property, + "<addr> <property_type> <value>"), + STD_METHODCH(get_remote_service_record, "<addr> <uuid>"), + STD_METHODCH(get_remote_services, "<addr>"), + STD_METHOD(start_discovery), + STD_METHOD(cancel_discovery), + STD_METHODCH(create_bond, "<addr>"), + STD_METHODCH(remove_bond, "<addr>"), + STD_METHODCH(cancel_bond, "<addr>"), + STD_METHODCH(pin_reply, "<address> [<pin>]"), + STD_METHODCH(ssp_reply, "<address> <ssp_veriant> 1|0 [<passkey>]"), + STD_METHODCH(get_profile_interface, "<profile id>"), + STD_METHODH(dut_mode_configure, "<dut mode>"), + STD_METHOD(dut_mode_send), + STD_METHOD(le_test_mode), + STD_METHODH(config_hci_snoop_log, "<mode>"), + END_METHOD +}; + +const struct interface bluetooth_if = { + .name = "bluetooth", + .methods = methods +};
diff --git a/bluez/android/client/if-gatt.c b/bluez/android/client/if-gatt.c new file mode 100644 index 0000000..da2f299 --- /dev/null +++ b/bluez/android/client/if-gatt.c
@@ -0,0 +1,1753 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <hardware/bluetooth.h> + +#include "../hal-utils.h" +#include "if-main.h" + +const btgatt_interface_t *if_gatt = NULL; + +/* In version 19 some callback were changed. + * btgatt_char_id_t -> btgatt_gatt_id_t + * bt_uuid_t -> btgatt_gatt_id_t + */ +#define str2btgatt_descr_id_t str2btgatt_gatt_id_t +#define btgatt_descr_id_t2str btgatt_gatt_id_t2str +#define btgatt_descr_id_t btgatt_gatt_id_t + +#define MAX_CHAR_ID_STR_LEN (MAX_UUID_STR_LEN + 3 + 11) +#define MAX_SRVC_ID_STR_LEN (MAX_UUID_STR_LEN + 3 + 11 + 1 + 11) +/* How man characters print from binary objects (arbitrary) */ +#define MAX_HEX_VAL_STR_LEN 100 +#define MAX_NOTIFY_PARAMS_STR_LEN (MAX_SRVC_ID_STR_LEN + MAX_CHAR_ID_STR_LEN \ + + MAX_ADDR_STR_LEN + MAX_HEX_VAL_STR_LEN + 60) +#define MAX_READ_PARAMS_STR_LEN (MAX_SRVC_ID_STR_LEN + MAX_CHAR_ID_STR_LEN \ + + MAX_UUID_STR_LEN + MAX_HEX_VAL_STR_LEN + 80) + +#define VERIFY_INT_ARG(n, v, err) \ + do { \ + if (n < argc) \ + v = atoi(argv[n]); \ + else { \ + haltest_error(err); \ + return;\ + } \ + } while (0) + +#define VERIFY_HEX_ARG(n, v, err) \ + do { \ + if (n < argc) \ + v = strtol(argv[n], NULL, 16); \ + else { \ + haltest_error(err); \ + return;\ + } \ + } while (0) + +/* Helper macros to verify arguments of methods */ +#define VERIFY_CLIENT_IF(n, v) VERIFY_INT_ARG(n, v, "No client_if specified\n") +#define VERIFY_SERVER_IF(n, v) VERIFY_INT_ARG(n, v, "No server_if specified\n") +#define VERIFY_CONN_ID(n, v) VERIFY_INT_ARG(n, v, "No conn_if specified\n") +#define VERIFY_HANDLE(n, v) VERIFY_HEX_ARG(n, v, "No "#v" specified\n") +#define VERIFY_SERVICE_HANDLE(n, v) VERIFY_HANDLE(n, v) + +#define VERIFY_UUID(n, v) \ + do { \ + if (n < argc) \ + gatt_str2bt_uuid_t(argv[n], -1, v); \ + else { \ + haltest_error("No uuid specified\n"); \ + return;\ + } \ + } while (0) + +#define VERIFY_SRVC_ID(n, v) \ + do { \ + if (n < argc) \ + str2btgatt_srvc_id_t(argv[n], v); \ + else { \ + haltest_error("No srvc_id specified\n"); \ + return;\ + } \ + } while (0) + +#define VERIFY_CHAR_ID(n, v) \ + do { \ + if (n < argc) \ + str2btgatt_gatt_id_t(argv[n], v); \ + else { \ + haltest_error("No char_id specified\n"); \ + return;\ + } \ + } while (0) + +#define VERIFY_DESCR_ID(n, v) \ + do { \ + if (n < argc) \ + str2btgatt_descr_id_t(argv[n], v); \ + else { \ + haltest_error("No descr_id specified\n"); \ + return;\ + } \ + } while (0) + +/* Gatt uses little endian uuid */ +static const char GATT_BASE_UUID[] = { + 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +/* + * converts gatt uuid to string + * buf should be at least 39 bytes + * + * This function formats 16, 32 and 128 bits uuid + * + * returns string representation of uuid + */ +static char *gatt_uuid_t2str(const bt_uuid_t *uuid, char *buf) +{ + int shift = 0; + int i = 16; + int limit = 0; + int j = 0; + + /* for bluetooth uuid only 32 bits */ + if (0 == memcmp(&uuid->uu, &GATT_BASE_UUID, + sizeof(bt_uuid_t) - 4)) { + limit = 12; + /* make it 16 bits */ + if (uuid->uu[15] == 0 && uuid->uu[14] == 0) + i = 14; + } + + while (i-- > limit) { + if (i == 11 || i == 9 || i == 7 || i == 5) { + buf[j * 2 + shift] = '-'; + shift++; + } + + sprintf(buf + j * 2 + shift, "%02x", uuid->uu[i]); + ++j; + } + + return buf; +} + +/* + * Tries to convert hex string of given size into out buffer. + * Output buffer is little endian. + */ +static void scan_field(const char *str, int len, uint8_t *out, int out_size) +{ + int i; + + memset(out, 0, out_size); + if (out_size * 2 > len + 1) + out_size = (len + 1) / 2; + + for (i = 0; i < out_size && len > 0; ++i) { + len -= 2; + if (len >= 0) + sscanf(str + len, "%02hhx", &out[i]); + else + sscanf(str, "%1hhx", &out[i]); + } +} + +/* Like strchr but with upper limit instead of 0 terminated string */ +static const char *strchrlimit(const char *p, const char *e, int c) +{ + while (p < e && *p != (char) c) + ++p; + + return p < e ? p : NULL; +} + +/* + * converts string to uuid + * it accepts uuid in following forms: + * 123 + * 0000123 + * 0000123-0014-1234-0000-000056789abc + * 0000123001412340000000056789abc + * 123-14-1234-0-56789abc + */ +static void gatt_str2bt_uuid_t(const char *str, int len, bt_uuid_t *uuid) +{ + int dash_cnt = 0; + int dashes[6] = {-1}; /* indexes of '-' or \0 */ + static uint8_t filed_offset[] = { 16, 12, 10, 8, 6, 0 }; + const char *p = str; + const char *e; + int i; + + e = str + ((len >= 0) ? len : (int) strlen(str)); + + while (p != NULL && dash_cnt < 5) { + const char *f = strchrlimit(p, e, '-'); + + if (f != NULL) + dashes[++dash_cnt] = f++ - str; + p = f; + } + + /* get index of \0 to dashes table */ + if (dash_cnt < 5) + dashes[++dash_cnt] = e - str; + + memcpy(uuid, GATT_BASE_UUID, sizeof(bt_uuid_t)); + + /* whole uuid in one string without dashes */ + if (dash_cnt == 1 && dashes[1] > 8) { + if (dashes[1] > 32) + dashes[1] = 32; + scan_field(str, dashes[1], + &uuid->uu[16 - (dashes[1] + 1) / 2], + (dashes[1] + 1) / 2); + } else { + for (i = 0; i < dash_cnt; ++i) { + scan_field(str + dashes[i] + 1, + dashes[i + 1] - dashes[i] - 1, + &uuid->uu[filed_offset[i + 1]], + filed_offset[i] - filed_offset[i + 1]); + } + } +} + +/* char_id formating function */ +static char *btgatt_gatt_id_t2str(const btgatt_gatt_id_t *char_id, char *buf) +{ + char uuid_buf[MAX_UUID_STR_LEN]; + + sprintf(buf, "{%s,%d}", gatt_uuid_t2str(&char_id->uuid, uuid_buf), + char_id->inst_id); + return buf; +} + +/* Parse btgatt_gatt_id_t */ +static void str2btgatt_gatt_id_t(const char *buf, btgatt_gatt_id_t *char_id) +{ + const char *e; + + memcpy(&char_id->uuid, &GATT_BASE_UUID, sizeof(bt_uuid_t)); + char_id->inst_id = 0; + + if (*buf == '{') + buf++; + e = strpbrk(buf, " ,}"); + if (e == NULL) + e = buf + strlen(buf); + + gatt_str2bt_uuid_t(buf, e - buf, &char_id->uuid); + if (*e == ',') { + buf = e + 1; + e = strpbrk(buf, " ,}"); + if (e == NULL) + e = buf + strlen(buf); + if (buf < e) + char_id->inst_id = atoi(buf); + } +} + +/* service_id formating function */ +static char *btgatt_srvc_id_t2str(const btgatt_srvc_id_t *srvc_id, char *buf) +{ + char uuid_buf[MAX_UUID_STR_LEN]; + + sprintf(buf, "{%s,%d,%d}", gatt_uuid_t2str(&srvc_id->id.uuid, uuid_buf), + srvc_id->id.inst_id, srvc_id->is_primary); + return buf; +} + +/* Parse btgatt_srvc_id_t */ +static void str2btgatt_srvc_id_t(const char *buf, btgatt_srvc_id_t *srvc_id) +{ + const char *e; + + memcpy(&srvc_id->id.uuid, &GATT_BASE_UUID, sizeof(bt_uuid_t)); + srvc_id->id.inst_id = 0; + srvc_id->is_primary = 1; + + if (*buf == '{') + buf++; + e = strpbrk(buf, " ,}"); + if (e == NULL) + e = buf + strlen(buf); + + gatt_str2bt_uuid_t(buf, e - buf, &srvc_id->id.uuid); + if (*e == ',') { + buf = e + 1; + e = strpbrk(buf, " ,}"); + if (e == NULL) + e = buf + strlen(buf); + if (buf < e) + srvc_id->id.inst_id = atoi(buf); + } + + if (*e == ',') { + buf = e + 1; + e = strpbrk(buf, " ,}"); + if (e == NULL) + e = buf + strlen(buf); + if (buf < e) + srvc_id->is_primary = atoi(buf); + } +} + +/* Converts array of uint8_t to string representation */ +static char *array2str(const uint8_t *v, int size, char *buf, int out_size) +{ + int limit = size; + int i; + + if (out_size > 0) { + *buf = '\0'; + if (size >= 2 * out_size) + limit = (out_size - 2) / 2; + + for (i = 0; i < limit; ++i) + sprintf(buf + 2 * i, "%02x", v[i]); + + /* output buffer not enough to hold whole field fill with ...*/ + if (limit < size) + sprintf(buf + 2 * i, "..."); + } + + return buf; +} + +/* Converts btgatt_notify_params_t to string */ +static char *btgatt_notify_params_t2str(const btgatt_notify_params_t *data, + char *buf) +{ + char addr[MAX_ADDR_STR_LEN]; + char srvc_id[MAX_SRVC_ID_STR_LEN]; + char char_id[MAX_CHAR_ID_STR_LEN]; + char value[MAX_HEX_VAL_STR_LEN]; + + sprintf(buf, "{bda=%s, srvc_id=%s, char_id=%s, val=%s, is_notify=%u}", + bt_bdaddr_t2str(&data->bda, addr), + btgatt_srvc_id_t2str(&data->srvc_id, srvc_id), + btgatt_gatt_id_t2str(&data->char_id, char_id), + array2str(data->value, data->len, value, sizeof(value)), + data->is_notify); + return buf; +} + +static char *btgatt_unformatted_value_t2str(const btgatt_unformatted_value_t *v, + char *buf, int size) +{ + return array2str(v->value, v->len, buf, size); +} + +static char *btgatt_read_params_t2str(const btgatt_read_params_t *data, + char *buf) +{ + char srvc_id[MAX_SRVC_ID_STR_LEN]; + char char_id[MAX_CHAR_ID_STR_LEN]; + char descr_id[MAX_UUID_STR_LEN]; + char value[MAX_HEX_VAL_STR_LEN]; + + sprintf(buf, "{srvc_id=%s, char_id=%s, descr_id=%s, val=%s value_type=%d, status=%d}", + btgatt_srvc_id_t2str(&data->srvc_id, srvc_id), + btgatt_gatt_id_t2str(&data->char_id, char_id), + btgatt_descr_id_t2str(&data->descr_id, descr_id), + btgatt_unformatted_value_t2str(&data->value, value, 100), + data->value_type, data->status); + return buf; +} + +/* BT-GATT Client callbacks. */ + +/* Cache client_if and conn_id for tab completion */ +static char client_if_str[20]; +static char conn_id_str[20]; +/* Cache address for tab completion */ +static char last_addr[MAX_ADDR_STR_LEN]; + +/* Callback invoked in response to register_client */ +static void gattc_register_client_cb(int status, int client_if, + bt_uuid_t *app_uuid) +{ + char buf[MAX_UUID_STR_LEN]; + + snprintf(client_if_str, sizeof(client_if_str), "%d", client_if); + + haltest_info("%s: status=%d client_if=%d app_uuid=%s\n", __func__, + status, client_if, + gatt_uuid_t2str(app_uuid, buf)); +} + +/* Callback for scan results */ +static void gattc_scan_result_cb(bt_bdaddr_t *bda, int rssi, uint8_t *adv_data) +{ + char buf[MAX_ADDR_STR_LEN]; + + haltest_info("%s: bda=%s rssi=%d adv_data=%p\n", __func__, + bt_bdaddr_t2str(bda, buf), rssi, adv_data); +} + +/* GATT open callback invoked in response to open */ +static void gattc_connect_cb(int conn_id, int status, int client_if, + bt_bdaddr_t *bda) +{ + haltest_info("%s: conn_id=%d status=%d, client_if=%d bda=%s\n", + __func__, conn_id, status, client_if, + bt_bdaddr_t2str(bda, last_addr)); +} + +/* Callback invoked in response to close */ +static void gattc_disconnect_cb(int conn_id, int status, int client_if, + bt_bdaddr_t *bda) +{ + char buf[MAX_ADDR_STR_LEN]; + + haltest_info("%s: conn_id=%d status=%d, client_if=%d bda=%s\n", + __func__, conn_id, status, client_if, + bt_bdaddr_t2str(bda, buf)); +} + +/* + * Invoked in response to search_service when the GATT service search + * has been completed. + */ +static void gattc_search_complete_cb(int conn_id, int status) +{ + haltest_info("%s: conn_id=%d status=%d\n", __func__, conn_id, status); +} + +/* Reports GATT services on a remote device */ +static void gattc_search_result_cb(int conn_id, btgatt_srvc_id_t *srvc_id) +{ + char srvc_id_buf[MAX_SRVC_ID_STR_LEN]; + + haltest_info("%s: conn_id=%d srvc_id=%s\n", __func__, conn_id, + btgatt_srvc_id_t2str(srvc_id, srvc_id_buf)); +} + +/* GATT characteristic enumeration result callback */ +static void gattc_get_characteristic_cb(int conn_id, int status, + btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id, + int char_prop) +{ + char srvc_id_buf[MAX_SRVC_ID_STR_LEN]; + char char_id_buf[MAX_CHAR_ID_STR_LEN]; + + haltest_info("%s: conn_id=%d status=%d srvc_id=%s char_id=%s, char_prop=%x\n", + __func__, conn_id, status, + btgatt_srvc_id_t2str(srvc_id, srvc_id_buf), + btgatt_gatt_id_t2str(char_id, char_id_buf), char_prop); + + /* enumerate next characteristic */ + if (status == 0) + EXEC(if_gatt->client->get_characteristic, conn_id, srvc_id, + char_id); +} + +/* GATT descriptor enumeration result callback */ +static void gattc_get_descriptor_cb(int conn_id, int status, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, + btgatt_descr_id_t *descr_id) +{ + char buf[MAX_UUID_STR_LEN]; + char srvc_id_buf[MAX_SRVC_ID_STR_LEN]; + char char_id_buf[MAX_CHAR_ID_STR_LEN]; + + haltest_info("%s: conn_id=%d status=%d srvc_id=%s char_id=%s, descr_id=%s\n", + __func__, conn_id, status, + btgatt_srvc_id_t2str(srvc_id, srvc_id_buf), + btgatt_gatt_id_t2str(char_id, char_id_buf), + btgatt_descr_id_t2str(descr_id, buf)); + + if (status == 0) + EXEC(if_gatt->client->get_descriptor, conn_id, srvc_id, char_id, + descr_id); +} + +/* GATT included service enumeration result callback */ +static void gattc_get_included_service_cb(int conn_id, int status, + btgatt_srvc_id_t *srvc_id, + btgatt_srvc_id_t *incl_srvc_id) +{ + char srvc_id_buf[MAX_SRVC_ID_STR_LEN]; + char incl_srvc_id_buf[MAX_SRVC_ID_STR_LEN]; + + haltest_info("%s: conn_id=%d status=%d srvc_id=%s incl_srvc_id=%s)\n", + __func__, conn_id, status, + btgatt_srvc_id_t2str(srvc_id, srvc_id_buf), + btgatt_srvc_id_t2str(incl_srvc_id, incl_srvc_id_buf)); + + if (status == 0) + EXEC(if_gatt->client->get_included_service, conn_id, srvc_id, + incl_srvc_id); +} + +/* Callback invoked in response to [de]register_for_notification */ +static void gattc_register_for_notification_cb(int conn_id, int registered, + int status, + btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id) +{ + char srvc_id_buf[MAX_SRVC_ID_STR_LEN]; + char char_id_buf[MAX_CHAR_ID_STR_LEN]; + + haltest_info("%s: conn_id=%d registered=%d status=%d srvc_id=%s char_id=%s\n", + __func__, conn_id, registered, status, + btgatt_srvc_id_t2str(srvc_id, srvc_id_buf), + btgatt_gatt_id_t2str(char_id, char_id_buf)); +} + +/* + * Remote device notification callback, invoked when a remote device sends + * a notification or indication that a client has registered for. + */ +static void gattc_notify_cb(int conn_id, btgatt_notify_params_t *p_data) +{ + char buf[MAX_NOTIFY_PARAMS_STR_LEN]; + + haltest_info("%s: conn_id=%d data=%s\n", __func__, conn_id, + btgatt_notify_params_t2str(p_data, buf)); +} + +/* Reports result of a GATT read operation */ +static void gattc_read_characteristic_cb(int conn_id, int status, + btgatt_read_params_t *p_data) +{ + char buf[MAX_READ_PARAMS_STR_LEN]; + + haltest_info("%s: conn_id=%d status=%d data=%s\n", __func__, conn_id, + status, btgatt_read_params_t2str(p_data, buf)); +} + +/* GATT write characteristic operation callback */ +static void gattc_write_characteristic_cb(int conn_id, int status, + btgatt_write_params_t *p_data) +{ + haltest_info("%s: conn_id=%d status=%d\n", __func__, conn_id, status); +} + +/* GATT execute prepared write callback */ +static void gattc_execute_write_cb(int conn_id, int status) +{ + haltest_info("%s: conn_id=%d status=%d\n", __func__, conn_id, status); +} + +/* Callback invoked in response to read_descriptor */ +static void gattc_read_descriptor_cb(int conn_id, int status, + btgatt_read_params_t *p_data) +{ + char buf[MAX_READ_PARAMS_STR_LEN]; + + haltest_info("%s: conn_id=%d status=%d data=%s\n", __func__, conn_id, + status, btgatt_read_params_t2str(p_data, buf)); +} + +/* Callback invoked in response to write_descriptor */ +static void gattc_write_descriptor_cb(int conn_id, int status, + btgatt_write_params_t *p_data) +{ + haltest_info("%s: conn_id=%d status=%d\n", __func__, conn_id, status); +} + +/* Callback triggered in response to read_remote_rssi */ +static void gattc_read_remote_rssi_cb(int client_if, bt_bdaddr_t *bda, int rssi, + int status) +{ + char buf[MAX_ADDR_STR_LEN]; + + haltest_info("%s: client_if=%d bda=%s rssi=%d satus=%d\n", __func__, + client_if, bt_bdaddr_t2str(bda, buf), rssi, status); +} + +static const btgatt_client_callbacks_t btgatt_client_callbacks = { + .register_client_cb = gattc_register_client_cb, + .scan_result_cb = gattc_scan_result_cb, + .open_cb = gattc_connect_cb, + .close_cb = gattc_disconnect_cb, + .search_complete_cb = gattc_search_complete_cb, + .search_result_cb = gattc_search_result_cb, + .get_characteristic_cb = gattc_get_characteristic_cb, + .get_descriptor_cb = gattc_get_descriptor_cb, + .get_included_service_cb = gattc_get_included_service_cb, + .register_for_notification_cb = gattc_register_for_notification_cb, + .notify_cb = gattc_notify_cb, + .read_characteristic_cb = gattc_read_characteristic_cb, + .write_characteristic_cb = gattc_write_characteristic_cb, + .read_descriptor_cb = gattc_read_descriptor_cb, + .write_descriptor_cb = gattc_write_descriptor_cb, + .execute_write_cb = gattc_execute_write_cb, + .read_remote_rssi_cb = gattc_read_remote_rssi_cb +}; + +/* BT-GATT Server callbacks */ + +/* Cache server_if and conn_id for tab completion */ +static char server_if_str[20]; + +/* Callback invoked in response to register_server */ +static void gatts_register_server_cb(int status, int server_if, + bt_uuid_t *app_uuid) +{ + char buf[MAX_UUID_STR_LEN]; + + haltest_info("%s: status=%d server_if=%d app_uuid=%s\n", __func__, + status, server_if, gatt_uuid_t2str(app_uuid, buf)); +} + +/* + * Callback indicating that a remote device has connected + * or been disconnected + */ +static void gatts_connection_cb(int conn_id, int server_if, int connected, + bt_bdaddr_t *bda) +{ + haltest_info("%s: conn_id=%d server_if=%d connected=%d bda=%s\n", + __func__, conn_id, server_if, connected, + bt_bdaddr_t2str(bda, last_addr)); + snprintf(conn_id_str, sizeof(conn_id_str), "%d", conn_id); +} + +/* Callback invoked in response to create_service */ +static void gatts_service_added_cb(int status, int server_if, + btgatt_srvc_id_t *srvc_id, int srvc_handle) +{ + char buf[MAX_SRVC_ID_STR_LEN]; + + snprintf(server_if_str, sizeof(server_if_str), "%d", server_if); + + haltest_info("%s: status=%d server_if=%d srvc_id=%s handle=%x\n", + __func__, status, server_if, + btgatt_srvc_id_t2str(srvc_id, buf), srvc_handle); +} + +/* Callback indicating that an included service has been added to a service */ +static void gatts_included_service_added_cb(int status, int server_if, + int srvc_handle, + int incl_srvc_handle) +{ + haltest_info("%s: status=%d server_if=%d srvc_handle=%x inc_srvc_handle=%x\n", + __func__, status, server_if, + srvc_handle, incl_srvc_handle); +} + +/* Callback invoked when a characteristic has been added to a service */ +static void gatts_characteristic_added_cb(int status, int server_if, + bt_uuid_t *uuid, + int srvc_handle, + int char_handle) +{ + char buf[MAX_SRVC_ID_STR_LEN]; + + haltest_info("%s: status=%d server_if=%d uuid=%s srvc_handle=%x char_handle=%x\n", + __func__, status, server_if, gatt_uuid_t2str(uuid, buf), + srvc_handle, char_handle); +} + +/* Callback invoked when a descriptor has been added to a characteristic */ +static void gatts_descriptor_added_cb(int status, int server_if, + bt_uuid_t *uuid, int srvc_handle, + int descr_handle) +{ + char buf[MAX_SRVC_ID_STR_LEN]; + + haltest_info("%s: status=%d server_if=%d uuid=%s srvc_handle=%x descr_handle=%x\n", + __func__, status, server_if, gatt_uuid_t2str(uuid, buf), + srvc_handle, descr_handle); +} + +/* Callback invoked in response to start_service */ +static void gatts_service_started_cb(int status, int server_if, int srvc_handle) +{ + haltest_info("%s: status=%d server_if=%d srvc_handle=%x\n", + __func__, status, server_if, srvc_handle); +} + +/* Callback invoked in response to stop_service */ +static void gatts_service_stopped_cb(int status, int server_if, int srvc_handle) +{ + haltest_info("%s: status=%d server_if=%d srvc_handle=%x\n", + __func__, status, server_if, srvc_handle); +} + +/* Callback triggered when a service has been deleted */ +static void gatts_service_deleted_cb(int status, int server_if, int srvc_handle) +{ + haltest_info("%s: status=%d server_if=%d srvc_handle=%x\n", + __func__, status, server_if, srvc_handle); +} + +/* + * Callback invoked when a remote device has requested to read a characteristic + * or descriptor. The application must respond by calling send_response + */ +static void gatts_request_read_cb(int conn_id, int trans_id, bt_bdaddr_t *bda, + int attr_handle, int offset, + bool is_long) +{ + char buf[MAX_ADDR_STR_LEN]; + + haltest_info("%s: conn_id=%d trans_id=%d bda=%s attr_handle=%x offset=%d is_long=%d\n", + __func__, conn_id, trans_id, bt_bdaddr_t2str(bda, buf), + attr_handle, offset, is_long); +} + +/* + * Callback invoked when a remote device has requested to write to a + * characteristic or descriptor. + */ +static void gatts_request_write_cb(int conn_id, int trans_id, bt_bdaddr_t *bda, + int attr_handle, int offset, int length, + bool need_rsp, bool is_prep, + uint8_t *value) +{ + char buf[MAX_ADDR_STR_LEN]; + char valbuf[100]; + + haltest_info("%s: conn_id=%d trans_id=%d bda=%s attr_handle=%x offset=%d length=%d need_rsp=%d is_prep=%d value=%s\n", + __func__, conn_id, trans_id, bt_bdaddr_t2str(bda, buf), + attr_handle, offset, length, need_rsp, is_prep, + array2str(value, length, valbuf, sizeof(valbuf))); +} + +/* Callback invoked when a previously prepared write is to be executed */ +static void gatts_request_exec_write_cb(int conn_id, int trans_id, + bt_bdaddr_t *bda, int exec_write) +{ + char buf[MAX_ADDR_STR_LEN]; + + haltest_info("%s: conn_id=%d trans_id=%d bda=%s exec_write=%d\n", + __func__, conn_id, trans_id, bt_bdaddr_t2str(bda, buf), + exec_write); +} + +/* + * Callback triggered in response to send_response if the remote device + * sends a confirmation. + */ +static void gatts_response_confirmation_cb(int status, int handle) +{ + haltest_info("%s: status=%d handle=%x\n", __func__, status, handle); +} + +static const btgatt_server_callbacks_t btgatt_server_callbacks = { + .register_server_cb = gatts_register_server_cb, + .connection_cb = gatts_connection_cb, + .service_added_cb = gatts_service_added_cb, + .included_service_added_cb = gatts_included_service_added_cb, + .characteristic_added_cb = gatts_characteristic_added_cb, + .descriptor_added_cb = gatts_descriptor_added_cb, + .service_started_cb = gatts_service_started_cb, + .service_stopped_cb = gatts_service_stopped_cb, + .service_deleted_cb = gatts_service_deleted_cb, + .request_read_cb = gatts_request_read_cb, + .request_write_cb = gatts_request_write_cb, + .request_exec_write_cb = gatts_request_exec_write_cb, + .response_confirmation_cb = gatts_response_confirmation_cb +}; + +static const btgatt_callbacks_t gatt_cbacks = { + .size = sizeof(gatt_cbacks), + .client = &btgatt_client_callbacks, + .server = &btgatt_server_callbacks +}; + +/* gatt client methods */ + +/* init */ + +static void init_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_gatt); + + EXEC(if_gatt->init, &gatt_cbacks); +} + +/* cleanup */ + +static void cleanup_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_gatt); + + EXECV(if_gatt->cleanup); + + if_gatt = NULL; +} + +static struct method methods[] = { + STD_METHOD(init), + STD_METHOD(cleanup), + END_METHOD +}; + +const struct interface gatt_if = { + .name = "gatt", + .methods = methods +}; + +/* register_client */ + +static void register_client_p(int argc, const char **argv) +{ + bt_uuid_t uuid; + + RETURN_IF_NULL(if_gatt); + + /* uuid */ + if (argc <= 2) + gatt_str2bt_uuid_t("babe4bed", -1, &uuid); + else + gatt_str2bt_uuid_t(argv[2], -1, &uuid); + + EXEC(if_gatt->client->register_client, &uuid); +} + +/* unregister_client */ + +static void unregister_client_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = client_if_str; + *enum_func = enum_one_string; + } +} + +static void unregister_client_p(int argc, const char **argv) +{ + int client_if; + + RETURN_IF_NULL(if_gatt); + VERIFY_CLIENT_IF(2, client_if); + + EXEC(if_gatt->client->unregister_client, client_if); +} + +/* scan */ + +/* Same completion as unregister for now, start stop is not auto completed */ +#define scan_c unregister_client_c + +static void scan_p(int argc, const char **argv) +{ + int client_if; + int start = 1; + + RETURN_IF_NULL(if_gatt); + + VERIFY_CLIENT_IF(2, client_if); + + /* start */ + if (argc >= 4) + start = atoi(argv[3]); + + EXEC(if_gatt->client->scan, client_if, start); +} + +/* connect */ + +static void connect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = client_if_str; + *enum_func = enum_one_string; + } else if (argc == 4) { + *user = NULL; + *enum_func = enum_devices; + } +} + +static void connect_p(int argc, const char **argv) +{ + int client_if; + bt_bdaddr_t bd_addr; + int is_direct = 1; + + RETURN_IF_NULL(if_gatt); + VERIFY_CLIENT_IF(2, client_if); + VERIFY_ADDR_ARG(3, &bd_addr); + + /* is_direct */ + if (argc > 4) + is_direct = atoi(argv[4]); + + EXEC(if_gatt->client->connect, client_if, &bd_addr, is_direct); +} + +/* disconnect */ + +static void disconnect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = client_if_str; + *enum_func = enum_one_string; + } else if (argc == 4) { + *user = last_addr; + *enum_func = enum_one_string; + } else if (argc == 5) { + *user = conn_id_str; + *enum_func = enum_one_string; + } +} + +static void disconnect_p(int argc, const char **argv) +{ + int client_if; + bt_bdaddr_t bd_addr; + int conn_id; + + RETURN_IF_NULL(if_gatt); + VERIFY_CLIENT_IF(2, client_if); + VERIFY_ADDR_ARG(3, &bd_addr); + VERIFY_CONN_ID(4, conn_id); + + EXEC(if_gatt->client->disconnect, client_if, &bd_addr, conn_id); +} + +/* refresh */ + +static void refresh_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = client_if_str; + *enum_func = enum_one_string; + } else if (argc == 4) { + *enum_func = enum_devices; + } +} + +static void refresh_p(int argc, const char **argv) +{ + int client_if; + bt_bdaddr_t bd_addr; + + RETURN_IF_NULL(if_gatt); + VERIFY_CLIENT_IF(2, client_if); + VERIFY_ADDR_ARG(3, &bd_addr); + + EXEC(if_gatt->client->refresh, client_if, &bd_addr); +} + +/* search_service */ + +static void search_service_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = conn_id_str; + *enum_func = enum_one_string; + } +} + +static void search_service_p(int argc, const char **argv) +{ + int conn_id; + + RETURN_IF_NULL(if_gatt); + + VERIFY_CONN_ID(2, conn_id); + + /* uuid */ + if (argc <= 3) { + EXEC(if_gatt->client->search_service, conn_id, NULL); + + } else { + bt_uuid_t filter_uuid; + + gatt_str2bt_uuid_t(argv[3], -1, &filter_uuid); + EXEC(if_gatt->client->search_service, conn_id, &filter_uuid); + } +} + +/* get_included_service */ + +static void get_included_service_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = conn_id_str; + *enum_func = enum_one_string; + } +} + +static void get_included_service_p(int argc, const char **argv) +{ + int conn_id; + btgatt_srvc_id_t srvc_id; + + RETURN_IF_NULL(if_gatt); + VERIFY_CONN_ID(2, conn_id); + VERIFY_SRVC_ID(3, &srvc_id); + + EXEC(if_gatt->client->get_included_service, conn_id, &srvc_id, NULL); +} + +/* get_characteristic */ + +/* Same completion as get_included_service_c */ +#define get_characteristic_c get_included_service_c + +static void get_characteristic_p(int argc, const char **argv) +{ + int conn_id; + btgatt_srvc_id_t srvc_id; + + RETURN_IF_NULL(if_gatt); + VERIFY_CONN_ID(2, conn_id); + VERIFY_SRVC_ID(3, &srvc_id); + + EXEC(if_gatt->client->get_characteristic, conn_id, &srvc_id, NULL); +} + +/* get_descriptor */ + +/* Same completion as get_included_service_c */ +#define get_descriptor_c get_included_service_c + +static void get_descriptor_p(int argc, const char **argv) +{ + int conn_id; + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + + RETURN_IF_NULL(if_gatt); + VERIFY_CONN_ID(2, conn_id); + VERIFY_SRVC_ID(3, &srvc_id); + VERIFY_CHAR_ID(4, &char_id); + + EXEC(if_gatt->client->get_descriptor, conn_id, &srvc_id, &char_id, + NULL); +} + +/* read_characteristic */ + +/* Same completion as get_included_service_c */ +#define read_characteristic_c get_included_service_c + +static void read_characteristic_p(int argc, const char **argv) +{ + int conn_id; + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + int auth_req = 0; + + RETURN_IF_NULL(if_gatt); + VERIFY_CONN_ID(2, conn_id); + VERIFY_SRVC_ID(3, &srvc_id); + VERIFY_CHAR_ID(4, &char_id); + + /* auth_req */ + if (argc > 5) + auth_req = atoi(argv[5]); + + EXEC(if_gatt->client->read_characteristic, conn_id, &srvc_id, &char_id, + auth_req); +} + +/* write_characteristic */ + +static void write_characteristic_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + /* + * This should be from tGATT_WRITE_TYPE but it's burried + * inside bluedroid guts + */ + static const char *wrtypes[] = { "1", "2", "3", NULL }; + + if (argc == 3) { + *user = conn_id_str; + *enum_func = enum_one_string; + } else if (argc == 6) { + *user = wrtypes; + *enum_func = enum_strings; + } +} + +static void write_characteristic_p(int argc, const char **argv) +{ + int conn_id; + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + int write_type; + int len; + int auth_req = 0; + uint8_t value[100]; + + RETURN_IF_NULL(if_gatt); + VERIFY_CONN_ID(2, conn_id); + VERIFY_SRVC_ID(3, &srvc_id); + VERIFY_CHAR_ID(4, &char_id); + + /* write type */ + if (argc <= 5) { + haltest_error("No write type specified\n"); + return; + } + write_type = atoi(argv[5]); + + /* value */ + if (argc <= 6) { + haltest_error("No value specified\n"); + return; + } + + /* len in chars */ + len = strlen(argv[6]); + scan_field(argv[6], len, value, sizeof(value)); + /* len in bytes converted from ascii chars */ + len = (len + 1) / 2; + + /* auth_req */ + if (argc > 7) + auth_req = atoi(argv[7]); + + EXEC(if_gatt->client->write_characteristic, conn_id, &srvc_id, &char_id, + write_type, len, auth_req, (char *) value); +} + +/* read_descriptor */ + +/* Same completion as get_included_service_c */ +#define read_descriptor_c get_included_service_c + +static void read_descriptor_p(int argc, const char **argv) +{ + int conn_id; + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + btgatt_descr_id_t descr_id; + int auth_req = 0; + + RETURN_IF_NULL(if_gatt); + VERIFY_CONN_ID(2, conn_id); + VERIFY_SRVC_ID(3, &srvc_id); + VERIFY_CHAR_ID(4, &char_id); + VERIFY_DESCR_ID(5, &descr_id); + + /* auth_req */ + if (argc > 6) + auth_req = atoi(argv[6]); + + EXEC(if_gatt->client->read_descriptor, conn_id, &srvc_id, &char_id, + &descr_id, auth_req); +} + +/* write_descriptor */ + +static void write_descriptor_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + /* + * This should be from tGATT_WRITE_TYPE but it's burried + * inside bluedroid guts + */ + static const char *wrtypes[] = { "1", "2", "3", NULL }; + + if (argc == 3) { + *user = conn_id_str; + *enum_func = enum_one_string; + } else if (argc == 7) { + *user = wrtypes; + *enum_func = enum_strings; + } +} + +static void write_descriptor_p(int argc, const char **argv) +{ + int conn_id; + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + btgatt_descr_id_t descr_id; + int write_type; + int len; + int auth_req = 0; + uint8_t value[200] = {0}; + + RETURN_IF_NULL(if_gatt); + VERIFY_CONN_ID(2, conn_id); + VERIFY_SRVC_ID(3, &srvc_id); + VERIFY_CHAR_ID(4, &char_id); + VERIFY_DESCR_ID(5, &descr_id); + + /* write type */ + if (argc <= 6) { + haltest_error("No write type specified\n"); + return; + } + write_type = atoi(argv[6]); + + /* value */ + if (argc <= 7) { + haltest_error("No value specified\n"); + return; + } + + /* len in chars */ + len = strlen(argv[7]); + scan_field(argv[7], len, value, sizeof(value)); + /* len in bytes converted from ascii chars */ + len = (len + 1) / 2; + + /* auth_req */ + if (argc > 8) + auth_req = atoi(argv[8]); + + EXEC(if_gatt->client->write_descriptor, conn_id, &srvc_id, &char_id, + &descr_id, write_type, len, auth_req, (char *) value); +} + +/* execute_write */ + +/* Same completion as search_service */ +#define execute_write_c search_service_c + +static void execute_write_p(int argc, const char **argv) +{ + int conn_id; + int execute; + + RETURN_IF_NULL(if_gatt); + VERIFY_CONN_ID(2, conn_id); + + /* execute */ + if (argc <= 3) { + haltest_error("No execute specified\n"); + return; + } + execute = atoi(argv[3]); + + EXEC(if_gatt->client->execute_write, conn_id, execute); +} + +/* register_for_notification */ + +static void register_for_notification_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = client_if_str; + *enum_func = enum_one_string; + } else if (argc == 4) { + *user = last_addr; + *enum_func = enum_one_string; + } +} + +static void register_for_notification_p(int argc, const char **argv) +{ + int client_if; + bt_bdaddr_t bd_addr; + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + + RETURN_IF_NULL(if_gatt); + VERIFY_CLIENT_IF(2, client_if); + VERIFY_ADDR_ARG(3, &bd_addr); + VERIFY_SRVC_ID(4, &srvc_id); + VERIFY_CHAR_ID(5, &char_id); + + EXEC(if_gatt->client->register_for_notification, client_if, &bd_addr, + &srvc_id, &char_id); +} + +/* deregister_for_notification */ + +/* Same completion as search_service */ +#define deregister_for_notification_c register_for_notification_c + +static void deregister_for_notification_p(int argc, const char **argv) +{ + int client_if; + bt_bdaddr_t bd_addr; + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + + RETURN_IF_NULL(if_gatt); + VERIFY_CLIENT_IF(2, client_if); + VERIFY_ADDR_ARG(3, &bd_addr); + VERIFY_SRVC_ID(4, &srvc_id); + VERIFY_CHAR_ID(5, &char_id); + + EXEC(if_gatt->client->deregister_for_notification, client_if, &bd_addr, + &srvc_id, &char_id); +} + +/* read_remote_rssi */ + +static void read_remote_rssi_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = client_if_str; + *enum_func = enum_one_string; + } else if (argc == 4) { + *enum_func = enum_devices; + } +} + +static void read_remote_rssi_p(int argc, const char **argv) +{ + int client_if; + bt_bdaddr_t bd_addr; + + RETURN_IF_NULL(if_gatt); + VERIFY_CLIENT_IF(2, client_if); + VERIFY_ADDR_ARG(3, &bd_addr); + + EXEC(if_gatt->client->read_remote_rssi, client_if, &bd_addr); +} + +/* get_device_type */ + +static void get_device_type_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) + *enum_func = enum_devices; +} + +static void get_device_type_p(int argc, const char **argv) +{ + bt_bdaddr_t bd_addr; + int dev_type; + + RETURN_IF_NULL(if_gatt); + VERIFY_ADDR_ARG(2, &bd_addr); + + dev_type = if_gatt->client->get_device_type(&bd_addr); + haltest_info("%s: %d\n", "get_device_type", dev_type); +} + +/* test_command */ + +static void test_command_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 4) + *enum_func = enum_devices; +} + +static void test_command_p(int argc, const char **argv) +{ + int command; + int i; + bt_bdaddr_t bd_addr; + bt_uuid_t uuid; + btgatt_test_params_t params = { + .bda1 = &bd_addr, + .uuid1 = &uuid + }; + uint16_t *u = ¶ms.u1; + + RETURN_IF_NULL(if_gatt); + + /* command */ + if (argc <= 2) { + haltest_error("No command specified\n"); + return; + } + command = atoi(argv[2]); + + VERIFY_ADDR_ARG(3, &bd_addr); + VERIFY_UUID(4, &uuid); + + for (i = 5; i < argc; i++) + *u++ = atoi(argv[i]); + + EXEC(if_gatt->client->test_command, command, ¶ms); +} + +static struct method client_methods[] = { + STD_METHODH(register_client, "[<uuid>]"), + STD_METHODCH(unregister_client, "<client_if>"), + STD_METHODCH(scan, "<client_if> [1|0]"), + STD_METHODCH(connect, "<client_if> <addr> [<is_direct>]"), + STD_METHODCH(disconnect, "<client_if> <addr> <conn_id>"), + STD_METHODCH(refresh, "<client_if> <addr>"), + STD_METHODCH(search_service, "<conn_id> [<uuid>]"), + STD_METHODCH(get_included_service, "<conn_id> <srvc_id>"), + STD_METHODCH(get_characteristic, "<conn_id> <srvc_id>"), + STD_METHODCH(get_descriptor, "<conn_id> <srvc_id> <char_id>"), + STD_METHODCH(read_characteristic, + "<conn_id> <srvc_id> <char_id> [<auth_req>]"), + STD_METHODCH(write_characteristic, + "<conn_id> <srvc_id> <char_id> <write_type> <hex_value> [<auth_req>]"), + STD_METHODCH(read_descriptor, + "<conn_id> <srvc_id> <char_id> <descr_id> [<auth_req>]"), + STD_METHODCH(write_descriptor, + "<conn_id> <srvc_id> <char_id> <descr_id> <write_type> <hex_value> [<auth_req>]"), + STD_METHODCH(execute_write, "<conn_id> <execute>"), + STD_METHODCH(register_for_notification, + "<client_if> <addr> <srvc_id> <char_id>"), + STD_METHODCH(deregister_for_notification, + "<client_if> <addr> <srvc_id> <char_id>"), + STD_METHODCH(read_remote_rssi, "<client_if> <addr>"), + STD_METHODCH(get_device_type, "<addr>"), + STD_METHODCH(test_command, + "<cmd> <addr> <uuid> [u1] [u2] [u3] [u4] [u5]"), + END_METHOD +}; + +const struct interface gatt_client_if = { + .name = "gattc", + .methods = client_methods +}; + +/* gatt server methods */ + +/* register_server */ + +static void gatts_register_server_p(int argc, const char *argv[]) +{ + bt_uuid_t uuid; + + RETURN_IF_NULL(if_gatt); + + /* uuid */ + if (argc <= 2) + gatt_str2bt_uuid_t("bed4babe", -1, &uuid); + else + gatt_str2bt_uuid_t(argv[2], -1, &uuid); + + EXEC(if_gatt->server->register_server, &uuid); +} + +/* unregister_server */ + +static void gatts_unregister_server_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = server_if_str; + *enum_func = enum_one_string; + } +} + +static void gatts_unregister_server_p(int argc, const char *argv[]) +{ + int server_if; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + + EXEC(if_gatt->server->unregister_server, server_if); +} + +/* connect */ + +static void gatts_connect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = server_if_str; + *enum_func = enum_one_string; + } else if (argc == 4) { + *user = NULL; + *enum_func = enum_devices; + } +} + +static void gatts_connect_p(int argc, const char *argv[]) +{ + int server_if; + bt_bdaddr_t bd_addr; + int is_direct = 1; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_ADDR_ARG(3, &bd_addr); + + /* is_direct */ + if (argc > 4) + is_direct = atoi(argv[4]); + + EXEC(if_gatt->server->connect, server_if, &bd_addr, is_direct); +} + +/* disconnect */ + +static void gatts_disconnect_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = server_if_str; + *enum_func = enum_one_string; + } else if (argc == 4) { + *user = last_addr; + *enum_func = enum_one_string; + } else if (argc == 5) { + *user = conn_id_str; + *enum_func = enum_one_string; + } +} + +static void gatts_disconnect_p(int argc, const char *argv[]) +{ + int server_if; + bt_bdaddr_t bd_addr; + int conn_id; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_ADDR_ARG(3, &bd_addr); + VERIFY_CONN_ID(4, conn_id); + + EXEC(if_gatt->server->disconnect, server_if, &bd_addr, conn_id); +} + +/* add_service */ + +/* Same completion as gatts_unregister_server_c */ +#define gatts_add_service_c gatts_unregister_server_c + +static void gatts_add_service_p(int argc, const char *argv[]) +{ + int server_if; + btgatt_srvc_id_t srvc_id; + int num_handles; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_SRVC_ID(3, &srvc_id); + + /* num handles */ + if (argc <= 4) { + haltest_error("No num_handles specified\n"); + return; + } + num_handles = atoi(argv[4]); + + EXEC(if_gatt->server->add_service, server_if, &srvc_id, num_handles); +} + +/* add_included_service */ + +/* Same completion as gatts_unregister_server_c */ +#define gatts_add_included_service_c gatts_unregister_server_c + +static void gatts_add_included_service_p(int argc, const char *argv[]) +{ + int server_if; + int service_handle; + int included_handle; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_SERVICE_HANDLE(3, service_handle); + VERIFY_HANDLE(4, included_handle); + + EXEC(if_gatt->server->add_included_service, server_if, service_handle, + included_handle); +} + +/* add_characteristic */ + +/* Same completion as gatts_unregister_server_c */ +#define gatts_add_characteristic_c gatts_unregister_server_c + +static void gatts_add_characteristic_p(int argc, const char *argv[]) +{ + int server_if; + int service_handle; + int properties; + int permissions; + bt_uuid_t uuid; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_SERVICE_HANDLE(3, service_handle); + VERIFY_UUID(4, &uuid); + + /* properties */ + if (argc <= 5) { + haltest_error("No properties specified\n"); + return; + } + properties = atoi(argv[5]); + + /* permissions */ + if (argc <= 6) { + haltest_error("No permissions specified\n"); + return; + } + permissions = atoi(argv[6]); + + EXEC(if_gatt->server->add_characteristic, server_if, service_handle, + &uuid, properties, permissions); +} + +/* add_descriptor */ + +/* Same completion as gatts_unregister_server_c */ +#define gatts_add_descriptor_c gatts_unregister_server_c + +static void gatts_add_descriptor_p(int argc, const char *argv[]) +{ + int server_if; + int service_handle; + int permissions; + bt_uuid_t uuid; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_SERVICE_HANDLE(3, service_handle); + VERIFY_UUID(4, &uuid); + + /* permissions */ + if (argc <= 5) { + haltest_error("No permissions specified\n"); + return; + } + permissions = atoi(argv[5]); + + EXEC(if_gatt->server->add_descriptor, server_if, service_handle, &uuid, + permissions); +} + +/* start_service */ + +/* Same completion as gatts_unregister_server_c */ +#define gatts_start_service_c gatts_unregister_server_c + +static void gatts_start_service_p(int argc, const char *argv[]) +{ + int server_if; + int service_handle; + int transport; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_SERVICE_HANDLE(3, service_handle); + + /* transport */ + if (argc <= 4) { + haltest_error("No transport specified\n"); + return; + } + transport = atoi(argv[4]); + + EXEC(if_gatt->server->start_service, server_if, service_handle, + transport); +} + +/* stop_service */ + +/* Same completion as gatts_unregister_server_c */ +#define gatts_stop_service_c gatts_unregister_server_c + +static void gatts_stop_service_p(int argc, const char *argv[]) +{ + int server_if; + int service_handle; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_SERVICE_HANDLE(3, service_handle); + + EXEC(if_gatt->server->stop_service, server_if, service_handle); +} + +/* delete_service */ + +/* Same completion as gatts_unregister_server_c */ +#define gatts_delete_service_c gatts_unregister_server_c + +static void gatts_delete_service_p(int argc, const char *argv[]) +{ + int server_if; + int service_handle; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_SERVICE_HANDLE(3, service_handle); + + EXEC(if_gatt->server->delete_service, server_if, service_handle); +} + +/* send_indication */ + +static void gatts_send_indication_p(int argc, const char *argv[]) +{ + int server_if; + int attr_handle; + int conn_id; + int confirm; + char data[200]; + int len = 0; + + RETURN_IF_NULL(if_gatt); + VERIFY_SERVER_IF(2, server_if); + VERIFY_HANDLE(3, attr_handle); + VERIFY_CONN_ID(4, conn_id); + + /* confirm */ + if (argc <= 5) { + haltest_error("No transport specified\n"); + return; + } + confirm = atoi(argv[5]); + + if (argc > 6) { + len = strlen(argv[6]); + scan_field(argv[6], len, (uint8_t *) data, sizeof(data)); + } + + EXEC(if_gatt->server->send_indication, server_if, attr_handle, conn_id, + len, confirm, data); +} + +/* send_response */ + +static void gatts_send_response_p(int argc, const char *argv[]) +{ + haltest_warn("%s is not implemented yet\n", __func__); +} + +#define GATTS_METHODH(n, h) METHOD(#n, gatts_##n##_p, NULL, h) +#define GATTS_METHODCH(n, h) METHOD(#n, gatts_##n##_p, gatts_##n##_c, h) + +static struct method server_methods[] = { + GATTS_METHODH(register_server, "[<uuid>]"), + GATTS_METHODCH(unregister_server, "<server_if>"), + GATTS_METHODCH(connect, "<server_if> <addr> [<is_direct>]"), + GATTS_METHODCH(disconnect, "<server_if> <addr> <conn_id>"), + GATTS_METHODCH(add_service, "<server_if> <srvc_id> <num_handles>"), + GATTS_METHODCH(add_included_service, + "<server_if> <service_handle> <included_handle>"), + GATTS_METHODCH(add_characteristic, + "<server_if> <service_handle> <uuid> <properites> <permissions>"), + GATTS_METHODCH(add_descriptor, "<server_if> <uuid> <permissions>"), + GATTS_METHODCH(start_service, + "<server_if> <service_handle> <transport>"), + GATTS_METHODCH(stop_service, "<server_if> <service_handle>"), + GATTS_METHODCH(delete_service, "<server_if> <service_handle>"), + GATTS_METHODH(send_indication, + "<server_if> <attr_handle> <conn_id> <confirm> [<data>]"), + GATTS_METHODH(send_response, "<conn_id> <trans_id> <status>"), + END_METHOD +}; + +const struct interface gatt_server_if = { + .name = "gatts", + .methods = server_methods +};
diff --git a/bluez/android/client/if-hf.c b/bluez/android/client/if-hf.c new file mode 100644 index 0000000..d0e7a66 --- /dev/null +++ b/bluez/android/client/if-hf.c
@@ -0,0 +1,785 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "if-main.h" +#include "../hal-utils.h" + +const bthf_interface_t *if_hf = NULL; + +SINTMAP(bthf_at_response_t, -1, "(unknown)") + DELEMENT(BTHF_AT_RESPONSE_ERROR), + DELEMENT(BTHF_AT_RESPONSE_OK), +ENDMAP + +SINTMAP(bthf_connection_state_t, -1, "(unknown)") + DELEMENT(BTHF_CONNECTION_STATE_DISCONNECTED), + DELEMENT(BTHF_CONNECTION_STATE_CONNECTING), + DELEMENT(BTHF_CONNECTION_STATE_CONNECTED), + DELEMENT(BTHF_CONNECTION_STATE_SLC_CONNECTED), + DELEMENT(BTHF_CONNECTION_STATE_DISCONNECTING), +ENDMAP + +SINTMAP(bthf_audio_state_t, -1, "(unknown)") + DELEMENT(BTHF_AUDIO_STATE_DISCONNECTED), + DELEMENT(BTHF_AUDIO_STATE_CONNECTING), + DELEMENT(BTHF_AUDIO_STATE_CONNECTED), + DELEMENT(BTHF_AUDIO_STATE_DISCONNECTING), +ENDMAP + +SINTMAP(bthf_vr_state_t, -1, "(unknown)") + DELEMENT(BTHF_VR_STATE_STOPPED), + DELEMENT(BTHF_VR_STATE_STARTED), +ENDMAP + +SINTMAP(bthf_volume_type_t, -1, "(unknown)") + DELEMENT(BTHF_VOLUME_TYPE_SPK), + DELEMENT(BTHF_VOLUME_TYPE_MIC), +ENDMAP + +SINTMAP(bthf_nrec_t, -1, "(unknown)") + DELEMENT(BTHF_NREC_STOP), + DELEMENT(BTHF_NREC_START), +ENDMAP + +SINTMAP(bthf_chld_type_t, -1, "(unknown)") + DELEMENT(BTHF_CHLD_TYPE_RELEASEHELD), + DELEMENT(BTHF_CHLD_TYPE_RELEASEACTIVE_ACCEPTHELD), + DELEMENT(BTHF_CHLD_TYPE_HOLDACTIVE_ACCEPTHELD), + DELEMENT(BTHF_CHLD_TYPE_ADDHELDTOCONF), +ENDMAP + +/* Network Status */ +SINTMAP(bthf_network_state_t, -1, "(unknown)") + DELEMENT(BTHF_NETWORK_STATE_NOT_AVAILABLE), + DELEMENT(BTHF_NETWORK_STATE_AVAILABLE), +ENDMAP + +/* Service type */ +SINTMAP(bthf_service_type_t, -1, "(unknown)") + DELEMENT(BTHF_SERVICE_TYPE_HOME), + DELEMENT(BTHF_SERVICE_TYPE_ROAMING), +ENDMAP + +SINTMAP(bthf_call_state_t, -1, "(unknown)") + DELEMENT(BTHF_CALL_STATE_ACTIVE), + DELEMENT(BTHF_CALL_STATE_HELD), + DELEMENT(BTHF_CALL_STATE_DIALING), + DELEMENT(BTHF_CALL_STATE_ALERTING), + DELEMENT(BTHF_CALL_STATE_INCOMING), + DELEMENT(BTHF_CALL_STATE_WAITING), + DELEMENT(BTHF_CALL_STATE_IDLE), +ENDMAP + +SINTMAP(bthf_call_direction_t, -1, "(unknown)") + DELEMENT(BTHF_CALL_DIRECTION_OUTGOING), + DELEMENT(BTHF_CALL_DIRECTION_INCOMING), +ENDMAP + +SINTMAP(bthf_call_mode_t, -1, "(unknown)") + DELEMENT(BTHF_CALL_TYPE_VOICE), + DELEMENT(BTHF_CALL_TYPE_DATA), + DELEMENT(BTHF_CALL_TYPE_FAX), +ENDMAP + +SINTMAP(bthf_call_mpty_type_t, -1, "(unknown)") + DELEMENT(BTHF_CALL_MPTY_TYPE_SINGLE), + DELEMENT(BTHF_CALL_MPTY_TYPE_MULTI), +ENDMAP + +SINTMAP(bthf_call_addrtype_t, -1, "(unknown)") + DELEMENT(BTHF_CALL_ADDRTYPE_UNKNOWN), + DELEMENT(BTHF_CALL_ADDRTYPE_INTERNATIONAL), +ENDMAP + +/* Callbacks */ + +static char last_addr[MAX_ADDR_STR_LEN]; + +/* + * Callback for connection state change. + * state will have one of the values from BtHfConnectionState + */ +static void connection_state_cb(bthf_connection_state_t state, + bt_bdaddr_t *bd_addr) +{ + haltest_info("%s: state=%s bd_addr=%s\n", __func__, + bthf_connection_state_t2str(state), + bt_bdaddr_t2str(bd_addr, last_addr)); +} + +/* + * Callback for audio connection state change. + * state will have one of the values from BtHfAudioState + */ +static void audio_state_cb(bthf_audio_state_t state, bt_bdaddr_t *bd_addr) +{ + haltest_info("%s: state=%s bd_addr=%s\n", __func__, + bthf_audio_state_t2str(state), + bt_bdaddr_t2str(bd_addr, last_addr)); +} + +/* + * Callback for VR connection state change. + * state will have one of the values from BtHfVRState + */ +static void vr_cmd_cb(bthf_vr_state_t state) +{ + haltest_info("%s: state=%s\n", __func__, bthf_vr_state_t2str(state)); +} + +/* Callback for answer incoming call (ATA) */ +static void answer_call_cmd_cb(void) +{ + haltest_info("%s\n", __func__); +} + +/* Callback for disconnect call (AT+CHUP) */ +static void hangup_call_cmd_cb(void) +{ + haltest_info("%s\n", __func__); +} + +/* + * Callback for disconnect call (AT+CHUP) + * type will denote Speaker/Mic gain (BtHfVolumeControl). + */ +static void volume_cmd_cb(bthf_volume_type_t type, int volume) +{ + haltest_info("%s: type=%s volume=%d\n", __func__, + bthf_volume_type_t2str(type), volume); +} + +/* + * Callback for dialing an outgoing call + * If number is NULL, redial + */ +static void dial_call_cmd_cb(char *number) +{ + haltest_info("%s: number=%s\n", __func__, number); +} + +/* + * Callback for sending DTMF tones + * tone contains the dtmf character to be sent + */ +static void dtmf_cmd_cb(char tone) +{ + haltest_info("%s: tone=%d\n", __func__, tone); +} + +/* + * Callback for enabling/disabling noise reduction/echo cancellation + * value will be 1 to enable, 0 to disable + */ +static void nrec_cmd_cb(bthf_nrec_t nrec) +{ + haltest_info("%s: nrec=%s\n", __func__, bthf_nrec_t2str(nrec)); +} + +/* + * Callback for call hold handling (AT+CHLD) + * value will contain the call hold command (0, 1, 2, 3) + */ +static void chld_cmd_cb(bthf_chld_type_t chld) +{ + haltest_info("%s: chld=%s\n", __func__, bthf_chld_type_t2str(chld)); +} + +/* Callback for CNUM (subscriber number) */ +static void cnum_cmd_cb(void) +{ + haltest_info("%s\n", __func__); +} + +/* Callback for indicators (CIND) */ +static void cind_cmd_cb(void) +{ + haltest_info("%s\n", __func__); +} + +/* Callback for operator selection (COPS) */ +static void cops_cmd_cb(void) +{ + haltest_info("%s\n", __func__); +} + +/* Callback for call list (AT+CLCC) */ +static void clcc_cmd_cb(void) +{ + haltest_info("%s\n", __func__); +} + +/* + * Callback for unknown AT command recd from HF + * at_string will contain the unparsed AT string + */ +static void unknown_at_cmd_cb(char *at_string) +{ + haltest_info("%s: at_string=%s\n", __func__, at_string); +} + +/* Callback for keypressed (HSP) event. */ +static void key_pressed_cmd_cb(void) +{ + haltest_info("%s\n", __func__); +} + +static bthf_callbacks_t hf_cbacks = { + + .size = sizeof(hf_cbacks), + .connection_state_cb = connection_state_cb, + .audio_state_cb = audio_state_cb, + .vr_cmd_cb = vr_cmd_cb, + .answer_call_cmd_cb = answer_call_cmd_cb, + .hangup_call_cmd_cb = hangup_call_cmd_cb, + .volume_cmd_cb = volume_cmd_cb, + .dial_call_cmd_cb = dial_call_cmd_cb, + .dtmf_cmd_cb = dtmf_cmd_cb, + .nrec_cmd_cb = nrec_cmd_cb, + .chld_cmd_cb = chld_cmd_cb, + .cnum_cmd_cb = cnum_cmd_cb, + .cind_cmd_cb = cind_cmd_cb, + .cops_cmd_cb = cops_cmd_cb, + .clcc_cmd_cb = clcc_cmd_cb, + .unknown_at_cmd_cb = unknown_at_cmd_cb, + .key_pressed_cmd_cb = key_pressed_cmd_cb, +}; + +/* init */ + +static void init_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_hf); + + EXEC(if_hf->init, &hf_cbacks); +} + +/* connect */ + +static void connect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = NULL; + *enum_func = enum_devices; + } +} + +static void connect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_hf); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_hf->connect, &addr); +} + +/* disconnect */ + +/* + * This completion function will be used for several methods + * returning recently connected address + */ +static void connected_addr_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = last_addr; + *enum_func = enum_one_string; + } +} + +/* Map completion to connected_addr_c */ +#define disconnect_c connected_addr_c + +static void disconnect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_hf); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_hf->disconnect, &addr); +} + +/* create an audio connection */ + +/* Map completion to connected_addr_c */ +#define connect_audio_c connected_addr_c + +static void connect_audio_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_hf); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_hf->connect_audio, &addr); +} + +/* close the audio connection */ + +/* Map completion to connected_addr_c */ +#define disconnect_audio_c connected_addr_c + +static void disconnect_audio_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_hf); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_hf->disconnect_audio, &addr); +} + +/* start voice recognition */ + +static void start_voice_recognition_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_hf); + + EXEC(if_hf->start_voice_recognition); +} + +/* stop voice recognition */ + +static void stop_voice_recognition_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_hf); + + EXEC(if_hf->stop_voice_recognition); +} + +/* volume control */ + +static void volume_control_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = TYPE_ENUM(bthf_volume_type_t); + *enum_func = enum_defines; + } +} + +static void volume_control_p(int argc, const char **argv) +{ + bthf_volume_type_t type; + int volume; + + RETURN_IF_NULL(if_hf); + + /* volume type */ + if (argc <= 2) { + haltest_error("No volume type specified\n"); + return; + } + type = str2bthf_volume_type_t(argv[2]); + + /* volume */ + if (argc <= 3) { + haltest_error("No volume specified\n"); + return; + } + volume = atoi(argv[3]); + + EXEC(if_hf->volume_control, type, volume); +} + +/* Combined device status change notification */ + +static void device_status_notification_c(int argc, const char **argv, + enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = TYPE_ENUM(bthf_network_state_t); + *enum_func = enum_defines; + } else if (argc == 4) { + *user = TYPE_ENUM(bthf_service_type_t); + *enum_func = enum_defines; + } +} + +static void device_status_notification_p(int argc, const char **argv) +{ + bthf_network_state_t ntk_state; + bthf_service_type_t svc_type; + int signal; + int batt_chg; + + RETURN_IF_NULL(if_hf); + + /* network state */ + if (argc <= 2) { + haltest_error("No network state specified\n"); + return; + } + ntk_state = str2bthf_network_state_t(argv[2]); + + /* service type */ + if (argc <= 3) { + haltest_error("No service type specified\n"); + return; + } + svc_type = str2bthf_service_type_t(argv[3]); + + /* signal */ + if (argc <= 4) { + haltest_error("No signal specified\n"); + return; + } + signal = atoi(argv[4]); + + /* batt_chg */ + if (argc <= 5) { + haltest_error("No batt_chg specified\n"); + return; + } + batt_chg = atoi(argv[5]); + + EXEC(if_hf->device_status_notification, ntk_state, svc_type, signal, + batt_chg); +} + +/* Response for COPS command */ + +static void cops_response_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_hf); + + /* response */ + if (argc <= 2) { + haltest_error("No cops specified\n"); + return; + } + + EXEC(if_hf->cops_response, argv[2]); +} + +/* Response for CIND command */ + +static void cind_response_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 6) { + *user = TYPE_ENUM(bthf_call_state_t); + *enum_func = enum_defines; + } +} + +static void cind_response_p(int argc, const char **argv) +{ + int svc; + int num_active; + int num_held; + bthf_call_state_t call_setup_state; + int signal; + int roam; + int batt_chg; + + RETURN_IF_NULL(if_hf); + + /* svc */ + if (argc <= 2) { + haltest_error("No service specified\n"); + return; + } + svc = atoi(argv[2]); + + /* num active */ + if (argc <= 3) { + haltest_error("No num active specified\n"); + return; + } + num_active = atoi(argv[3]); + + /* num held */ + if (argc <= 4) { + haltest_error("No num held specified\n"); + return; + } + num_held = atoi(argv[4]); + + /* call setup state */ + if (argc <= 5) { + haltest_error("No call setup state specified\n"); + return; + } + call_setup_state = str2bthf_call_state_t(argv[5]); + + /* signal */ + if (argc <= 6) { + haltest_error("No signal specified\n"); + return; + } + signal = atoi(argv[6]); + + /* roam */ + if (argc <= 7) { + haltest_error("No roam specified\n"); + return; + } + roam = atoi(argv[7]); + + /* batt_chg */ + if (argc <= 8) { + haltest_error("No batt_chg specified\n"); + return; + } + batt_chg = atoi(argv[8]); + + EXEC(if_hf->cind_response, svc, num_active, num_held, call_setup_state, + signal, roam, batt_chg); +} + +/* Pre-formatted AT response, typically in response to unknown AT cmd */ + +static void formatted_at_response_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_hf); + + /* response */ + if (argc <= 2) { + haltest_error("No response specified\n"); + return; + } + + EXEC(if_hf->formatted_at_response, argv[2]); +} + +/* at_response */ + +static void at_response_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = TYPE_ENUM(bthf_at_response_t); + *enum_func = enum_defines; + } +} + +static void at_response_p(int argc, const char **argv) +{ + bthf_at_response_t response_code; + int error_code = 0; + + RETURN_IF_NULL(if_hf); + + /* response type */ + if (argc <= 2) { + haltest_error("No response specified\n"); + return; + } + response_code = str2bthf_at_response_t(argv[2]); + + /* error code */ + if (argc >= 3) + error_code = atoi(argv[3]); + + EXEC(if_hf->at_response, response_code, error_code); +} + +/* response for CLCC command */ + +static void clcc_response_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 4) { + *user = TYPE_ENUM(bthf_call_direction_t); + *enum_func = enum_defines; + } else if (argc == 5) { + *user = TYPE_ENUM(bthf_call_state_t); + *enum_func = enum_defines; + } else if (argc == 6) { + *user = TYPE_ENUM(bthf_call_mode_t); + *enum_func = enum_defines; + } else if (argc == 7) { + *user = TYPE_ENUM(bthf_call_mpty_type_t); + *enum_func = enum_defines; + } else if (argc == 9) { + *user = TYPE_ENUM(bthf_call_addrtype_t); + *enum_func = enum_defines; + } +} + +static void clcc_response_p(int argc, const char **argv) +{ + int index; + bthf_call_direction_t dir; + bthf_call_state_t state; + bthf_call_mode_t mode; + bthf_call_mpty_type_t mpty; + const char *number; + bthf_call_addrtype_t type; + + RETURN_IF_NULL(if_hf); + + /* index */ + if (argc <= 2) { + haltest_error("No index specified\n"); + return; + } + index = atoi(argv[2]); + + /* direction */ + if (argc <= 3) { + haltest_error("No direction specified\n"); + return; + } + dir = str2bthf_call_direction_t(argv[3]); + + /* call state */ + if (argc <= 4) { + haltest_error("No call state specified\n"); + return; + } + state = str2bthf_call_state_t(argv[4]); + + /* call mode */ + if (argc <= 5) { + haltest_error("No mode specified\n"); + return; + } + mode = str2bthf_call_mode_t(argv[5]); + + /* call mpty type */ + if (argc <= 6) { + haltest_error("No mpty type specified\n"); + return; + } + mpty = str2bthf_call_mpty_type_t(argv[6]); + + /* number */ + if (argc <= 7) { + haltest_error("No number specified\n"); + return; + } + number = argv[7]; + + /* call mpty type */ + if (argc <= 8) { + haltest_error("No address type specified\n"); + return; + } + type = str2bthf_call_addrtype_t(argv[8]); + + EXEC(if_hf->clcc_response, index, dir, state, mode, mpty, number, + type); +} + +/* phone state change */ + +static void phone_state_change_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 5) { + *user = TYPE_ENUM(bthf_call_state_t); + *enum_func = enum_defines; + } else if (argc == 7) { + *user = TYPE_ENUM(bthf_call_addrtype_t); + *enum_func = enum_defines; + } +} + +static void phone_state_change_p(int argc, const char **argv) +{ + int num_active; + int num_held; + bthf_call_state_t call_setup_state; + const char *number; + bthf_call_addrtype_t type; + + RETURN_IF_NULL(if_hf); + + /* num_active */ + if (argc <= 2) { + haltest_error("No num_active specified\n"); + return; + } + num_active = atoi(argv[2]); + + /* num_held */ + if (argc <= 3) { + haltest_error("No num_held specified\n"); + return; + } + num_held = atoi(argv[3]); + + /* setup state */ + if (argc <= 4) { + haltest_error("No call setup state specified\n"); + return; + } + call_setup_state = str2bthf_call_state_t(argv[4]); + + /* number */ + if (argc <= 5) { + haltest_error("No number specified\n"); + return; + } + number = argv[5]; + + /* call mpty type */ + if (argc <= 6) { + haltest_error("No address type specified\n"); + return; + } + type = str2bthf_call_addrtype_t(argv[6]); + + EXEC(if_hf->phone_state_change, num_active, num_held, call_setup_state, + number, type); +} + +/* cleanup */ + +static void cleanup_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_hf); + + EXECV(if_hf->cleanup); + if_hf = NULL; +} + +static struct method methods[] = { + STD_METHOD(init), + STD_METHODCH(connect, "<addr>"), + STD_METHODCH(disconnect, "<addr>"), + STD_METHODCH(connect_audio, "<addr>"), + STD_METHODCH(disconnect_audio, "<addr>"), + STD_METHOD(start_voice_recognition), + STD_METHOD(stop_voice_recognition), + STD_METHODCH(volume_control, "<vol_type> <volume>"), + STD_METHODCH(device_status_notification, + "<ntk_state> <svt_type> <signal> <batt_chg>"), + STD_METHODH(cops_response, "<cops string>"), + STD_METHODCH(cind_response, + "<svc> <num_active> <num_held> <setup_state> <signal> <roam> <batt_chg>"), + STD_METHODH(formatted_at_response, "<at_response>"), + STD_METHODCH(at_response, "<response_code> [<error_code>]"), + STD_METHODCH(clcc_response, + "<index> <direction> <state> <mode> <mpty> <number> <type>"), + STD_METHODCH(phone_state_change, + "<num_active> <num_held> <setup_state> <number> <type>"), + STD_METHOD(cleanup), + END_METHOD +}; + +const struct interface hf_if = { + .name = "handsfree", + .methods = methods +};
diff --git a/bluez/android/client/if-hh.c b/bluez/android/client/if-hh.c new file mode 100644 index 0000000..0341d25 --- /dev/null +++ b/bluez/android/client/if-hh.c
@@ -0,0 +1,438 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdio.h> +#include <ctype.h> + +#include <hardware/bluetooth.h> +#include <hardware/bt_hh.h> + +#include "if-main.h" +#include "pollhandler.h" +#include "../hal-utils.h" + +const bthh_interface_t *if_hh = NULL; + +SINTMAP(bthh_protocol_mode_t, -1, "(unknown)") + DELEMENT(BTHH_REPORT_MODE), + DELEMENT(BTHH_BOOT_MODE), + DELEMENT(BTHH_UNSUPPORTED_MODE), +ENDMAP + +SINTMAP(bthh_report_type_t, -1, "(unknown)") + DELEMENT(BTHH_INPUT_REPORT), + DELEMENT(BTHH_OUTPUT_REPORT), + DELEMENT(BTHH_FEATURE_REPORT), +ENDMAP + +SINTMAP(bthh_connection_state_t, -1, "(unknown)") + DELEMENT(BTHH_CONN_STATE_CONNECTED), + DELEMENT(BTHH_CONN_STATE_CONNECTING), + DELEMENT(BTHH_CONN_STATE_DISCONNECTED), + DELEMENT(BTHH_CONN_STATE_DISCONNECTING), + DELEMENT(BTHH_CONN_STATE_FAILED_MOUSE_FROM_HOST), + DELEMENT(BTHH_CONN_STATE_FAILED_KBD_FROM_HOST), + DELEMENT(BTHH_CONN_STATE_FAILED_TOO_MANY_DEVICES), + DELEMENT(BTHH_CONN_STATE_FAILED_NO_BTHID_DRIVER), + DELEMENT(BTHH_CONN_STATE_FAILED_GENERIC), + DELEMENT(BTHH_CONN_STATE_UNKNOWN), +ENDMAP + +SINTMAP(bthh_status_t, -1, "(unknown)") + DELEMENT(BTHH_OK), + DELEMENT(BTHH_HS_HID_NOT_READY), + DELEMENT(BTHH_HS_INVALID_RPT_ID), + DELEMENT(BTHH_HS_TRANS_NOT_SPT), + DELEMENT(BTHH_HS_INVALID_PARAM), + DELEMENT(BTHH_HS_ERROR), + DELEMENT(BTHH_ERR), + DELEMENT(BTHH_ERR_SDP), + DELEMENT(BTHH_ERR_PROTO), + DELEMENT(BTHH_ERR_DB_FULL), + DELEMENT(BTHH_ERR_TOD_UNSPT), + DELEMENT(BTHH_ERR_NO_RES), + DELEMENT(BTHH_ERR_AUTH_FAILED), + DELEMENT(BTHH_ERR_HDL), +ENDMAP + +static char connected_device_addr[MAX_ADDR_STR_LEN]; +/* + * Callback for connection state change. + * state will have one of the values from bthh_connection_state_t + */ +static void connection_state_cb(bt_bdaddr_t *bd_addr, + bthh_connection_state_t state) +{ + char addr[MAX_ADDR_STR_LEN]; + + haltest_info("%s: bd_addr=%s connection_state=%s\n", __func__, + bt_bdaddr_t2str(bd_addr, addr), + bthh_connection_state_t2str(state)); + if (state == BTHH_CONN_STATE_CONNECTED) + strcpy(connected_device_addr, addr); +} + +/* + * Callback for virtual unplug api. + * the status of the virtual unplug + */ +static void virtual_unplug_cb(bt_bdaddr_t *bd_addr, bthh_status_t hh_status) +{ + char addr[MAX_ADDR_STR_LEN]; + + haltest_info("%s: bd_addr=%s hh_status=%s\n", __func__, + bt_bdaddr_t2str(bd_addr, addr), + bthh_status_t2str(hh_status)); +} + +/* + * Callback for get hid info + * hid_info will contain attr_mask, sub_class, app_id, vendor_id, product_id, + * version, ctry_code, len + */ +static void hid_info_cb(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info) +{ + char addr[MAX_ADDR_STR_LEN]; + + /* TODO: bluedroid does not seem to ever call this callback */ + haltest_info("%s: bd_addr=%s\n", __func__, + bt_bdaddr_t2str(bd_addr, addr)); +} + +/* + * Callback for get/set protocol api. + * the protocol mode is one of the value from bthh_protocol_mode_t + */ +static void protocol_mode_cb(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, + bthh_protocol_mode_t mode) +{ + char addr[MAX_ADDR_STR_LEN]; + + haltest_info("%s: bd_addr=%s hh_status=%s mode=%s\n", __func__, + bt_bdaddr_t2str(bd_addr, addr), + bthh_status_t2str(hh_status), + bthh_protocol_mode_t2str(mode)); +} + +/* + * Callback for get/set_idle_time api. + */ +static void idle_time_cb(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, + int idle_rate) +{ + char addr[MAX_ADDR_STR_LEN]; + + haltest_info("%s: bd_addr=%s hh_status=%s idle_rate=%d\n", __func__, + bt_bdaddr_t2str(bd_addr, addr), + bthh_status_t2str(hh_status), idle_rate); +} + + +/* + * Callback for get report api. + * if status is ok rpt_data contains the report data + */ +static void get_report_cb(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, + uint8_t *rpt_data, int rpt_size) +{ + char addr[MAX_ADDR_STR_LEN]; + + /* TODO: print actual report */ + haltest_info("%s: bd_addr=%s hh_status=%s rpt_size=%d\n", __func__, + bt_bdaddr_t2str(bd_addr, addr), + bthh_status_t2str(hh_status), rpt_size); +} + +static bthh_callbacks_t bthh_callbacks = { + .size = sizeof(bthh_callbacks), + .connection_state_cb = connection_state_cb, + .hid_info_cb = hid_info_cb, + .protocol_mode_cb = protocol_mode_cb, + .idle_time_cb = idle_time_cb, + .get_report_cb = get_report_cb, + .virtual_unplug_cb = virtual_unplug_cb +}; + +/* init */ + +static void init_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_hh); + + EXEC(if_hh->init, &bthh_callbacks); +} + +/* connect */ + +static void connect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = (void *) connected_device_addr; + *enum_func = enum_one_string; + } +} + +static void connect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_hh->connect, &addr); +} + +/* disconnect */ + +/* Same completion as connect_c */ +#define disconnect_c connect_c + +static void disconnect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_hh->disconnect, &addr); +} + +/* virtual_unplug */ + +/* Same completion as connect_c */ +#define virtual_unplug_c connect_c + +static void virtual_unplug_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_hh->virtual_unplug, &addr); +} + +/* set_info */ + +/* Same completion as connect_c */ +#define set_info_c connect_c + +static void set_info_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + bthh_hid_info_t hid_info; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + memset(&hid_info, 0, sizeof(hid_info)); + + /* This command is intentionally not supported. See comment from + * bt_hid_info() in android/hidhost.c */ + EXEC(if_hh->set_info, &addr, hid_info); +} + +/* get_protocol */ + +static void get_protocol_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = connected_device_addr; + *enum_func = enum_one_string; + } else if (argc == 4) { + *user = TYPE_ENUM(bthh_protocol_mode_t); + *enum_func = enum_defines; + } +} + +static void get_protocol_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + bthh_protocol_mode_t protocolMode; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + if (argc < 4) { + haltest_error("No protocol mode specified\n"); + return; + } + protocolMode = str2bthh_protocol_mode_t(argv[3]); + + EXEC(if_hh->get_protocol, &addr, protocolMode); +} + +/* set_protocol */ + +/* Same completion as get_protocol_c */ +#define set_protocol_c get_protocol_c + +static void set_protocol_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + bthh_protocol_mode_t protocolMode; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + if (argc < 4) { + haltest_error("No protocol mode specified\n"); + return; + } + protocolMode = str2bthh_protocol_mode_t(argv[3]); + + EXEC(if_hh->set_protocol, &addr, protocolMode); +} + +/* get_report */ + +static void get_report_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = connected_device_addr; + *enum_func = enum_one_string; + } else if (argc == 4) { + *user = TYPE_ENUM(bthh_report_type_t); + *enum_func = enum_defines; + } +} + +static void get_report_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + bthh_report_type_t reportType; + uint8_t reportId; + int bufferSize; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + if (argc < 4) { + haltest_error("No report type specified\n"); + return; + } + reportType = str2bthh_report_type_t(argv[3]); + + if (argc < 5) { + haltest_error("No reportId specified\n"); + return; + } + reportId = (uint8_t) atoi(argv[4]); + + if (argc < 6) { + haltest_error("No bufferSize specified\n"); + return; + } + bufferSize = atoi(argv[5]); + + EXEC(if_hh->get_report, &addr, reportType, reportId, bufferSize); +} + +/* set_report */ + +static void set_report_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = connected_device_addr; + *enum_func = enum_one_string; + } else if (argc == 4) { + *user = TYPE_ENUM(bthh_report_type_t); + *enum_func = enum_defines; + } +} + +static void set_report_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + bthh_report_type_t reportType; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + if (argc <= 3) { + haltest_error("No report type specified\n"); + return; + } + reportType = str2bthh_report_type_t(argv[3]); + + if (argc <= 4) { + haltest_error("No report specified\n"); + return; + } + + EXEC(if_hh->set_report, &addr, reportType, (char *) argv[4]); +} + +/* send_data */ + +static void send_data_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = connected_device_addr; + *enum_func = enum_one_string; + } +} + +static void send_data_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_hh); + VERIFY_ADDR_ARG(2, &addr); + + if (argc <= 3) { + haltest_error("No data to send specified\n"); + return; + } + + EXEC(if_hh->send_data, &addr, (char *) argv[3]); +} + +/* cleanup */ + +static void cleanup_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_hh); + + EXECV(if_hh->cleanup); +} + +/* Methods available in bthh_interface_t */ +static struct method methods[] = { + STD_METHOD(init), + STD_METHODCH(connect, "<addr>"), + STD_METHODCH(disconnect, "<addr>"), + STD_METHODCH(virtual_unplug, "<addr>"), + STD_METHODCH(set_info, "<addr>"), + STD_METHODCH(get_protocol, "<addr> <mode>"), + STD_METHODCH(set_protocol, "<addr> <mode>"), + STD_METHODCH(get_report, "<addr> <type> <report_id> <size>"), + STD_METHODCH(set_report, "<addr> <type> <hex_encoded_report>"), + STD_METHODCH(send_data, "<addr> <hex_encoded_data>"), + STD_METHOD(cleanup), + END_METHOD +}; + +const struct interface hh_if = { + .name = "hidhost", + .methods = methods +};
diff --git a/bluez/android/client/if-main.h b/bluez/android/client/if-main.h new file mode 100644 index 0000000..b628464 --- /dev/null +++ b/bluez/android/client/if-main.h
@@ -0,0 +1,177 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <signal.h> +#include <fcntl.h> +#include <errno.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <sys/time.h> +#include <sys/un.h> +#include <poll.h> + +#include <hardware/audio.h> +#include <hardware/bluetooth.h> +#include <hardware/bt_av.h> +#include <hardware/bt_hh.h> +#include <hardware/bt_pan.h> +#include <hardware/bt_sock.h> +#include <hardware/bt_hf.h> +#include <hardware/bt_hl.h> + +#include <hardware/bt_rc.h> +#include <hardware/bt_gatt.h> +#include <hardware/bt_gatt_types.h> +#include <hardware/bt_gatt_client.h> +#include <hardware/bt_gatt_server.h> + +extern audio_hw_device_t *if_audio; + +/* Interfaces from hal that can be populated during application lifetime */ +extern const bt_interface_t *if_bluetooth; +extern const btav_interface_t *if_av; +extern const btrc_interface_t *if_rc; +extern const bthf_interface_t *if_hf; +extern const bthh_interface_t *if_hh; +extern const btpan_interface_t *if_pan; +extern const btsock_interface_t *if_sock; +extern const btgatt_interface_t *if_gatt; +extern const btgatt_server_interface_t *if_gatt_server; +extern const btgatt_client_interface_t *if_gatt_client; + +/* + * Structure defines top level interfaces that can be used in test tool + * this will contain values as: bluetooth, av, gatt, socket, pan... + */ +struct interface { + const char *name; /* interface name */ + struct method *methods; /* methods available for this interface */ +}; + +extern const struct interface audio_if; +extern const struct interface bluetooth_if; +extern const struct interface av_if; +extern const struct interface rc_if; +extern const struct interface gatt_if; +extern const struct interface gatt_client_if; +extern const struct interface gatt_server_if; +extern const struct interface pan_if; +extern const struct interface sock_if; +extern const struct interface hf_if; +extern const struct interface hh_if; + +/* Interfaces that will show up in tool (first part of command line) */ +extern const struct interface *interfaces[]; + +#define METHOD(name, func, comp, help) {name, func, comp, help} +#define STD_METHOD(m) {#m, m##_p, NULL, NULL} +#define STD_METHODC(m) {#m, m##_p, m##_c, NULL} +#define STD_METHODH(m, h) {#m, m##_p, NULL, h} +#define STD_METHODCH(m, h) {#m, m##_p, m##_c, h} +#define END_METHOD {"", NULL, NULL, NULL} + +/* + * Function to parse argument for function, argv[0] and argv[1] are already + * parsed before this function is called and contain interface and method name + * up to argc - 1 arguments are finished and should be used to decide which + * function enumeration function to return + */ +typedef void (*parse_and_call)(int argc, const char **argv); + +/* + * This is prototype of function that will return string for given number. + * Purpose is to enumerate string for auto completion. + * Function of this type will always be called in loop. + * First time function is called i = 0, then if function returns non-NULL + * it will be called again till for some value of i it will return NULL + */ +typedef const char *(*enum_func)(void *user, int i); + +/* + * This is prototype of function that when given argc, argv will + * fill enum_func with pointer to function that will enumerate + * parameters for argc argument, user will be passed to enum_func. + */ +typedef void (*tab_complete)(int argc, const char **argv, enum_func *enum_func, + void **user); + +/* + * For each method there is name and two functions to parse command line + * and call proper hal function on. + */ +struct method { + const char *name; + parse_and_call func; + tab_complete complete; + const char *help; +}; + +int haltest_error(const char *format, ...) + __attribute__((format(printf, 1, 2))); +int haltest_info(const char *format, ...)__attribute__((format(printf, 1, 2))); +int haltest_warn(const char *format, ...)__attribute__((format(printf, 1, 2))); + +/* + * Enumerator for discovered devices, to be used as tab completion enum_func + */ +const char *enum_devices(void *v, int i); +const char *interface_name(void *v, int i); +const char *command_name(void *v, int i); +void add_remote_device(const bt_bdaddr_t *addr); + +const struct interface *get_interface(const char *name); +struct method *get_method(struct method *methods, const char *name); +struct method *get_command(const char *name); +const struct method *get_interface_method(const char *iname, + const char *mname); + +#define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) + +/* Helper macro for executing function on interface and printing BT_STATUS */ +#define EXEC(f, ...) \ + { \ + if (f) { \ + int err = f(__VA_ARGS__); \ + haltest_info("%s: %s\n", #f, bt_status_t2str(err)); \ + } else { \ + haltest_info("%s is NULL\n", #f); \ + } \ + } + +/* Helper macro for executing void function on interface */ +#define EXECV(f, ...) \ + { \ + (void) f(__VA_ARGS__); \ + haltest_info("%s: void\n", #f); \ + } + +#define RETURN_IF_NULL(x) \ + do { if (!x) { haltest_error("%s is NULL\n", #x); return; } } while (0) + +#define VERIFY_ADDR_ARG(n, adr) \ + do { \ + if (n < argc) {\ + str2bt_bdaddr_t(argv[n], adr); \ + } else { \ + haltest_error("No address specified\n");\ + return;\ + } \ + } while (0)
diff --git a/bluez/android/client/if-pan.c b/bluez/android/client/if-pan.c new file mode 100644 index 0000000..bdb36cc --- /dev/null +++ b/bluez/android/client/if-pan.c
@@ -0,0 +1,210 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <hardware/bluetooth.h> + +#include "if-main.h" +#include "../hal-utils.h" + +const btpan_interface_t *if_pan = NULL; + +typedef int btpan_role_t; + +SINTMAP(btpan_role_t, -1, "(unknown)") + DELEMENT(BTPAN_ROLE_NONE), + DELEMENT(BTPAN_ROLE_PANNAP), + DELEMENT(BTPAN_ROLE_PANU), +ENDMAP + +SINTMAP(btpan_connection_state_t, -1, "(unknown)") + DELEMENT(BTPAN_STATE_CONNECTED), + DELEMENT(BTPAN_STATE_CONNECTING), + DELEMENT(BTPAN_STATE_DISCONNECTED), + DELEMENT(BTPAN_STATE_DISCONNECTING), +ENDMAP + +SINTMAP(btpan_control_state_t, -1, "(unknown)") + DELEMENT(BTPAN_STATE_ENABLED), + DELEMENT(BTPAN_STATE_DISABLED), +ENDMAP + +static void control_state_cb(btpan_control_state_t state, bt_status_t error, + int local_role, const char *ifname) +{ + haltest_info("%s: state=%s error=%s local_role=%s ifname=%s\n", + __func__, btpan_control_state_t2str(state), + bt_status_t2str(error), btpan_role_t2str(local_role), + ifname); +} + +static char last_used_addr[MAX_ADDR_STR_LEN]; + +static void connection_state_cb(btpan_connection_state_t state, + bt_status_t error, const bt_bdaddr_t *bd_addr, + int local_role, int remote_role) +{ + haltest_info("%s: state=%s error=%s bd_addr=%s local_role=%s remote_role=%s\n", + __func__, btpan_connection_state_t2str(state), + bt_status_t2str(error), + bt_bdaddr_t2str(bd_addr, last_used_addr), + btpan_role_t2str(local_role), + btpan_role_t2str(remote_role)); +} + +static btpan_callbacks_t pan_cbacks = { + .size = sizeof(pan_cbacks), + .control_state_cb = control_state_cb, + .connection_state_cb = connection_state_cb +}; + +static void init_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_pan); + + EXEC(if_pan->init, &pan_cbacks); +} + +/* enable */ + +static void enable_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = TYPE_ENUM(btpan_role_t); + *enum_func = enum_defines; + } +} + +static void enable_p(int argc, const char **argv) +{ + int local_role; + + RETURN_IF_NULL(if_pan); + + /* local role */ + if (argc < 3) { + haltest_error("No local mode specified\n"); + return; + } + local_role = str2btpan_role_t(argv[2]); + if (local_role == -1) + local_role = atoi(argv[2]); + + EXEC(if_pan->enable, local_role); +} + +/* get_local_role */ + +static void get_local_role_p(int argc, const char **argv) +{ + int local_role; + + RETURN_IF_NULL(if_pan); + + local_role = if_pan->get_local_role(); + haltest_info("local_role: %s\n", btpan_role_t2str(local_role)); +} + +/* connect */ + +static void connect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = NULL; + *enum_func = enum_devices; + } else if (argc == 4 || argc == 5) { + *user = TYPE_ENUM(btpan_role_t); + *enum_func = enum_defines; + } +} + +static void connect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + int local_role; + int remote_role; + + RETURN_IF_NULL(if_pan); + VERIFY_ADDR_ARG(2, &addr); + + /* local role */ + if (argc < 4) { + haltest_error("No local mode specified\n"); + return; + } + local_role = str2btpan_role_t(argv[3]); + if (local_role == -1) + local_role = atoi(argv[3]); + + /* remote role */ + if (argc < 5) { + haltest_error("No remote mode specified\n"); + return; + } + remote_role = str2btpan_role_t(argv[4]); + if (remote_role == -1) + remote_role = atoi(argv[4]); + + EXEC(if_pan->connect, &addr, local_role, remote_role); +} + +/* disconnect */ + +static void disconnect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = last_used_addr; + *enum_func = enum_one_string; + } +} + +static void disconnect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + + RETURN_IF_NULL(if_pan); + VERIFY_ADDR_ARG(2, &addr); + + EXEC(if_pan->disconnect, &addr); +} + +/* cleanup */ + +static void cleanup_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_pan); + + EXECV(if_pan->cleanup); + if_pan = NULL; +} + +static struct method methods[] = { + STD_METHOD(init), + STD_METHODCH(connect, "<addr> <local_role> <remote_role>"), + STD_METHODCH(enable, "<local_role>"), + STD_METHOD(get_local_role), + STD_METHODCH(disconnect, "<addr>"), + STD_METHOD(cleanup), + END_METHOD +}; + +const struct interface pan_if = { + .name = "pan", + .methods = methods +};
diff --git a/bluez/android/client/if-rc.c b/bluez/android/client/if-rc.c new file mode 100644 index 0000000..31efc29 --- /dev/null +++ b/bluez/android/client/if-rc.c
@@ -0,0 +1,321 @@ +/* + * Copyright (C) 2014 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include<stdio.h> +#include<ctype.h> + +#include<hardware/bluetooth.h> +#include<hardware/bt_hh.h> + +#include "if-main.h" +#include "pollhandler.h" +#include "../hal-utils.h" + +const btrc_interface_t *if_rc = NULL; + +SINTMAP(btrc_play_status_t, -1, "(unknown)") + DELEMENT(BTRC_PLAYSTATE_STOPPED), + DELEMENT(BTRC_PLAYSTATE_PLAYING), + DELEMENT(BTRC_PLAYSTATE_PAUSED), + DELEMENT(BTRC_PLAYSTATE_FWD_SEEK), + DELEMENT(BTRC_PLAYSTATE_REV_SEEK), + DELEMENT(BTRC_PLAYSTATE_ERROR), +ENDMAP + +SINTMAP(btrc_media_attr_t, -1, "(unknown)") + DELEMENT(BTRC_MEDIA_ATTR_TITLE), + DELEMENT(BTRC_MEDIA_ATTR_ARTIST), + DELEMENT(BTRC_MEDIA_ATTR_ALBUM), + DELEMENT(BTRC_MEDIA_ATTR_TRACK_NUM), + DELEMENT(BTRC_MEDIA_ATTR_NUM_TRACKS), + DELEMENT(BTRC_MEDIA_ATTR_GENRE), + DELEMENT(BTRC_MEDIA_ATTR_PLAYING_TIME), +ENDMAP + +SINTMAP(btrc_status_t, -1, "(unknown)") + DELEMENT(BTRC_STS_BAD_CMD), + DELEMENT(BTRC_STS_BAD_PARAM), + DELEMENT(BTRC_STS_NOT_FOUND), + DELEMENT(BTRC_STS_INTERNAL_ERR), + DELEMENT(BTRC_STS_NO_ERROR), +ENDMAP + +static char last_addr[MAX_ADDR_STR_LEN]; + +static void remote_features_cb(bt_bdaddr_t *bd_addr, + btrc_remote_features_t features) +{ + haltest_info("%s: remote_bd_addr=%s features=%u\n", __func__, + bt_bdaddr_t2str(bd_addr, last_addr), features); +} + +static void get_play_status_cb(void) +{ + haltest_info("%s\n", __func__); +} + +static void list_player_app_attr_cb(void) +{ + haltest_info("%s\n", __func__); +} + +static void list_player_app_values_cb(btrc_player_attr_t attr_id) +{ + haltest_info("%s, attr_id=%d\n", __func__, attr_id); +} + +static void get_player_app_value_cb(uint8_t num_attr, + btrc_player_attr_t *p_attrs) +{ + int i; + + haltest_info("%s, num_attr=%d\n", __func__, num_attr); + + for (i = 0; i < num_attr; i++) + haltest_info("attribute=%u\n", p_attrs[i]); +} + +static void get_player_app_attrs_text_cb(uint8_t num_attr, + btrc_player_attr_t *p_attrs) +{ + int i; + + haltest_info("%s, num_attr=%d\n", __func__, num_attr); + + for (i = 0; i < num_attr; i++) + haltest_info("attribute=%u\n", p_attrs[i]); + +} + +static void get_player_app_values_text_cb(uint8_t attr_id, uint8_t num_val, + uint8_t *p_vals) +{ + haltest_info("%s, attr_id=%d num_val=%d values=%p\n", __func__, + attr_id, num_val, p_vals); +} + +static void set_player_app_value_cb(btrc_player_settings_t *p_vals) +{ + int i; + + haltest_info("%s, num_attr=%u\n", __func__, p_vals->num_attr); + + for (i = 0; i < p_vals->num_attr; i++) + haltest_info("attr id=%u, values=%u\n", p_vals->attr_ids[i], + p_vals->attr_values[i]); +} + +static void get_element_attr_cb(uint8_t num_attr, btrc_media_attr_t *attrs) +{ + uint8_t i; + + haltest_info("%s, num_of_attributes=%d\n", __func__, num_attr); + + for (i = 0; i < num_attr; i++) + haltest_info("attr id=%s\n", btrc_media_attr_t2str(attrs[i])); +} + +static void register_notification_cb(btrc_event_id_t event_id, uint32_t param) +{ + haltest_info("%s, event=%u param=%u\n", __func__, event_id, param); +} + +static void volume_change_cb(uint8_t volume, uint8_t ctype) +{ + haltest_info("%s, volume=%d ctype=%d\n", __func__, volume, ctype); +} + +static void passthrough_cmd_cb(int id, int key_state) +{ + haltest_info("%s, id=%d key_state=%d\n", __func__, id, key_state); +} + +static btrc_callbacks_t rc_cbacks = { + .size = sizeof(rc_cbacks), + .remote_features_cb = remote_features_cb, + .get_play_status_cb = get_play_status_cb, + .list_player_app_attr_cb = list_player_app_attr_cb, + .list_player_app_values_cb = list_player_app_values_cb, + .get_player_app_value_cb = get_player_app_value_cb, + .get_player_app_attrs_text_cb = get_player_app_attrs_text_cb, + .get_player_app_values_text_cb = get_player_app_values_text_cb, + .set_player_app_value_cb = set_player_app_value_cb, + .get_element_attr_cb = get_element_attr_cb, + .register_notification_cb = register_notification_cb, + .volume_change_cb = volume_change_cb, + .passthrough_cmd_cb = passthrough_cmd_cb, +}; + +/* init */ + +static void init_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_rc); + + EXEC(if_rc->init, &rc_cbacks); +} + +/* get_play_status_rsp */ + +static void get_play_status_rsp_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = TYPE_ENUM(btrc_play_status_t); + *enum_func = enum_defines; + } +} + +static void get_play_status_rsp_p(int argc, const char **argv) +{ + btrc_play_status_t play_status; + uint32_t song_len, song_pos; + + RETURN_IF_NULL(if_rc); + + if (argc <= 2) { + haltest_error("No play status specified"); + return; + } + + if (argc <= 3) { + haltest_error("No song length specified"); + return; + } + + if (argc <= 4) { + haltest_error("No song position specified"); + return; + } + + play_status = str2btrc_play_status_t(argv[2]); + song_len = (uint32_t) atoi(argv[3]); + song_pos = (uint32_t) atoi(argv[4]); + + EXEC(if_rc->get_play_status_rsp, play_status, song_len, song_pos); +} + +/* get_element_attr_rsp */ + +static void get_element_attr_rsp_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 4) { + *user = TYPE_ENUM(btrc_media_attr_t); + *enum_func = enum_defines; + } +} + +static void get_element_attr_rsp_p(int argc, const char **argv) +{ + uint8_t num_attr; + btrc_element_attr_val_t attrs; + + RETURN_IF_NULL(if_rc); + + if (argc <= 2) { + haltest_error("No number of attributes specified"); + return; + } + + if (argc <= 4) { + haltest_error("No attr id and value specified"); + return; + } + + num_attr = (uint8_t) atoi(argv[2]); + attrs.attr_id = str2btrc_media_attr_t(argv[3]); + strcpy((char *)attrs.text, argv[4]); + + EXEC(if_rc->get_element_attr_rsp, num_attr, &attrs); +} + +/* set_volume */ + +static void set_volume_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ +} + +static void set_volume_p(int argc, const char **argv) +{ + uint8_t volume; + + RETURN_IF_NULL(if_rc); + + if (argc <= 2) { + haltest_error("No volume specified"); + return; + } + + volume = (uint8_t) atoi(argv[2]); + + EXEC(if_rc->set_volume, volume); +} + +/* set_player_app_value_rsp */ + +static void set_player_app_value_rsp_c(int argc, const char **argv, + enum_func *enum_func, void **user) +{ + if (argc == 3) { + *user = TYPE_ENUM(btrc_status_t); + *enum_func = enum_defines; + } +} + +static void set_player_app_value_rsp_p(int argc, const char **argv) +{ + btrc_status_t rsp_status; + + RETURN_IF_NULL(if_rc); + + if (argc <= 2) { + haltest_error("No response status specified"); + return; + } + + rsp_status = str2btrc_status_t(argv[2]); + + EXEC(if_rc->set_player_app_value_rsp, rsp_status); +} + +/* cleanup */ + +static void cleanup_p(int argc, const char **argv) +{ + RETURN_IF_NULL(if_rc); + + EXECV(if_rc->cleanup); + if_rc = NULL; +} + +static struct method methods[] = { + STD_METHOD(init), + STD_METHODCH(get_play_status_rsp, + "<play_status> <song_len> <song_pos>"), + STD_METHODCH(get_element_attr_rsp, "<num_attr> <attrs_id> <value>"), + STD_METHODCH(set_player_app_value_rsp, "<rsp_status>"), + STD_METHODCH(set_volume, "<volume>"), + STD_METHOD(cleanup), + END_METHOD +}; + +const struct interface rc_if = { + .name = "rc", + .methods = methods +};
diff --git a/bluez/android/client/if-sock.c b/bluez/android/client/if-sock.c new file mode 100644 index 0000000..4c1af82 --- /dev/null +++ b/bluez/android/client/if-sock.c
@@ -0,0 +1,348 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdio.h> +#include <ctype.h> +#include <unistd.h> + +#include "if-main.h" +#include "pollhandler.h" +#include "../hal-utils.h" + +const btsock_interface_t *if_sock = NULL; + +SINTMAP(btsock_type_t, -1, "(unknown)") + DELEMENT(BTSOCK_RFCOMM), + DELEMENT(BTSOCK_SCO), + DELEMENT(BTSOCK_L2CAP), +ENDMAP + +#define MAX_LISTEN_FD 15 +static int listen_fd[MAX_LISTEN_FD]; +static int listen_fd_count; + +static const char * const uuids[] = { + "00001101", "00001105", "0000112f", NULL +}; + +/* + * This function reads data from file descriptor and + * prints it to the user + */ +static void receive_from_client(struct pollfd *pollfd) +{ + char buf[16]; + /* Buffer for lines: + * 41 42 43 20 20 00 31 32 00 07 04 00 00 00 00 00 ABC .12..... + */ + char outbuf[sizeof(buf) * 4 + 2]; + int i; + int ret; + + if (pollfd->revents & POLLHUP) { + haltest_error("Disconnected fd=%d\n", pollfd->fd); + poll_unregister_fd(pollfd->fd, receive_from_client); + } else if (pollfd->revents & POLLIN) { + haltest_info("receiving from client fd=%d\n", pollfd->fd); + + do { + memset(outbuf, ' ', sizeof(outbuf)); + outbuf[sizeof(outbuf) - 1] = 0; + ret = recv(pollfd->fd, buf, sizeof(buf), MSG_DONTWAIT); + + for (i = 0; i < ret; ++i) + sprintf(outbuf + i * 3, "%02X ", + (unsigned) buf[i]); + outbuf[i * 3] = ' '; + for (i = 0; i < ret; ++i) + sprintf(outbuf + 48 + i, "%c", + (isprint(buf[i]) ? buf[i] : '.')); + if (ret > 0) + haltest_info("%s\n", outbuf); + } while (ret > 0); + } else { + /* For now disconnect on all other events */ + haltest_error("Poll event %x\n", pollfd->revents); + poll_unregister_fd(pollfd->fd, receive_from_client); + } +} + +/* + * This function read from fd socket information about + * connected socket + */ +static void receive_sock_connect_signal(struct pollfd *pollfd) +{ + sock_connect_signal_t cs; + char addr_str[MAX_ADDR_STR_LEN]; + + if (pollfd->revents & POLLIN) { + int ret; + + poll_unregister_fd(pollfd->fd, receive_sock_connect_signal); + ret = read(pollfd->fd, &cs, sizeof(cs)); + if (ret != sizeof(cs)) { + haltest_info("Read on connect return %d\n", ret); + return; + } + + haltest_info("Connection to %s channel %d status=%d\n", + bt_bdaddr_t2str(&cs.bd_addr, addr_str), + cs.channel, cs.status); + + if (cs.status == 0) + poll_register_fd(pollfd->fd, POLLIN, + receive_from_client); + } + + if (pollfd->revents & POLLHUP) { + haltest_error("Disconnected fd=%d revents=0x%X\n", pollfd->fd, + pollfd->revents); + poll_unregister_fd(pollfd->fd, receive_sock_connect_signal); + } +} + +/* + * This function read from fd socket information about + * incoming connection and starts monitoring new connection + * on file descriptor read from fd. + */ +static void read_accepted(int fd) +{ + int ret; + struct msghdr msg; + struct iovec iv; + char cmsgbuf[CMSG_SPACE(1)]; + struct cmsghdr *cmsgptr; + sock_connect_signal_t cs; + int accepted_fd = -1; + char addr_str[MAX_ADDR_STR_LEN]; + + memset(&msg, 0, sizeof(msg)); + memset(&iv, 0, sizeof(iv)); + memset(cmsgbuf, 0, sizeof(cmsgbuf)); + + iv.iov_base = &cs; + iv.iov_len = sizeof(cs); + + msg.msg_iov = &iv; + msg.msg_iovlen = 1; + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); + + do { + ret = recvmsg(fd, &msg, MSG_NOSIGNAL); + } while (ret < 0 && errno == EINTR); + + if (ret < 16 || + (msg.msg_flags & (MSG_CTRUNC | MSG_OOB | MSG_ERRQUEUE)) != 0) + haltest_error("Failed to accept connection\n"); + + for (cmsgptr = CMSG_FIRSTHDR(&msg); + cmsgptr != NULL; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) { + int count; + + if (cmsgptr->cmsg_level != SOL_SOCKET || + cmsgptr->cmsg_type != SCM_RIGHTS) + continue; + + memcpy(&accepted_fd, CMSG_DATA(cmsgptr), sizeof(accepted_fd)); + count = ((cmsgptr->cmsg_len - CMSG_LEN(0)) / sizeof(int)); + + if (count != 1) + haltest_error("Failed to accept descriptors count=%d\n", + count); + + break; + } + + haltest_info("Incoming connection from %s channel %d status=%d fd=%d\n", + bt_bdaddr_t2str(&cs.bd_addr, addr_str), + cs.channel, cs.status, accepted_fd); + poll_register_fd(accepted_fd, POLLIN, receive_from_client); +} + +/* handles incoming connections on socket */ +static void client_connected(struct pollfd *pollfd) +{ + haltest_info("client connected %x\n", pollfd->revents); + + if (pollfd->revents & POLLHUP) + poll_unregister_fd(pollfd->fd, client_connected); + else if (pollfd->revents & POLLIN) + read_accepted(pollfd->fd); +} + +/** listen */ + +static void listen_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *user = TYPE_ENUM(btsock_type_t); + *enum_func = enum_defines; + } else if (argc == 5) { + *user = (void *) uuids; + *enum_func = enum_strings; + } +} + +static void listen_p(int argc, const char **argv) +{ + btsock_type_t type; + const char *service_name; + bt_uuid_t service_uuid; + int channel; + int sock_fd = -1; + int flags; + + RETURN_IF_NULL(if_sock); + + /* Socket type */ + if (argc < 3) { + haltest_error("No socket type specified\n"); + return; + } + type = str2btsock_type_t(argv[2]); + if ((int) type == -1) + type = atoi(argv[2]); + + /* service name */ + if (argc < 4) { + haltest_error("No service name specified\n"); + return; + } + service_name = argv[3]; + + /* uuid */ + if (argc < 5) { + haltest_error("No uuid specified\n"); + return; + } + str2bt_uuid_t(argv[4], &service_uuid); + + /* channel */ + channel = argc > 5 ? atoi(argv[5]) : 0; + + /* flags */ + flags = argc > 6 ? atoi(argv[6]) : 0; + + if (listen_fd_count >= MAX_LISTEN_FD) { + haltest_error("Max (%d) listening sockets exceeded\n", + listen_fd_count); + return; + } + EXEC(if_sock->listen, type, service_name, + &service_uuid.uu[0], channel, &sock_fd, flags); + if (sock_fd > 0) { + int channel = 0; + int ret = read(sock_fd, &channel, 4); + if (ret != 4) + haltest_info("Read channel failed\n"); + haltest_info("Channel returned from first read %d\n", channel); + listen_fd[listen_fd_count++] = sock_fd; + poll_register_fd(sock_fd, POLLIN, client_connected); + } +} + +/** connect */ + +static void connect_c(int argc, const char **argv, enum_func *enum_func, + void **user) +{ + if (argc == 3) { + *enum_func = enum_devices; + } else if (argc == 4) { + *user = TYPE_ENUM(btsock_type_t); + *enum_func = enum_defines; + } else if (argc == 5) { + *user = (void *) uuids; + *enum_func = enum_strings; + } +} + +static void connect_p(int argc, const char **argv) +{ + bt_bdaddr_t addr; + btsock_type_t type; + bt_uuid_t uuid; + int channel; + int sock_fd = -1; + int flags; + + /* Address */ + if (argc <= 2) { + haltest_error("No address specified\n"); + return; + } + str2bt_bdaddr_t(argv[2], &addr); + + /* Socket type */ + if (argc <= 3) { + haltest_error("No socket type specified\n"); + return; + } + type = str2btsock_type_t(argv[3]); + if ((int) type == -1) + type = atoi(argv[3]); + + /* uuid */ + if (argc <= 4) { + haltest_error("No uuid specified\n"); + return; + } + str2bt_uuid_t(argv[4], &uuid); + + /* channel */ + if (argc <= 5) { + haltest_error("No channel specified\n"); + return; + } + channel = atoi(argv[5]); + + /* flags */ + flags = argc <= 6 ? 0 : atoi(argv[6]); + + RETURN_IF_NULL(if_sock); + + EXEC(if_sock->connect, &addr, type, &uuid.uu[0], channel, &sock_fd, + flags); + if (sock_fd > 0) { + int channel = 0; + int ret = read(sock_fd, &channel, 4); + + if (ret != 4) + haltest_info("Read channel failed\n"); + haltest_info("Channel returned from first read %d\n", channel); + listen_fd[listen_fd_count++] = sock_fd; + poll_register_fd(sock_fd, POLLIN, receive_sock_connect_signal); + } +} + +/* Methods available in btsock_interface_t */ +static struct method methods[] = { + STD_METHODCH(listen, + "<sock_type> <srvc_name> <uuid> [<channel>] [<flags>]"), + STD_METHODCH(connect, + "<addr> <sock_type> <uuid> <channel> [<flags>]"), + END_METHOD +}; + +const struct interface sock_if = { + .name = "socket", + .methods = methods +};
diff --git a/bluez/android/client/pollhandler.c b/bluez/android/client/pollhandler.c new file mode 100644 index 0000000..6160921 --- /dev/null +++ b/bluez/android/client/pollhandler.c
@@ -0,0 +1,117 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdio.h> +#include <errno.h> +#include <poll.h> + +#include "pollhandler.h" + +/* + * Code that allows to poll multiply file descriptors for events + * File descriptors can be added and removed at runtime + * + * Call poll_register_fd function first to add file descriptors to monitor + * Then call poll_dispatch_loop that will poll all registered file descriptors + * as long as they are not unregistered. + * + * When event happen on given fd appropriate user supplied handler is called + */ + +/* Maximum number of files to monitor */ +#define MAX_OPEN_FD 10 + +/* Storage for pollfd structures for monitored file descriptors */ +static struct pollfd fds[MAX_OPEN_FD]; +static poll_handler fds_handler[MAX_OPEN_FD]; +/* Number of registered file descriptors */ +static int fds_count = 0; + +/* + * Function polls file descriptor in loop and calls appropriate handler + * on event. Function returns when there is no more file descriptor to + * monitor + */ +void poll_dispatch_loop(void) +{ + while (fds_count > 0) { + int i; + int cur_fds_count = fds_count; + int ready = poll(fds, fds_count, 1000); + + for (i = 0; i < fds_count && ready > 0; ++i) { + if (fds[i].revents == 0) + continue; + + fds_handler[i](fds + i); + ready--; + /* + * If handler was remove from table + * just skip the rest and poll again + * This is due to reordering of tables in + * register/unregister functions + */ + if (cur_fds_count != fds_count) + break; + } + } +} + +/* + * Registers file descriptor to be monitored for events (see man poll(2)) + * for events. + * + * return non negative value on success + * -EMFILE when there are to much descriptors + */ +int poll_register_fd(int fd, short events, poll_handler ph) +{ + if (fds_count >= MAX_OPEN_FD) + return -EMFILE; + + fds_handler[fds_count] = ph; + fds[fds_count].fd = fd; + fds[fds_count].events = events; + fds_count++; + + return fds_count; +} + +/* + * Unregisters file descriptor + * Both fd and ph must match previously registered data + * + * return 0 if unregister succeeded + * -EBADF if arguments do not match any register handler + */ +int poll_unregister_fd(int fd, poll_handler ph) +{ + int i; + + for (i = 0; i < fds_count; ++i) { + if (fds_handler[i] == ph && fds[i].fd == fd) { + fds_count--; + if (i < fds_count) { + fds[i].fd = fds[fds_count].fd; + fds[i].events = fds[fds_count].events; + fds_handler[i] = fds_handler[fds_count]; + } + return 0; + } + } + return -EBADF; +}
diff --git a/bluez/android/client/pollhandler.h b/bluez/android/client/pollhandler.h new file mode 100644 index 0000000..e2f22df --- /dev/null +++ b/bluez/android/client/pollhandler.h
@@ -0,0 +1,26 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <poll.h> + +/* Function to be called when there are event for some descriptor */ +typedef void (*poll_handler)(struct pollfd *pollfd); + +int poll_register_fd(int fd, short events, poll_handler ph); +int poll_unregister_fd(int fd, poll_handler ph); + +void poll_dispatch_loop(void);
diff --git a/bluez/android/client/tabcompletion.c b/bluez/android/client/tabcompletion.c new file mode 100644 index 0000000..aceea39 --- /dev/null +++ b/bluez/android/client/tabcompletion.c
@@ -0,0 +1,378 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdio.h> +#include <ctype.h> +#include "if-main.h" +#include "terminal.h" + +/* how many times tab was hit */ +static int tab_hit_count; + +typedef struct split_arg { + struct split_arg *next; /* next argument in buffer */ + const char *origin; /* pointer to original argument */ + char ntcopy[1]; /* null terminated copy of argument */ +} split_arg_t; + +/* function returns method of given name or NULL if not found */ +const struct method *get_interface_method(const char *iname, + const char *mname) +{ + const struct interface *iface = get_interface(iname); + + if (iface == NULL) + return NULL; + + return get_method(iface->methods, mname); +} + +/* prints matching elements */ +static void print_matches(enum_func f, void *user, const char *prefix, int len) +{ + int i; + const char *enum_name; + + putchar('\n'); + for (i = 0; NULL != (enum_name = f(user, i)); ++i) { + if (strncmp(enum_name, prefix, len) == 0) + printf("%s\t", enum_name); + } + putchar('\n'); + terminal_draw_command_line(); +} + +/* + * This function splits command line into linked list of arguments. + * line_buffer - pointer to input command line + * size - size of command line to parse + * buf - output buffer to keep split arguments list + * buf_size_in_bytes - size of buf + */ +static int split_command(const char *line_buffer, int size, split_arg_t *buf, + int buf_size_in_bytes) +{ + split_arg_t *prev = NULL; + split_arg_t *arg = buf; + int argc = 0; + const char *p = line_buffer; + const char *e = p + (size > 0 ? size : (int) strlen(p)); + int len; + + do { + while (p < e && isspace(*p)) + p++; + arg->origin = p; + arg->next = NULL; + while (p < e && !isspace(*p)) + p++; + len = p - arg->origin; + if (&arg->ntcopy[0] + len + 1 > + (const char *) buf + buf_size_in_bytes) + break; + strncpy(arg->ntcopy, arg->origin, len); + arg->ntcopy[len] = 0; + if (prev != NULL) + prev->next = arg; + prev = arg; + arg += (2 * sizeof(*arg) + len) / sizeof(*arg); + argc++; + } while (p < e); + + return argc; +} + +/* Function to enumerate method names */ +static const char *methods_name(void *v, int i) +{ + const struct interface *iface = v; + + return iface->methods[i].name[0] ? iface->methods[i].name : NULL; +} + +struct command_completion_args; +typedef void (*short_help)(struct command_completion_args *args); + +struct command_completion_args { + const split_arg_t *arg; /* list of arguments */ + const char *typed; /* last typed element */ + enum_func func; /* enumerating function */ + void *user; /* argument to enumerating function */ + short_help help; /* help function */ + const char *user_help; /* additional data (used by short_help) */ +}; + +/* + * complete command line + */ +static void tab_completion(struct command_completion_args *args) +{ + const char *name = args->typed; + const int len = strlen(name); + int i; + int j; + char prefix[128] = {0}; + int prefix_len = 0; + int count = 0; + const char *enum_name; + + for (i = 0; NULL != (enum_name = args->func(args->user, i)); ++i) { + /* prefix does not match */ + if (strncmp(enum_name, name, len) != 0) + continue; + + /* prefix matches first time */ + if (count++ == 0) { + strcpy(prefix, enum_name); + prefix_len = strlen(prefix); + continue; + } + + /* + * Prefix matches next time + * reduce prefix to common part + */ + for (j = 0; prefix[j] != 0 + && prefix[j] == enum_name[j];) + ++j; + prefix_len = j; + prefix[j] = 0; + } + + if (count == 0) { + /* no matches */ + if (args->help != NULL) + args->help(args); + tab_hit_count = 0; + return; + } + + /* len == prefix_len => nothing new was added */ + if (len == prefix_len) { + if (count != 1) { + if (tab_hit_count == 1) { + putchar('\a'); + } else if (tab_hit_count == 2 || + args->help == NULL) { + print_matches(args->func, + args->user, name, len); + } else { + args->help(args); + tab_hit_count = 1; + } + } else if (count == 1) { + /* nothing to add, exact match add space */ + terminal_insert_into_command_line(" "); + } + } else { + /* new chars can be added from some interface name(s) */ + if (count == 1) { + /* exact match, add space */ + prefix[prefix_len++] = ' '; + prefix[prefix_len] = '\0'; + } + + terminal_insert_into_command_line(prefix + len); + tab_hit_count = 0; + } +} + +/* interface completion */ +static void command_completion(split_arg_t *arg) +{ + struct command_completion_args args = { + .arg = arg, + .typed = arg->ntcopy, + .func = command_name + }; + + tab_completion(&args); +} + +/* method completion */ +static void method_completion(const struct interface *iface, split_arg_t *arg) +{ + struct command_completion_args args = { + .arg = arg, + .typed = arg->next->ntcopy, + .func = methods_name, + .user = (void *) iface + }; + + if (iface == NULL) + return; + + tab_completion(&args); +} + +static const char *bold = "\x1b[1m"; +static const char *normal = "\x1b[0m"; + +static bool find_nth_argument(const char *str, int n, const char **s, + const char **e) +{ + const char *p = str; + int argc = 0; + *e = NULL; + + while (p != NULL && *p != 0) { + + while (isspace(*p)) + ++p; + + if (n == argc) + *s = p; + + if (*p == '[') { + p = strchr(p, ']'); + if (p != NULL) + *e = ++p; + } else if (*p == '<') { + p = strchr(p, '>'); + if (p != NULL) + *e = ++p; + } else { + *e = strchr(p, ' '); + if (*e == NULL) + *e = p + strlen(p); + p = *e; + } + + if (n == argc) + break; + + argc++; + *e = NULL; + } + return *e != NULL; +} + +/* prints short help on method for interface */ +static void method_help(struct command_completion_args *args) +{ + int argc; + const split_arg_t *arg = args->arg; + const char *sb = NULL; + const char *eb = NULL; + const char *arg1 = ""; + int arg1_size = 0; /* size of method field (for methods > 0) */ + + if (args->user_help == NULL) + return; + + for (argc = 0; arg != NULL; argc++) + arg = arg->next; + + /* Check if this is method from interface */ + if (get_command(args->arg->ntcopy) == NULL) { + /* if so help is missing interface and method name */ + arg1 = args->arg->next->ntcopy; + arg1_size = strlen(arg1) + 1; + } + + find_nth_argument(args->user_help, argc - (arg1_size ? 3 : 2), + &sb, &eb); + + if (eb != NULL) + haltest_info("%s %-*s%.*s%s%.*s%s%s\n", args->arg->ntcopy, + arg1_size, arg1, (int) (sb - args->user_help), + args->user_help, bold, (int) (eb - sb), + sb, normal, eb); + else + haltest_info("%s %-*s%s\n", args->arg->ntcopy, + arg1_size, arg1, args->user_help); +} + +/* So we have empty enumeration */ +static const char *return_null(void *user, int i) +{ + return NULL; +} + +/* + * parameter completion function + * argc - number of elements in arg list + * arg - list of arguments + * method - method to get completion from (can be NULL) + */ +static void param_completion(int argc, const split_arg_t *arg, + const struct method *method, int hlpix) +{ + int i; + const char *argv[argc]; + const split_arg_t *tmp = arg; + struct command_completion_args args = { + .arg = arg, + .func = return_null + }; + + /* prepare standard argv from arg */ + for (i = 0; i < argc; ++i) { + argv[i] = tmp->ntcopy; + tmp = tmp->next; + } + + if (method != NULL && method->complete != NULL) { + /* ask method for completion function */ + method->complete(argc, argv, &args.func, &args.user); + } + + /* If method provided enumeration function call try to complete */ + if (args.func != NULL) { + args.typed = argv[argc - 1]; + args.help = method_help; + args.user_help = method ? method->help : NULL; + + tab_completion(&args); + } +} + +/* + * This method gets called when user tapped tab key. + * line - points to command line + * len - size of line that should be used for completions. This should be + * cursor position during tab hit. + */ +void process_tab(const char *line, int len) +{ + int argc; + static split_arg_t buf[(LINE_BUF_MAX * 2) / sizeof(split_arg_t)]; + const struct method *method; + + argc = split_command(line, len, buf, sizeof(buf)); + tab_hit_count++; + + if (argc == 0) + return; + + if (argc == 1) { + command_completion(buf); + return; + } + + method = get_command(buf[0].ntcopy); + if (method != NULL) { + param_completion(argc, buf, method, 1); + } else if (argc == 2) { + method_completion(get_interface(buf[0].ntcopy), buf); + } else { + /* Find method for <interface, name> pair */ + method = get_interface_method(buf[0].ntcopy, + buf[0].next->ntcopy); + param_completion(argc, buf, method, 2); + } +}
diff --git a/bluez/android/client/terminal.c b/bluez/android/client/terminal.c new file mode 100644 index 0000000..f7b56de --- /dev/null +++ b/bluez/android/client/terminal.c
@@ -0,0 +1,824 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdbool.h> +#include <termios.h> +#include <stdlib.h> + +#include "terminal.h" +#include "history.h" + +/* + * Character sequences recognized by code in this file + * Leading ESC 0x1B is not included + */ +#define SEQ_INSERT "[2~" +#define SEQ_DELETE "[3~" +#define SEQ_HOME "OH" +#define SEQ_END "OF" +#define SEQ_PGUP "[5~" +#define SEQ_PGDOWN "[6~" +#define SEQ_LEFT "[D" +#define SEQ_RIGHT "[C" +#define SEQ_UP "[A" +#define SEQ_DOWN "[B" +#define SEQ_STAB "[Z" +#define SEQ_M_n "n" +#define SEQ_M_p "p" +#define SEQ_CLEFT "[1;5D" +#define SEQ_CRIGHT "[1;5C" +#define SEQ_CUP "[1;5A" +#define SEQ_CDOWN "[1;5B" +#define SEQ_SLEFT "[1;2D" +#define SEQ_SRIGHT "[1;2C" +#define SEQ_SUP "[1;2A" +#define SEQ_SDOWN "[1;2B" +#define SEQ_MLEFT "[1;3D" +#define SEQ_MRIGHT "[1;3C" +#define SEQ_MUP "[1;3A" +#define SEQ_MDOWN "[1;3B" + +#define KEY_SEQUENCE(k) { KEY_##k, SEQ_##k } +struct ansii_sequence { + int code; + const char *sequence; +}; + +/* Table connects single int key codes with character sequences */ +static const struct ansii_sequence ansii_sequnces[] = { + KEY_SEQUENCE(INSERT), + KEY_SEQUENCE(DELETE), + KEY_SEQUENCE(HOME), + KEY_SEQUENCE(END), + KEY_SEQUENCE(PGUP), + KEY_SEQUENCE(PGDOWN), + KEY_SEQUENCE(LEFT), + KEY_SEQUENCE(RIGHT), + KEY_SEQUENCE(UP), + KEY_SEQUENCE(DOWN), + KEY_SEQUENCE(CLEFT), + KEY_SEQUENCE(CRIGHT), + KEY_SEQUENCE(CUP), + KEY_SEQUENCE(CDOWN), + KEY_SEQUENCE(SLEFT), + KEY_SEQUENCE(SRIGHT), + KEY_SEQUENCE(SUP), + KEY_SEQUENCE(SDOWN), + KEY_SEQUENCE(MLEFT), + KEY_SEQUENCE(MRIGHT), + KEY_SEQUENCE(MUP), + KEY_SEQUENCE(MDOWN), + KEY_SEQUENCE(STAB), + KEY_SEQUENCE(M_p), + KEY_SEQUENCE(M_n), + { 0, NULL } +}; + +#define KEY_SEQUNCE_NOT_FINISHED -1 +#define KEY_C_C 3 +#define KEY_C_D 4 +#define KEY_C_L 12 + +#define isseqence(c) ((c) == 0x1B) + +/* + * Number of characters that consist of ANSI sequence + * Should not be less then longest string in ansi_sequences + */ +#define MAX_ASCII_SEQUENCE 10 + +static char current_sequence[MAX_ASCII_SEQUENCE]; +static int current_sequence_len = -1; + +/* single line typed by user goes here */ +static char line_buf[LINE_BUF_MAX]; +/* index of cursor in input line */ +static int line_buf_ix = 0; +/* current length of input line */ +static int line_len = 0; + +/* line index used for fetching lines from history */ +static int line_index = 0; + +static char prompt_buf[10] = "> "; +static const char *const noprompt = ""; +static const char *current_prompt = prompt_buf; +static const char *prompt = prompt_buf; +/* + * Moves cursor to right or left + * + * n - positive - moves cursor right + * n - negative - moves cursor left + */ +static void terminal_move_cursor(int n) +{ + if (n < 0) { + for (; n < 0; n++) + putchar('\b'); + } else if (n > 0) { + printf("%*s", n, line_buf + line_buf_ix); + } +} + +/* Draw command line */ +void terminal_draw_command_line(void) +{ + /* + * this needs to be checked here since line_buf is not cleared + * before parsing event though line_len and line_buf_ix are + */ + if (line_len > 0) + printf("%s%s", prompt, line_buf); + else + printf("%s", prompt); + + /* move cursor to it's place */ + terminal_move_cursor(line_buf_ix - line_len); +} + +/* inserts string into command line at cursor position */ +void terminal_insert_into_command_line(const char *p) +{ + int len = strlen(p); + + if (line_len == line_buf_ix) { + strcat(line_buf, p); + printf("%s", p); + line_len = line_len + len; + line_buf_ix = line_len; + } else { + memmove(line_buf + line_buf_ix + len, + line_buf + line_buf_ix, line_len - line_buf_ix + 1); + memmove(line_buf + line_buf_ix, p, len); + printf("%s", line_buf + line_buf_ix); + line_buf_ix += len; + line_len += len; + terminal_move_cursor(line_buf_ix - line_len); + } +} + +/* Prints string and redraws command line */ +int terminal_print(const char *format, ...) +{ + va_list args; + int ret; + + va_start(args, format); + + ret = terminal_vprint(format, args); + + va_end(args); + return ret; +} + +/* Prints string and redraws command line */ +int terminal_vprint(const char *format, va_list args) +{ + int ret; + + printf("\r%*s\r", (int) line_len + 1, " "); + + ret = vprintf(format, args); + + terminal_draw_command_line(); + + fflush(stdout); + + return ret; +} + +/* + * Call this when text in line_buf was changed + * and line needs to be redrawn + */ +static void terminal_line_replaced(void) +{ + int len = strlen(line_buf); + + /* line is shorter that previous */ + if (len < line_len) { + /* if new line is shorter move cursor to end of new end */ + while (line_buf_ix > len) { + putchar('\b'); + line_buf_ix--; + } + + /* If cursor was not at the end, move it to the end */ + if (line_buf_ix < line_len) + printf("%.*s", line_len - line_buf_ix, + line_buf + line_buf_ix); + /* over write end of previous line */ + while (line_len >= len++) + putchar(' '); + } + + /* draw new line */ + printf("\r%s%s", prompt, line_buf); + /* set up indexes to new line */ + line_len = strlen(line_buf); + line_buf_ix = line_len; + fflush(stdout); +} + +static void terminal_clear_line(void) +{ + line_buf[0] = '\0'; + terminal_line_replaced(); +} + +static void terminal_clear_screen(void) +{ + line_buf[0] = '\0'; + line_buf_ix = 0; + line_len = 0; + + printf("\x1b[2J\x1b[1;1H%s", prompt); +} + +static void terminal_delete_char(void) +{ + /* delete character under cursor if not at the very end */ + if (line_buf_ix >= line_len) + return; + /* + * Prepare buffer with one character missing + * trailing 0 is moved + */ + line_len--; + memmove(line_buf + line_buf_ix, line_buf + line_buf_ix + 1, + line_len - line_buf_ix + 1); + /* print rest of line from current cursor position */ + printf("%s \b", line_buf + line_buf_ix); + /* move back cursor */ + terminal_move_cursor(line_buf_ix - line_len); +} + +/* + * Function tries to replace current line with specified line in history + * new_line_index - new line to show, -1 to show oldest + */ +static void terminal_get_line_from_history(int new_line_index) +{ + new_line_index = history_get_line(new_line_index, + line_buf, LINE_BUF_MAX); + + if (new_line_index >= 0) { + terminal_line_replaced(); + line_index = new_line_index; + } +} + +/* + * Function searches history back or forward for command line that starts + * with characters up to cursor position + * + * back - true - searches backward + * back - false - searches forward (more recent commands) + */ +static void terminal_match_hitory(bool back) +{ + char buf[line_buf_ix + 1]; + int line; + int matching_line = -1; + int dir = back ? 1 : -1; + + line = line_index + dir; + while (matching_line == -1 && line >= 0) { + int new_line_index; + + new_line_index = history_get_line(line, buf, line_buf_ix + 1); + if (new_line_index < 0) + break; + + if (0 == strncmp(line_buf, buf, line_buf_ix)) + matching_line = line; + line += dir; + } + + if (matching_line >= 0) { + int pos = line_buf_ix; + terminal_get_line_from_history(matching_line); + /* move back to cursor position to original place */ + line_buf_ix = pos; + terminal_move_cursor(pos - line_len); + } +} + +/* + * Converts terminal character sequences to single value representing + * keyboard keys + */ +static int terminal_convert_sequence(int c) +{ + int i; + + /* Not in sequence yet? */ + if (current_sequence_len == -1) { + /* Is ansi sequence detected by 0x1B ? */ + if (isseqence(c)) { + current_sequence_len++; + return KEY_SEQUNCE_NOT_FINISHED; + } + + return c; + } + + /* Inside sequence */ + current_sequence[current_sequence_len++] = c; + current_sequence[current_sequence_len] = '\0'; + for (i = 0; ansii_sequnces[i].code; ++i) { + /* Matches so far? */ + if (0 != strncmp(current_sequence, ansii_sequnces[i].sequence, + current_sequence_len)) + continue; + + /* Matches as a whole? */ + if (ansii_sequnces[i].sequence[current_sequence_len] == 0) { + current_sequence_len = -1; + return ansii_sequnces[i].code; + } + + /* partial match (not whole sequence yet) */ + return KEY_SEQUNCE_NOT_FINISHED; + } + + terminal_print("ansi char 0x%X %c\n", c); + /* + * Sequence does not match + * mark that no in sequence any more, return char + */ + current_sequence_len = -1; + return c; +} + +typedef void (*terminal_action)(int c, line_callback process_line); + +#define TERMINAL_ACTION(n) \ + static void n(int c, void (*process_line)(char *line)) + +TERMINAL_ACTION(terminal_action_null) +{ +} + +/* Mapping between keys and function */ +typedef struct { + int key; + terminal_action func; +} KeyAction; + +int action_keys[] = { + KEY_SEQUNCE_NOT_FINISHED, + KEY_LEFT, + KEY_RIGHT, + KEY_HOME, + KEY_END, + KEY_DELETE, + KEY_CLEFT, + KEY_CRIGHT, + KEY_SUP, + KEY_SDOWN, + KEY_UP, + KEY_DOWN, + KEY_BACKSPACE, + KEY_INSERT, + KEY_PGUP, + KEY_PGDOWN, + KEY_CUP, + KEY_CDOWN, + KEY_SLEFT, + KEY_SRIGHT, + KEY_MLEFT, + KEY_MRIGHT, + KEY_MUP, + KEY_MDOWN, + KEY_STAB, + KEY_M_n, + KEY_M_p, + KEY_C_C, + KEY_C_D, + KEY_C_L, + '\t', + '\r', + '\n', +}; + +#define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) + +/* + * current_actions holds all recognizable kes and actions for them + * additional element (index 0) is used for default action + */ +static KeyAction current_actions[NELEM(action_keys) + 1]; + +/* KeyAction comparator by key, for qsort and bsearch */ +static int KeyActionKeyCompare(const void *a, const void *b) +{ + return ((const KeyAction *) a)->key - ((const KeyAction *) b)->key; +} + +/* Find action by key, NULL if no action for this key */ +static KeyAction *terminal_get_action(int key) +{ + KeyAction a = { .key = key }; + + return bsearch(&a, current_actions + 1, NELEM(action_keys), sizeof(a), + KeyActionKeyCompare); +} + +/* Sets new set of actions to use */ +static void terminal_set_actions(const KeyAction *actions) +{ + int i; + + /* Make map with empty function for every key */ + for (i = 0; i < NELEM(action_keys); ++i) { + /* + * + 1 due to 0 index reserved for default action that is + * called for non mapped key + */ + current_actions[i + 1].key = action_keys[i]; + current_actions[i + 1].func = terminal_action_null; + } + + /* Sort action from 1 (index 0 - default action) */ + qsort(current_actions + 1, NELEM(action_keys), sizeof(KeyAction), + KeyActionKeyCompare); + /* Set default action (first in array) */ + current_actions[0] = *actions++; + + /* Copy rest of actions into their places */ + for (; actions->key; ++actions) { + KeyAction *place = terminal_get_action(actions->key); + + if (place) + place->func = actions->func; + } +} + +TERMINAL_ACTION(terminal_action_left) +{ + /* if not at the beginning move to previous character */ + if (line_buf_ix <= 0) + return; + line_buf_ix--; + terminal_move_cursor(-1); +} + +TERMINAL_ACTION(terminal_action_right) +{ + /* + * If not at the end, just print current character + * and modify position + */ + if (line_buf_ix < line_len) + putchar(line_buf[line_buf_ix++]); +} + +TERMINAL_ACTION(terminal_action_home) +{ + /* move to beginning of line and update position */ + printf("\r%s", prompt); + line_buf_ix = 0; +} + +TERMINAL_ACTION(terminal_action_end) +{ + /* if not at the end of line */ + if (line_buf_ix < line_len) { + /* print everything from cursor */ + printf("%s", line_buf + line_buf_ix); + /* just modify current position */ + line_buf_ix = line_len; + } +} + +TERMINAL_ACTION(terminal_action_del) +{ + terminal_delete_char(); +} + +TERMINAL_ACTION(terminal_action_word_left) +{ + int old_pos; + /* + * Move by word left + * + * Are we at the beginning of line? + */ + if (line_buf_ix <= 0) + return; + + old_pos = line_buf_ix; + line_buf_ix--; + /* skip spaces left */ + while (line_buf_ix && isspace(line_buf[line_buf_ix])) + line_buf_ix--; + + /* skip all non spaces to the left */ + while (line_buf_ix > 0 && + !isspace(line_buf[line_buf_ix - 1])) + line_buf_ix--; + + /* move cursor to new position */ + terminal_move_cursor(line_buf_ix - old_pos); +} + +TERMINAL_ACTION(terminal_action_word_right) +{ + int old_pos; + /* + * Move by word right + * + * are we at the end of line? + */ + if (line_buf_ix >= line_len) + return; + + old_pos = line_buf_ix; + /* skip all spaces */ + while (line_buf_ix < line_len && isspace(line_buf[line_buf_ix])) + line_buf_ix++; + + /* skip all non spaces */ + while (line_buf_ix < line_len && !isspace(line_buf[line_buf_ix])) + line_buf_ix++; + /* + * Move cursor to right by printing text + * between old cursor and new + */ + if (line_buf_ix > old_pos) + printf("%.*s", (int) (line_buf_ix - old_pos), + line_buf + old_pos); +} + +TERMINAL_ACTION(terminal_action_history_begin) +{ + terminal_get_line_from_history(-1); +} + +TERMINAL_ACTION(terminal_action_history_end) +{ + if (line_index > 0) + terminal_get_line_from_history(0); +} + +TERMINAL_ACTION(terminal_action_history_up) +{ + terminal_get_line_from_history(line_index + 1); +} + +TERMINAL_ACTION(terminal_action_history_down) +{ + if (line_index > 0) + terminal_get_line_from_history(line_index - 1); +} + +TERMINAL_ACTION(terminal_action_tab) +{ + /* tab processing */ + process_tab(line_buf, line_buf_ix); +} + + +TERMINAL_ACTION(terminal_action_backspace) +{ + if (line_buf_ix <= 0) + return; + + if (line_buf_ix == line_len) { + printf("\b \b"); + line_len = --line_buf_ix; + line_buf[line_len] = 0; + } else { + putchar('\b'); + line_buf_ix--; + line_len--; + memmove(line_buf + line_buf_ix, + line_buf + line_buf_ix + 1, + line_len - line_buf_ix + 1); + printf("%s \b", line_buf + line_buf_ix); + terminal_move_cursor(line_buf_ix - line_len); + } +} + +TERMINAL_ACTION(terminal_action_find_history_forward) +{ + /* Search history forward */ + terminal_match_hitory(false); +} + +TERMINAL_ACTION(terminal_action_find_history_backward) +{ + /* Search history forward */ + terminal_match_hitory(true); +} + +TERMINAL_ACTION(terminal_action_ctrl_c) +{ + terminal_clear_line(); +} + +TERMINAL_ACTION(terminal_action_ctrl_d) +{ + if (line_len > 0) { + terminal_delete_char(); + } else { + puts(""); + exit(0); + } +} + +TERMINAL_ACTION(terminal_action_clear_screen) +{ + terminal_clear_screen(); +} + +TERMINAL_ACTION(terminal_action_enter) +{ + /* + * On new line add line to history + * forget history position + */ + history_add_line(line_buf); + line_len = 0; + line_buf_ix = 0; + line_index = -1; + /* print new line */ + putchar(c); + prompt = noprompt; + process_line(line_buf); + /* clear current line */ + line_buf[0] = '\0'; + prompt = current_prompt; + printf("%s", prompt); +} + +TERMINAL_ACTION(terminal_action_default) +{ + char str[2] = { c, 0 }; + + if (!isprint(c)) + /* + * TODO: remove this print once all meaningful sequences + * are identified + */ + printf("char-0x%02x\n", c); + else if (line_buf_ix < LINE_BUF_MAX - 1) + terminal_insert_into_command_line(str); +} + +/* Callback to call when user hit enter during prompt for */ +static line_callback prompt_callback; + +static KeyAction normal_actions[] = { + { 0, terminal_action_default }, + { KEY_LEFT, terminal_action_left }, + { KEY_RIGHT, terminal_action_right }, + { KEY_HOME, terminal_action_home }, + { KEY_END, terminal_action_end }, + { KEY_DELETE, terminal_action_del }, + { KEY_CLEFT, terminal_action_word_left }, + { KEY_CRIGHT, terminal_action_word_right }, + { KEY_SUP, terminal_action_history_begin }, + { KEY_SDOWN, terminal_action_history_end }, + { KEY_UP, terminal_action_history_up }, + { KEY_DOWN, terminal_action_history_down }, + { '\t', terminal_action_tab }, + { KEY_BACKSPACE, terminal_action_backspace }, + { KEY_M_n, terminal_action_find_history_forward }, + { KEY_M_p, terminal_action_find_history_backward }, + { KEY_C_C, terminal_action_ctrl_c }, + { KEY_C_D, terminal_action_ctrl_d }, + { KEY_C_L, terminal_action_clear_screen }, + { '\r', terminal_action_enter }, + { '\n', terminal_action_enter }, + { 0, NULL }, +}; + +TERMINAL_ACTION(terminal_action_answer) +{ + putchar(c); + + terminal_set_actions(normal_actions); + /* Restore default prompt */ + current_prompt = prompt_buf; + + /* No prompt for prints */ + prompt = noprompt; + line_buf_ix = 0; + line_len = 0; + /* Call user function with what was typed */ + prompt_callback(line_buf); + + line_buf[0] = 0; + /* promot_callback could change current_prompt */ + prompt = current_prompt; + + printf("%s", prompt); +} + +TERMINAL_ACTION(terminal_action_prompt_ctrl_c) +{ + printf("^C\n"); + line_buf_ix = 0; + line_len = 0; + line_buf[0] = 0; + + current_prompt = prompt_buf; + prompt = current_prompt; + terminal_set_actions(normal_actions); + + printf("%s", prompt); +} + +static KeyAction prompt_actions[] = { + { 0, terminal_action_default }, + { KEY_LEFT, terminal_action_left }, + { KEY_RIGHT, terminal_action_right }, + { KEY_HOME, terminal_action_home }, + { KEY_END, terminal_action_end }, + { KEY_DELETE, terminal_action_del }, + { KEY_CLEFT, terminal_action_word_left }, + { KEY_CRIGHT, terminal_action_word_right }, + { KEY_BACKSPACE, terminal_action_backspace }, + { KEY_C_C, terminal_action_prompt_ctrl_c }, + { KEY_C_D, terminal_action_ctrl_d }, + { '\r', terminal_action_answer }, + { '\n', terminal_action_answer }, + { 0, NULL }, +}; + +void terminal_process_char(int c, line_callback process_line) +{ + KeyAction *a; + + c = terminal_convert_sequence(c); + + /* Get action for this key */ + a = terminal_get_action(c); + + /* No action found, get default one */ + if (a == NULL) + a = ¤t_actions[0]; + + a->func(c, process_line); + fflush(stdout); +} + +void terminal_prompt_for(const char *s, line_callback process_line) +{ + current_prompt = s; + if (prompt != noprompt) { + prompt = s; + terminal_clear_line(); + } + prompt_callback = process_line; + terminal_set_actions(prompt_actions); +} + +static struct termios origianl_tios; + +static void terminal_cleanup(void) +{ + tcsetattr(0, TCSANOW, &origianl_tios); +} + +void terminal_setup(void) +{ + struct termios tios; + + terminal_set_actions(normal_actions); + + tcgetattr(0, &origianl_tios); + tios = origianl_tios; + + /* + * Turn off echo since all editing is done by hand, + * Ctrl-c handled internally + */ + tios.c_lflag &= ~(ICANON | ECHO | BRKINT | IGNBRK); + tcsetattr(0, TCSANOW, &tios); + + /* Restore terminal at exit */ + atexit(terminal_cleanup); + + printf("%s", prompt); + fflush(stdout); +}
diff --git a/bluez/android/client/terminal.h b/bluez/android/client/terminal.h new file mode 100644 index 0000000..0e63936 --- /dev/null +++ b/bluez/android/client/terminal.h
@@ -0,0 +1,62 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdarg.h> + +/* size of supported line */ +#define LINE_BUF_MAX 1024 + +enum key_codes { + KEY_BACKSPACE = 0x7F, + KEY_INSERT = 1000, /* arbitrary value */ + KEY_DELETE, + KEY_HOME, + KEY_END, + KEY_PGUP, + KEY_PGDOWN, + KEY_LEFT, + KEY_RIGHT, + KEY_UP, + KEY_DOWN, + KEY_CLEFT, + KEY_CRIGHT, + KEY_CUP, + KEY_CDOWN, + KEY_SLEFT, + KEY_SRIGHT, + KEY_SUP, + KEY_SDOWN, + KEY_MLEFT, + KEY_MRIGHT, + KEY_MUP, + KEY_MDOWN, + KEY_STAB, + KEY_M_p, + KEY_M_n +}; + +typedef void (*line_callback)(char *); + +void terminal_setup(void); +int terminal_print(const char *format, ...); +int terminal_vprint(const char *format, va_list args); +void terminal_process_char(int c, line_callback process_line); +void terminal_insert_into_command_line(const char *p); +void terminal_draw_command_line(void); +void terminal_prompt_for(const char *s, line_callback process_line); + +void process_tab(const char *line, int len);
diff --git a/bluez/android/cutils/properties.h b/bluez/android/cutils/properties.h new file mode 100644 index 0000000..66a4a84 --- /dev/null +++ b/bluez/android/cutils/properties.h
@@ -0,0 +1,71 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <sys/socket.h> +#include <sys/un.h> + +#define PROPERTY_VALUE_MAX 32 + +static inline int property_get(const char *key, char *value, + const char *default_value) +{ + return 0; +} + +/* property_set: returns 0 on success, < 0 on failure +*/ +static inline int property_set(const char *key, const char *value) +{ + static const char SYSTEM_SOCKET_PATH[] = "\0android_system"; + + struct sockaddr_un addr; + char msg[256]; + int fd, len; + + fd = socket(PF_LOCAL, SOCK_DGRAM, 0); + if (fd < 0) + return -1; + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + memcpy(addr.sun_path, SYSTEM_SOCKET_PATH, sizeof(SYSTEM_SOCKET_PATH)); + + if (connect(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + close(fd); + return 0; + } + + len = snprintf(msg, sizeof(msg), "%s=%s", key, value); + + if (send(fd, msg, len + 1, 0) < 0) { + close(fd); + return -1; + } + + close(fd); + + return 0; +}
diff --git a/bluez/android/gatt.c b/bluez/android/gatt.c new file mode 100644 index 0000000..0414c4f --- /dev/null +++ b/bluez/android/gatt.c
@@ -0,0 +1,1236 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdbool.h> +#include <stdlib.h> +#include <stdint.h> +#include <glib.h> +#include <errno.h> +#include <sys/socket.h> + +#include "ipc.h" +#include "ipc-common.h" +#include "lib/sdp.h" +#include "lib/uuid.h" +#include "bluetooth.h" +#include "gatt.h" +#include "src/log.h" +#include "hal-msg.h" +#include "utils.h" +#include "src/shared/util.h" +#include "src/shared/queue.h" +#include "attrib/gattrib.h" +#include "attrib/att.h" +#include "attrib/gatt.h" +#include "btio/btio.h" + +struct gatt_client { + int32_t id; + uint8_t uuid[16]; +}; + +struct gatt_device { + bdaddr_t bdaddr; + uint8_t bdaddr_type; + + struct queue *clients; + + bool connect_ready; + int32_t conn_id; + + GAttrib *attrib; + GIOChannel *att_io; + struct queue *services; + + guint watch_id; +}; + +static struct ipc *hal_ipc = NULL; +static bdaddr_t adapter_addr; +static bool scanning = false; + +static struct queue *gatt_clients = NULL; +static struct queue *conn_list = NULL; /* Connected devices */ +static struct queue *conn_wait_queue = NULL; /* Devs waiting to connect */ + +static void bt_le_discovery_stop_cb(void); + +static bool match_client_by_uuid(const void *data, const void *user_data) +{ + const uint8_t *exp_uuid = user_data; + const struct gatt_client *client = data; + + return !memcmp(exp_uuid, client->uuid, sizeof(client->uuid)); +} + +static bool match_client_by_id(const void *data, const void *user_data) +{ + int32_t exp_id = PTR_TO_INT(user_data); + const struct gatt_client *client = data; + + return client->id == exp_id; +} + +static bool match_by_value(const void *data, const void *user_data) +{ + return data == user_data; +} + +static bool match_dev_by_bdaddr(const void *data, const void *user_data) +{ + const struct gatt_device *dev = data; + const bdaddr_t *addr = user_data; + + return !bacmp(&dev->bdaddr, addr); +} + +static bool match_dev_connect_ready(const void *data, const void *user_data) +{ + const struct gatt_device *dev = data; + + return dev->connect_ready; +} + +static bool match_dev_by_conn_id(const void *data, const void *user_data) +{ + const struct gatt_device *dev = data; + const int32_t conn_id = PTR_TO_INT(user_data); + + return dev->conn_id == conn_id; +} + +static void destroy_device(void *data) +{ + struct gatt_device *dev = data; + + queue_destroy(dev->clients, NULL); + queue_destroy(dev->services, free); + free(dev); +} + +static void handle_client_register(const void *buf, uint16_t len) +{ + const struct hal_cmd_gatt_client_register *cmd = buf; + struct hal_ev_gatt_client_register_client ev; + struct gatt_client *client; + static int32_t client_cnt = 1; + uint8_t status; + + DBG(""); + + if (!cmd->uuid) { + error("gatt: no uuid received"); + status = HAL_STATUS_FAILED; + goto failed; + } + + if (queue_find(gatt_clients, match_client_by_uuid, &cmd->uuid)) { + error("gatt: client uuid is already on list"); + status = HAL_STATUS_FAILED; + goto failed; + } + + client = new0(struct gatt_client, 1); + + memcpy(client->uuid, cmd->uuid, sizeof(client->uuid)); + + client->id = client_cnt++; + + queue_push_head(gatt_clients, client); + + status = HAL_STATUS_SUCCESS; + + ev.status = status; + ev.client_if = client->id; + memcpy(ev.app_uuid, client->uuid, sizeof(client->uuid)); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_EV_GATT_CLIENT_REGISTER_CLIENT, sizeof(ev), &ev); + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_REGISTER, status); +} + +static void handle_client_unregister(const void *buf, uint16_t len) +{ + const struct hal_cmd_gatt_client_unregister *cmd = buf; + uint8_t status; + struct gatt_client *cl; + + DBG(""); + + cl = queue_remove_if(gatt_clients, match_client_by_id, + INT_TO_PTR(cmd->client_if)); + if (!cl) { + error("gatt: client_if=%d not found", cmd->client_if); + status = HAL_STATUS_FAILED; + goto failed; + } + + free(cl); + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_UNREGISTER, status); +} + +static void primary_cb(uint8_t status, GSList *services, void *user_data) +{ + struct hal_ev_gatt_client_search_complete ev; + struct gatt_device *dev = user_data; + GSList *l; + + DBG("Status %d", status); + + if (status) { + error("gatt: Discover all primary services failed: %s", + att_ecode2str(status)); + ev.status = HAL_STATUS_FAILED; + goto done; + } + + if (!services) { + info("gatt: No primary services found"); + ev.status = HAL_STATUS_SUCCESS; + goto done; + } + + for (l = services; l; l = l->next) { + struct hal_ev_gatt_client_search_result ev_res; + struct gatt_primary *prim = l->data; + struct gatt_primary *p; + bt_uuid_t uuid; + + p = new0(struct gatt_primary, 1); + if (!p) { + error("gatt: Cannot allocate memory for gatt_primary"); + continue; + } + + memset(&ev_res, 0, sizeof(ev_res)); + + /* Put primary service to our local list */ + memcpy(p, prim, sizeof(*p)); + if (!queue_push_tail(dev->services, p)) { + error("gatt: Cannot push primary service to the list"); + free(p); + continue; + } + + DBG("attr handle = 0x%04x, end grp handle = 0x%04x uuid: %s", + prim->range.start, prim->range.end, prim->uuid); + + /* Set event data */ + ev_res.conn_id = dev->conn_id; + ev_res.srvc_id.is_primary = 1; + ev_res.srvc_id.inst_id = 0; + + if (bt_string_to_uuid(&uuid, prim->uuid) < 0) { + error("gatt: Cannot convert string to uuid"); + continue; + } + + memcpy(&ev_res.srvc_id.uuid, &uuid.value, sizeof(uuid.value)); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT , + HAL_EV_GATT_CLIENT_SEARCH_RESULT, + sizeof(ev_res), &ev_res); + } + + ev.status = HAL_STATUS_SUCCESS; + +done: + ev.conn_id = dev->conn_id; + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_EV_GATT_CLIENT_SEARCH_COMPLETE, sizeof(ev), &ev); +} + +static void connection_cleanup(struct gatt_device *device) +{ + if (device->watch_id) { + g_source_remove(device->watch_id); + device->watch_id = 0; + } + + if (device->att_io) { + g_io_channel_shutdown(device->att_io, FALSE, NULL); + g_io_channel_unref(device->att_io); + device->att_io = NULL; + } + + if (device->attrib) { + GAttrib *attrib = device->attrib; + device->attrib = NULL; + g_attrib_cancel_all(attrib); + g_attrib_unref(attrib); + } +} + +static void send_client_disconnect_notify(int32_t id, struct gatt_device *dev, + uint8_t status) +{ + struct hal_ev_gatt_client_disconnect ev; + + ev.client_if = id; + ev.conn_id = dev->conn_id; + ev.status = status; + bdaddr2android(&dev->bdaddr, &ev.bda); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_EV_GATT_CLIENT_DISCONNECT, sizeof(ev), &ev); +} + +static void client_disconnect_notify(void *data, void *user_data) +{ + struct gatt_device *dev = user_data; + int32_t id = PTR_TO_INT(data); + + send_client_disconnect_notify(id, dev, HAL_STATUS_SUCCESS); +} + +static bool is_device_wating_for_connect(const bdaddr_t *addr, + uint8_t addr_type) +{ + struct gatt_device *dev; + + DBG(""); + + dev = queue_find(conn_wait_queue, match_dev_by_bdaddr, (void *)addr); + if (!dev) + return false; + + dev->bdaddr_type = addr_type; + + /* Mark that this device is ready for connect. + * Need it because will continue with connect after scan is stopped + */ + dev->connect_ready = true; + + return true; +} + +static void le_device_found_handler(const bdaddr_t *addr, uint8_t addr_type, + int rssi, uint16_t eir_len, + const void *eir) +{ + uint8_t buf[IPC_MTU]; + struct hal_ev_gatt_client_scan_result *ev = (void *) buf; + char bda[18]; + + if (!scanning) + goto connect; + + ba2str(addr, bda); + DBG("LE Device found: %s, rssi: %d, adv_data: %d", bda, rssi, !!eir); + + bdaddr2android(addr, ev->bda); + ev->rssi = rssi; + ev->len = eir_len; + + memcpy(ev->adv_data, eir, ev->len); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_EV_GATT_CLIENT_SCAN_RESULT, + sizeof(ev) + ev->len, ev); + +connect: + if (!is_device_wating_for_connect(addr, addr_type)) + return; + + /* We are ok to perform connect now. Stop discovery + * and once it is stopped continue with creating ACL + */ + bt_le_discovery_stop(bt_le_discovery_stop_cb); +} + +static gboolean disconnected_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + bdaddr_t *addr = user_data; + struct gatt_device *dev; + int sock, err = 0; + socklen_t len; + + dev = queue_remove_if(conn_list, match_dev_by_bdaddr, addr); + + sock = g_io_channel_unix_get_fd(io); + len = sizeof(err); + if (getsockopt(sock, SOL_SOCKET, SO_ERROR, &err, &len) < 0) + goto done; + + DBG("%s (%d)", strerror(err), err); + + /* Keep scanning/re-connection active if disconnection reason + * is connection timeout, remote user terminated connection or local + * initiated disconnection. + */ + if (err == ETIMEDOUT || err == ECONNRESET || err == ECONNABORTED) { + if (!queue_push_tail(conn_wait_queue, dev)) { + error("gatt: Cannot push data"); + } else { + bt_le_discovery_start(le_device_found_handler); + return FALSE; + } + } + +done: + connection_cleanup(dev); + + queue_foreach(dev->clients, client_disconnect_notify, dev); + destroy_device(dev); + + return FALSE; +} + +static void send_client_connect_notify(void *data, void *user_data) +{ + struct hal_ev_gatt_client_connect *ev = user_data; + int32_t id = PTR_TO_INT(data); + + ev->client_if = id; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_EV_GATT_CLIENT_CONNECT, sizeof(*ev), ev); + +} + +static void connect_cb(GIOChannel *io, GError *gerr, gpointer user_data) +{ + bdaddr_t *addr = user_data; + struct gatt_device *dev; + struct hal_ev_gatt_client_connect ev; + GAttrib *attrib; + static uint32_t conn_id = 0; + uint8_t status; + + /* Take device from conn waiting queue */ + dev = queue_remove_if(conn_wait_queue, match_dev_by_bdaddr, addr); + if (!dev) { + error("gatt: Device not on the connect wait queue!?"); + g_io_channel_shutdown(io, TRUE, NULL); + return; + } + + g_io_channel_unref(dev->att_io); + dev->att_io = NULL; + + /* Set address and client id in the event */ + bdaddr2android(&dev->bdaddr, &ev.bda); + + if (gerr) { + error("gatt: connection failed %s", gerr->message); + status = HAL_STATUS_FAILED; + goto reply; + } + + attrib = g_attrib_new(io); + if (!attrib) { + error("gatt: unable to create new GAttrib instance"); + status = HAL_STATUS_FAILED; + goto reply; + } + + dev->attrib = attrib; + dev->watch_id = g_io_add_watch(io, G_IO_HUP | G_IO_ERR | G_IO_NVAL, + disconnected_cb, dev); + dev->conn_id = ++conn_id; + + /* Move gatt device from connect queue to conn_list */ + if (!queue_push_tail(conn_list, dev)) { + error("gatt: Cannot push dev on conn_list"); + connection_cleanup(dev); + status = HAL_STATUS_FAILED; + goto reply; + } + + status = HAL_STATUS_SUCCESS; + goto reply; + +reply: + ev.conn_id = dev ? dev->conn_id : 0; + ev.status = status; + + queue_foreach(dev->clients, send_client_connect_notify, &ev); + + /* If connection did not succeed, destroy device */ + if (status) + destroy_device(dev); + + /* Check if we should restart scan */ + if (scanning) + bt_le_discovery_start(le_device_found_handler); + + /*FIXME: What to do if discovery won't start here. */ +} + +static int connect_le(struct gatt_device *dev) +{ + BtIOSecLevel sec_level; + GIOChannel *io; + GError *gerr = NULL; + char addr[18]; + + ba2str(&dev->bdaddr, addr); + + /* There is one connection attempt going on */ + if (dev->att_io) { + info("gatt: connection to dev %s is ongoing", addr); + return -EALREADY; + } + + DBG("Connection attempt to: %s", addr); + + /*TODO: If we are bonded then we should use higier sec level */ + sec_level = BT_IO_SEC_LOW; + + /* + * This connection will help us catch any PDUs that comes before + * pairing finishes + */ + io = bt_io_connect(connect_cb, dev, NULL, &gerr, + BT_IO_OPT_SOURCE_BDADDR, + &adapter_addr, + BT_IO_OPT_SOURCE_TYPE, BDADDR_LE_PUBLIC, + BT_IO_OPT_DEST_BDADDR, &dev->bdaddr, + BT_IO_OPT_DEST_TYPE, dev->bdaddr_type, + BT_IO_OPT_CID, ATT_CID, + BT_IO_OPT_SEC_LEVEL, sec_level, + BT_IO_OPT_INVALID); + if (!io) { + error("gatt: Failed bt_io_connect(%s): %s", addr, + gerr->message); + g_error_free(gerr); + return -EIO; + } + + /* Keep this, so we can cancel the connection */ + dev->att_io = io; + + return 0; +} + +static void handle_client_scan(const void *buf, uint16_t len) +{ + const struct hal_cmd_gatt_client_scan *cmd = buf; + uint8_t status; + void *registered; + + DBG("new state %d", cmd->start); + + registered = queue_find(gatt_clients, match_client_by_id, + INT_TO_PTR(cmd->client_if)); + if (!registered) { + error("gatt: Client not registered"); + status = HAL_STATUS_FAILED; + goto reply; + } + + /* Turn off scan */ + if (!cmd->start) { + DBG("Stopping LE SCAN"); + + if (scanning) { + bt_le_discovery_stop(NULL); + scanning = false; + } + + status = HAL_STATUS_SUCCESS; + goto reply; + } + + /* Reply success if we already do scan */ + if (scanning) { + status = HAL_STATUS_SUCCESS; + goto reply; + } + + /* Turn on scan */ + if (!bt_le_discovery_start(le_device_found_handler)) { + error("gatt: LE scan switch failed"); + status = HAL_STATUS_FAILED; + goto reply; + } + scanning = true; + status = HAL_STATUS_SUCCESS; + +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_SCAN, + status); +} + +static int connect_next_dev(void) +{ + struct gatt_device *dev; + + DBG(""); + + if (queue_isempty(conn_wait_queue)) + return 0; + + /* Discovery has been stopped because there is connection waiting */ + dev = queue_find(conn_wait_queue, match_dev_connect_ready, NULL); + if (!dev) + /* Lets try again. */ + return -1; + + dev->connect_ready = false; + + return connect_le(dev); +} + +static void bt_le_discovery_stop_cb(void) +{ + DBG(""); + + /* Check now if there is any device ready to connect*/ + if (connect_next_dev() < 0) + bt_le_discovery_start(le_device_found_handler); +} + +static struct gatt_device *find_device(bdaddr_t *addr) +{ + struct gatt_device *dev; + + dev = queue_find(conn_list, match_dev_by_bdaddr, addr); + if (dev) + return dev; + + dev = queue_find(conn_wait_queue, match_dev_by_bdaddr, addr); + if (dev) + return dev; + + return NULL; +} + +static void handle_client_connect(const void *buf, uint16_t len) +{ + const struct hal_cmd_gatt_client_connect *cmd = buf; + struct gatt_device *dev = NULL; + void *l; + bdaddr_t addr; + uint8_t status; + bool send_notify = false; + + DBG(""); + + /* Check if client is registered */ + l = queue_find(gatt_clients, match_client_by_id, + INT_TO_PTR(cmd->client_if)); + if (!l) { + error("gatt: Client id %d not found", cmd->client_if); + status = HAL_STATUS_FAILED; + goto reply; + } + + android2bdaddr(&cmd->bdaddr, &addr); + + /* We do support many clients for one device connection so lets check + * If device is connected or in connecting state just update list of + * clients + */ + dev = find_device(&addr); + if (dev) { + /* Remeber to send dummy notification event if we area + * connected + */ + if (dev->conn_id) + send_notify = true; + + if (queue_find(dev->clients, match_by_value, + INT_TO_PTR(cmd->client_if))) { + status = HAL_STATUS_SUCCESS; + goto reply; + } + + /* Store another client */ + if (!queue_push_tail(dev->clients, + INT_TO_PTR(cmd->client_if))) { + error("gatt: Cannot push client on gatt device list"); + status = HAL_STATUS_FAILED; + goto reply; + } + + status = HAL_STATUS_SUCCESS; + goto reply; + } + + /* Lets create new gatt device and put it on conn_wait_queue. + * Once it is connected we move it to conn_list + */ + dev = new0(struct gatt_device, 1); + if (!dev) { + status = HAL_STATUS_FAILED; + goto reply; + } + + memcpy(&dev->bdaddr, &addr, sizeof(bdaddr_t)); + + /* Create queue to keep list of clients for given device*/ + dev->clients = queue_new(); + if (!dev->clients) { + error("gatt: Cannot create client queue"); + status = HAL_STATUS_FAILED; + goto reply; + } + + dev->services = queue_new(); + if (!dev->services) { + error("gatt: Cannot create services queue"); + queue_destroy(dev->clients, NULL); + status = HAL_STATUS_FAILED; + goto reply; + } + + /* Update client list of device */ + if (!queue_push_tail(dev->clients, INT_TO_PTR(cmd->client_if))) { + error("gatt: Cannot push client on the client queue!?"); + status = HAL_STATUS_FAILED; + goto reply; + } + + /* Start le scan if not started */ + if (!scanning && !bt_le_discovery_start(le_device_found_handler)) { + error("gatt: Could not start scan"); + status = HAL_STATUS_FAILED; + goto reply; + } + + if (!queue_push_tail(conn_wait_queue, dev)) { + error("gatt: Cannot push device on conn_wait_queue"); + status = HAL_STATUS_FAILED; + goto reply; + } + + status = HAL_STATUS_SUCCESS; + +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_CONNECT, + status); + + /* If there is an error here we should make sure dev is out.*/ + if ((status != HAL_STATUS_SUCCESS) && dev) { + destroy_device(dev); + return; + } + + /* Send dummy notification since ACL is already up*/ + if (send_notify) { + struct hal_ev_gatt_client_connect ev; + + ev.conn_id = dev->conn_id; + ev.status = HAL_STATUS_SUCCESS; + ev.client_if = cmd->client_if; + bdaddr2android(&addr, &ev.bda); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_EV_GATT_CLIENT_CONNECT, + sizeof(ev), &ev); + } +} + +static void handle_client_disconnect(const void *buf, uint16_t len) +{ + const struct hal_cmd_gatt_client_disconnect *cmd = buf; + struct gatt_device *dev; + uint8_t status; + char addr[18]; + + DBG(""); + + ba2str((bdaddr_t *)&cmd->bdaddr, addr); + + dev = queue_find(conn_list, match_dev_by_conn_id, + INT_TO_PTR(cmd->conn_id)); + if (!dev) { + error("gatt: dev %s with conn_id=%d not found", + addr, cmd->conn_id); + status = HAL_STATUS_FAILED; + goto reply; + } + + /*Check if client owns this connection */ + if (!queue_remove_if(dev->clients, match_by_value, + INT_TO_PTR(cmd->client_if))) { + error("gatt: cannot remove conn_id=%d", cmd->client_if); + status = HAL_STATUS_FAILED; + } else { + status = HAL_STATUS_SUCCESS; + } + +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_DISCONNECT, status); + + if (status == HAL_STATUS_FAILED) + return; + + /* Just send disconnect event. If there is more clients on this + * device then this is what we shall to do. + * If this is last client, this is still OK to do because on connect + * request we do le scan and wait until remote device start + * advertisement */ + send_client_disconnect_notify(cmd->client_if, dev, HAL_STATUS_SUCCESS); + + /* If there is more clients just return */ + if (!queue_isempty(dev->clients)) + return; + + /* If this is last client do more cleaning */ + connection_cleanup(dev); + dev = queue_remove_if(conn_list, match_dev_by_bdaddr, &dev->bdaddr); + destroy_device(dev); +} + +static void handle_client_listen(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_LISTEN, + HAL_STATUS_FAILED); +} + +static void handle_client_refresh(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_REFRESH, + HAL_STATUS_FAILED); +} + +static void handle_client_search_service(const void *buf, uint16_t len) +{ + const struct hal_cmd_gatt_client_search_service *cmd = buf; + struct gatt_device *dev; + uint8_t status; + + DBG(""); + + dev = queue_find(conn_list, match_dev_by_conn_id, + INT_TO_PTR(cmd->conn_id)); + if (!dev) { + error("gatt: dev with conn_id=%d not found", cmd->conn_id); + status = HAL_STATUS_FAILED; + goto reply; + } + + /*TODO: Handle filter uuid */ + + if (!gatt_discover_primary(dev->attrib, NULL, primary_cb, dev)) { + status = HAL_STATUS_FAILED; + goto reply; + } + + status = HAL_STATUS_SUCCESS; + +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_SEARCH_SERVICE, status); +} + +static void handle_client_get_included_service(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_GET_INCLUDED_SERVICE, + HAL_STATUS_FAILED); +} + +static void handle_client_get_characteristic(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_GET_CHARACTERISTIC, + HAL_STATUS_FAILED); +} + +static void handle_client_get_descriptor(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_GET_DESCRIPTOR, HAL_STATUS_FAILED); +} + +static void handle_client_read_characteristic(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_READ_CHARACTERISTIC, + HAL_STATUS_FAILED); +} + +static void handle_client_write_characteristic(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_WRITE_CHARACTERISTIC, + HAL_STATUS_FAILED); +} + +static void handle_client_read_descriptor(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_READ_DESCRIPTOR, HAL_STATUS_FAILED); +} + +static void handle_client_write_descriptor(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR, HAL_STATUS_FAILED); +} + +static void handle_client_execute_write(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_EXECUTE_WRITE, HAL_STATUS_FAILED); +} + +static void handle_client_register_for_notification(const void *buf, + uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_REGISTER_FOR_NOTIFICATION, + HAL_STATUS_FAILED); +} + +static void handle_client_deregister_for_notification(const void *buf, + uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_DEREGISTER_FOR_NOTIFICATION, + HAL_STATUS_FAILED); +} + +static void handle_client_read_remote_rssi(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_READ_REMOTE_RSSI, HAL_STATUS_FAILED); +} + +static void handle_client_get_device_type(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE, HAL_STATUS_FAILED); +} + +static void handle_client_set_adv_data(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_SET_ADV_DATA, HAL_STATUS_FAILED); +} + +static void handle_client_test_command(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_TEST_COMMAND, HAL_STATUS_FAILED); +} + +static void handle_server_register(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_REGISTER, + HAL_STATUS_FAILED); +} + +static void handle_server_unregister(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_UNREGISTER, HAL_STATUS_FAILED); +} + +static void handle_server_connect(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_CONNECT, + HAL_STATUS_FAILED); +} + +static void handle_server_disconnect(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_DISCONNECT, HAL_STATUS_FAILED); +} + +static void handle_server_add_service(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_ADD_SERVICE, HAL_STATUS_FAILED); +} + +static void handle_server_add_included_service(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_ADD_INC_SERVICE, HAL_STATUS_FAILED); +} + +static void handle_server_add_characteristic(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_ADD_CHARACTERISTIC, + HAL_STATUS_FAILED); +} + +static void handle_server_add_descriptor(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_ADD_DESCRIPTOR, HAL_STATUS_FAILED); +} + +static void handle_server_start_service(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_START_SERVICE, HAL_STATUS_FAILED); +} + +static void handle_server_stop_service(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_STOP_SERVICE, HAL_STATUS_FAILED); +} + +static void handle_server_delete_service(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_DELETE_SERVICE, HAL_STATUS_FAILED); +} + +static void handle_server_send_indication(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_SEND_INDICATION, HAL_STATUS_FAILED); +} + +static void handle_server_send_response(const void *buf, uint16_t len) +{ + DBG(""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_SEND_RESPONSE, HAL_STATUS_FAILED); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_GATT_CLIENT_REGISTER */ + {handle_client_register, false, + sizeof(struct hal_cmd_gatt_client_register)}, + /* HAL_OP_GATT_CLIENT_UNREGISTER */ + {handle_client_unregister, false, + sizeof(struct hal_cmd_gatt_client_unregister)}, + /* HAL_OP_GATT_CLIENT_SCAN */ + {handle_client_scan, false, + sizeof(struct hal_cmd_gatt_client_scan)}, + /* HAL_OP_GATT_CLIENT_CONNECT */ + {handle_client_connect, false, + sizeof(struct hal_cmd_gatt_client_connect)}, + /* HAL_OP_GATT_CLIENT_DISCONNECT */ + {handle_client_disconnect, false, + sizeof(struct hal_cmd_gatt_client_disconnect)}, + /* HAL_OP_GATT_CLIENT_LISTEN */ + {handle_client_listen, false, + sizeof(struct hal_cmd_gatt_client_listen)}, + /* HAL_OP_GATT_CLIENT_REFRESH */ + {handle_client_refresh, false, + sizeof(struct hal_cmd_gatt_client_refresh)}, + /* HAL_OP_GATT_CLIENT_SEARCH_SERVICE */ + {handle_client_search_service, true, + sizeof(struct hal_cmd_gatt_client_search_service)}, + /* HAL_OP_GATT_CLIENT_GET_INCLUDED_SERVICE */ + {handle_client_get_included_service, true, + sizeof(struct hal_cmd_gatt_client_get_included_service)}, + /* HAL_OP_GATT_CLIENT_GET_CHARACTERISTIC */ + {handle_client_get_characteristic, true, + sizeof(struct hal_cmd_gatt_client_get_characteristic)}, + /* HAL_OP_GATT_CLIENT_GET_DESCRIPTOR */ + {handle_client_get_descriptor, true, + sizeof(struct hal_cmd_gatt_client_get_descriptor)}, + /* HAL_OP_GATT_CLIENT_READ_CHARACTERISTIC */ + {handle_client_read_characteristic, false, + sizeof(struct hal_cmd_gatt_client_read_characteristic)}, + /* HAL_OP_GATT_CLIENT_WRITE_CHARACTERISTIC */ + {handle_client_write_characteristic, true, + sizeof(struct hal_cmd_gatt_client_write_characteristic)}, + /* HAL_OP_GATT_CLIENT_READ_DESCRIPTOR */ + {handle_client_read_descriptor, false, + sizeof(struct hal_cmd_gatt_client_read_descriptor)}, + /* HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR */ + {handle_client_write_descriptor, true, + sizeof(struct hal_cmd_gatt_client_write_descriptor)}, + /* HAL_OP_GATT_CLIENT_EXECUTE_WRITE */ + {handle_client_execute_write, false, + sizeof(struct hal_cmd_gatt_client_execute_write)}, + /* HAL_OP_GATT_CLIENT_REGISTER_FOR_NOTIFICATION */ + {handle_client_register_for_notification, false, + sizeof(struct hal_cmd_gatt_client_register_for_notification)}, + /* HAL_OP_GATT_CLIENT_DEREGISTER_FOR_NOTIFICATION */ + {handle_client_deregister_for_notification, false, + sizeof(struct hal_cmd_gatt_client_deregister_for_notification)}, + /* HAL_OP_GATT_CLIENT_READ_REMOTE_RSSI */ + {handle_client_read_remote_rssi, false, + sizeof(struct hal_cmd_gatt_client_read_remote_rssi)}, + /* HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE */ + {handle_client_get_device_type, false, + sizeof(struct hal_cmd_gatt_client_get_device_type)}, + /* HAL_OP_GATT_CLIENT_SET_ADV_DATA */ + {handle_client_set_adv_data, true, + sizeof(struct hal_cmd_gatt_client_set_adv_data)}, + /* HAL_OP_GATT_CLIENT_TEST_COMMAND */ + {handle_client_test_command, false, + sizeof(struct hal_cmd_gatt_client_test_command)}, + /* HAL_OP_GATT_SERVER_REGISTER */ + {handle_server_register, false, + sizeof(struct hal_cmd_gatt_server_register)}, + /* HAL_OP_GATT_SERVER_UNREGISTER */ + {handle_server_unregister, false, + sizeof(struct hal_cmd_gatt_server_unregister)}, + /* HAL_OP_GATT_SERVER_CONNECT */ + {handle_server_connect, false, + sizeof(struct hal_cmd_gatt_server_connect)}, + /* HAL_OP_GATT_SERVER_DISCONNECT */ + {handle_server_disconnect, false, + sizeof(struct hal_cmd_gatt_server_disconnect)}, + /* HAL_OP_GATT_SERVER_ADD_SERVICE */ + {handle_server_add_service, false, + sizeof(struct hal_cmd_gatt_server_add_service)}, + /* HAL_OP_GATT_SERVER_ADD_INC_SERVICE */ + {handle_server_add_included_service, false, + sizeof(struct hal_cmd_gatt_server_add_inc_service)}, + /* HAL_OP_GATT_SERVER_ADD_CHARACTERISTIC */ + {handle_server_add_characteristic, false, + sizeof(struct hal_cmd_gatt_server_add_characteristic)}, + /* HAL_OP_GATT_SERVER_ADD_DESCRIPTOR */ + {handle_server_add_descriptor, false, + sizeof(struct hal_cmd_gatt_server_add_descriptor)}, + /* HAL_OP_GATT_SERVER_START_SERVICE */ + {handle_server_start_service, false, + sizeof(struct hal_cmd_gatt_server_start_service)}, + /* HAL_OP_GATT_SERVER_STOP_SERVICE */ + {handle_server_stop_service, false, + sizeof(struct hal_cmd_gatt_server_stop_service)}, + /* HAL_OP_GATT_SERVER_DELETE_SERVICE */ + {handle_server_delete_service, false, + sizeof(struct hal_cmd_gatt_server_delete_service)}, + /* HAL_OP_GATT_SERVER_SEND_INDICATION */ + {handle_server_send_indication, true, + sizeof(struct hal_cmd_gatt_server_send_indication)}, + /* HAL_OP_GATT_SERVER_SEND_RESPONSE */ + {handle_server_send_response, true, + sizeof(struct hal_cmd_gatt_server_send_response)}, +}; + +bool bt_gatt_register(struct ipc *ipc, const bdaddr_t *addr) +{ + DBG(""); + + bacpy(&adapter_addr, addr); + + hal_ipc = ipc; + + conn_list = queue_new(); + if (!conn_list) { + error("gatt: Can not create conn queue"); + return false; + } + + conn_wait_queue = queue_new(); + if (!conn_wait_queue) { + error("gatt: Can not create conn queue"); + return false; + } + + ipc_register(hal_ipc, HAL_SERVICE_ID_GATT, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); + + gatt_clients = queue_new(); + if (!gatt_clients) { + error("gatt: Cannot allocate gatt_clients"); + return false; + } + + return true; +} + +void bt_gatt_unregister(void) +{ + DBG(""); + + queue_destroy(gatt_clients, free); + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_GATT); + hal_ipc = NULL; + + queue_destroy(conn_list, destroy_device); + conn_list = NULL; + + queue_destroy(conn_wait_queue, destroy_device); + conn_wait_queue = NULL; + +}
diff --git a/bluez/android/gatt.h b/bluez/android/gatt.h new file mode 100644 index 0000000..d4392d9 --- /dev/null +++ b/bluez/android/gatt.h
@@ -0,0 +1,25 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +bool bt_gatt_register(struct ipc *ipc, const bdaddr_t *addr); +void bt_gatt_unregister(void);
diff --git a/bluez/android/hal-a2dp.c b/bluez/android/hal-a2dp.c new file mode 100644 index 0000000..ac495a1 --- /dev/null +++ b/bluez/android/hal-a2dp.c
@@ -0,0 +1,155 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdbool.h> +#include <stddef.h> +#include <string.h> + +#include "hal-log.h" +#include "hal.h" +#include "hal-msg.h" +#include "hal-ipc.h" + +static const btav_callbacks_t *cbs = NULL; + +static bool interface_ready(void) +{ + return cbs != NULL; +} + +static void handle_conn_state(void *buf, uint16_t len) +{ + struct hal_ev_a2dp_conn_state *ev = buf; + + if (cbs->connection_state_cb) + cbs->connection_state_cb(ev->state, + (bt_bdaddr_t *) (ev->bdaddr)); +} + +static void handle_audio_state(void *buf, uint16_t len) +{ + struct hal_ev_a2dp_audio_state *ev = buf; + + if (cbs->audio_state_cb) + cbs->audio_state_cb(ev->state, (bt_bdaddr_t *)(ev->bdaddr)); +} + +/* handlers will be called from notification thread context, + * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ +static const struct hal_ipc_handler ev_handlers[] = { + { /* HAL_EV_A2DP_CONN_STATE */ + .handler = handle_conn_state, + .var_len = false, + .data_len = sizeof(struct hal_ev_a2dp_conn_state), + }, + { /* HAL_EV_A2DP_AUDIO_STATE */ + .handler = handle_audio_state, + .var_len = false, + .data_len = sizeof(struct hal_ev_a2dp_audio_state), + }, +}; + +static bt_status_t a2dp_connect(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_a2dp_connect cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_A2DP, HAL_OP_A2DP_CONNECT, + sizeof(cmd), &cmd, NULL, NULL, NULL); +} + +static bt_status_t disconnect(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_a2dp_disconnect cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_A2DP, HAL_OP_A2DP_DISCONNECT, + sizeof(cmd), &cmd, NULL, NULL, NULL); +} + +static bt_status_t init(btav_callbacks_t *callbacks) +{ + struct hal_cmd_register_module cmd; + int ret; + + DBG(""); + + if (interface_ready()) + return BT_STATUS_DONE; + + cbs = callbacks; + + hal_ipc_register(HAL_SERVICE_ID_A2DP, ev_handlers, + sizeof(ev_handlers)/sizeof(ev_handlers[0])); + + cmd.service_id = HAL_SERVICE_ID_A2DP; + cmd.mode = HAL_MODE_DEFAULT; + + ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + if (ret != BT_STATUS_SUCCESS) { + cbs = NULL; + hal_ipc_unregister(HAL_SERVICE_ID_A2DP); + } + + return ret; +} + +static void cleanup() +{ + struct hal_cmd_unregister_module cmd; + + DBG(""); + + if (!interface_ready()) + return; + + cbs = NULL; + + cmd.service_id = HAL_SERVICE_ID_A2DP; + + hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + hal_ipc_unregister(HAL_SERVICE_ID_A2DP); +} + +static btav_interface_t iface = { + .size = sizeof(iface), + .init = init, + .connect = a2dp_connect, + .disconnect = disconnect, + .cleanup = cleanup +}; + +btav_interface_t *bt_get_a2dp_interface() +{ + return &iface; +}
diff --git a/bluez/android/hal-audio.c b/bluez/android/hal-audio.c new file mode 100644 index 0000000..00dde49 --- /dev/null +++ b/bluez/android/hal-audio.c
@@ -0,0 +1,1743 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <errno.h> +#include <pthread.h> +#include <poll.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/socket.h> +#include <sys/un.h> +#include <unistd.h> +#include <arpa/inet.h> +#include <fcntl.h> + +#include <hardware/audio.h> +#include <hardware/hardware.h> + +#include <sbc/sbc.h> + +#include "audio-msg.h" +#include "ipc-common.h" +#include "hal-log.h" +#include "hal-msg.h" +#include "../profiles/audio/a2dp-codecs.h" +#include "../src/shared/util.h" + +#define FIXED_A2DP_PLAYBACK_LATENCY_MS 25 + +#define FIXED_BUFFER_SIZE (20 * 512) + +#define MAX_FRAMES_IN_PAYLOAD 15 + +static const uint8_t a2dp_src_uuid[] = { + 0x00, 0x00, 0x11, 0x0a, 0x00, 0x00, 0x10, 0x00, + 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb }; + +static int listen_sk = -1; +static int audio_sk = -1; + +static pthread_t ipc_th = 0; +static pthread_mutex_t sk_mutex = PTHREAD_MUTEX_INITIALIZER; + +#if __BYTE_ORDER == __LITTLE_ENDIAN + +struct rtp_header { + unsigned cc:4; + unsigned x:1; + unsigned p:1; + unsigned v:2; + + unsigned pt:7; + unsigned m:1; + + uint16_t sequence_number; + uint32_t timestamp; + uint32_t ssrc; + uint32_t csrc[0]; +} __attribute__ ((packed)); + +struct rtp_payload { + unsigned frame_count:4; + unsigned rfa0:1; + unsigned is_last_fragment:1; + unsigned is_first_fragment:1; + unsigned is_fragmented:1; +} __attribute__ ((packed)); + +#elif __BYTE_ORDER == __BIG_ENDIAN + +struct rtp_header { + unsigned v:2; + unsigned p:1; + unsigned x:1; + unsigned cc:4; + + unsigned m:1; + unsigned pt:7; + + uint16_t sequence_number; + uint32_t timestamp; + uint32_t ssrc; + uint32_t csrc[0]; +} __attribute__ ((packed)); + +struct rtp_payload { + unsigned is_fragmented:1; + unsigned is_first_fragment:1; + unsigned is_last_fragment:1; + unsigned rfa0:1; + unsigned frame_count:4; +} __attribute__ ((packed)); + +#else +#error "Unknown byte order" +#endif + +struct media_packet { + struct rtp_header hdr; + struct rtp_payload payload; + uint8_t data[0]; +}; + +struct audio_input_config { + uint32_t rate; + uint32_t channels; + audio_format_t format; +}; + +struct sbc_data { + a2dp_sbc_t sbc; + + sbc_t enc; + + size_t in_frame_len; + size_t in_buf_size; + + size_t out_frame_len; + + unsigned frame_duration; + unsigned frames_per_packet; +}; + +static inline void timespec_diff(struct timespec *a, struct timespec *b, + struct timespec *res) +{ + res->tv_sec = a->tv_sec - b->tv_sec; + res->tv_nsec = a->tv_nsec - b->tv_nsec; + + if (res->tv_nsec < 0) { + res->tv_sec--; + res->tv_nsec += 1000000000; /* 1sec */ + } +} + +static void timespec_add(struct timespec *base, uint64_t time_us, + struct timespec *res) +{ + res->tv_sec = base->tv_sec + time_us / 1000000; + res->tv_nsec = base->tv_nsec + (time_us % 1000000) * 1000; + + if (res->tv_nsec >= 1000000000) { + res->tv_sec++; + res->tv_nsec -= 1000000000; + } +} + +#if defined(ANDROID) +/* Bionic does not have clock_nanosleep() prototype in time.h even though + * it provides its implementation. + */ +extern int clock_nanosleep(clockid_t clock_id, int flags, + const struct timespec *request, + struct timespec *remain); +#endif + +static int sbc_get_presets(struct audio_preset *preset, size_t *len); +static int sbc_codec_init(struct audio_preset *preset, uint16_t mtu, + void **codec_data); +static int sbc_cleanup(void *codec_data); +static int sbc_get_config(void *codec_data, struct audio_input_config *config); +static size_t sbc_get_buffer_size(void *codec_data); +static size_t sbc_get_mediapacket_duration(void *codec_data); +static ssize_t sbc_encode_mediapacket(void *codec_data, const uint8_t *buffer, + size_t len, struct media_packet *mp, + size_t mp_data_len, size_t *written); + +struct audio_codec { + uint8_t type; + + int (*get_presets) (struct audio_preset *preset, size_t *len); + + int (*init) (struct audio_preset *preset, uint16_t mtu, + void **codec_data); + int (*cleanup) (void *codec_data); + int (*get_config) (void *codec_data, + struct audio_input_config *config); + size_t (*get_buffer_size) (void *codec_data); + size_t (*get_mediapacket_duration) (void *codec_data); + ssize_t (*encode_mediapacket) (void *codec_data, const uint8_t *buffer, + size_t len, struct media_packet *mp, + size_t mp_data_len, size_t *written); +}; + +static const struct audio_codec audio_codecs[] = { + { + .type = A2DP_CODEC_SBC, + + .get_presets = sbc_get_presets, + + .init = sbc_codec_init, + .cleanup = sbc_cleanup, + .get_config = sbc_get_config, + .get_buffer_size = sbc_get_buffer_size, + .get_mediapacket_duration = sbc_get_mediapacket_duration, + .encode_mediapacket = sbc_encode_mediapacket, + } +}; + +#define NUM_CODECS (sizeof(audio_codecs) / sizeof(audio_codecs[0])) + +#define MAX_AUDIO_ENDPOINTS NUM_CODECS + +struct audio_endpoint { + uint8_t id; + const struct audio_codec *codec; + void *codec_data; + int fd; + + struct media_packet *mp; + size_t mp_data_len; + + uint16_t seq; + uint32_t samples; + struct timespec start; +}; + +static struct audio_endpoint audio_endpoints[MAX_AUDIO_ENDPOINTS]; + +enum a2dp_state_t { + AUDIO_A2DP_STATE_NONE, + AUDIO_A2DP_STATE_STANDBY, + AUDIO_A2DP_STATE_SUSPENDED, + AUDIO_A2DP_STATE_STARTED +}; + +struct a2dp_stream_out { + struct audio_stream_out stream; + + struct audio_endpoint *ep; + enum a2dp_state_t audio_state; + struct audio_input_config cfg; + + uint8_t *downmix_buf; +}; + +struct a2dp_audio_dev { + struct audio_hw_device dev; + struct a2dp_stream_out *out; +}; + +static const a2dp_sbc_t sbc_presets[] = { + { + .frequency = SBC_SAMPLING_FREQ_44100 | SBC_SAMPLING_FREQ_48000, + .channel_mode = SBC_CHANNEL_MODE_MONO | + SBC_CHANNEL_MODE_DUAL_CHANNEL | + SBC_CHANNEL_MODE_STEREO | + SBC_CHANNEL_MODE_JOINT_STEREO, + .subbands = SBC_SUBBANDS_4 | SBC_SUBBANDS_8, + .allocation_method = SBC_ALLOCATION_SNR | + SBC_ALLOCATION_LOUDNESS, + .block_length = SBC_BLOCK_LENGTH_4 | SBC_BLOCK_LENGTH_8 | + SBC_BLOCK_LENGTH_12 | SBC_BLOCK_LENGTH_16, + .min_bitpool = MIN_BITPOOL, + .max_bitpool = MAX_BITPOOL + }, + { + .frequency = SBC_SAMPLING_FREQ_44100, + .channel_mode = SBC_CHANNEL_MODE_JOINT_STEREO, + .subbands = SBC_SUBBANDS_8, + .allocation_method = SBC_ALLOCATION_LOUDNESS, + .block_length = SBC_BLOCK_LENGTH_16, + .min_bitpool = MIN_BITPOOL, + .max_bitpool = MAX_BITPOOL + }, + { + .frequency = SBC_SAMPLING_FREQ_48000, + .channel_mode = SBC_CHANNEL_MODE_JOINT_STEREO, + .subbands = SBC_SUBBANDS_8, + .allocation_method = SBC_ALLOCATION_LOUDNESS, + .block_length = SBC_BLOCK_LENGTH_16, + .min_bitpool = MIN_BITPOOL, + .max_bitpool = MAX_BITPOOL + }, +}; + +static int sbc_get_presets(struct audio_preset *preset, size_t *len) +{ + int i; + int count; + size_t new_len = 0; + uint8_t *ptr = (uint8_t *) preset; + size_t preset_size = sizeof(*preset) + sizeof(a2dp_sbc_t); + + count = sizeof(sbc_presets) / sizeof(sbc_presets[0]); + + for (i = 0; i < count; i++) { + preset = (struct audio_preset *) ptr; + + if (new_len + preset_size > *len) + break; + + preset->len = sizeof(a2dp_sbc_t); + memcpy(preset->data, &sbc_presets[i], preset->len); + + new_len += preset_size; + ptr += preset_size; + } + + *len = new_len; + + return i; +} + +static int sbc_freq2int(uint8_t freq) +{ + switch (freq) { + case SBC_SAMPLING_FREQ_16000: + return 16000; + case SBC_SAMPLING_FREQ_32000: + return 32000; + case SBC_SAMPLING_FREQ_44100: + return 44100; + case SBC_SAMPLING_FREQ_48000: + return 48000; + default: + return 0; + } +} + +static const char *sbc_mode2str(uint8_t mode) +{ + switch (mode) { + case SBC_CHANNEL_MODE_MONO: + return "Mono"; + case SBC_CHANNEL_MODE_DUAL_CHANNEL: + return "DualChannel"; + case SBC_CHANNEL_MODE_STEREO: + return "Stereo"; + case SBC_CHANNEL_MODE_JOINT_STEREO: + return "JointStereo"; + default: + return "(unknown)"; + } +} + +static int sbc_blocks2int(uint8_t blocks) +{ + switch (blocks) { + case SBC_BLOCK_LENGTH_4: + return 4; + case SBC_BLOCK_LENGTH_8: + return 8; + case SBC_BLOCK_LENGTH_12: + return 12; + case SBC_BLOCK_LENGTH_16: + return 16; + default: + return 0; + } +} + +static int sbc_subbands2int(uint8_t subbands) +{ + switch (subbands) { + case SBC_SUBBANDS_4: + return 4; + case SBC_SUBBANDS_8: + return 8; + default: + return 0; + } +} + +static const char *sbc_allocation2str(uint8_t allocation) +{ + switch (allocation) { + case SBC_ALLOCATION_SNR: + return "SNR"; + case SBC_ALLOCATION_LOUDNESS: + return "Loudness"; + default: + return "(unknown)"; + } +} + +static void sbc_init_encoder(struct sbc_data *sbc_data) +{ + a2dp_sbc_t *in = &sbc_data->sbc; + sbc_t *out = &sbc_data->enc; + + sbc_init_a2dp(out, 0L, in, sizeof(*in)); + + out->endian = SBC_LE; + out->bitpool = in->max_bitpool; + + DBG("frequency=%d channel_mode=%s block_length=%d subbands=%d " + "allocation=%s bitpool=%d-%d", + sbc_freq2int(in->frequency), + sbc_mode2str(in->channel_mode), + sbc_blocks2int(in->block_length), + sbc_subbands2int(in->subbands), + sbc_allocation2str(in->allocation_method), + in->min_bitpool, in->max_bitpool); +} + +static int sbc_codec_init(struct audio_preset *preset, uint16_t payload_len, + void **codec_data) +{ + struct sbc_data *sbc_data; + size_t in_frame_len; + size_t out_frame_len; + size_t num_frames; + + if (preset->len != sizeof(a2dp_sbc_t)) { + error("SBC: preset size mismatch"); + return AUDIO_STATUS_FAILED; + } + + sbc_data = calloc(sizeof(struct sbc_data), 1); + if (!sbc_data) + return AUDIO_STATUS_FAILED; + + memcpy(&sbc_data->sbc, preset->data, preset->len); + + sbc_init_encoder(sbc_data); + + in_frame_len = sbc_get_codesize(&sbc_data->enc); + out_frame_len = sbc_get_frame_length(&sbc_data->enc); + num_frames = payload_len / out_frame_len; + + sbc_data->in_frame_len = in_frame_len; + sbc_data->in_buf_size = num_frames * in_frame_len; + + sbc_data->out_frame_len = out_frame_len; + + sbc_data->frame_duration = sbc_get_frame_duration(&sbc_data->enc); + sbc_data->frames_per_packet = num_frames; + + DBG("in_frame_len=%zu out_frame_len=%zu frames_per_packet=%zu", + in_frame_len, out_frame_len, num_frames); + + *codec_data = sbc_data; + + return AUDIO_STATUS_SUCCESS; +} + +static int sbc_cleanup(void *codec_data) +{ + struct sbc_data *sbc_data = (struct sbc_data *) codec_data; + + sbc_finish(&sbc_data->enc); + free(codec_data); + + return AUDIO_STATUS_SUCCESS; +} + +static int sbc_get_config(void *codec_data, struct audio_input_config *config) +{ + struct sbc_data *sbc_data = (struct sbc_data *) codec_data; + + switch (sbc_data->sbc.frequency) { + case SBC_SAMPLING_FREQ_16000: + config->rate = 16000; + break; + case SBC_SAMPLING_FREQ_32000: + config->rate = 32000; + break; + case SBC_SAMPLING_FREQ_44100: + config->rate = 44100; + break; + case SBC_SAMPLING_FREQ_48000: + config->rate = 48000; + break; + default: + return AUDIO_STATUS_FAILED; + } + config->channels = sbc_data->sbc.channel_mode == SBC_CHANNEL_MODE_MONO ? + AUDIO_CHANNEL_OUT_MONO : + AUDIO_CHANNEL_OUT_STEREO; + config->format = AUDIO_FORMAT_PCM_16_BIT; + + return AUDIO_STATUS_SUCCESS; +} + +static size_t sbc_get_buffer_size(void *codec_data) +{ + struct sbc_data *sbc_data = (struct sbc_data *) codec_data; + + return sbc_data->in_buf_size; +} + +static size_t sbc_get_mediapacket_duration(void *codec_data) +{ + struct sbc_data *sbc_data = (struct sbc_data *) codec_data; + + return sbc_data->frame_duration * sbc_data->frames_per_packet; +} + +static ssize_t sbc_encode_mediapacket(void *codec_data, const uint8_t *buffer, + size_t len, struct media_packet *mp, + size_t mp_data_len, size_t *written) +{ + struct sbc_data *sbc_data = (struct sbc_data *) codec_data; + size_t consumed = 0; + size_t encoded = 0; + uint8_t frame_count = 0; + + while (len - consumed >= sbc_data->in_frame_len && + mp_data_len - encoded >= sbc_data->out_frame_len && + frame_count < MAX_FRAMES_IN_PAYLOAD) { + ssize_t read; + ssize_t written = 0; + + read = sbc_encode(&sbc_data->enc, buffer + consumed, + sbc_data->in_frame_len, mp->data + encoded, + mp_data_len - encoded, &written); + + if (read < 0) { + error("SBC: failed to encode block at frame %d (%zd)", + frame_count, read); + break; + } + + frame_count++; + consumed += read; + encoded += written; + } + + *written = encoded; + mp->payload.frame_count = frame_count; + + return consumed; +} + +static int audio_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len, + void *param, size_t *rsp_len, void *rsp, int *fd) +{ + ssize_t ret; + struct msghdr msg; + struct iovec iv[2]; + struct ipc_hdr cmd; + char cmsgbuf[CMSG_SPACE(sizeof(int))]; + struct ipc_status s; + size_t s_len = sizeof(s); + + pthread_mutex_lock(&sk_mutex); + + if (audio_sk < 0) { + error("audio: Invalid cmd socket passed to audio_ipc_cmd"); + goto failed; + } + + if (!rsp || !rsp_len) { + memset(&s, 0, s_len); + rsp_len = &s_len; + rsp = &s; + } + + memset(&msg, 0, sizeof(msg)); + memset(&cmd, 0, sizeof(cmd)); + + cmd.service_id = service_id; + cmd.opcode = opcode; + cmd.len = len; + + iv[0].iov_base = &cmd; + iv[0].iov_len = sizeof(cmd); + + iv[1].iov_base = param; + iv[1].iov_len = len; + + msg.msg_iov = iv; + msg.msg_iovlen = 2; + + ret = sendmsg(audio_sk, &msg, 0); + if (ret < 0) { + error("audio: Sending command failed:%s", strerror(errno)); + goto failed; + } + + /* socket was shutdown */ + if (ret == 0) { + error("audio: Command socket closed"); + goto failed; + } + + memset(&msg, 0, sizeof(msg)); + memset(&cmd, 0, sizeof(cmd)); + + iv[0].iov_base = &cmd; + iv[0].iov_len = sizeof(cmd); + + iv[1].iov_base = rsp; + iv[1].iov_len = *rsp_len; + + msg.msg_iov = iv; + msg.msg_iovlen = 2; + + if (fd) { + memset(cmsgbuf, 0, sizeof(cmsgbuf)); + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); + } + + ret = recvmsg(audio_sk, &msg, 0); + if (ret < 0) { + error("audio: Receiving command response failed:%s", + strerror(errno)); + goto failed; + } + + if (ret < (ssize_t) sizeof(cmd)) { + error("audio: Too small response received(%zd bytes)", ret); + goto failed; + } + + if (cmd.service_id != service_id) { + error("audio: Invalid service id (%u vs %u)", cmd.service_id, + service_id); + goto failed; + } + + if (ret != (ssize_t) (sizeof(cmd) + cmd.len)) { + error("audio: Malformed response received(%zd bytes)", ret); + goto failed; + } + + if (cmd.opcode != opcode && cmd.opcode != AUDIO_OP_STATUS) { + error("audio: Invalid opcode received (%u vs %u)", + cmd.opcode, opcode); + goto failed; + } + + if (cmd.opcode == AUDIO_OP_STATUS) { + struct ipc_status *s = rsp; + + if (sizeof(*s) != cmd.len) { + error("audio: Invalid status length"); + goto failed; + } + + if (s->code == AUDIO_STATUS_SUCCESS) { + error("audio: Invalid success status response"); + goto failed; + } + + pthread_mutex_unlock(&sk_mutex); + + return s->code; + } + + pthread_mutex_unlock(&sk_mutex); + + /* Receive auxiliary data in msg */ + if (fd) { + struct cmsghdr *cmsg; + + *fd = -1; + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET + && cmsg->cmsg_type == SCM_RIGHTS) { + memcpy(fd, CMSG_DATA(cmsg), sizeof(int)); + break; + } + } + + if (*fd < 0) + goto failed; + } + + if (rsp_len) + *rsp_len = cmd.len; + + return AUDIO_STATUS_SUCCESS; + +failed: + /* Some serious issue happen on IPC - recover */ + shutdown(audio_sk, SHUT_RDWR); + pthread_mutex_unlock(&sk_mutex); + + return AUDIO_STATUS_FAILED; +} + +static int ipc_open_cmd(const struct audio_codec *codec) +{ + uint8_t buf[BLUEZ_AUDIO_MTU]; + struct audio_cmd_open *cmd = (struct audio_cmd_open *) buf; + struct audio_rsp_open rsp; + size_t cmd_len = sizeof(buf) - sizeof(*cmd); + size_t rsp_len = sizeof(rsp); + int result; + + DBG(""); + + memcpy(cmd->uuid, a2dp_src_uuid, sizeof(a2dp_src_uuid)); + + cmd->codec = codec->type; + cmd->presets = codec->get_presets(cmd->preset, &cmd_len); + + cmd_len += sizeof(*cmd); + + result = audio_ipc_cmd(AUDIO_SERVICE_ID, AUDIO_OP_OPEN, cmd_len, cmd, + &rsp_len, &rsp, NULL); + + if (result != AUDIO_STATUS_SUCCESS) + return 0; + + return rsp.id; +} + +static int ipc_close_cmd(uint8_t endpoint_id) +{ + struct audio_cmd_close cmd; + int result; + + DBG(""); + + cmd.id = endpoint_id; + + result = audio_ipc_cmd(AUDIO_SERVICE_ID, AUDIO_OP_CLOSE, + sizeof(cmd), &cmd, NULL, NULL, NULL); + + return result; +} + +static int ipc_open_stream_cmd(uint8_t endpoint_id, uint16_t *mtu, int *fd, + struct audio_preset **caps) +{ + char buf[BLUEZ_AUDIO_MTU]; + struct audio_cmd_open_stream cmd; + struct audio_rsp_open_stream *rsp = + (struct audio_rsp_open_stream *) &buf; + size_t rsp_len = sizeof(buf); + int result; + + DBG(""); + + if (!caps) + return AUDIO_STATUS_FAILED; + + cmd.id = endpoint_id; + + result = audio_ipc_cmd(AUDIO_SERVICE_ID, AUDIO_OP_OPEN_STREAM, + sizeof(cmd), &cmd, &rsp_len, rsp, fd); + if (result == AUDIO_STATUS_SUCCESS) { + size_t buf_len = sizeof(struct audio_preset) + + rsp->preset[0].len; + *mtu = rsp->mtu; + *caps = malloc(buf_len); + memcpy(*caps, &rsp->preset, buf_len); + } else { + *caps = NULL; + } + + return result; +} + +static int ipc_close_stream_cmd(uint8_t endpoint_id) +{ + struct audio_cmd_close_stream cmd; + int result; + + DBG(""); + + cmd.id = endpoint_id; + + result = audio_ipc_cmd(AUDIO_SERVICE_ID, AUDIO_OP_CLOSE_STREAM, + sizeof(cmd), &cmd, NULL, NULL, NULL); + + return result; +} + +static int ipc_resume_stream_cmd(uint8_t endpoint_id) +{ + struct audio_cmd_resume_stream cmd; + int result; + + DBG(""); + + cmd.id = endpoint_id; + + result = audio_ipc_cmd(AUDIO_SERVICE_ID, AUDIO_OP_RESUME_STREAM, + sizeof(cmd), &cmd, NULL, NULL, NULL); + + return result; +} + +static int ipc_suspend_stream_cmd(uint8_t endpoint_id) +{ + struct audio_cmd_suspend_stream cmd; + int result; + + DBG(""); + + cmd.id = endpoint_id; + + result = audio_ipc_cmd(AUDIO_SERVICE_ID, AUDIO_OP_SUSPEND_STREAM, + sizeof(cmd), &cmd, NULL, NULL, NULL); + + return result; +} + +static int register_endpoints(void) +{ + struct audio_endpoint *ep = &audio_endpoints[0]; + size_t i; + + for (i = 0; i < NUM_CODECS; i++, ep++) { + const struct audio_codec *codec = &audio_codecs[i]; + + ep->id = ipc_open_cmd(codec); + + if (!ep->id) + return AUDIO_STATUS_FAILED; + + ep->codec = codec; + ep->codec_data = NULL; + ep->fd = -1; + } + + return AUDIO_STATUS_SUCCESS; +} + +static void unregister_endpoints(void) +{ + size_t i; + + for (i = 0; i < MAX_AUDIO_ENDPOINTS; i++) { + struct audio_endpoint *ep = &audio_endpoints[i]; + + if (ep->id) { + ipc_close_cmd(ep->id); + memset(ep, 0, sizeof(*ep)); + } + } +} + +static int set_blocking(int fd) +{ + int flags; + + flags = fcntl(fd, F_GETFL, 0); + if (flags < 0) { + int err = -errno; + error("fcntl(F_GETFL): %s (%d)", strerror(-err), -err); + return err; + } + + if (fcntl(fd, F_SETFL, flags & ~O_NONBLOCK) < 0) { + int err = -errno; + error("fcntl(F_SETFL): %s (%d)", strerror(-err), -err); + return err; + } + + return 0; +} + +static bool open_endpoint(struct audio_endpoint *ep, + struct audio_input_config *cfg) +{ + struct audio_preset *preset; + const struct audio_codec *codec; + uint16_t mtu; + uint16_t payload_len; + int fd; + + if (ipc_open_stream_cmd(ep->id, &mtu, &fd, &preset) != + AUDIO_STATUS_SUCCESS) + return false; + + if (set_blocking(fd) < 0) + goto failed; + + DBG("mtu=%u", mtu); + + payload_len = mtu - sizeof(*ep->mp); + + ep->fd = fd; + + codec = ep->codec; + codec->init(preset, payload_len, &ep->codec_data); + codec->get_config(ep->codec_data, cfg); + + ep->mp = calloc(mtu, 1); + if (!ep->mp) + goto failed; + ep->mp->hdr.v = 2; + ep->mp->hdr.pt = 1; + ep->mp->hdr.ssrc = htonl(1); + + ep->mp_data_len = payload_len; + + free(preset); + + return true; + +failed: + close(fd); + free(preset); + + return false; +} + +static void close_endpoint(struct audio_endpoint *ep) +{ + ipc_close_stream_cmd(ep->id); + if (ep->fd >= 0) { + close(ep->fd); + ep->fd = -1; + } + + free(ep->mp); + + ep->codec->cleanup(ep->codec_data); + ep->codec_data = NULL; +} + +static void downmix_to_mono(struct a2dp_stream_out *out, const uint8_t *buffer, + size_t bytes) +{ + const int16_t *input = (const void *) buffer; + int16_t *output = (void *) out->downmix_buf; + size_t i; + + for (i = 0; i < bytes / 2; i++) { + int16_t l = le16_to_cpu(get_unaligned(&input[i * 2])); + int16_t r = le16_to_cpu(get_unaligned(&input[i * 2 + 1])); + + put_unaligned(cpu_to_le16((l + r) / 2), &output[i]); + } +} + +static bool write_data(struct a2dp_stream_out *out, const void *buffer, + size_t bytes) +{ + struct audio_endpoint *ep = out->ep; + struct media_packet *mp = (struct media_packet *) ep->mp; + size_t free_space = ep->mp_data_len; + size_t consumed = 0; + + while (consumed < bytes) { + size_t written = 0; + ssize_t read; + uint32_t samples; + int ret; + uint64_t time_us; + struct timespec anchor; + + time_us = ep->samples * 1000000ll / out->cfg.rate; + + timespec_add(&ep->start, time_us, &anchor); + + while (true) { + ret = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, + &anchor, NULL); + + if (!ret) + break; + + if (ret != EINTR) { + error("clock_nanosleep failed (%d)", ret); + return false; + } + } + + read = ep->codec->encode_mediapacket(ep->codec_data, + buffer + consumed, + bytes - consumed, mp, + free_space, &written); + + /* This is non-fatal and we can just assume buffer was processed + * properly and wait for next one. + */ + if (read <= 0) + return true; + + consumed += read; + + mp->hdr.sequence_number = htons(ep->seq++); + mp->hdr.timestamp = htonl(ep->samples); + + /* AudioFlinger provides 16bit PCM, so sample size is 2 bytes + * multipled by number of channels. Number of channels is simply + * number of bits set in channels mask. + */ + samples = read / (2 * popcount(out->cfg.channels)); + ep->samples += samples; + + while (true) { + ret = write(ep->fd, mp, sizeof(*mp) + written); + + if (ret >= 0) + break; + + if (errno != EINTR) + return false; + } + } + + return true; +} + +static ssize_t out_write(struct audio_stream_out *stream, const void *buffer, + size_t bytes) +{ + struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream; + const void *in_buf = buffer; + size_t in_len = bytes; + + /* just return in case we're closing */ + if (out->audio_state == AUDIO_A2DP_STATE_NONE) + return -1; + + /* We can auto-start only from standby */ + if (out->audio_state == AUDIO_A2DP_STATE_STANDBY) { + DBG("stream in standby, auto-start"); + + if (ipc_resume_stream_cmd(out->ep->id) != AUDIO_STATUS_SUCCESS) + return -1; + + clock_gettime(CLOCK_MONOTONIC, &out->ep->start); + out->ep->samples = 0; + + out->audio_state = AUDIO_A2DP_STATE_STARTED; + } + + if (out->audio_state != AUDIO_A2DP_STATE_STARTED) { + error("audio: stream not started"); + return -1; + } + + if (out->ep->fd < 0) { + error("audio: no transport socket"); + return -1; + } + + /* currently Android audioflinger is not able to provide mono stream on + * A2DP output so down mixing needs to be done in hal-audio plugin. + * + * for reference see + * AudioFlinger::PlaybackThread::readOutputParameters() + * frameworks/av/services/audioflinger/Threads.cpp:1631 + */ + if (out->cfg.channels == AUDIO_CHANNEL_OUT_MONO) { + if (!out->downmix_buf) { + error("audio: downmix buffer not initialized"); + return -1; + } + + downmix_to_mono(out, buffer, bytes); + + in_buf = out->downmix_buf; + in_len = bytes / 2; + } + + if (!write_data(out, in_buf, in_len)) + return -1; + + return bytes; +} + +static uint32_t out_get_sample_rate(const struct audio_stream *stream) +{ + struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream; + + DBG(""); + + return out->cfg.rate; +} + +static int out_set_sample_rate(struct audio_stream *stream, uint32_t rate) +{ + struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream; + + DBG(""); + + if (rate != out->cfg.rate) { + warn("audio: cannot set sample rate to %d", rate); + return -1; + } + + return 0; +} + +static size_t out_get_buffer_size(const struct audio_stream *stream) +{ + DBG(""); + + /* We should return proper buffer size calculated by codec (so each + * input buffer is encoded into single media packed) but this does not + * work well with AudioFlinger and causes problems. For this reason we + * use magic value here and out_write code takes care of splitting + * input buffer into multiple media packets. + */ + return FIXED_BUFFER_SIZE; +} + +static uint32_t out_get_channels(const struct audio_stream *stream) +{ + DBG(""); + + /* AudioFlinger can only provide stereo stream, so we return it here and + * later we'll downmix this to mono in case codec requires it + */ + + return AUDIO_CHANNEL_OUT_STEREO; +} + +static audio_format_t out_get_format(const struct audio_stream *stream) +{ + struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream; + + DBG(""); + + return out->cfg.format; +} + +static int out_set_format(struct audio_stream *stream, audio_format_t format) +{ + DBG(""); + return -ENOSYS; +} + +static int out_standby(struct audio_stream *stream) +{ + struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream; + + DBG(""); + + if (out->audio_state == AUDIO_A2DP_STATE_STARTED) { + if (ipc_suspend_stream_cmd(out->ep->id) != AUDIO_STATUS_SUCCESS) + return -1; + out->audio_state = AUDIO_A2DP_STATE_STANDBY; + } + + return 0; +} + +static int out_dump(const struct audio_stream *stream, int fd) +{ + DBG(""); + return -ENOSYS; +} + +static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) +{ + struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream; + char *kvpair; + char *str; + char *saveptr; + bool enter_suspend = false; + bool exit_suspend = false; + + DBG("%s", kvpairs); + + str = strdup(kvpairs); + kvpair = strtok_r(str, ";", &saveptr); + + for (; kvpair && *kvpair; kvpair = strtok_r(NULL, ";", &saveptr)) { + char *keyval; + + keyval = strchr(kvpair, '='); + if (!keyval) + continue; + + *keyval = '\0'; + keyval++; + + if (!strcmp(kvpair, "closing")) { + if (!strcmp(keyval, "true")) + out->audio_state = AUDIO_A2DP_STATE_NONE; + } else if (!strcmp(kvpair, "A2dpSuspended")) { + if (!strcmp(keyval, "true")) + enter_suspend = true; + else + exit_suspend = true; + } + } + + free(str); + + if (enter_suspend && out->audio_state == AUDIO_A2DP_STATE_STARTED) { + if (ipc_suspend_stream_cmd(out->ep->id) != AUDIO_STATUS_SUCCESS) + return -1; + out->audio_state = AUDIO_A2DP_STATE_SUSPENDED; + } + + if (exit_suspend && out->audio_state == AUDIO_A2DP_STATE_SUSPENDED) + out->audio_state = AUDIO_A2DP_STATE_STANDBY; + + return 0; +} + +static char *out_get_parameters(const struct audio_stream *stream, + const char *keys) +{ + DBG(""); + return strdup(""); +} + +static uint32_t out_get_latency(const struct audio_stream_out *stream) +{ + struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream; + struct audio_endpoint *ep = out->ep; + size_t pkt_duration; + + DBG(""); + + pkt_duration = ep->codec->get_mediapacket_duration(ep->codec_data); + + return FIXED_A2DP_PLAYBACK_LATENCY_MS + pkt_duration / 1000; +} + +static int out_set_volume(struct audio_stream_out *stream, float left, + float right) +{ + DBG(""); + /* volume controlled in audioflinger mixer (digital) */ + return -ENOSYS; +} + +static int out_get_render_position(const struct audio_stream_out *stream, + uint32_t *dsp_frames) +{ + DBG(""); + return -ENOSYS; +} + +static int out_add_audio_effect(const struct audio_stream *stream, + effect_handle_t effect) +{ + DBG(""); + return -ENOSYS; +} + +static int out_remove_audio_effect(const struct audio_stream *stream, + effect_handle_t effect) +{ + DBG(""); + return -ENOSYS; +} + +static uint32_t in_get_sample_rate(const struct audio_stream *stream) +{ + DBG(""); + return -ENOSYS; +} + +static int in_set_sample_rate(struct audio_stream *stream, uint32_t rate) +{ + DBG(""); + return -ENOSYS; +} + +static size_t in_get_buffer_size(const struct audio_stream *stream) +{ + DBG(""); + return -ENOSYS; +} + +static uint32_t in_get_channels(const struct audio_stream *stream) +{ + DBG(""); + return -ENOSYS; +} + +static audio_format_t in_get_format(const struct audio_stream *stream) +{ + DBG(""); + return -ENOSYS; +} + +static int in_set_format(struct audio_stream *stream, audio_format_t format) +{ + DBG(""); + return -ENOSYS; +} + +static int in_standby(struct audio_stream *stream) +{ + DBG(""); + return -ENOSYS; +} + +static int in_dump(const struct audio_stream *stream, int fd) +{ + DBG(""); + return -ENOSYS; +} + +static int in_set_parameters(struct audio_stream *stream, const char *kvpairs) +{ + DBG(""); + return -ENOSYS; +} + +static char *in_get_parameters(const struct audio_stream *stream, + const char *keys) +{ + DBG(""); + return strdup(""); +} + +static int in_set_gain(struct audio_stream_in *stream, float gain) +{ + DBG(""); + return -ENOSYS; +} + +static ssize_t in_read(struct audio_stream_in *stream, void *buffer, + size_t bytes) +{ + DBG(""); + return -ENOSYS; +} + +static uint32_t in_get_input_frames_lost(struct audio_stream_in *stream) +{ + DBG(""); + return -ENOSYS; +} + +static int in_add_audio_effect(const struct audio_stream *stream, + effect_handle_t effect) +{ + DBG(""); + return -ENOSYS; +} + +static int in_remove_audio_effect(const struct audio_stream *stream, + effect_handle_t effect) +{ + DBG(""); + return -ENOSYS; +} + +static int audio_open_output_stream(struct audio_hw_device *dev, + audio_io_handle_t handle, + audio_devices_t devices, + audio_output_flags_t flags, + struct audio_config *config, + struct audio_stream_out **stream_out) + +{ + struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *) dev; + struct a2dp_stream_out *out; + + out = calloc(1, sizeof(struct a2dp_stream_out)); + if (!out) + return -ENOMEM; + + DBG(""); + + out->stream.common.get_sample_rate = out_get_sample_rate; + out->stream.common.set_sample_rate = out_set_sample_rate; + out->stream.common.get_buffer_size = out_get_buffer_size; + out->stream.common.get_channels = out_get_channels; + out->stream.common.get_format = out_get_format; + out->stream.common.set_format = out_set_format; + out->stream.common.standby = out_standby; + out->stream.common.dump = out_dump; + out->stream.common.set_parameters = out_set_parameters; + out->stream.common.get_parameters = out_get_parameters; + out->stream.common.add_audio_effect = out_add_audio_effect; + out->stream.common.remove_audio_effect = out_remove_audio_effect; + out->stream.get_latency = out_get_latency; + out->stream.set_volume = out_set_volume; + out->stream.write = out_write; + out->stream.get_render_position = out_get_render_position; + + /* TODO: for now we always use endpoint 0 */ + out->ep = &audio_endpoints[0]; + + if (!open_endpoint(out->ep, &out->cfg)) + goto fail; + + DBG("rate=%d channels=%d format=%d", out->cfg.rate, + out->cfg.channels, out->cfg.format); + + if (out->cfg.channels == AUDIO_CHANNEL_OUT_MONO) { + out->downmix_buf = malloc(FIXED_BUFFER_SIZE / 2); + if (!out->downmix_buf) + goto fail; + } + + *stream_out = &out->stream; + a2dp_dev->out = out; + + out->audio_state = AUDIO_A2DP_STATE_STANDBY; + + return 0; + +fail: + error("audio: cannot open output stream"); + free(out); + *stream_out = NULL; + return -EIO; +} + +static void audio_close_output_stream(struct audio_hw_device *dev, + struct audio_stream_out *stream) +{ + struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *) dev; + struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream; + + DBG(""); + + close_endpoint(a2dp_dev->out->ep); + + free(out->downmix_buf); + + free(stream); + a2dp_dev->out = NULL; +} + +static int audio_set_parameters(struct audio_hw_device *dev, + const char *kvpairs) +{ + struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *) dev; + struct a2dp_stream_out *out = a2dp_dev->out; + + DBG(""); + + if (!out) + return 0; + + return out->stream.common.set_parameters((struct audio_stream *) out, + kvpairs); +} + +static char *audio_get_parameters(const struct audio_hw_device *dev, + const char *keys) +{ + DBG(""); + return strdup(""); +} + +static int audio_init_check(const struct audio_hw_device *dev) +{ + DBG(""); + return 0; +} + +static int audio_set_voice_volume(struct audio_hw_device *dev, float volume) +{ + DBG(""); + return -ENOSYS; +} + +static int audio_set_master_volume(struct audio_hw_device *dev, float volume) +{ + DBG(""); + return -ENOSYS; +} + +static int audio_set_mode(struct audio_hw_device *dev, int mode) +{ + DBG(""); + return -ENOSYS; +} + +static int audio_set_mic_mute(struct audio_hw_device *dev, bool state) +{ + DBG(""); + return -ENOSYS; +} + +static int audio_get_mic_mute(const struct audio_hw_device *dev, bool *state) +{ + DBG(""); + return -ENOSYS; +} + +static size_t audio_get_input_buffer_size(const struct audio_hw_device *dev, + const struct audio_config *config) +{ + DBG(""); + return -ENOSYS; +} + +static int audio_open_input_stream(struct audio_hw_device *dev, + audio_io_handle_t handle, + audio_devices_t devices, + struct audio_config *config, + struct audio_stream_in **stream_in) +{ + struct audio_stream_in *in; + + DBG(""); + + in = calloc(1, sizeof(struct audio_stream_in)); + if (!in) + return -ENOMEM; + + in->common.get_sample_rate = in_get_sample_rate; + in->common.set_sample_rate = in_set_sample_rate; + in->common.get_buffer_size = in_get_buffer_size; + in->common.get_channels = in_get_channels; + in->common.get_format = in_get_format; + in->common.set_format = in_set_format; + in->common.standby = in_standby; + in->common.dump = in_dump; + in->common.set_parameters = in_set_parameters; + in->common.get_parameters = in_get_parameters; + in->common.add_audio_effect = in_add_audio_effect; + in->common.remove_audio_effect = in_remove_audio_effect; + in->set_gain = in_set_gain; + in->read = in_read; + in->get_input_frames_lost = in_get_input_frames_lost; + + *stream_in = in; + + return 0; +} + +static void audio_close_input_stream(struct audio_hw_device *dev, + struct audio_stream_in *stream_in) +{ + DBG(""); + free(stream_in); +} + +static int audio_dump(const audio_hw_device_t *device, int fd) +{ + DBG(""); + return -ENOSYS; +} + +static int audio_close(hw_device_t *device) +{ + struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)device; + + DBG(""); + + unregister_endpoints(); + + shutdown(listen_sk, SHUT_RDWR); + shutdown(audio_sk, SHUT_RDWR); + + pthread_join(ipc_th, NULL); + + close(listen_sk); + listen_sk = -1; + + free(a2dp_dev); + return 0; +} + +static void *ipc_handler(void *data) +{ + bool done = false; + struct pollfd pfd; + int sk; + + DBG(""); + + while (!done) { + DBG("Waiting for connection ..."); + + sk = accept(listen_sk, NULL, NULL); + if (sk < 0) { + int err = errno; + + if (err == EINTR) + continue; + + if (err != ECONNABORTED && err != EINVAL) + error("audio: Failed to accept socket: %d (%s)", + err, strerror(err)); + + break; + } + + pthread_mutex_lock(&sk_mutex); + audio_sk = sk; + pthread_mutex_unlock(&sk_mutex); + + DBG("Audio IPC: Connected"); + + if (register_endpoints() != AUDIO_STATUS_SUCCESS) { + error("audio: Failed to register endpoints"); + + unregister_endpoints(); + + pthread_mutex_lock(&sk_mutex); + shutdown(audio_sk, SHUT_RDWR); + close(audio_sk); + audio_sk = -1; + pthread_mutex_unlock(&sk_mutex); + + continue; + } + + memset(&pfd, 0, sizeof(pfd)); + pfd.fd = audio_sk; + pfd.events = POLLHUP | POLLERR | POLLNVAL; + + /* Check if socket is still alive. Empty while loop.*/ + while (poll(&pfd, 1, -1) < 0 && errno == EINTR); + + if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) { + info("Audio HAL: Socket closed"); + + pthread_mutex_lock(&sk_mutex); + close(audio_sk); + audio_sk = -1; + pthread_mutex_unlock(&sk_mutex); + } + } + + /* audio_sk is closed at this point, just cleanup endpoints states */ + memset(audio_endpoints, 0, sizeof(audio_endpoints)); + + info("Closing Audio IPC thread"); + return NULL; +} + +static int audio_ipc_init(void) +{ + struct sockaddr_un addr; + int err; + int sk; + + DBG(""); + + sk = socket(PF_LOCAL, SOCK_SEQPACKET, 0); + if (sk < 0) { + err = -errno; + error("audio: Failed to create socket: %d (%s)", -err, + strerror(-err)); + return err; + } + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + + memcpy(addr.sun_path, BLUEZ_AUDIO_SK_PATH, + sizeof(BLUEZ_AUDIO_SK_PATH)); + + if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + err = -errno; + error("audio: Failed to bind socket: %d (%s)", -err, + strerror(-err)); + goto failed; + } + + if (listen(sk, 1) < 0) { + err = -errno; + error("audio: Failed to listen on the socket: %d (%s)", -err, + strerror(-err)); + goto failed; + } + + listen_sk = sk; + + err = pthread_create(&ipc_th, NULL, ipc_handler, NULL); + if (err) { + err = -err; + ipc_th = 0; + error("audio: Failed to start Audio IPC thread: %d (%s)", + -err, strerror(-err)); + goto failed; + } + + return 0; + +failed: + close(sk); + return err; +} + +static int audio_open(const hw_module_t *module, const char *name, + hw_device_t **device) +{ + struct a2dp_audio_dev *a2dp_dev; + int err; + + DBG(""); + + if (strcmp(name, AUDIO_HARDWARE_INTERFACE)) { + error("audio: interface %s not matching [%s]", name, + AUDIO_HARDWARE_INTERFACE); + return -EINVAL; + } + + err = audio_ipc_init(); + if (err < 0) + return err; + + a2dp_dev = calloc(1, sizeof(struct a2dp_audio_dev)); + if (!a2dp_dev) + return -ENOMEM; + + a2dp_dev->dev.common.tag = HARDWARE_DEVICE_TAG; + a2dp_dev->dev.common.version = AUDIO_DEVICE_API_VERSION_CURRENT; + a2dp_dev->dev.common.module = (struct hw_module_t *) module; + a2dp_dev->dev.common.close = audio_close; + + a2dp_dev->dev.init_check = audio_init_check; + a2dp_dev->dev.set_voice_volume = audio_set_voice_volume; + a2dp_dev->dev.set_master_volume = audio_set_master_volume; + a2dp_dev->dev.set_mode = audio_set_mode; + a2dp_dev->dev.set_mic_mute = audio_set_mic_mute; + a2dp_dev->dev.get_mic_mute = audio_get_mic_mute; + a2dp_dev->dev.set_parameters = audio_set_parameters; + a2dp_dev->dev.get_parameters = audio_get_parameters; + a2dp_dev->dev.get_input_buffer_size = audio_get_input_buffer_size; + a2dp_dev->dev.open_output_stream = audio_open_output_stream; + a2dp_dev->dev.close_output_stream = audio_close_output_stream; + a2dp_dev->dev.open_input_stream = audio_open_input_stream; + a2dp_dev->dev.close_input_stream = audio_close_input_stream; + a2dp_dev->dev.dump = audio_dump; + + /* Note that &a2dp_dev->dev.common is the same pointer as a2dp_dev. + * This results from the structure of following structs:a2dp_audio_dev, + * audio_hw_device. We will rely on this later in the code.*/ + *device = &a2dp_dev->dev.common; + + return 0; +} + +static struct hw_module_methods_t hal_module_methods = { + .open = audio_open, +}; + +struct audio_module HAL_MODULE_INFO_SYM = { + .common = { + .tag = HARDWARE_MODULE_TAG, + .version_major = 1, + .version_minor = 0, + .id = AUDIO_HARDWARE_MODULE_ID, + .name = "A2DP Bluez HW HAL", + .author = "Intel Corporation", + .methods = &hal_module_methods, + }, +};
diff --git a/bluez/android/hal-avrcp.c b/bluez/android/hal-avrcp.c new file mode 100644 index 0000000..5f98f5b --- /dev/null +++ b/bluez/android/hal-avrcp.c
@@ -0,0 +1,684 @@ +/* + * Copyright (C) 2014 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdbool.h> +#include <stddef.h> +#include <string.h> +#include <stdlib.h> + +#include "hal-log.h" +#include "hal.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "hal-ipc.h" + +static const btrc_callbacks_t *cbs = NULL; + +static bool interface_ready(void) +{ + return cbs != NULL; +} + +static void handle_remote_features(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_remote_features *ev = buf; + + if (cbs->remote_features_cb) + cbs->remote_features_cb((bt_bdaddr_t *) (ev->bdaddr), + ev->features); +} + +static void handle_get_play_status(void *buf, uint16_t len) +{ + if (cbs->get_play_status_cb) + cbs->get_play_status_cb(); +} + +static void handle_list_player_attrs(void *buf, uint16_t len) +{ + if (cbs->list_player_app_attr_cb) + cbs->list_player_app_attr_cb(); +} + +static void handle_list_player_values(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_list_player_values *ev = buf; + + if (cbs->list_player_app_values_cb) + cbs->list_player_app_values_cb(ev->attr); +} + +static void handle_get_player_values(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_get_player_values *ev = buf; + btrc_player_attr_t attrs[4]; + int i; + + if (!cbs->get_player_app_value_cb) + return; + + /* Convert uint8_t array to btrc_player_attr_t array */ + for (i = 0; i < ev->number; i++) + attrs[i] = ev->attrs[i]; + + cbs->get_player_app_value_cb(ev->number, attrs); +} + +static void handle_get_player_attrs_text(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_get_player_attrs_text *ev = buf; + btrc_player_attr_t attrs[4]; + int i; + + if (!cbs->get_player_app_attrs_text_cb) + return; + + /* Convert uint8_t array to btrc_player_attr_t array */ + for (i = 0; i < ev->number; i++) + attrs[i] = ev->attrs[i]; + + cbs->get_player_app_attrs_text_cb(ev->number, attrs); +} + +static void handle_get_player_values_text(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_get_player_values_text *ev = buf; + + if (cbs->get_player_app_values_text_cb) + cbs->get_player_app_values_text_cb(ev->attr, ev->number, + ev->values); +} + +static void handle_set_player_value(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_set_player_values *ev = buf; + struct hal_avrcp_player_attr_value *attrs; + btrc_player_settings_t values; + int i; + + if (!cbs->set_player_app_value_cb) + return; + + attrs = (struct hal_avrcp_player_attr_value *) ev->attrs; + + /* Convert to btrc_player_settings_t */ + values.num_attr = ev->number; + for (i = 0; i < ev->number; i++) { + values.attr_ids[i] = attrs[i].attr; + values.attr_values[i] = attrs[i].value; + } + + cbs->set_player_app_value_cb(&values); +} + +static void handle_get_element_attrs(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_get_element_attrs *ev = buf; + btrc_media_attr_t attrs[BTRC_MAX_APP_SETTINGS]; + int i; + + if (!cbs->get_element_attr_cb) + return; + + /* Convert uint8_t array to btrc_media_attr_t array */ + for (i = 0; i < ev->number; i++) + attrs[i] = ev->attrs[i]; + + cbs->get_element_attr_cb(ev->number, attrs); +} + +static void handle_register_notification(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_register_notification *ev = buf; + + if (cbs->register_notification_cb) + cbs->register_notification_cb(ev->event, ev->param); +} + +static void handle_volume_changed(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_volume_changed *ev = buf; + + if (cbs->volume_change_cb) + cbs->volume_change_cb(ev->volume, ev->type); +} + +static void handle_passthrough_cmd(void *buf, uint16_t len) +{ + struct hal_ev_avrcp_passthrough_cmd *ev = buf; + + if (cbs->passthrough_cmd_cb) + cbs->passthrough_cmd_cb(ev->id, ev->state); +} + +/* handlers will be called from notification thread context, + * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ +static const struct hal_ipc_handler ev_handlers[] = { + /* HAL_EV_AVRCP_REMOTE_FEATURES */ + { handle_remote_features, false, + sizeof(struct hal_ev_avrcp_remote_features) }, + /* HAL_EV_AVRCP_GET_PLAY_STATUS */ + { handle_get_play_status, false, 0 }, + /* HAL_EV_AVRCP_LIST_PLAYER_ATTRS */ + { handle_list_player_attrs, false, 0 }, + /* HAL_EV_AVRCP_LIST_PLAYER_VALUES */ + { handle_list_player_values, false, + sizeof(struct hal_ev_avrcp_list_player_values) }, + /* HAL_EV_AVRCP_GET_PLAYER_VALUES */ + { handle_get_player_values, true, + sizeof(struct hal_ev_avrcp_get_player_values) }, + /* HAL_EV_AVRCP_GET_PLAYER_ATTRS_TEXT */ + { handle_get_player_attrs_text, true, + sizeof(struct hal_ev_avrcp_get_player_attrs_text) }, + /* HAL_EV_AVRCP_GET_PLAYER_VALUES_TEXT */ + { handle_get_player_values_text, true, + sizeof(struct hal_ev_avrcp_get_player_values_text) }, + /* HAL_EV_AVRCP_SET_PLAYER_VALUES */ + { handle_set_player_value, true, + sizeof(struct hal_ev_avrcp_set_player_values) }, + /* HAL_EV_AVRCP_GET_ELEMENT_ATTRS */ + { handle_get_element_attrs, true, + sizeof(struct hal_ev_avrcp_get_element_attrs) }, + /* HAL_EV_AVRCP_REGISTER_NOTIFICATION */ + { handle_register_notification, false, + sizeof(struct hal_ev_avrcp_register_notification) }, + /* HAL_EV_AVRCP_VOLUME_CHANGED */ + { handle_volume_changed, false, + sizeof(struct hal_ev_avrcp_volume_changed) }, + /* HAL_EV_AVRCP_PASSTHROUGH_CMD */ + { handle_passthrough_cmd, false, + sizeof(struct hal_ev_avrcp_passthrough_cmd) }, +}; + +static bt_status_t init(btrc_callbacks_t *callbacks) +{ + struct hal_cmd_register_module cmd; + int ret; + + DBG(""); + + if (interface_ready()) + return BT_STATUS_DONE; + + cbs = callbacks; + + hal_ipc_register(HAL_SERVICE_ID_AVRCP, ev_handlers, + sizeof(ev_handlers) / sizeof(ev_handlers[0])); + + cmd.service_id = HAL_SERVICE_ID_AVRCP; + cmd.mode = HAL_MODE_DEFAULT; + + ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + if (ret != BT_STATUS_SUCCESS) { + cbs = NULL; + hal_ipc_unregister(HAL_SERVICE_ID_AVRCP); + } + + return ret; +} + +static bt_status_t get_play_status_rsp(btrc_play_status_t status, + uint32_t song_len, uint32_t song_pos) +{ + struct hal_cmd_avrcp_get_play_status cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.status = status; + cmd.duration = song_len; + cmd.position = song_pos; + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, HAL_OP_AVRCP_GET_PLAY_STATUS, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t list_player_app_attr_rsp(int num_attr, + btrc_player_attr_t *p_attrs) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_list_player_attrs *cmd = (void *) buf; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (num_attr < 0) + return BT_STATUS_PARM_INVALID; + + len = sizeof(*cmd) + num_attr; + if (len > IPC_MTU) + return BT_STATUS_PARM_INVALID; + + cmd->number = num_attr; + memcpy(cmd->attrs, p_attrs, num_attr); + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_LIST_PLAYER_ATTRS, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t list_player_app_value_rsp(int num_val, uint8_t *p_vals) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_list_player_values *cmd = (void *) buf; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (num_val < 0) + return BT_STATUS_PARM_INVALID; + + len = sizeof(*cmd) + num_val; + + if (len > IPC_MTU) + return BT_STATUS_PARM_INVALID; + + cmd->number = num_val; + memcpy(cmd->values, p_vals, num_val); + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_LIST_PLAYER_VALUES, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t get_player_app_value_rsp(btrc_player_settings_t *p_vals) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_get_player_attrs *cmd = (void *) buf; + size_t len, attrs_len; + int i; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!p_vals) + return BT_STATUS_PARM_INVALID; + + attrs_len = p_vals->num_attr * + sizeof(struct hal_avrcp_player_attr_value); + len = sizeof(*cmd) + attrs_len; + + if (len > IPC_MTU) + return BT_STATUS_PARM_INVALID; + + cmd->number = p_vals->num_attr; + + for (i = 0; i < p_vals->num_attr; i++) { + cmd->attrs[i].attr = p_vals->attr_ids[i]; + cmd->attrs[i].value = p_vals->attr_values[i]; + } + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_PLAYER_ATTRS, + len, cmd, 0, NULL, NULL); +} + +static int write_text(uint8_t *ptr, uint8_t id, uint8_t *text, size_t *len) +{ + struct hal_avrcp_player_setting_text *value = (void *) ptr; + size_t attr_len = sizeof(*value); + + if (attr_len + *len > IPC_MTU) + return 0; + + value->id = id; + value->len = strnlen((const char *) text, BTRC_MAX_ATTR_STR_LEN); + + *len += attr_len; + + if (value->len + *len > IPC_MTU) + value->len = IPC_MTU - *len; + + memcpy(value->text, text, value->len); + + *len += value->len; + + return attr_len + value->len; +} + +static uint8_t write_player_setting_text(uint8_t *ptr, uint8_t num_attr, + btrc_player_setting_text_t *p_attrs, + size_t *len) +{ + int i; + + for (i = 0; i < num_attr && *len < IPC_MTU; i++) { + int ret; + + ret = write_text(ptr, p_attrs[i].id, p_attrs[i].text, len); + if (ret == 0) + break; + + ptr += ret; + } + + return i; +} + +static bt_status_t get_player_app_attr_text_rsp(int num_attr, + btrc_player_setting_text_t *p_attrs) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_get_player_attrs_text *cmd = (void *) buf; + uint8_t *ptr; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (num_attr < 0 || num_attr > BTRC_MAX_APP_SETTINGS) + return BT_STATUS_PARM_INVALID; + + len = sizeof(*cmd); + ptr = (uint8_t *) &cmd->attrs[0]; + cmd->number = write_player_setting_text(ptr, num_attr, p_attrs, &len); + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_PLAYER_ATTRS_TEXT, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t get_player_app_value_text_rsp(int num_val, + btrc_player_setting_text_t *p_vals) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_get_player_values_text *cmd = (void *) buf; + uint8_t *ptr; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (num_val < 0) + return BT_STATUS_PARM_INVALID; + + len = sizeof(*cmd); + ptr = (uint8_t *) &cmd->values[0]; + cmd->number = write_player_setting_text(ptr, num_val, p_vals, &len); + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_PLAYER_VALUES_TEXT, + len, cmd, 0, NULL, NULL); +} + +static uint8_t write_element_attr_text(uint8_t *ptr, uint8_t num_attr, + btrc_element_attr_val_t *p_attrs, + size_t *len) +{ + int i; + + for (i = 0; i < num_attr && *len < IPC_MTU; i++) { + int ret; + + ret = write_text(ptr, p_attrs[i].attr_id, p_attrs[i].text, len); + if (ret == 0) + break; + + ptr += ret; + } + + return i; +} + +static bt_status_t get_element_attr_rsp(uint8_t num_attr, + btrc_element_attr_val_t *p_attrs) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_get_element_attrs_text *cmd = (void *) buf; + size_t len; + uint8_t *ptr; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + len = sizeof(*cmd); + ptr = (uint8_t *) &cmd->values[0]; + cmd->number = write_element_attr_text(ptr, num_attr, p_attrs, &len); + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_GET_ELEMENT_ATTRS_TEXT, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t set_player_app_value_rsp(btrc_status_t rsp_status) +{ + struct hal_cmd_avrcp_set_player_attrs_value cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.status = rsp_status; + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_SET_PLAYER_ATTRS_VALUE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t play_status_changed_rsp(btrc_notification_type_t type, + btrc_play_status_t *play_status) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_register_notification *cmd = (void *) buf; + size_t len; + + cmd->event = BTRC_EVT_PLAY_STATUS_CHANGED; + cmd->type = type; + cmd->len = 1; + memcpy(cmd->data, play_status, cmd->len); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_REGISTER_NOTIFICATION, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t track_change_rsp(btrc_notification_type_t type, + btrc_uid_t *track) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_register_notification *cmd = (void *) buf; + size_t len; + + cmd->event = BTRC_EVT_TRACK_CHANGE; + cmd->type = type; + cmd->len = sizeof(*track); + memcpy(cmd->data, track, cmd->len); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_REGISTER_NOTIFICATION, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t track_reached_end_rsp(btrc_notification_type_t type) +{ + struct hal_cmd_avrcp_register_notification cmd; + + cmd.event = BTRC_EVT_TRACK_REACHED_END; + cmd.type = type; + cmd.len = 0; + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_REGISTER_NOTIFICATION, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t track_reached_start_rsp(btrc_notification_type_t type) +{ + struct hal_cmd_avrcp_register_notification cmd; + + cmd.event = BTRC_EVT_TRACK_REACHED_START; + cmd.type = type; + cmd.len = 0; + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_REGISTER_NOTIFICATION, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t play_pos_changed_rsp(btrc_notification_type_t type, + uint32_t *song_pos) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_register_notification *cmd = (void *) buf; + size_t len; + + cmd->event = BTRC_EVT_PLAY_POS_CHANGED; + cmd->type = type; + cmd->len = sizeof(*song_pos); + memcpy(cmd->data, song_pos, cmd->len); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_REGISTER_NOTIFICATION, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t settings_changed_rsp(btrc_notification_type_t type, + btrc_player_settings_t *player_setting) +{ + char buf[IPC_MTU]; + struct hal_cmd_avrcp_register_notification *cmd = (void *) buf; + struct hal_avrcp_player_attr_value *attrs; + size_t len, param_len; + int i; + + param_len = player_setting->num_attr * sizeof(*attrs); + len = sizeof(*cmd) + param_len; + + if (len > IPC_MTU) + return BT_STATUS_PARM_INVALID; + + cmd->event = BTRC_EVT_APP_SETTINGS_CHANGED; + cmd->type = type; + cmd->len = param_len; + + attrs = (struct hal_avrcp_player_attr_value *) &cmd->data[0]; + for (i = 0; i < player_setting->num_attr; i++) { + attrs[i].attr = player_setting->attr_ids[i]; + attrs[i].value = player_setting->attr_values[i]; + } + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, + HAL_OP_AVRCP_REGISTER_NOTIFICATION, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t register_notification_rsp(btrc_event_id_t event_id, + btrc_notification_type_t type, + btrc_register_notification_t *p_param) +{ + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + switch (event_id) { + case BTRC_EVT_PLAY_STATUS_CHANGED: + return play_status_changed_rsp(type, &p_param->play_status); + case BTRC_EVT_TRACK_CHANGE: + return track_change_rsp(type, &p_param->track); + case BTRC_EVT_TRACK_REACHED_END: + return track_reached_end_rsp(type); + case BTRC_EVT_TRACK_REACHED_START: + return track_reached_start_rsp(type); + case BTRC_EVT_PLAY_POS_CHANGED: + return play_pos_changed_rsp(type, &p_param->song_pos); + case BTRC_EVT_APP_SETTINGS_CHANGED: + return settings_changed_rsp(type, &p_param->player_setting); + default: + return BT_STATUS_PARM_INVALID; + } +} + +static bt_status_t set_volume(uint8_t volume) +{ + struct hal_cmd_avrcp_set_volume cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.value = volume; + + return hal_ipc_cmd(HAL_SERVICE_ID_AVRCP, HAL_OP_AVRCP_SET_VOLUME, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static void cleanup() +{ + struct hal_cmd_unregister_module cmd; + + DBG(""); + + if (!interface_ready()) + return; + + cbs = NULL; + + cmd.service_id = HAL_SERVICE_ID_AVRCP; + + hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + hal_ipc_unregister(HAL_SERVICE_ID_AVRCP); +} + +static btrc_interface_t iface = { + .size = sizeof(iface), + .init = init, + .get_play_status_rsp = get_play_status_rsp, + .list_player_app_attr_rsp = list_player_app_attr_rsp, + .list_player_app_value_rsp = list_player_app_value_rsp, + .get_player_app_value_rsp = get_player_app_value_rsp, + .get_player_app_attr_text_rsp = get_player_app_attr_text_rsp, + .get_player_app_value_text_rsp = get_player_app_value_text_rsp, + .get_element_attr_rsp = get_element_attr_rsp, + .set_player_app_value_rsp = set_player_app_value_rsp, + .register_notification_rsp = register_notification_rsp, + .set_volume = set_volume, + .cleanup = cleanup +}; + +btrc_interface_t *bt_get_avrcp_interface() +{ + return &iface; +}
diff --git a/bluez/android/hal-bluetooth.c b/bluez/android/hal-bluetooth.c new file mode 100644 index 0000000..48d5ea2 --- /dev/null +++ b/bluez/android/hal-bluetooth.c
@@ -0,0 +1,937 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <string.h> + +#include <cutils/properties.h> + +#include "hal-log.h" +#include "hal.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "hal-ipc.h" +#include "hal-utils.h" + +static const bt_callbacks_t *bt_hal_cbacks = NULL; + +#define enum_prop_to_hal(prop, hal_prop, type) do { \ + static type e; \ + prop.val = &e; \ + prop.len = sizeof(e); \ + e = *((uint8_t *) (hal_prop->val)); \ +} while (0) + +#define enum_prop_from_hal(prop, hal_len, hal_val, enum_type) do { \ + enum_type e; \ + if (prop->len != sizeof(e)) { \ + error("invalid HAL property %u (%u vs %zu), aborting ", \ + prop->type, prop->len, sizeof(e)); \ + exit(EXIT_FAILURE); \ + } \ + memcpy(&e, prop->val, sizeof(e)); \ + *((uint8_t *) hal_val) = e; /* enums are mapped to 1 byte */ \ + *hal_len = 1; \ +} while (0) + +static void handle_adapter_state_changed(void *buf, uint16_t len) +{ + struct hal_ev_adapter_state_changed *ev = buf; + + DBG("state: %s", bt_state_t2str(ev->state)); + + if (bt_hal_cbacks->adapter_state_changed_cb) + bt_hal_cbacks->adapter_state_changed_cb(ev->state); +} + +static void adapter_props_to_hal(bt_property_t *send_props, + struct hal_property *prop, + uint8_t num_props, uint16_t len) +{ + void *buf = prop; + uint8_t i; + + for (i = 0; i < num_props; i++) { + if (sizeof(*prop) + prop->len > len) { + error("invalid adapter properties(%zu > %u), aborting", + sizeof(*prop) + prop->len, len); + exit(EXIT_FAILURE); + } + + send_props[i].type = prop->type; + + switch (prop->type) { + case HAL_PROP_ADAPTER_TYPE: + enum_prop_to_hal(send_props[i], prop, + bt_device_type_t); + break; + case HAL_PROP_ADAPTER_SCAN_MODE: + enum_prop_to_hal(send_props[i], prop, + bt_scan_mode_t); + break; + case HAL_PROP_ADAPTER_SERVICE_REC: + default: + send_props[i].len = prop->len; + send_props[i].val = prop->val; + break; + } + + DBG("prop[%d]: %s", i, btproperty2str(&send_props[i])); + + len -= sizeof(*prop) + prop->len; + buf += sizeof(*prop) + prop->len; + prop = buf; + } + + if (!len) + return; + + error("invalid adapter properties (%u bytes left), aborting", len); + exit(EXIT_FAILURE); +} + +static void adapter_prop_from_hal(const bt_property_t *property, uint8_t *type, + uint16_t *len, void *val) +{ + /* type match IPC type */ + *type = property->type; + + switch (property->type) { + case HAL_PROP_ADAPTER_SCAN_MODE: + enum_prop_from_hal(property, len, val, bt_scan_mode_t); + break; + default: + *len = property->len; + memcpy(val, property->val, property->len); + break; + } +} + +static void device_props_to_hal(bt_property_t *send_props, + struct hal_property *prop, uint8_t num_props, + uint16_t len) +{ + void *buf = prop; + uint8_t i; + + for (i = 0; i < num_props; i++) { + if (sizeof(*prop) + prop->len > len) { + error("invalid device properties (%zu > %u), aborting", + sizeof(*prop) + prop->len, len); + exit(EXIT_FAILURE); + } + + send_props[i].type = prop->type; + + switch (prop->type) { + case HAL_PROP_DEVICE_TYPE: + enum_prop_to_hal(send_props[i], prop, + bt_device_type_t); + break; + case HAL_PROP_DEVICE_VERSION_INFO: + { + static bt_remote_version_t e; + const struct hal_prop_device_info *p; + + send_props[i].val = &e; + send_props[i].len = sizeof(e); + + p = (struct hal_prop_device_info *) prop->val; + + e.manufacturer = p->manufacturer; + e.sub_ver = p->sub_version; + e.version = p->version; + } + break; + case HAL_PROP_DEVICE_SERVICE_REC: + { + static bt_service_record_t e; + const struct hal_prop_device_service_rec *p; + + send_props[i].val = &e; + send_props[i].len = sizeof(e); + + p = (struct hal_prop_device_service_rec *) prop->val; + + memset(&e, 0, sizeof(e)); + memcpy(&e.channel, &p->channel, sizeof(e.channel)); + memcpy(e.uuid.uu, p->uuid, sizeof(e.uuid.uu)); + memcpy(e.name, p->name, p->name_len); + } + break; + default: + send_props[i].len = prop->len; + send_props[i].val = prop->val; + break; + } + + len -= sizeof(*prop) + prop->len; + buf += sizeof(*prop) + prop->len; + prop = buf; + + DBG("prop[%d]: %s", i, btproperty2str(&send_props[i])); + } + + if (!len) + return; + + error("invalid device properties (%u bytes left), aborting", len); + exit(EXIT_FAILURE); +} + +static void handle_adapter_props_changed(void *buf, uint16_t len) +{ + struct hal_ev_adapter_props_changed *ev = buf; + bt_property_t props[ev->num_props]; + + DBG(""); + + if (!bt_hal_cbacks->adapter_properties_cb) + return; + + len -= sizeof(*ev); + adapter_props_to_hal(props, ev->props, ev->num_props, len); + + bt_hal_cbacks->adapter_properties_cb(ev->status, ev->num_props, props); +} + +static void handle_bond_state_change(void *buf, uint16_t len) +{ + struct hal_ev_bond_state_changed *ev = buf; + bt_bdaddr_t *addr = (bt_bdaddr_t *) ev->bdaddr; + + DBG("state %u", ev->state); + + if (bt_hal_cbacks->bond_state_changed_cb) + bt_hal_cbacks->bond_state_changed_cb(ev->status, addr, + ev->state); +} + +static void handle_pin_request(void *buf, uint16_t len) +{ + struct hal_ev_pin_request *ev = buf; + /* Those are declared as packed, so it's safe to assign pointers */ + bt_bdaddr_t *addr = (bt_bdaddr_t *) ev->bdaddr; + bt_bdname_t *name = (bt_bdname_t *) ev->name; + + DBG(""); + + if (bt_hal_cbacks->pin_request_cb) + bt_hal_cbacks->pin_request_cb(addr, name, ev->class_of_dev); +} + +static void handle_ssp_request(void *buf, uint16_t len) +{ + struct hal_ev_ssp_request *ev = buf; + /* Those are declared as packed, so it's safe to assign pointers */ + bt_bdaddr_t *addr = (bt_bdaddr_t *) ev->bdaddr; + bt_bdname_t *name = (bt_bdname_t *) ev->name; + + DBG(""); + + if (bt_hal_cbacks->ssp_request_cb) + bt_hal_cbacks->ssp_request_cb(addr, name, ev->class_of_dev, + ev->pairing_variant, + ev->passkey); +} + +void bt_thread_associate(void) +{ + if (bt_hal_cbacks->thread_evt_cb) + bt_hal_cbacks->thread_evt_cb(ASSOCIATE_JVM); +} + +void bt_thread_disassociate(void) +{ + if (bt_hal_cbacks->thread_evt_cb) + bt_hal_cbacks->thread_evt_cb(DISASSOCIATE_JVM); +} + +static bool interface_ready(void) +{ + return bt_hal_cbacks != NULL; +} + +static void handle_discovery_state_changed(void *buf, uint16_t len) +{ + struct hal_ev_discovery_state_changed *ev = buf; + + DBG(""); + + if (bt_hal_cbacks->discovery_state_changed_cb) + bt_hal_cbacks->discovery_state_changed_cb(ev->state); +} + +static void handle_device_found(void *buf, uint16_t len) +{ + struct hal_ev_device_found *ev = buf; + bt_property_t props[ev->num_props]; + + DBG(""); + + if (!bt_hal_cbacks->device_found_cb) + return; + + len -= sizeof(*ev); + device_props_to_hal(props, ev->props, ev->num_props, len); + + bt_hal_cbacks->device_found_cb(ev->num_props, props); +} + +static void handle_device_state_changed(void *buf, uint16_t len) +{ + struct hal_ev_remote_device_props *ev = buf; + bt_property_t props[ev->num_props]; + + DBG(""); + + if (!bt_hal_cbacks->remote_device_properties_cb) + return; + + len -= sizeof(*ev); + device_props_to_hal(props, ev->props, ev->num_props, len); + + bt_hal_cbacks->remote_device_properties_cb(ev->status, + (bt_bdaddr_t *)ev->bdaddr, + ev->num_props, props); +} + +static void handle_acl_state_changed(void *buf, uint16_t len) +{ + struct hal_ev_acl_state_changed *ev = buf; + bt_bdaddr_t *addr = (bt_bdaddr_t *) ev->bdaddr; + + DBG("state %u", ev->state); + + if (bt_hal_cbacks->acl_state_changed_cb) + bt_hal_cbacks->acl_state_changed_cb(ev->status, addr, + ev->state); +} + +static void handle_dut_mode_receive(void *buf, uint16_t len) +{ + struct hal_ev_dut_mode_receive *ev = buf; + + DBG(""); + + if (len != sizeof(*ev) + ev->len) { + error("invalid dut mode receive event (%u), aborting", len); + exit(EXIT_FAILURE); + } + + if (bt_hal_cbacks->dut_mode_recv_cb) + bt_hal_cbacks->dut_mode_recv_cb(ev->opcode, ev->data, ev->len); +} + +static void handle_le_test_mode(void *buf, uint16_t len) +{ + struct hal_ev_le_test_mode *ev = buf; + + DBG(""); + + if (bt_hal_cbacks->le_test_mode_cb) + bt_hal_cbacks->le_test_mode_cb(ev->status, ev->num_packets); +} + +/* handlers will be called from notification thread context, + * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ +static const struct hal_ipc_handler ev_handlers[] = { + { /* HAL_EV_ADAPTER_STATE_CHANGED */ + .handler = handle_adapter_state_changed, + .var_len = false, + .data_len = sizeof(struct hal_ev_adapter_state_changed) + }, + { /* HAL_EV_ADAPTER_PROPS_CHANGED */ + .handler = handle_adapter_props_changed, + .var_len = true, + .data_len = sizeof(struct hal_ev_adapter_props_changed) + + sizeof(struct hal_property), + }, + { /* HAL_EV_REMOTE_DEVICE_PROPS */ + .handler = handle_device_state_changed, + .var_len = true, + .data_len = sizeof(struct hal_ev_remote_device_props) + + sizeof(struct hal_property), + }, + { /* HAL_EV_DEVICE_FOUND */ + .handler = handle_device_found, + .var_len = true, + .data_len = sizeof(struct hal_ev_device_found) + + sizeof(struct hal_property), + }, + { /* HAL_EV_DISCOVERY_STATE_CHANGED */ + .handler = handle_discovery_state_changed, + .var_len = false, + .data_len = sizeof(struct hal_ev_discovery_state_changed), + }, + { /* HAL_EV_PIN_REQUEST */ + .handler = handle_pin_request, + .var_len = false, + .data_len = sizeof(struct hal_ev_pin_request), + }, + { /* HAL_EV_SSP_REQUEST */ + .handler = handle_ssp_request, + .var_len = false, + .data_len = sizeof(struct hal_ev_ssp_request), + }, + { /* HAL_EV_BOND_STATE_CHANGED */ + .handler = handle_bond_state_change, + .var_len = false, + .data_len = sizeof(struct hal_ev_bond_state_changed), + }, + { /* HAL_EV_ACL_STATE_CHANGED */ + .handler = handle_acl_state_changed, + .var_len = false, + .data_len = sizeof(struct hal_ev_acl_state_changed), + }, + { /* HAL_EV_DUT_MODE_RECEIVE */ + .handler = handle_dut_mode_receive, + .var_len = true, + .data_len = sizeof(struct hal_ev_dut_mode_receive), + }, + { /* HAL_EV_LE_TEST_MODE */ + .handler = handle_le_test_mode, + .var_len = false, + .data_len = sizeof(struct hal_ev_le_test_mode), + } +}; + +static int init(bt_callbacks_t *callbacks) +{ + struct hal_cmd_register_module cmd; + int status; + + DBG(""); + + if (interface_ready()) + return BT_STATUS_DONE; + + bt_hal_cbacks = callbacks; + + hal_ipc_register(HAL_SERVICE_ID_BLUETOOTH, ev_handlers, + sizeof(ev_handlers)/sizeof(ev_handlers[0])); + + if (!hal_ipc_init()) { + bt_hal_cbacks = NULL; + return BT_STATUS_FAIL; + } + + cmd.service_id = HAL_SERVICE_ID_BLUETOOTH; + cmd.mode = HAL_MODE_DEFAULT; + + status = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, NULL, NULL, NULL); + if (status != BT_STATUS_SUCCESS) { + error("Failed to register 'bluetooth' service"); + goto fail; + } + + cmd.service_id = HAL_SERVICE_ID_SOCKET; + cmd.mode = HAL_MODE_DEFAULT; + + status = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, NULL, NULL, NULL); + if (status != BT_STATUS_SUCCESS) { + error("Failed to register 'socket' service"); + goto fail; + } + + return status; + +fail: + hal_ipc_cleanup(); + bt_hal_cbacks = NULL; + + hal_ipc_unregister(HAL_SERVICE_ID_BLUETOOTH); + + return status; +} + +static int enable(void) +{ + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_ENABLE, 0, NULL, 0, + NULL, NULL); +} + +static int disable(void) +{ + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_DISABLE, 0, NULL, 0, + NULL, NULL); +} + +static void cleanup(void) +{ + DBG(""); + + if (!interface_ready()) + return; + + hal_ipc_cleanup(); + + bt_hal_cbacks = NULL; + + hal_ipc_unregister(HAL_SERVICE_ID_BLUETOOTH); +} + +static int get_adapter_properties(void) +{ + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_GET_ADAPTER_PROPS, + 0, NULL, 0, NULL, NULL); +} + +static int get_adapter_property(bt_property_type_t type) +{ + struct hal_cmd_get_adapter_prop cmd; + + DBG("prop: %s (%d)", bt_property_type_t2str(type), type); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + /* type match IPC type */ + cmd.type = type; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_GET_ADAPTER_PROP, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int set_adapter_property(const bt_property_t *property) +{ + char buf[IPC_MTU]; + struct hal_cmd_set_adapter_prop *cmd = (void *) buf; + size_t len; + + DBG("prop: %s", btproperty2str(property)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + adapter_prop_from_hal(property, &cmd->type, &cmd->len, cmd->val); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_SET_ADAPTER_PROP, + len, cmd, 0, NULL, NULL); +} + +static int get_remote_device_properties(bt_bdaddr_t *remote_addr) +{ + struct hal_cmd_get_remote_device_props cmd; + + DBG("bdaddr: %s", bdaddr2str(remote_addr)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, remote_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_DEVICE_PROPS, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int get_remote_device_property(bt_bdaddr_t *remote_addr, + bt_property_type_t type) +{ + struct hal_cmd_get_remote_device_prop cmd; + + DBG("bdaddr: %s prop: %s", bdaddr2str(remote_addr), + bt_property_type_t2str(type)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, remote_addr, sizeof(cmd.bdaddr)); + + /* type match IPC type */ + cmd.type = type; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_DEVICE_PROP, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int set_remote_device_property(bt_bdaddr_t *remote_addr, + const bt_property_t *property) +{ + char buf[IPC_MTU]; + struct hal_cmd_set_remote_device_prop *cmd = (void *) buf; + size_t len; + + DBG("bdaddr: %s prop: %s", bdaddr2str(remote_addr), + bt_property_type_t2str(property->type)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd->bdaddr, remote_addr, sizeof(cmd->bdaddr)); + + /* type match IPC type */ + cmd->type = property->type; + cmd->len = property->len; + memcpy(cmd->val, property->val, property->len); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_SET_REMOTE_DEVICE_PROP, + len, cmd, 0, NULL, NULL); +} + +static int get_remote_service_record(bt_bdaddr_t *remote_addr, bt_uuid_t *uuid) +{ + struct hal_cmd_get_remote_service_rec cmd; + + DBG("bdaddr: %s", bdaddr2str(remote_addr)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, remote_addr, sizeof(cmd.bdaddr)); + memcpy(cmd.uuid, uuid, sizeof(cmd.uuid)); + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_SERVICE_REC, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int get_remote_services(bt_bdaddr_t *remote_addr) +{ + struct hal_cmd_get_remote_services cmd; + + DBG("bdaddr: %s", bdaddr2str(remote_addr)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, remote_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_SERVICES, sizeof(cmd), &cmd, 0, + NULL, NULL); +} + +static int start_discovery(void) +{ + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_START_DISCOVERY, 0, NULL, 0, + NULL, NULL); +} + +static int cancel_discovery(void) +{ + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_CANCEL_DISCOVERY, 0, NULL, 0, + NULL, NULL); +} + +static int create_bond(const bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_create_bond cmd; + + DBG("bdaddr: %s", bdaddr2str(bd_addr)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_CREATE_BOND, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int cancel_bond(const bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_cancel_bond cmd; + + DBG("bdaddr: %s", bdaddr2str(bd_addr)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_CANCEL_BOND, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int remove_bond(const bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_remove_bond cmd; + + DBG("bdaddr: %s", bdaddr2str(bd_addr)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_REMOVE_BOND, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int pin_reply(const bt_bdaddr_t *bd_addr, uint8_t accept, + uint8_t pin_len, bt_pin_code_t *pin_code) +{ + struct hal_cmd_pin_reply cmd; + + DBG("bdaddr: %s", bdaddr2str(bd_addr)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + cmd.accept = accept; + cmd.pin_len = pin_len; + memcpy(cmd.pin_code, pin_code, sizeof(cmd.pin_code)); + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_PIN_REPLY, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int ssp_reply(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t variant, + uint8_t accept, uint32_t passkey) +{ + struct hal_cmd_ssp_reply cmd; + + DBG("bdaddr: %s", bdaddr2str(bd_addr)); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + /* type match IPC type */ + cmd.ssp_variant = variant; + cmd.accept = accept; + cmd.passkey = passkey; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_SSP_REPLY, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static const void *get_profile_interface(const char *profile_id) +{ + DBG("%s", profile_id); + + if (!interface_ready()) + return NULL; + + if (!strcmp(profile_id, BT_PROFILE_SOCKETS_ID)) + return bt_get_socket_interface(); + + if (!strcmp(profile_id, BT_PROFILE_HIDHOST_ID)) + return bt_get_hidhost_interface(); + + if (!strcmp(profile_id, BT_PROFILE_PAN_ID)) + return bt_get_pan_interface(); + + if (!strcmp(profile_id, BT_PROFILE_ADVANCED_AUDIO_ID)) + return bt_get_a2dp_interface(); + + if (!strcmp(profile_id, BT_PROFILE_AV_RC_ID)) + return bt_get_avrcp_interface(); + + if (!strcmp(profile_id, BT_PROFILE_HANDSFREE_ID)) + return bt_get_handsfree_interface(); + + if (!strcmp(profile_id, BT_PROFILE_GATT_ID)) + return bt_get_gatt_interface(); + + if (!strcmp(profile_id, BT_PROFILE_HEALTH_ID)) + return bt_get_health_interface(); + + return NULL; +} + +static int dut_mode_configure(uint8_t enable) +{ + struct hal_cmd_dut_mode_conf cmd; + + DBG("enable %u", enable); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.enable = enable; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_DUT_MODE_CONF, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int dut_mode_send(uint16_t opcode, uint8_t *buf, uint8_t buf_len) +{ + char cmd_buf[IPC_MTU]; + struct hal_cmd_dut_mode_send *cmd = (void *) cmd_buf; + size_t len; + + DBG("opcode %u len %u", opcode, buf_len); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd->opcode = opcode; + cmd->len = buf_len; + memcpy(cmd->data, buf, cmd->len); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_DUT_MODE_SEND, + len, cmd, 0, NULL, NULL); +} + +static int le_test_mode(uint16_t opcode, uint8_t *buf, uint8_t buf_len) +{ + char cmd_buf[IPC_MTU]; + struct hal_cmd_le_test_mode *cmd = (void *) cmd_buf; + size_t len; + + DBG("opcode %u len %u", opcode, buf_len); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd->opcode = opcode; + cmd->len = buf_len; + memcpy(cmd->data, buf, cmd->len); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_LE_TEST_MODE, + len, cmd, 0, NULL, NULL); +} + +static int config_hci_snoop_log(uint8_t enable) +{ + const char *property; + + DBG("enable %u", enable); + + property = enable ? "bluetooth.start" : "bluetooth.stop"; + + if (property_set(property, "snoop") < 0) { + error("Failed to set %s=snoop", property); + return BT_STATUS_FAIL; + } + + return BT_STATUS_SUCCESS; +} + +static const bt_interface_t bluetooth_if = { + .size = sizeof(bt_interface_t), + .init = init, + .enable = enable, + .disable = disable, + .cleanup = cleanup, + .get_adapter_properties = get_adapter_properties, + .get_adapter_property = get_adapter_property, + .set_adapter_property = set_adapter_property, + .get_remote_device_properties = get_remote_device_properties, + .get_remote_device_property = get_remote_device_property, + .set_remote_device_property = set_remote_device_property, + .get_remote_service_record = get_remote_service_record, + .get_remote_services = get_remote_services, + .start_discovery = start_discovery, + .cancel_discovery = cancel_discovery, + .create_bond = create_bond, + .remove_bond = remove_bond, + .cancel_bond = cancel_bond, + .pin_reply = pin_reply, + .ssp_reply = ssp_reply, + .get_profile_interface = get_profile_interface, + .dut_mode_configure = dut_mode_configure, + .dut_mode_send = dut_mode_send, + .le_test_mode = le_test_mode, + .config_hci_snoop_log = config_hci_snoop_log, +}; + +static const bt_interface_t *get_bluetooth_interface(void) +{ + DBG(""); + + return &bluetooth_if; +} + +static int close_bluetooth(struct hw_device_t *device) +{ + DBG(""); + + cleanup(); + + free(device); + + return 0; +} + +static int open_bluetooth(const struct hw_module_t *module, char const *name, + struct hw_device_t **device) +{ + bluetooth_device_t *dev = malloc(sizeof(bluetooth_device_t)); + + DBG(""); + + memset(dev, 0, sizeof(bluetooth_device_t)); + dev->common.tag = HARDWARE_DEVICE_TAG; + dev->common.version = 0; + dev->common.module = (struct hw_module_t *) module; + dev->common.close = close_bluetooth; + dev->get_bluetooth_interface = get_bluetooth_interface; + + *device = (struct hw_device_t *) dev; + + return 0; +} + +static struct hw_module_methods_t bluetooth_module_methods = { + .open = open_bluetooth, +}; + +struct hw_module_t HAL_MODULE_INFO_SYM = { + .tag = HARDWARE_MODULE_TAG, + .version_major = 1, + .version_minor = 0, + .id = BT_HARDWARE_MODULE_ID, + .name = "BlueZ Bluetooth stack", + .author = "Intel Corporation", + .methods = &bluetooth_module_methods +};
diff --git a/bluez/android/hal-gatt.c b/bluez/android/hal-gatt.c new file mode 100644 index 0000000..51caf8d --- /dev/null +++ b/bluez/android/hal-gatt.c
@@ -0,0 +1,1189 @@ +/* + * Copyright (C) 2014 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdbool.h> +#include <string.h> + +#include "hal-log.h" +#include "hal.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "hal-ipc.h" +#include "hal-utils.h" + +static const btgatt_callbacks_t *cbs = NULL; + +static bool interface_ready(void) +{ + return cbs != NULL; +} + +static void gatt_id_from_hal(btgatt_gatt_id_t *to, + struct hal_gatt_gatt_id *from) +{ + memcpy(&to->uuid, from->uuid, sizeof(to->uuid)); + to->inst_id = from->inst_id; +} + +static void gatt_id_to_hal(struct hal_gatt_gatt_id *to, btgatt_gatt_id_t *from) +{ + memcpy(to->uuid, &from->uuid, sizeof(from->uuid)); + to->inst_id = from->inst_id; +} + +static void srvc_id_from_hal(btgatt_srvc_id_t *to, + struct hal_gatt_srvc_id *from) +{ + memcpy(&to->id.uuid, from->uuid, sizeof(to->id.uuid)); + to->id.inst_id = from->inst_id; + to->is_primary = from->is_primary; +} + +static void srvc_id_to_hal(struct hal_gatt_srvc_id *to, btgatt_srvc_id_t *from) +{ + memcpy(to->uuid, &from->id.uuid, sizeof(from->id.uuid)); + to->inst_id = from->id.inst_id; + to->is_primary = from->is_primary; +} + +/* Client Event Handlers */ + +static void handle_register_client(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_register_client *ev = buf; + + if (cbs->client->register_client_cb) + cbs->client->register_client_cb(ev->status, ev->client_if, + (bt_uuid_t *) ev->app_uuid); +} + +static void handle_scan_result(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_scan_result *ev = buf; + + if (cbs->client->scan_result_cb) + cbs->client->scan_result_cb((bt_bdaddr_t *) ev->bda, ev->rssi, + ev->adv_data); +} + +static void handle_connect(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_connect *ev = buf; + + if (cbs->client->open_cb) + cbs->client->open_cb(ev->conn_id, ev->status, ev->client_if, + (bt_bdaddr_t *) ev->bda); +} + +static void handle_disconnect(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_disconnect *ev = buf; + + if (cbs->client->close_cb) + cbs->client->close_cb(ev->conn_id, ev->status, ev->client_if, + (bt_bdaddr_t *) ev->bda); +} + +static void handle_search_complete(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_search_complete *ev = buf; + + if (cbs->client->search_complete_cb) + cbs->client->search_complete_cb(ev->conn_id, ev->status); +} + +static void handle_search_result(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_search_result *ev = buf; + btgatt_srvc_id_t srvc_id; + + srvc_id_from_hal(&srvc_id, &ev->srvc_id); + + if (cbs->client->search_result_cb) + cbs->client->search_result_cb(ev->conn_id, &srvc_id); +} + +static void handle_get_characteristic(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_get_characteristic *ev = buf; + btgatt_gatt_id_t char_id; + btgatt_srvc_id_t srvc_id; + + srvc_id_from_hal(&srvc_id, &ev->srvc_id); + gatt_id_from_hal(&char_id, &ev->char_id); + + if (cbs->client->get_characteristic_cb) + cbs->client->get_characteristic_cb(ev->conn_id, ev->status, + &srvc_id, &char_id, + ev->char_prop); +} + +static void handle_get_descriptor(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_get_descriptor *ev = buf; + btgatt_gatt_id_t descr_id; + btgatt_gatt_id_t char_id; + btgatt_srvc_id_t srvc_id; + + srvc_id_from_hal(&srvc_id, &ev->srvc_id); + gatt_id_from_hal(&char_id, &ev->char_id); + gatt_id_from_hal(&descr_id, &ev->descr_id); + + if (cbs->client->get_descriptor_cb) + cbs->client->get_descriptor_cb(ev->conn_id, ev->status, + &srvc_id, &char_id, &descr_id); +} + +static void handle_get_included_service(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_get_inc_service *ev = buf; + btgatt_srvc_id_t srvc_id; + btgatt_srvc_id_t incl_srvc_id; + + srvc_id_from_hal(&srvc_id, &ev->srvc_id); + srvc_id_from_hal(&incl_srvc_id, &ev->incl_srvc_id); + + if (cbs->client->get_included_service_cb) + cbs->client->get_included_service_cb(ev->conn_id, ev->status, + &srvc_id, + &incl_srvc_id); +} + +static void handle_register_for_notification(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_reg_for_notif *ev = buf; + btgatt_gatt_id_t char_id; + btgatt_srvc_id_t srvc_id; + + srvc_id_from_hal(&srvc_id, &ev->srvc_id); + gatt_id_from_hal(&char_id, &ev->char_id); + + if (cbs->client->register_for_notification_cb) + cbs->client->register_for_notification_cb(ev->conn_id, + ev->registered, + ev->status, + &srvc_id, + &char_id); +} + +static void handle_notify(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_notify *ev = buf; + btgatt_notify_params_t params; + + memset(¶ms, 0, sizeof(params)); + memcpy(params.value, ev->value, ev->len); + memcpy(¶ms.bda, ev->bda, sizeof(params.bda)); + + srvc_id_from_hal(¶ms.srvc_id, &ev->srvc_id); + gatt_id_from_hal(¶ms.char_id, &ev->char_id); + + params.len = ev->len; + params.is_notify = ev->is_notify; + + if (cbs->client->notify_cb) + cbs->client->notify_cb(ev->conn_id, ¶ms); +} + +static void handle_read_characteristic(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_read_characteristic *ev = buf; + btgatt_read_params_t params; + + memset(¶ms, 0, sizeof(params)); + + srvc_id_from_hal(¶ms.srvc_id, &ev->data.srvc_id); + gatt_id_from_hal(¶ms.char_id, &ev->data.char_id); + gatt_id_from_hal(¶ms.descr_id, &ev->data.descr_id); + + memcpy(¶ms.value.value, ev->data.value, ev->data.len); + + params.value_type = ev->data.value_type; + params.value.len = ev->data.len; + params.status = ev->data.status; + + if (cbs->client->read_characteristic_cb) + cbs->client->read_characteristic_cb(ev->conn_id, ev->status, + ¶ms); +} + +static void handle_write_characteristic(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_write_characteristic *ev = buf; + btgatt_write_params_t params; + + memset(¶ms, 0, sizeof(params)); + + srvc_id_from_hal(¶ms.srvc_id, &ev->data.srvc_id); + gatt_id_from_hal(¶ms.char_id, &ev->data.char_id); + gatt_id_from_hal(¶ms.descr_id, &ev->data.descr_id); + + params.status = ev->data.status; + + if (cbs->client->write_characteristic_cb) + cbs->client->write_characteristic_cb(ev->conn_id, ev->status, + ¶ms); +} + +static void handle_read_descriptor(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_read_descriptor *ev = buf; + btgatt_read_params_t params; + + memset(¶ms, 0, sizeof(params)); + + srvc_id_from_hal(¶ms.srvc_id, &ev->data.srvc_id); + gatt_id_from_hal(¶ms.char_id, &ev->data.char_id); + gatt_id_from_hal(¶ms.descr_id, &ev->data.descr_id); + + memcpy(¶ms.value.value, ev->data.value, ev->data.len); + + params.value_type = ev->data.value_type; + params.value.len = ev->data.len; + params.status = ev->data.status; + + if (cbs->client->read_descriptor_cb) + cbs->client->read_descriptor_cb(ev->conn_id, ev->status, + ¶ms); +} + +static void handle_write_descriptor(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_write_descriptor *ev = buf; + btgatt_write_params_t params; + + memset(¶ms, 0, sizeof(params)); + + srvc_id_from_hal(¶ms.srvc_id, &ev->data.srvc_id); + gatt_id_from_hal(¶ms.char_id, &ev->data.char_id); + gatt_id_from_hal(¶ms.descr_id, &ev->data.descr_id); + + params.status = ev->data.status; + + if (cbs->client->write_descriptor_cb) + cbs->client->write_descriptor_cb(ev->conn_id, ev->status, + ¶ms); +} + +static void handle_execute_write(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_exec_write *ev = buf; + + if (cbs->client->execute_write_cb) + cbs->client->execute_write_cb(ev->conn_id, ev->status); +} + +static void handle_read_remote_rssi(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_read_remote_rssi *ev = buf; + + if (cbs->client->read_remote_rssi_cb) + cbs->client->read_remote_rssi_cb(ev->client_if, + (bt_bdaddr_t *) ev->address, + ev->rssi, ev->status); +} + +static void handle_listen(void *buf, uint16_t len) +{ + struct hal_ev_gatt_client_listen *ev = buf; + + if (cbs->client->listen_cb) + cbs->client->listen_cb(ev->status, ev->server_if); +} + +/* Server Event Handlers */ + +static void handle_register_server(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_register *ev = buf; + + if (cbs->server->register_server_cb) + cbs->server->register_server_cb(ev->status, ev->server_if, + (bt_uuid_t *) &ev->uuid); +} + +static void handle_connection(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_connection *ev = buf; + + if (cbs->server->connection_cb) + cbs->server->connection_cb(ev->conn_id, ev->server_if, + ev->connected, + (bt_bdaddr_t *) &ev->bdaddr); +} + +static void handle_service_added(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_service_added *ev = buf; + btgatt_srvc_id_t srvc_id; + + srvc_id_from_hal(&srvc_id, &ev->srvc_id); + + if (cbs->server->service_added_cb) + cbs->server->service_added_cb(ev->status, ev->server_if, + &srvc_id, ev->srvc_handle); +} + +static void handle_included_service_added(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_inc_srvc_added *ev = buf; + + if (cbs->server->included_service_added_cb) + cbs->server->included_service_added_cb(ev->status, + ev->server_if, + ev->srvc_handle, + ev->incl_srvc_handle); +} + +static void handle_characteristic_added(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_characteristic_added *ev = buf; + + if (cbs->server->characteristic_added_cb) + cbs->server->characteristic_added_cb(ev->status, ev->server_if, + (bt_uuid_t *) &ev->uuid, + ev->srvc_handle, + ev->char_handle); +} + +static void handle_descriptor_added(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_descriptor_added *ev = buf; + + if (cbs->server->descriptor_added_cb) + cbs->server->descriptor_added_cb(ev->status, ev->server_if, + (bt_uuid_t *) &ev->uuid, + ev->srvc_handle, + ev->descr_handle); +} + +static void handle_service_started(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_service_started *ev = buf; + + if (cbs->server->service_started_cb) + cbs->server->service_started_cb(ev->status, ev->server_if, + ev->srvc_handle); +} + +static void handle_service_stopped(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_service_stopped *ev = buf; + + if (cbs->server->service_stopped_cb) + cbs->server->service_stopped_cb(ev->status, ev->server_if, + ev->srvc_handle); +} + +static void handle_service_deleted(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_service_deleted *ev = buf; + + if (cbs->server->service_deleted_cb) + cbs->server->service_deleted_cb(ev->status, ev->server_if, + ev->srvc_handle); +} + +static void handle_request_read(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_request_read *ev = buf; + + if (cbs->server->request_read_cb) + cbs->server->request_read_cb(ev->conn_id, ev->trans_id, + (bt_bdaddr_t *) &ev->bdaddr, + ev->attr_handle, ev->offset, + ev->is_long); +} + +static void handle_request_write(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_request_write *ev = buf; + + if (cbs->server->request_write_cb) + cbs->server->request_write_cb(ev->conn_id, ev->trans_id, + (bt_bdaddr_t *) ev->bdaddr, + ev->attr_handle, ev->offset, + ev->length, ev->need_rsp, + ev->is_prep, ev->value); +} + +static void handle_request_exec_write(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_request_exec_write *ev = buf; + + if (cbs->server->request_exec_write_cb) + cbs->server->request_exec_write_cb(ev->conn_id, ev->trans_id, + (bt_bdaddr_t *) ev->bdaddr, + ev->exec_write); +} + +static void handle_response_confirmation(void *buf, uint16_t len) +{ + struct hal_ev_gatt_server_rsp_confirmation *ev = buf; + + if (cbs->server->response_confirmation_cb) + cbs->server->response_confirmation_cb(ev->status, ev->handle); +} + +/* handlers will be called from notification thread context, + * index in table equals to 'opcode - HAL_MINIMUM_EVENT' + */ +static const struct hal_ipc_handler ev_handlers[] = { + /* Client Event Handlers */ + {handle_register_client, false, + sizeof(struct hal_ev_gatt_client_register_client)}, + {handle_scan_result, true, + sizeof(struct hal_ev_gatt_client_scan_result)}, + {handle_connect, false, sizeof(struct hal_ev_gatt_client_connect)}, + {handle_disconnect, false, + sizeof(struct hal_ev_gatt_client_disconnect)}, + {handle_search_complete, false, + sizeof(struct hal_ev_gatt_client_search_complete)}, + {handle_search_result, false, + sizeof(struct hal_ev_gatt_client_search_result)}, + {handle_get_characteristic, false, + sizeof(struct hal_ev_gatt_client_get_characteristic)}, + {handle_get_descriptor, false, + sizeof(struct hal_ev_gatt_client_get_descriptor)}, + {handle_get_included_service, false, + sizeof(struct hal_ev_gatt_client_get_inc_service)}, + {handle_register_for_notification, false, + sizeof(struct hal_ev_gatt_client_reg_for_notif)}, + {handle_notify, true, sizeof(struct hal_ev_gatt_client_notify)}, + {handle_read_characteristic, true, + sizeof(struct hal_ev_gatt_client_read_characteristic)}, + {handle_write_characteristic, false, + sizeof(struct hal_ev_gatt_client_write_characteristic)}, + {handle_read_descriptor, true, + sizeof(struct hal_ev_gatt_client_read_descriptor)}, + {handle_write_descriptor, false, + sizeof(struct hal_ev_gatt_client_write_descriptor)}, + {handle_execute_write, false, + sizeof(struct hal_ev_gatt_client_exec_write)}, + {handle_read_remote_rssi, false, + sizeof(struct hal_ev_gatt_client_read_remote_rssi)}, + {handle_listen, false, sizeof(struct hal_ev_gatt_client_listen)}, + + /* Server Event Handlers */ + {handle_register_server, false, + sizeof(struct hal_ev_gatt_server_register)}, + {handle_connection, false, + sizeof(struct hal_ev_gatt_server_connection)}, + {handle_service_added, false, + sizeof(struct hal_ev_gatt_server_service_added)}, + {handle_included_service_added, false, + sizeof(struct hal_ev_gatt_server_service_added)}, + {handle_characteristic_added, false, + sizeof(struct hal_ev_gatt_server_characteristic_added)}, + {handle_descriptor_added, false, + sizeof(struct hal_ev_gatt_server_descriptor_added)}, + {handle_service_started, false, + sizeof(struct hal_ev_gatt_server_service_started)}, + {handle_service_stopped, false, + sizeof(struct hal_ev_gatt_server_service_stopped)}, + {handle_service_deleted, false, + sizeof(struct hal_ev_gatt_server_service_deleted)}, + {handle_request_read, false, + sizeof(struct hal_ev_gatt_server_request_read)}, + {handle_request_write, true, + sizeof(struct hal_ev_gatt_server_request_write)}, + {handle_request_exec_write, false, + sizeof(struct hal_ev_gatt_server_request_exec_write)}, + {handle_response_confirmation, false, + sizeof(struct hal_ev_gatt_server_rsp_confirmation)}, +}; + +/* Client API */ + +static bt_status_t register_client(bt_uuid_t *uuid) +{ + struct hal_cmd_gatt_client_register cmd; + + memcpy(cmd.uuid, uuid, sizeof(*uuid)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_REGISTER, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t unregister_client(int client_if) +{ + struct hal_cmd_gatt_client_unregister cmd; + + cmd.client_if = client_if; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_UNREGISTER, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t scan(int client_if, bool start) +{ + struct hal_cmd_gatt_client_scan cmd; + + cmd.client_if = client_if; + cmd.start = start; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_SCAN, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t connect(int client_if, const bt_bdaddr_t *bd_addr, + bool is_direct) +{ + struct hal_cmd_gatt_client_connect cmd; + + cmd.client_if = client_if; + cmd.is_direct = is_direct; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_CONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t disconnect(int client_if, const bt_bdaddr_t *bd_addr, + int conn_id) +{ + struct hal_cmd_gatt_client_disconnect cmd; + + cmd.client_if = client_if; + cmd.conn_id = conn_id; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_DISCONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t listen(int client_if, bool start) +{ + struct hal_cmd_gatt_client_listen cmd; + + cmd.client_if = client_if; + cmd.start = start; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_LISTEN, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t refresh(int client_if, const bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_gatt_client_refresh cmd; + + cmd.client_if = client_if; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_REFRESH, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t search_service(int conn_id, bt_uuid_t *filter_uuid) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_client_search_service *cmd = (void *) buf; + size_t len = sizeof(*cmd); + + memset(cmd, 0, sizeof(*cmd)); + + cmd->conn_id = conn_id; + + if (filter_uuid) { + memcpy(cmd->filter_uuid, filter_uuid, sizeof(*filter_uuid)); + len += sizeof(*filter_uuid); + cmd->number = 1; + } + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_SEARCH_SERVICE, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t get_included_service(int conn_id, btgatt_srvc_id_t *srvc_id, + btgatt_srvc_id_t *start_incl_srvc_id) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_client_get_included_service *cmd = (void *) buf; + size_t len = sizeof(*cmd); + + cmd->conn_id = conn_id; + + srvc_id_to_hal(&cmd->srvc_id[0], srvc_id); + len += sizeof(cmd->srvc_id[0]); + cmd->number = 1; + + if (start_incl_srvc_id) { + srvc_id_to_hal(&cmd->srvc_id[1], start_incl_srvc_id); + len += sizeof(cmd->srvc_id[1]); + cmd->number++; + } + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_GET_INCLUDED_SERVICE, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t get_characteristic(int conn_id, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *start_char_id) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_client_get_characteristic *cmd = (void *) buf; + size_t len = sizeof(*cmd); + + cmd->conn_id = conn_id; + + srvc_id_to_hal(&cmd->srvc_id, srvc_id); + cmd->number = 0; + + if (start_char_id) { + gatt_id_to_hal(&cmd->gatt_id[0], start_char_id); + len += sizeof(cmd->gatt_id[0]); + cmd->number = 1; + } + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_GET_CHARACTERISTIC, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t get_descriptor(int conn_id, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id, + btgatt_gatt_id_t *start_descr_id) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_client_get_descriptor *cmd = (void *) buf; + size_t len = sizeof(*cmd); + + cmd->conn_id = conn_id; + + srvc_id_to_hal(&cmd->srvc_id, srvc_id); + + gatt_id_to_hal(&cmd->gatt_id[0], char_id); + len += sizeof(cmd->gatt_id[0]); + cmd->number = 1; + + if (start_descr_id) { + gatt_id_to_hal(&cmd->gatt_id[1], start_descr_id); + len += sizeof(cmd->gatt_id[1]); + cmd->number++; + } + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_GET_DESCRIPTOR, + len, cmd, 0 , NULL, NULL); +} + +static bt_status_t read_characteristic(int conn_id, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id, + int auth_req) +{ + struct hal_cmd_gatt_client_read_characteristic cmd; + + cmd.conn_id = conn_id; + cmd.auth_req = auth_req; + + srvc_id_to_hal(&cmd.srvc_id, srvc_id); + gatt_id_to_hal(&cmd.gatt_id, char_id); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_READ_CHARACTERISTIC, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t write_characteristic(int conn_id, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id, + int write_type, int len, int auth_req, + char *p_value) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_client_write_characteristic *cmd = (void *) buf; + size_t cmd_len = sizeof(*cmd) + len; + + cmd->conn_id = conn_id; + cmd->write_type = write_type; + cmd->len = len; + cmd->auth_req = auth_req; + + srvc_id_to_hal(&cmd->srvc_id, srvc_id); + gatt_id_to_hal(&cmd->gatt_id, char_id); + + memcpy(cmd->value, p_value, len); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_WRITE_CHARACTERISTIC, + cmd_len, cmd, 0, NULL, NULL); +} + +static bt_status_t read_descriptor(int conn_id, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id, + btgatt_gatt_id_t *descr_id, + int auth_req) +{ + struct hal_cmd_gatt_client_read_descriptor cmd; + + cmd.conn_id = conn_id; + cmd.auth_req = auth_req; + + srvc_id_to_hal(&cmd.srvc_id, srvc_id); + gatt_id_to_hal(&cmd.char_id, char_id); + gatt_id_to_hal(&cmd.descr_id, descr_id); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_READ_DESCRIPTOR, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t write_descriptor(int conn_id, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id, + btgatt_gatt_id_t *descr_id, + int write_type, int len, int auth_req, + char *p_value) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_client_write_descriptor *cmd = (void *) buf; + size_t cmd_len = sizeof(*cmd) + len; + + cmd->conn_id = conn_id; + cmd->write_type = write_type; + cmd->len = len; + cmd->auth_req = auth_req; + + srvc_id_to_hal(&cmd->srvc_id, srvc_id); + gatt_id_to_hal(&cmd->char_id, char_id); + gatt_id_to_hal(&cmd->descr_id, descr_id); + + memcpy(cmd->value, p_value, len); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR, + cmd_len, cmd, 0, NULL, NULL); +} + +static bt_status_t execute_write(int conn_id, int execute) +{ + struct hal_cmd_gatt_client_execute_write cmd; + + cmd.conn_id = conn_id; + cmd.execute = execute; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_EXECUTE_WRITE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t register_for_notification(int client_if, + const bt_bdaddr_t *bd_addr, + btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id) +{ + struct hal_cmd_gatt_client_register_for_notification cmd; + + cmd.client_if = client_if; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + srvc_id_to_hal(&cmd.srvc_id, srvc_id); + gatt_id_to_hal(&cmd.char_id, char_id); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_REGISTER_FOR_NOTIFICATION, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t deregister_for_notification(int client_if, + const bt_bdaddr_t *bd_addr, + btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id) +{ + struct hal_cmd_gatt_client_deregister_for_notification cmd; + + cmd.client_if = client_if; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + srvc_id_to_hal(&cmd.srvc_id, srvc_id); + gatt_id_to_hal(&cmd.char_id, char_id); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_DEREGISTER_FOR_NOTIFICATION, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t read_remote_rssi(int client_if, const bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_gatt_client_read_remote_rssi cmd; + + cmd.client_if = client_if; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_READ_REMOTE_RSSI, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int get_device_type(const bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_gatt_client_get_device_type cmd; + uint8_t dev_type; + size_t resp_len = sizeof(dev_type); + bt_status_t status; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + status = hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE, + sizeof(cmd), &cmd, &resp_len, &dev_type, NULL); + + if (status != BT_STATUS_SUCCESS || resp_len != sizeof(dev_type)) + return 0; + + return dev_type; +} + +static bt_status_t set_adv_data(int server_if, bool set_scan_rsp, + bool include_name, bool include_txpower, + int min_interval, int max_interval, + int appearance, uint16_t manufacturer_len, + char *manufacturer_data) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_client_set_adv_data *cmd = (void *) buf; + size_t cmd_len = sizeof(*cmd) + manufacturer_len; + + cmd->server_if = server_if; + cmd->set_scan_rsp = set_scan_rsp; + cmd->include_name = include_name; + cmd->include_txpower = include_txpower; + cmd->min_interval = min_interval; + cmd->max_interval = max_interval; + cmd->appearance = appearance; + cmd->manufacturer_len = manufacturer_len; + + memcpy(cmd->manufacturer_data, manufacturer_data, manufacturer_len); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_SET_ADV_DATA, + cmd_len, cmd, 0, NULL, NULL); +} + +static bt_status_t test_command(int command, btgatt_test_params_t *params) +{ + struct hal_cmd_gatt_client_test_command cmd; + + cmd.command = command; + + memcpy(cmd.bda1, params->bda1, sizeof(*params->bda1)); + memcpy(cmd.uuid1, params->uuid1, sizeof(*params->uuid1)); + + cmd.u1 = params->u1; + cmd.u2 = params->u2; + cmd.u3 = params->u3; + cmd.u4 = params->u4; + cmd.u5 = params->u5; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_CLIENT_TEST_COMMAND, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +/* Server API */ + +static bt_status_t register_server(bt_uuid_t *uuid) +{ + struct hal_cmd_gatt_server_register cmd; + + memcpy(cmd.uuid, uuid, sizeof(*uuid)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_REGISTER, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t unregister_server(int server_if) +{ + struct hal_cmd_gatt_server_unregister cmd; + + cmd.server_if = server_if; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_UNREGISTER, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t server_connect(int server_if, const bt_bdaddr_t *bd_addr, + bool is_direct) +{ + struct hal_cmd_gatt_server_connect cmd; + + cmd.server_if = server_if; + cmd.is_direct = is_direct; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_CONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t server_disconnect(int server_if, const bt_bdaddr_t *bd_addr, + int conn_id) +{ + struct hal_cmd_gatt_server_disconnect cmd; + + cmd.server_if = server_if; + cmd.conn_id = conn_id; + + memcpy(cmd.bdaddr, bd_addr, sizeof(*bd_addr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_DISCONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t add_service(int server_if, btgatt_srvc_id_t *srvc_id, + int num_handles) +{ + struct hal_cmd_gatt_server_add_service cmd; + + cmd.server_if = server_if; + cmd.num_handles = num_handles; + + srvc_id_to_hal(&cmd.srvc_id, srvc_id); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_ADD_SERVICE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t add_included_service(int server_if, int service_handle, + int included_handle) +{ + struct hal_cmd_gatt_server_add_inc_service cmd; + + cmd.server_if = server_if; + cmd.service_handle = service_handle; + cmd.included_handle = included_handle; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_ADD_INC_SERVICE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t add_characteristic(int server_if, int service_handle, + bt_uuid_t *uuid, int properties, + int permissions) +{ + struct hal_cmd_gatt_server_add_characteristic cmd; + + cmd.server_if = server_if; + cmd.service_handle = service_handle; + cmd.properties = properties; + cmd.permissions = permissions; + + memcpy(cmd.uuid, uuid, sizeof(*uuid)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_ADD_CHARACTERISTIC, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t add_descriptor(int server_if, int service_handle, + bt_uuid_t *uuid, int permissions) +{ + struct hal_cmd_gatt_server_add_descriptor cmd; + + cmd.server_if = server_if; + cmd.service_handle = service_handle; + cmd.permissions = permissions; + + memcpy(cmd.uuid, uuid, sizeof(*uuid)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_ADD_DESCRIPTOR, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t start_service(int server_if, int service_handle, + int transport) +{ + struct hal_cmd_gatt_server_start_service cmd; + + cmd.server_if = server_if; + cmd.service_handle = service_handle; + cmd.transport = transport; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_START_SERVICE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t stop_service(int server_if, int service_handle) +{ + struct hal_cmd_gatt_server_stop_service cmd; + + cmd.server_if = server_if; + cmd.service_handle = service_handle; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, HAL_OP_GATT_SERVER_STOP_SERVICE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t delete_service(int server_if, int service_handle) +{ + struct hal_cmd_gatt_server_delete_service cmd; + + cmd.server_if = server_if; + cmd.service_handle = service_handle; + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_DELETE_SERVICE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t send_indication(int server_if, int attribute_handle, + int conn_id, int len, int confirm, + char *p_value) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_server_send_indication *cmd = (void *) buf; + size_t cmd_len = sizeof(*cmd) + len; + + cmd->server_if = server_if; + cmd->attribute_handle = attribute_handle; + cmd->conn_id = conn_id; + cmd->len = len; + cmd->confirm = confirm; + + memcpy(cmd->value, p_value, len); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_SEND_INDICATION, + cmd_len, cmd, 0, NULL, NULL); +} + +static bt_status_t send_response(int conn_id, int trans_id, int status, + btgatt_response_t *response) +{ + char buf[IPC_MTU]; + struct hal_cmd_gatt_server_send_response *cmd = (void *) buf; + size_t cmd_len = sizeof(*cmd) + sizeof(*response); + + cmd->conn_id = conn_id; + cmd->trans_id = trans_id; + cmd->status = status; + cmd->len = sizeof(*response); + + memcpy(cmd->data, response, sizeof(*response)); + + return hal_ipc_cmd(HAL_SERVICE_ID_GATT, + HAL_OP_GATT_SERVER_SEND_RESPONSE, + cmd_len, cmd, 0, NULL, NULL); +} + +static bt_status_t init(const btgatt_callbacks_t *callbacks) +{ + struct hal_cmd_register_module cmd; + int ret; + + DBG(""); + + if (interface_ready()) + return BT_STATUS_DONE; + + cbs = callbacks; + + hal_ipc_register(HAL_SERVICE_ID_GATT, ev_handlers, + sizeof(ev_handlers)/sizeof(ev_handlers[0])); + + cmd.service_id = HAL_SERVICE_ID_GATT; + + ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + if (ret != BT_STATUS_SUCCESS) { + cbs = NULL; + hal_ipc_unregister(HAL_SERVICE_ID_GATT); + } + + return ret; +} + +static void cleanup(void) +{ + struct hal_cmd_unregister_module cmd; + + DBG(""); + + if (!interface_ready()) + return; + + cbs = NULL; + + cmd.service_id = HAL_SERVICE_ID_GATT; + + hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + hal_ipc_unregister(HAL_SERVICE_ID_GATT); +} + +static btgatt_client_interface_t client_iface = { + .register_client = register_client, + .unregister_client = unregister_client, + .scan = scan, + .connect = connect, + .disconnect = disconnect, + .listen = listen, + .refresh = refresh, + .search_service = search_service, + .get_included_service = get_included_service, + .get_characteristic = get_characteristic, + .get_descriptor = get_descriptor, + .read_characteristic = read_characteristic, + .write_characteristic = write_characteristic, + .read_descriptor = read_descriptor, + .write_descriptor = write_descriptor, + .execute_write = execute_write, + .register_for_notification = register_for_notification, + .deregister_for_notification = deregister_for_notification, + .read_remote_rssi = read_remote_rssi, + .get_device_type = get_device_type, + .set_adv_data = set_adv_data, + .test_command = test_command, +}; + +static btgatt_server_interface_t server_iface = { + .register_server = register_server, + .unregister_server = unregister_server, + .connect = server_connect, + .disconnect = server_disconnect, + .add_service = add_service, + .add_included_service = add_included_service, + .add_characteristic = add_characteristic, + .add_descriptor = add_descriptor, + .start_service = start_service, + .stop_service = stop_service, + .delete_service = delete_service, + .send_indication = send_indication, + .send_response = send_response, +}; + +static btgatt_interface_t iface = { + .size = sizeof(iface), + .init = init, + .cleanup = cleanup, + .client = &client_iface, + .server = &server_iface, +}; + +btgatt_interface_t *bt_get_gatt_interface(void) +{ + return &iface; +}
diff --git a/bluez/android/hal-handsfree.c b/bluez/android/hal-handsfree.c new file mode 100644 index 0000000..5a05975 --- /dev/null +++ b/bluez/android/hal-handsfree.c
@@ -0,0 +1,591 @@ +/* + * Copyright (C) 2014 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdbool.h> +#include <stddef.h> +#include <string.h> +#include <stdlib.h> + +#include <cutils/properties.h> + +#include "hal-log.h" +#include "hal.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "hal-ipc.h" + +#define MODE_PROPERTY_NAME "persist.sys.bluetooth.handsfree" + +static const bthf_callbacks_t *cbs = NULL; + +static bool interface_ready(void) +{ + return cbs != NULL; +} + +static void handle_conn_state(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_conn_state *ev = buf; + + if (cbs->connection_state_cb) + cbs->connection_state_cb(ev->state, + (bt_bdaddr_t *) (ev->bdaddr)); +} + +static void handle_audio_state(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_audio_state *ev = buf; + + if (cbs->audio_state_cb) + cbs->audio_state_cb(ev->state, (bt_bdaddr_t *) (ev->bdaddr)); +} + +static void handle_vr_state(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_vr_state *ev = buf; + + if (cbs->vr_cmd_cb) + cbs->vr_cmd_cb(ev->state); +} + +static void handle_answer(void *buf, uint16_t len) +{ + if (cbs->answer_call_cmd_cb) + cbs->answer_call_cmd_cb(); +} + +static void handle_hangup(void *buf, uint16_t len) +{ + if (cbs->hangup_call_cmd_cb) + cbs->hangup_call_cmd_cb(); +} + +static void handle_volume(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_volume *ev = buf; + + if (cbs->volume_cmd_cb) + cbs->volume_cmd_cb(ev->type, ev->volume); +} + +static void handle_dial(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_dial *ev = buf; + uint16_t num_len = ev->number_len; + + if (len != sizeof(*ev) + num_len || + (num_len != 0 && ev->number[num_len - 1] != '\0')) { + error("invalid dial event, aborting"); + exit(EXIT_FAILURE); + } + + if (!cbs->dial_call_cmd_cb) + return; + + if (ev->number_len) + cbs->dial_call_cmd_cb((char *) ev->number); + else + cbs->dial_call_cmd_cb(NULL); +} + +static void handle_dtmf(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_dtmf *ev = buf; + + if (cbs->dtmf_cmd_cb) + cbs->dtmf_cmd_cb(ev->tone); +} + +static void handle_nrec(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_nrec *ev = buf; + + if (cbs->nrec_cmd_cb) + cbs->nrec_cmd_cb(ev->nrec); +} + +static void handle_chld(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_chld *ev = buf; + + if (cbs->chld_cmd_cb) + cbs->chld_cmd_cb(ev->chld); +} + +static void handle_cnum(void *buf, uint16_t len) +{ + if (cbs->cnum_cmd_cb) + cbs->cnum_cmd_cb(); +} + +static void handle_cind(void *buf, uint16_t len) +{ + if (cbs->cind_cmd_cb) + cbs->cind_cmd_cb(); +} + +static void handle_cops(void *buf, uint16_t len) +{ + if (cbs->cops_cmd_cb) + cbs->cops_cmd_cb(); +} + +static void handle_clcc(void *buf, uint16_t len) +{ + if (cbs->clcc_cmd_cb) + cbs->clcc_cmd_cb(); +} + +static void handle_unknown_at(void *buf, uint16_t len) +{ + struct hal_ev_handsfree_unknown_at *ev = buf; + + if (len != sizeof(*ev) + ev->len || + (ev->len != 0 && ev->buf[ev->len - 1] != '\0')) { + error("invalid unknown command event, aborting"); + exit(EXIT_FAILURE); + } + + if (cbs->unknown_at_cmd_cb) + cbs->unknown_at_cmd_cb((char *) ev->buf); +} + +static void handle_hsp_key_press(void *buf, uint16_t len) +{ + if (cbs->key_pressed_cmd_cb) + cbs->key_pressed_cmd_cb(); +} + +/* handlers will be called from notification thread context, + * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ +static const struct hal_ipc_handler ev_handlers[] = { + /* HAL_EV_HANDSFREE_CONN_STATE */ + {handle_conn_state, false, sizeof(struct hal_ev_handsfree_conn_state)}, + /* HAL_EV_HANDSFREE_AUDIO_STATE */ + {handle_audio_state, false, + sizeof(struct hal_ev_handsfree_audio_state)}, + /* HAL_EV_HANDSFREE_VR */ + {handle_vr_state, false, sizeof(struct hal_ev_handsfree_vr_state)}, + /*HAL_EV_HANDSFREE_ANSWER */ + {handle_answer, false, 0}, + /*HAL_EV_HANDSFREE_HANGUP */ + {handle_hangup, false, 0}, + /* HAL_EV_HANDSFREE_VOLUME */ + {handle_volume, false, sizeof(struct hal_ev_handsfree_volume)}, + /* HAL_EV_HANDSFREE_DIAL */ + {handle_dial, true, sizeof(struct hal_ev_handsfree_dial)}, + /* HAL_EV_HANDSFREE_DTMF */ + {handle_dtmf, false, sizeof(struct hal_ev_handsfree_dtmf)}, + /* HAL_EV_HANDSFREE_NREC */ + {handle_nrec, false, sizeof(struct hal_ev_handsfree_nrec)}, + /* HAL_EV_HANDSFREE_CHLD */ + {handle_chld, false, sizeof(struct hal_ev_handsfree_chld)}, + /* HAL_EV_HANDSFREE_CNUM */ + {handle_cnum, false, 0}, + /* HAL_EV_HANDSFREE_CIND */ + {handle_cind, false, 0}, + /* HAL_EV_HANDSFREE_COPS */ + {handle_cops, false, 0}, + /* HAL_EV_HANDSFREE_CLCC */ + {handle_clcc, false, 0}, + /* HAL_EV_HANDSFREE_UNKNOWN_AT */ + {handle_unknown_at, true, sizeof(struct hal_ev_handsfree_unknown_at)}, + /* HAL_EV_HANDSFREE_HSP_KEY_PRESS */ + {handle_hsp_key_press, false, 0}, +}; + +static uint8_t get_mode(void) +{ + char value[PROPERTY_VALUE_MAX]; + + if (property_get(MODE_PROPERTY_NAME, value, "") > 0 && + (!strcasecmp(value, "hfp"))) + return HAL_MODE_HANDSFREE_HFP; + + if (property_get(MODE_PROPERTY_NAME, value, "") > 0 && + (!strcasecmp(value, "hfp_wbs"))) + return HAL_MODE_HANDSFREE_HFP_WBS; + + return HAL_MODE_HANDSFREE_HSP_ONLY; +} + +static bt_status_t init(bthf_callbacks_t *callbacks) +{ + struct hal_cmd_register_module cmd; + int ret; + + DBG(""); + + if (interface_ready()) + return BT_STATUS_DONE; + + cbs = callbacks; + + hal_ipc_register(HAL_SERVICE_ID_HANDSFREE, ev_handlers, + sizeof(ev_handlers)/sizeof(ev_handlers[0])); + + cmd.service_id = HAL_SERVICE_ID_HANDSFREE; + cmd.mode = get_mode(); + + ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + if (ret != BT_STATUS_SUCCESS) { + cbs = NULL; + hal_ipc_unregister(HAL_SERVICE_ID_HANDSFREE); + } + + return ret; +} + +static bt_status_t handsfree_connect(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_handsfree_connect cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, HAL_OP_HANDSFREE_CONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t disconnect(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_handsfree_disconnect cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_DISCONNECT, sizeof(cmd), &cmd, + 0, NULL, NULL); +} + +static bt_status_t connect_audio(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_handsfree_connect_audio cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_CONNECT_AUDIO, sizeof(cmd), + &cmd, 0, NULL, NULL); +} + +static bt_status_t disconnect_audio(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_handsfree_disconnect_audio cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_DISCONNECT_AUDIO, sizeof(cmd), + &cmd, 0, NULL, NULL); +} + +static bt_status_t start_voice_recognition(void) +{ + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, HAL_OP_HANDSFREE_START_VR, + 0, NULL, 0, NULL, NULL); +} + +static bt_status_t stop_voice_recognition(void) +{ + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, HAL_OP_HANDSFREE_STOP_VR, + 0, NULL, 0, NULL, NULL); +} + +static bt_status_t volume_control(bthf_volume_type_t type, int volume) +{ + struct hal_cmd_handsfree_volume_control cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.type = type; + cmd.volume = volume; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_VOLUME_CONTROL, sizeof(cmd), + &cmd, 0, NULL, NULL); +} + +static bt_status_t device_status_notification(bthf_network_state_t state, + bthf_service_type_t type, + int signal, int battery) +{ + struct hal_cmd_handsfree_device_status_notif cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.state = state; + cmd.type = type; + cmd.signal = signal; + cmd.battery = battery; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_DEVICE_STATUS_NOTIF, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t cops_response(const char *cops) +{ + char buf[IPC_MTU]; + struct hal_cmd_handsfree_cops_response *cmd = (void *) buf; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!cops) + return BT_STATUS_PARM_INVALID; + + cmd->len = strlen(cops) + 1; + memcpy(cmd->buf, cops, cmd->len); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_COPS_RESPONSE, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t cind_response(int svc, int num_active, int num_held, + bthf_call_state_t state, int signal, + int roam, int batt_chg) +{ + struct hal_cmd_handsfree_cind_response cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.svc = svc; + cmd.num_active = num_active; + cmd.num_held = num_held; + cmd.state = state; + cmd.signal = signal; + cmd.roam = roam; + cmd.batt_chg = batt_chg; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_CIND_RESPONSE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t formatted_at_response(const char *rsp) +{ + char buf[IPC_MTU]; + struct hal_cmd_handsfree_formatted_at_response *cmd = (void *) buf; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!rsp) + return BT_STATUS_PARM_INVALID; + + cmd->len = strlen(rsp) + 1; + memcpy(cmd->buf, rsp, cmd->len); + + len = sizeof(*cmd) + cmd->len; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_FORMATTED_AT_RESPONSE, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t at_response(bthf_at_response_t response, int error) +{ + struct hal_cmd_handsfree_at_response cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.response = response; + cmd.error = error; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_AT_RESPONSE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t clcc_response(int index, bthf_call_direction_t dir, + bthf_call_state_t state, + bthf_call_mode_t mode, + bthf_call_mpty_type_t mpty, + const char *number, + bthf_call_addrtype_t type) +{ + char buf[IPC_MTU]; + struct hal_cmd_handsfree_clcc_response *cmd = (void *) buf; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd->index = index; + cmd->dir = dir; + cmd->state = state; + cmd->mode = mode; + cmd->mpty = mpty; + cmd->type = type; + + if (number) { + cmd->number_len = strlen(number) + 1; + memcpy(cmd->number, number, cmd->number_len); + } else { + cmd->number_len = 0; + } + + len = sizeof(*cmd) + cmd->number_len; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_CLCC_RESPONSE, + len, cmd, 0, NULL, NULL); +} + +static bt_status_t phone_state_change(int num_active, int num_held, + bthf_call_state_t state, + const char *number, + bthf_call_addrtype_t type) +{ + char buf[IPC_MTU]; + struct hal_cmd_handsfree_phone_state_change *cmd = (void *) buf; + size_t len; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd->num_active = num_active; + cmd->num_held = num_held; + cmd->state = state; + cmd->type = type; + + if (number) { + cmd->number_len = strlen(number) + 1; + memcpy(cmd->number, number, cmd->number_len); + } else { + cmd->number_len = 0; + } + + len = sizeof(*cmd) + cmd->number_len; + + return hal_ipc_cmd(HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_PHONE_STATE_CHANGE, + len, cmd, 0, NULL, NULL); +} + +static void cleanup(void) +{ + struct hal_cmd_unregister_module cmd; + + DBG(""); + + if (!interface_ready()) + return; + + cbs = NULL; + + cmd.service_id = HAL_SERVICE_ID_HANDSFREE; + + hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + hal_ipc_unregister(HAL_SERVICE_ID_HANDSFREE); +} + +static bthf_interface_t iface = { + .size = sizeof(iface), + .init = init, + .connect = handsfree_connect, + .disconnect = disconnect, + .connect_audio = connect_audio, + .disconnect_audio = disconnect_audio, + .start_voice_recognition = start_voice_recognition, + .stop_voice_recognition = stop_voice_recognition, + .volume_control = volume_control, + .device_status_notification = device_status_notification, + .cops_response = cops_response, + .cind_response = cind_response, + .formatted_at_response = formatted_at_response, + .at_response = at_response, + .clcc_response = clcc_response, + .phone_state_change = phone_state_change, + .cleanup = cleanup +}; + +bthf_interface_t *bt_get_handsfree_interface(void) +{ + return &iface; +}
diff --git a/bluez/android/hal-health.c b/bluez/android/hal-health.c new file mode 100644 index 0000000..e6fe65a --- /dev/null +++ b/bluez/android/hal-health.c
@@ -0,0 +1,162 @@ +/* + * Copyright (C) 2014 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdbool.h> +#include <stddef.h> +#include <string.h> +#include <stdlib.h> + +#include "hal-log.h" +#include "hal.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "hal-ipc.h" + +static const bthl_callbacks_t *cbacks = NULL; + +static bool interface_ready(void) +{ + return cbacks != NULL; +} + +/* handlers will be called from notification thread context, + * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ +static const struct hal_ipc_handler ev_handlers[] = { +}; + +static bt_status_t unregister_application(int app_id) +{ + struct hal_cmd_health_unreg_app cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.app_id = app_id; + + return hal_ipc_cmd(HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_UNREG_APP, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t connect_channel(int app_id, bt_bdaddr_t *bd_addr, + int mdep_cfg_index, int *channel_id) +{ + struct hal_cmd_health_connect_channel cmd; + struct hal_rsp_health_connect_channel rsp; + size_t len = sizeof(rsp); + bt_status_t status; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr || !channel_id) + return BT_STATUS_PARM_INVALID; + + cmd.app_id = app_id; + cmd.mdep_index = mdep_cfg_index; + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + status = hal_ipc_cmd(HAL_SERVICE_ID_HEALTH, + HAL_OP_HEALTH_CONNECT_CHANNEL, + sizeof(cmd), &cmd, &len, &rsp, NULL); + + if (status == HAL_STATUS_SUCCESS) + *channel_id = rsp.channel_id; + + return status; +} + +static bt_status_t destroy_channel(int channel_id) +{ + struct hal_cmd_health_destroy_channel cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.channel_id = channel_id; + + return hal_ipc_cmd(HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_DESTROY_CHANNEL, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t init(bthl_callbacks_t *callbacks) +{ + struct hal_cmd_register_module cmd; + int ret; + + DBG(""); + + if (interface_ready()) + return BT_STATUS_DONE; + + /* store reference to user callbacks */ + cbacks = callbacks; + + hal_ipc_register(HAL_SERVICE_ID_HEALTH, ev_handlers, + sizeof(ev_handlers)/sizeof(ev_handlers[0])); + + cmd.service_id = HAL_SERVICE_ID_HEALTH; + + ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + if (ret != BT_STATUS_SUCCESS) { + cbacks = NULL; + hal_ipc_unregister(HAL_SERVICE_ID_HEALTH); + } + + return ret; +} + +static void cleanup(void) +{ + struct hal_cmd_unregister_module cmd; + + DBG(""); + + if (!interface_ready()) + return; + + cbacks = NULL; + + cmd.service_id = HAL_SERVICE_ID_HEALTH; + + hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + hal_ipc_unregister(HAL_SERVICE_ID_HEALTH); +} + +static bthl_interface_t health_if = { + .size = sizeof(health_if), + .init = init, + .register_application = NULL, + .unregister_application = unregister_application, + .connect_channel = connect_channel, + .destroy_channel = destroy_channel, + .cleanup = cleanup +}; + +bthl_interface_t *bt_get_health_interface(void) +{ + return &health_if; +}
diff --git a/bluez/android/hal-hidhost.c b/bluez/android/hal-hidhost.c new file mode 100644 index 0000000..16253e3 --- /dev/null +++ b/bluez/android/hal-hidhost.c
@@ -0,0 +1,407 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdbool.h> +#include <stddef.h> +#include <string.h> +#include <stdlib.h> + +#include "hal-log.h" +#include "hal.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "hal-ipc.h" + +static const bthh_callbacks_t *cbacks; + +static bool interface_ready(void) +{ + return cbacks != NULL; +} + +static void handle_conn_state(void *buf, uint16_t len) +{ + struct hal_ev_hidhost_conn_state *ev = buf; + + if (cbacks->connection_state_cb) + cbacks->connection_state_cb((bt_bdaddr_t *) ev->bdaddr, + ev->state); +} + +static void handle_info(void *buf, uint16_t len) +{ + struct hal_ev_hidhost_info *ev = buf; + bthh_hid_info_t info; + + info.attr_mask = ev->attr; + info.sub_class = ev->subclass; + info.app_id = ev->app_id; + info.vendor_id = ev->vendor; + info.product_id = ev->product; + info.version = ev->version; + info.ctry_code = ev->country; + info.dl_len = ev->descr_len; + memcpy(info.dsc_list, ev->descr, info.dl_len); + + if (cbacks->hid_info_cb) + cbacks->hid_info_cb((bt_bdaddr_t *) ev->bdaddr, info); +} + +static void handle_proto_mode(void *buf, uint16_t len) +{ + struct hal_ev_hidhost_proto_mode *ev = buf; + + if (cbacks->protocol_mode_cb) + cbacks->protocol_mode_cb((bt_bdaddr_t *) ev->bdaddr, + ev->status, ev->mode); +} + +static void handle_idle_time(void *buf, uint16_t len) +{ + struct hal_ev_hidhost_idle_time *ev = buf; + + if (cbacks->idle_time_cb) + cbacks->idle_time_cb((bt_bdaddr_t *) ev->bdaddr, ev->status, + ev->idle_rate); +} + +static void handle_get_report(void *buf, uint16_t len) +{ + struct hal_ev_hidhost_get_report *ev = buf; + + if (len != sizeof(*ev) + ev->len) { + error("invalid get report event, aborting"); + exit(EXIT_FAILURE); + } + + if (cbacks->get_report_cb) + cbacks->get_report_cb((bt_bdaddr_t *) ev->bdaddr, ev->status, + ev->data, ev->len); +} + +static void handle_virtual_unplug(void *buf, uint16_t len) +{ + struct hal_ev_hidhost_virtual_unplug *ev = buf; + + if (cbacks->virtual_unplug_cb) + cbacks->virtual_unplug_cb((bt_bdaddr_t *) ev->bdaddr, + ev->status); +} + +/* handlers will be called from notification thread context, + * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ +static const struct hal_ipc_handler ev_handlers[] = { + { /* HAL_EV_HIDHOST_CONN_STATE */ + .handler = handle_conn_state, + .var_len = false, + .data_len = sizeof(struct hal_ev_hidhost_conn_state) + }, + { /* HAL_EV_HIDHOST_INFO */ + .handler = handle_info, + .var_len = false, + .data_len = sizeof(struct hal_ev_hidhost_info), + }, + { /* HAL_EV_HIDHOST_PROTO_MODE */ + .handler = handle_proto_mode, + .var_len = false, + .data_len = sizeof(struct hal_ev_hidhost_proto_mode), + }, + { /* HAL_EV_HIDHOST_IDLE_TIME */ + .handler = handle_idle_time, + .var_len = false, + .data_len = sizeof(struct hal_ev_hidhost_idle_time), + }, + { /* HAL_EV_HIDHOST_GET_REPORT */ + .handler = handle_get_report, + .var_len = true, + .data_len = sizeof(struct hal_ev_hidhost_get_report), + }, + { /* HAL_EV_HIDHOST_VIRTUAL_UNPLUG */ + .handler = handle_virtual_unplug, + .var_len = false, + .data_len = sizeof(struct hal_ev_hidhost_virtual_unplug), + }, +}; + +static bt_status_t hidhost_connect(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_hidhost_connect cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_CONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t disconnect(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_hidhost_disconnect cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_DISCONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t virtual_unplug(bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_hidhost_virtual_unplug cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_VIRTUAL_UNPLUG, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t set_info(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info) +{ + struct hal_cmd_hidhost_set_info cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + cmd.attr = hid_info.attr_mask; + cmd.subclass = hid_info.sub_class; + cmd.app_id = hid_info.app_id; + cmd.vendor = hid_info.vendor_id; + cmd.product = hid_info.product_id; + cmd.country = hid_info.ctry_code; + cmd.descr_len = hid_info.dl_len; + memcpy(cmd.descr, hid_info.dsc_list, cmd.descr_len); + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_SET_INFO, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t get_protocol(bt_bdaddr_t *bd_addr, + bthh_protocol_mode_t protocol_mode) +{ + struct hal_cmd_hidhost_get_protocol cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + /* type match IPC type */ + cmd.mode = protocol_mode; + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_PROTOCOL, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t set_protocol(bt_bdaddr_t *bd_addr, + bthh_protocol_mode_t protocol_mode) +{ + struct hal_cmd_hidhost_set_protocol cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + /* type match IPC type */ + cmd.mode = protocol_mode; + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_PROTOCOL, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t get_report(bt_bdaddr_t *bd_addr, + bthh_report_type_t report_type, + uint8_t report_id, + int buffer_size) +{ + struct hal_cmd_hidhost_get_report cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + cmd.id = report_id; + cmd.buf_size = buffer_size; + + /* type match IPC type */ + cmd.type = report_type; + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_GET_REPORT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t set_report(bt_bdaddr_t *bd_addr, + bthh_report_type_t report_type, + char *report) +{ + uint8_t buf[IPC_MTU]; + struct hal_cmd_hidhost_set_report *cmd = (void *) buf; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr || !report) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd->bdaddr, bd_addr, sizeof(cmd->bdaddr)); + cmd->len = strlen(report); + memcpy(cmd->data, report, cmd->len); + + /* type match IPC type */ + cmd->type = report_type; + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_SET_REPORT, + sizeof(*cmd) + cmd->len, buf, 0, NULL, NULL); +} + +static bt_status_t send_data(bt_bdaddr_t *bd_addr, char *data) +{ + uint8_t buf[IPC_MTU]; + struct hal_cmd_hidhost_send_data *cmd = (void *) buf; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + if (!bd_addr || !data) + return BT_STATUS_PARM_INVALID; + + memcpy(cmd->bdaddr, bd_addr, sizeof(cmd->bdaddr)); + cmd->len = strlen(data); + memcpy(cmd->data, data, cmd->len); + + return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_SEND_DATA, + sizeof(*cmd) + cmd->len, buf, 0, NULL, NULL); +} + +static bt_status_t init(bthh_callbacks_t *callbacks) +{ + struct hal_cmd_register_module cmd; + int ret; + + DBG(""); + + if (interface_ready()) + return BT_STATUS_DONE; + + /* store reference to user callbacks */ + cbacks = callbacks; + + hal_ipc_register(HAL_SERVICE_ID_HIDHOST, ev_handlers, + sizeof(ev_handlers)/sizeof(ev_handlers[0])); + + cmd.service_id = HAL_SERVICE_ID_HIDHOST; + cmd.mode = HAL_MODE_DEFAULT; + + ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + if (ret != BT_STATUS_SUCCESS) { + cbacks = NULL; + hal_ipc_unregister(HAL_SERVICE_ID_HIDHOST); + } + + return ret; +} + +static void cleanup(void) +{ + struct hal_cmd_unregister_module cmd; + + DBG(""); + + if (!interface_ready()) + return; + + cbacks = NULL; + + cmd.service_id = HAL_SERVICE_ID_HIDHOST; + + hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + hal_ipc_unregister(HAL_SERVICE_ID_HIDHOST); +} + +static bthh_interface_t hidhost_if = { + .size = sizeof(hidhost_if), + .init = init, + .connect = hidhost_connect, + .disconnect = disconnect, + .virtual_unplug = virtual_unplug, + .set_info = set_info, + .get_protocol = get_protocol, + .set_protocol = set_protocol, + .get_report = get_report, + .set_report = set_report, + .send_data = send_data, + .cleanup = cleanup +}; + +bthh_interface_t *bt_get_hidhost_interface(void) +{ + return &hidhost_if; +}
diff --git a/bluez/android/hal-ipc-api.txt b/bluez/android/hal-ipc-api.txt new file mode 100644 index 0000000..5613e85 --- /dev/null +++ b/bluez/android/hal-ipc-api.txt
@@ -0,0 +1,2136 @@ +Android HAL protocol for Bluetooth +================================== + +The Android HAL daemon for Bluetooth functionality implements the Unix socket +server protocol around /run/bluetooth/daemon (tentative location) or Linux +abstract sockets (tentative name). + +The daemon is single threaded and uses a mainloop for scheduling and general +operation. + +The protocol is SOCK_SEQPACKET based and follows a strict PDU specification +with a generic header and initial registration exchange. The communication +is driven from the HAL with command/response exchanges. The daemon will use +notification to signal events. The protocol is single PDU exchanged based, +meaning every command requires a response. Notification does not require +any confirmation. Not handling this PDU exchange leads to a disconnection of +the socket. + +Command/response and notification use separate sockets. First connected socket +is used for command/response, second for notification. All services are +multi-plexed over same pair of sockets. Separation is done to ease +implementation of simple HAL library with dedicated thread for handling +notification. + +This strict protocol requirement is done to match C based callbacks and +callout functions that are running in a thread inside the HAL and might +block. + + .--Android--. .--Android--. + | daemon | | HAL | + | | Command | | + | | <-------------------------- | | + | | | | + | | --------------------------> | | + | | Response | | + | | | | + | | | | + | | Notification | | + | | --------------------------> | | + | | | | + '-----------' '-----------' + +Every packet will follow the basic header to support simple multi-plexing +over the same socket. It will also support a basic control channel with service +id 0. + + 0 8 16 24 31 + +--------------+--------------+--------------+--------------+ + | Service ID | Opcode | Data Length | + +--------------+--------------+-----------------------------+ + | | + +The unique service ID is assigned by this specification for each HAL. + +As general rule of thumb, the opcode for command matches the opcode for a +response. Or the opcode 0x00 for an error is returned. + +Notification opcodes start from 0x80. + +All command/response opcodes have the least significant bit not set. And all +notifications have the least significant bit set. + +The HAL modules only have the job to map the callback and event functions +to the protocol. They do not need to do anything else. Below is an example +of a sample transaction for the Bluetooth Core HAL and enabling of an +adapter. + + HAL Daemon + ---------------------------------------------------- + + call enable() --> command 0x01 + return enable() <-- response 0x01 + + call adapter_state_changed() <-- notification 0x81 + return adapter_state_changed() + +When the Android hardware framework calls into the Bluetooth Core HAL +and executes the enable() callback, the HAL module sends the enable +command with opcode 0x01 to the daemon. As soon as the daemon responds, +the callback will return with the appropriate result. + +After the daemon switched on the adapter, it will send a notification +with opcode 0x81 to the HAL module. + +The Bluetooth Core HAL and Bluetooth Socket HAL are guaranteed to be +available from the daemon. All other HAL modules are optional. + +When the Bluetooth Core HAL init() function is called, it should open +the socket and register both "bluetooth" and "socket" service modules. It is +required to register "socket" service at the same time since the HAL module +does not have its own init() function. + +When new profiles are initiated, the get_profile_interface() callback +will load the profile and during init() of the profile, it should register the +specific service. + + Bluetooth main thread Daemon + ------------------------------------------------------- + + init() --> open command socket + --> open notification socket + --> register module "bluetooth" + --> register module "socket" + + get_profile_interface() --> return profile struct + --> continue on Handsfree thread + + + Handsfree thread Daemon + -------------------------------------------------------- + + init() --> register module handsfree + + +Core Service (ID 0) +=================== + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 Failed + + Opcode 0x01 - Register module command/response + + Command parameters: Service id (1 octet) + Mode (1 octet) + Response parameters: <none> + + In case a command is sent for an undeclared service ID, it will + be rejected. Also there will be no notifications for undeclared + service ID. + + Valid Mode values: 0x00 = Default Mode + 0xXX = as defined by service + + In case of an error, the error response will be returned. + + Opcode 0x02 - Unregister module command/response + + Command parameters: Service id (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + +Bluetooth Core HAL (ID 1) +========================= + +Android HAL name: "bluetooth" (BT_HARDWARE_MODULE_ID) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Opcode 0x01 - Enable command/response + + Command parameters: <none> + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x02 - Disable command/response + + Command parameters: <none> + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x03 - Get Adapter Properties command/response + + Command parameters: <none> + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x04 - Get Adapter Property command/response + + Command parameters: Property type (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x05 - Set Adapter Property command/response + + Command parameters: Property type (1 octet) + Property length (2 octets) + Property value (variable) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x06 - Get Remote Device Properties command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x07 - Get Remote Device Property command/response + + Command parameters: Remote address (6 octets) + Property type (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x08 - Set Remote Device Property command/response + + Command parameters: Remote address (6 octets) + Property type (1 octet) + Property length (2 octets) + Property value (variable) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x09 - Get Remote Service Record command/response + + Command parameters: Remote address (6 octets) + UUID (16 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x0a - Get Remote Services command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x0b - Start Discovery command/response + + Command parameters: <none> + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x0c - Cancel Discovery command/response + + Command parameters: <none> + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x0d - Create Bond command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x0e - Remove Bond command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x0f - Cancel Bond command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x10 - PIN Reply command/response + + Command parameters: Remote address (6 octets) + Accept (1 octet) + PIN length (1 octet) + PIN code (16 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x11 - SSP Reply command/response + + Command parameters: Remote address (6 octets) + SSP variant (1 octet) + Accept (1 octet) + Passkey (4 octets) + Response parameters: <none> + + Valid SSP variant values: 0x00 = Passkey Confirmation + 0x01 = Passkey Entry + 0x02 = Consent (for Just Works) + 0x03 = Passkey Notification + + In case of an error, the error response will be returned. + + Opcode 0x12 - DUT Mode Configure command/response + + Command parameters: Enable (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x13 - DUT Mode Send command/response + + Command parameters: Opcode (2 octets) + Length (1 octet) + Data (variable) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x14 - LE Test Mode command/response + + Command parameters: Opcode (2 octets) + Length (1 octet) + Data (variable) + Response parameters: <none> + + In case of an error, the error response will be returned. + +Notifications: + + Opcode 0x81 - Adapter State Changed notification + + Notifications parameters: State (1 octet) + + Valid state values: 0x00 = Off + 0x01 = On + + Opcode 0x82 - Adapter Properties Changed notification + + Notification parameters: Status (1 octet) + Num properties (1 octet) + Type # (1 octet) + Length # (2 octets) + Value # (variable) + ... + + Opcode 0x83 - Remote Device Properties notification + + Notification parameters: Status (1 octet) + Remote address (6 octets) + Num properties (1 octet) + Type # (1 octet) + Length # (2 octets) + Value # (variable) + ... + + Opcode 0x84 - Device Found notification + + Notification parameters: Num properties (1 octet) + Type # (1 octet) + Length # (2 octets) + Value # (variable) + ... + + Opcode 0x85 - Discovery State Changed notification + + Notifications parameters: State (1 octet) + + Opcode 0x86 - PIN Request notification + + Notification parameters: Remote address (6 octets) + Remote name (249 octets) + Class of device (4 octets) + + Opcode 0x87 - SSP Request notification + + Notification parameters: Remote address (6 octets) + Remote name (249 octets) + Class of device (4 octets) + Pairing variant (1 octet) + Passkey (4 octets) + + Opcode 0x88 - Bond State Changed notification + + Notification parameters: Status (1 octet) + Remote address (6 octets) + Bond state (1 octet) + + Valid bond state values: 0x00 = None + 0x01 = Bonding + 0x02 = Bonded + + Opcode 0x89 - ACL State Changed notification + + Notification parameters: Status (1 octet) + Remote address (6 octets) + ACL state (1 octet) + + Opcode 0x8a - DUT Mode Receive notification + + Notification parameters: Opcode (2 octets) + Length (1 octet) + Data (variable) + + Opcode 0x8b - LE Test Mode notification + + Notification parameters: Status (1 octet) + Num packets (2 octets) + + +Bluetooth Socket HAL (ID 2) +=========================== + +Android HAL name:: "socket" (BT_PROFILE_SOCKETS_ID) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 = Fail + 0x02 = Not ready + 0x03 = No memory + 0x04 = Busy + 0x05 = Done (already completed) + 0x06 = Unsupported + 0x07 = Parameter invalid + 0x08 = Unhandled + 0x09 = Authentication failure + 0x0a = Remote device down + + Opcode 0x01 - Listen command/response + + Command parameters: Socket type (1 octet) + Service name (256 octets) + Service UUID (16 octets) + Channel (2 octets) + Socket flags (1 octet) + Response parameters: File descriptor (inline) + + Valid socket types: 0x01 = RFCOMM + 0x02 = SCO + 0x03 = L2CAP + + Valid socket flags: 0x01 = Encrypt + 0x02 = Auth + + In case of an error, the error response will be returned. + + Opcode 0x02 - Connect command/response + + Command parameters: Remote address (6 octets) + Socket type (1 octet) + Service UUID (16 octets) + Channel (2 octets) + Socket flags (1 octet) + Response parameters: File descriptor (inline) + + Valid socket types: 0x01 = RFCOMM + 0x02 = SCO + 0x03 = L2CAP + + Valid socket flags: 0x01 = Encrypt + 0x02 = Auth + + In case of an error, the error response will be returned. + + +Bluetooth HID Host HAL (ID 3) +============================ + +Android HAL name: "hidhost" (BT_PROFILE_HIDHOST_ID) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 = Fail + 0x02 = Not ready + 0x03 = No memory + 0x04 = Busy + 0x05 = Done (already completed) + 0x06 = Unsupported + 0x07 = Parameter invalid + 0x08 = Unhandled + 0x09 = Authentication failure + 0x0a = Remote device down + + Opcode 0x01 - Connect command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x02 - Disconnect command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x03 - Virtual Unplug command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x04 - Set Info command/response + + Command parameters: Remote address (6 octets) + Attribute mask (2 octets) + Subclass (1 octet) + Application ID (1 octet) + Vendor ID (2 octets) + Product ID (2 octets) + Version (2 octets) + Country code (1 octet) + Descriptor length (2 octet) + Descriptor value (884 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x05 - Get Protocol command/response + + Command parameters: Remote address (6 octets) + Protocol mode (1 octet) + Response parameters: <none> + + Valid protocol modes: 0x00 = Report + 0x01 = Boot + 0xff = Unsupported + + In case of an error, the error response will be returned. + + Opcode 0x06 - Set Protocol command/response + + Command parameters: Remote address (6 octets) + Protocol mode (1 octet) + Response parameters: <none> + + Valid protocol modes: 0x00 = Report + 0x01 = Boot + 0xff = Unsupported + + In case of an error, the error response will be returned. + + Opcode 0x07 - Get Report command/response + + Command parameters: Remote address (6 octets) + Report type (1 octet) + Report ID (1 octet) + Buffer size (2 octet) + Response parameters: <none> + + Valid report types: 0x01 = Input + 0x02 = Output + 0x03 = Feature + + In case of an error, the error response will be returned. + + Opcode 0x08 - Set Report command/response + + Command parameters: Remote address (6 octets) + Report type (1 octet) + Report length (2 octets) + Report data (Report length) + + Response parameters: <none> + + Valid report types: 0x01 = Input + 0x02 = Output + 0x03 = Feature + + In case of an error, the error response will be returned. + + Opcode 0x09 - Send Data command/response + + Command parameters: Remote address (6 octets) + Data length (2 octets) + Data (Data length) + + Response parameters: <none> + + In case of an error, the error response will be returned. + +Notifications: + + Opcode 0x81 - Connection State notification + + Notification parameters: Remote address (6 octets) + Connection State (1 octets) + + Valid connection states: 0x00 = Connected + 0x01 = Connecting + 0x02 = Disconnected + 0x03 = Disconnecting + 0x04 = Failed - Mouse from host + 0x05 = Failed - Keyboard from host + 0x06 = Failed - Too many devices + 0x07 = Failed - No HID driver + 0x08 = Failed - generic + 0x09 = Unknown + + Opcode 0x82 - HID Info notification + + Notification parameters: Remote address (6 octets) + Attribute mask (2 octets) + Subclass (1 octet) + Application ID (1 octet) + Vendor ID (2 octets) + Product ID (2 octets) + Version (2 octets) + Country code (1 octet) + Descriptor length (2 octet) + Descriptor value (884 octets) + + Opcode 0x83 - Protocol Mode notification + + Notification parameters: Remote address (6 octets) + Status (1 octet) + Protocol mode (1 octet) + + Valid protocol modes: 0x00 = Report + 0x01 = Boot + 0xff = Unsupported + + Opcode 0x84 - Idle Time notification + + Notification parameters: Remote address (6 octets) + Status (1 octet) + Idle time (2 octets) + + Opcode 0x85 - Get Report notification + + Notification parameters: Remote address (6 octets) + Status (1 octet) + Report length (2 octets) + Report data (variable) + + Opcode 0x86 - Virtual Unplug notification + + Notification parameters: Remote address (6 octets) + Status (1 octet) + + Valid status values: 0x00 = Ok + 0x01 = Handshake - Device not ready + 0x02 = Handshake - Invalid report ID + 0x03 = Handshake - Transaction not SPT + 0x04 = Handshake - Invalid parameter + 0x05 = Handshake - Generic error + 0x06 = General error + 0x07 = SDP error + 0x08 = Set protocol error + 0x09 = Device database full + 0x0a = Device type not supported + 0x0b = No resources + 0x0c = Authentication failed + 0x0d = HDL + + +Bluetooth PAN HAL (ID 4) +======================== + +Android HAL name: "pan" (BT_PROFILE_PAN_ID) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 = Fail + 0x02 = Not ready + 0x03 = No memory + 0x04 = Busy + 0x05 = Done (already completed) + 0x06 = Unsupported + 0x07 = Parameter invalid + 0x08 = Unhandled + 0x09 = Authentication failure + 0x0a = Remote device down + + Opcode 0x01 - Enable command/response + + Command parameters: Local role (1 octet) + Response parameters: <none> + + Valid role values: 0x00 = None + 0x01 = NAP + 0x02 = PANU + + In case of an error, the error response will be returned. + + Opcode 0x02 - Get Local Role command/response + + Command parameters: <none> + Response parameters: Local role (1 octet) + + Valid role values: 0x00 = None + 0x01 = NAP + 0x02 = PANU + + In case of an error, the error response will be returned. + + Opcode 0x03 - Connect command/response + + Command parameters: Remote address (6 octets) + Local role (1 octet) + Remote role (1 octet) + Response parameters: <none> + + Valid role values: 0x01 = NAP + 0x02 = PANU + + In case of an error, the error response will be returned. + + Opcode 0x04 - Disconnect command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + +Notifications: + + Opcode 0x81 - Control State notification + + Notification parameters: Control state (1 octet) + Status (1 octet) + Local role (1 octet) + Interface name (17 octet) + + Valid control states: 0x00 = Enabled + 0x01 = Disabled + + Valid role values: 0x00 = None + 0x01 = NAP + 0x02 = PANU + + Opcode 0x82 - Connection State notification + + Notification parameters: Connection state (1 octet) + Status (1 octet) + Remote address (6 octets) + Local role (1 octet) + Remote role (1 octet) + + Valid connection states: 0x00 = Connected + 0x01 = Connecting + 0x02 = Disconnected + 0x03 = Disconnecting + + Valid role values: 0x01 = NAP + 0x02 = PANU + + +Bluetooth Handsfree HAL (ID 5) +============================== + +Android HAL name: "handsfree" (BT_PROFILE_HANDSFREE_ID) + + Service modes: 0x00 = Headset Profile only mode (default) + 0x01 = Handsfree Profile (narrowband speech) + 0x02 = Handsfree Profile (narrowband and wideband speech) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 = Fail + 0x02 = Not ready + 0x03 = No memory + 0x04 = Busy + 0x05 = Done (already completed) + 0x06 = Unsupported + 0x07 = Parameter invalid + 0x08 = Unhandled + 0x09 = Authentication failure + 0x0a = Remote device down + + Opcode 0x01 - Connect command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x02 - Disconnect command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x03 - Connect Audio command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x04 - Disconnect Audio command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x05 - Start Voice Recognition command/response + + Command parameters: <none> + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x06 - Stop Voice Recognition command/response + + Command parameters: <none> + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x07 - Volume Control command/response + + Command parameters: Volume type (1 octet) + Volume (1 octet) + Response parameters: <none> + + Valid volume types: 0x00 = Speaker + 0x01 = Microphone + + In case of an error, the error response will be returned. + + Opcode 0x08 - Device Status Notification command/response + + Command parameters: Network state (1 octet) + Service type (1 octet) + Signal strength (1 octet) + Battery level (1 octet) + Response parameters: <none> + + Valid network states: 0x00 = Not available + 0x01 = Available + + Valid service types: 0x00 = Home network + 0x01 = Roaming network + + In case of an error, the error response will be returned. + + Opcode 0x09 - COPS Response command/response + + Command parameters: COPS command response (string) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x0a - CIND Response command/response + + Command parameters: Service (1 octet) + Number of active calls (1 octet) + Number of held calls (1 octet) + Call setup state (1 octet) + Signal strength (1 octet) + Roaming indicator (1 octet) + Battery level (1 octet) + Response parameters: <none> + + Valid call setup states: 0x00 = Active + 0x01 = Held + 0x02 = Dialing + 0x03 = Alerting + 0x04 = Incoming + 0x05 = Waiting + 0x06 = Idle + + In case of an error, the error response will be returned. + + Opcode 0x0b - Formatted AT Response command/response + + Command parameters: Pre-formatted AT response (string) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x0c - AT Response command/response + + Command parameters: Response code (1 octet) + Error code (1 octet) + Response parameters: <none> + + Valid response codes: 0x00 = ERROR + 0x01 = OK + + In case of an error, the error response will be returned. + + Opcode 0x0d - CLCC Response command/response + + Command parameters: Call index (1 octet) + Call direction (1 octet) + Call state (1 octet) + Call mode (1 octet) + Call multiparty type (1 octet) + Call number type (1 octet) + Call number (string) + Response parameters: <none> + + Valid call directions: 0x00 = Outgoing + 0x01 = Incoming + + Valid call states: 0x00 = Active + 0x01 = Held + 0x02 = Dialing + 0x03 = Alerting + 0x04 = Incoming + 0x05 = Waiting + 0x06 = Idle + + Valid call modes: 0x00 = Voice + 0x01 = Data + 0x02 = Fax + + Valid multiparty types: 0x00 = Single call + 0x01 = Multiparty call + + Valid number types: 0x81 = Unknown + 0x91 = International + + In case of an error, the error response will be returned. + + Opcode 0x0e - Phone Status Change command/response + + Command parameters: Number of active calls (1 octet) + Number of held calls (1 octet) + Call setup state (1 octet) + Call number type (1 octet) + Call number (string) + Response parameters: <none> + + Valid call setup states: 0x00 = Active + 0x01 = Held + 0x02 = Dialing + 0x03 = Alerting + 0x04 = Incoming + 0x05 = Waiting + 0x06 = Idle + + Valid number types: 0x81 = Unknown + 0x91 = International + + In case of an error, the error response will be returned. + +Notifications: + + Opcode 0x81 - Connection State notification + + Notification parameters: Connection state (1 octet) + Remote address (6 octets) + + Valid connection states: 0x00 = Disconnected + 0x01 = Connecting + 0x02 = Connected + 0x03 = SLC connected + 0x04 = Disconnecting + + Opcode 0x82 - Audio State notification + + Notification parameters: Audio state (1 octet) + Remote address (6 octets) + + Valid audio states: 0x00 = Disconnected + 0x01 = Connecting + 0x02 = Connected + 0x03 = Disconnecting + + Opcode 0x83 - Voice Recognition Command notification + + Notification parameters: Voice recognition state (1 octet) + + Valid voice recognition states: 0x00 = Stopped + 0x01 = Started + + Opcode 0x84 - Answer Call Command notification + + Notification parameters: <none> + + Opcode 0x85 - Hangup Call Command notification + + Notification parameters: <none> + + Opcode 0x86 - Volume Command notification + + Notification parameters: Volume type (1 octet) + Volume (1 octet) + + Valid volume types: 0x00 = Speaker + 0x01 = Microphone + + Opcode 0x87 - Dial Call Command notification + + Notification parameters: Number (string) + + Opcode 0x88 - DTMF Command notification + + Notification parameters: Tone (1 octet) + + Opcode 0x89 - NREC Command notification + + Notification parameters: NREC types (1 octet) + + Valid NREC types: 0x00 = Stop + 0x01 = Start + + Opcode 0x8a - CHLD Command notification + + Notification parameters: NREC types (1 octet) + + Valid CHLD types: 0x00 = Release and hold + 0x01 = Release active and accept held + 0x02 = Hold active and accept held + 0x03 = Add held call to conference + + Opcode 0x8b - CNUM Command notification + + Notification parameters: <none> + + Opcode 0x8c - CIND Command notification + + Notification parameters: <none> + + Opcode 0x8d - COPS Command notification + + Notification parameters: <none> + + Opcode 0x8e - CLCC Command notification + + Notification parameters: <none> + + Opcode 0x8f - Unknown AT Command notification + + Notification parameters: AT command (string) + + Opcode 0x90 - Key Pressed Command notification + + Notification parameters: <none> + + +Bluetooth Advanced Audio HAL (ID 6) +=================================== + +Android HAL name: "a2dp" (BT_PROFILE_ADVANCED_AUDIO_ID) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 = Fail + 0x02 = Not ready + 0x03 = No memory + 0x04 = Busy + 0x05 = Done (already completed) + 0x06 = Unsupported + 0x07 = Parameter invalid + 0x08 = Unhandled + 0x09 = Authentication failure + 0x0a = Remote device down + + Opcode 0x01 - Connect command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x02 - Disconnect command/response + + Command parameters: Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + +Notifications: + + Opcode 0x81 - Connection State notification + + Notification parameters: Connection state (1 octet) + Remote address (6 octets) + + Valid connection states: 0x00 = Disconnected + 0x01 = Connecting + 0x02 = Connected + 0x03 = Disconnecting + + Opcode 0x82 - Audio State notification + + Notification parameters: Audio state (1 octet) + Remote address (6 octets) + + Valid connection states: 0x00 = Remote suspend + 0x01 = Stopped + 0x02 = Started + + +Bluetooth Health HAL (ID 7) +=========================== + +Android HAL name: "health" (BT_PROFILE_HEALTH_ID) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 = Fail + 0x02 = Not ready + 0x03 = No memory + 0x04 = Busy + 0x05 = Done (already completed) + 0x06 = Unsupported + 0x07 = Parameter invalid + 0x08 = Unhandled + 0x09 = Authentication failure + 0x0a = Remote device down + + Opcode 0x01 - Register Application command/response + + Command parameters: Application name (string) + Provider name (string) + Service name (string) + Service description (string) + Number of MDEP (1 octet) + MDEP Role # (1 octet) + Data type # (1 octet) + Channel type # (1 octet) + MDEP description # (string) + ... + Response parameters: Application ID (2 octets) + + In case of an error, the error response will be returned. + + Opcode 0x02 - Unregister Application command/response + + Command parameters: Application ID (2 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x03 - Connect Channel command/response + + Command parameters: Application ID (2 octets) + Remote address (6 octets) + MDEP index (1 octet) + Response parameters: Channel ID (2 octets) + + In case of an error, the error response will be returned. + + Opcode 0x04 - Destroy Channel command/response + + Command parameters: Channel ID (2 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + +Notifications: + + Opcode 0x81 - Application Registration State notification + + Notification parameters: Application ID (2 octets) + Application state (1 octet) + + Valid application states: 0x00 = Registration success + 0x01 = Registration failed + 0x02 = Deregistration success + 0x03 = Deregistration failed + + Opcode 0x82 - Channel State notification + + Notification parameters: Application ID (2 octets) + Remote address (6 octets) + MDEP index (1 octet) + Channel ID (2 octets) + Channel state (1 octet) + File descriptor (inline) + + Valid channel states: 0x00 = Connecting + 0x01 = Connected + 0x02 = Disconnecting + 0x03 = Disconnected + 0x04 = Destroyed + + +Bluetooth Remote Control HAL (ID 8) +=================================== + +Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 = Fail + 0x02 = Not ready + 0x03 = No memory + 0x04 = Busy + 0x05 = Done (already completed) + 0x06 = Unsupported + 0x07 = Parameter invalid + 0x08 = Unhandled + 0x09 = Authentication failure + 0x0a = Remote device down + + Opcode 0x01 - Get Play Status Response command/response + + Command parameters: Status (1 octet) + Duration (4 octets) + Position (4 octets) + + In case of an error, the error response will be returned. + + Valid status values: 0x00 = Stopped + 0x01 = Playing + 0x02 = Paused + 0x03 = Fwd seek + 0x04 = Rev seek + 0xff = Error + + Opcode 0x02 - List Player Attributes Response command/response + + Command parameters: Number of attributes (1 octet) + Attribute # (1 octet) + ... + + In case of an error, the error response will be returned. + + Valid attributes: 0x01 = Equalizer + 0x02 = Repead + 0x03 = Shuffle + 0x04 = Scan + + Opcode 0x03 - List Player Values Response command/response + + Command parameters: Number of values (1 octet) + Value # (1 octet) + ... + + In case of an error, the error response will be returned. + + Opcode 0x04 - Get Player Values Response command/response + + Command parameters: Number of attributes (1 octet) + Attribute # (1 octet) + Value # (1 octet) + ... + + In case of an error, the error response will be returned. + + Valid attributes: Same as in List Player Attributes + + Opcode 0x05 - Get Player Attributes Text Response command/response + + Command parameters: Number of attributes (1 octet) + Attribute # (1 octet) + Attribute # text length (1 octet) + Attribute # text (variable) + ... + + In case of an error, the error response will be returned. + + Valid attributes: Same as in List Player Attributes + + Opcode 0x06 - Get Player Values Text Response command/response + + Command parameters: Number of values (1 octet) + Value # (1 octet) + Value # text length (1 octet) + Value # text (variable) + ... + + In case of an error, the error response will be returned. + + Opcode 0x07 - Get Element Attributes Text Response command/response + + Command parameters: Number of elements (1 octet) + Element # (1 octet) + Element # text length (1 octet) + Element # text (variable) + ... + + In case of an error, the error response will be returned. + + Valid elements: 0x01 = Title + 0x02 = Artist + 0x03 = Album + 0x04 = Track Number + 0x05 = Number of Tracks + 0x06 = Genre + 0x06 = Duration + + Opcode 0x08 - Set Player Attributes Value Response command/response + + Command parameters: Status (1 octet) + + In case of an error, the error response will be returned. + + Valid status values: Same as in Get Play Status Response + + Opcode 0x09 - Register Notification Response command/response + + Command parameters: Event (1 octet) + Type (1 octet) + Data length (1 octet) + Data (variable) + + In case of an error, the error response will be returned. + + Valid event values: 0x01 = Status Changed + 0x02 = Track Changed + 0x03 = Track Reached End + 0x04 = Track Reached Start + 0x05 = Position Changed + 0x08 = Setting Changed + + Valid type values : 0x00 = Interim + 0x01 = Changed + + Opcode 0x0a - Set Volume command/response + + Command parameters: Value (1 octet) + + In case of an error, the error response will be returned. + +Notifications: + + Opcode 0x81 - Remote Features notification + + Notification parameters: Remote address (6 octets) + Features (1 octet) + + Valid features values : 0x00 = None + 0x01 = Metadata + 0x02 = Absolute Volume + 0x03 = Browse + + Opcode 0x82 - Get Play Status notification + + Notification parameters: <none> + + Opcode 0x83 - List Player Attributes notification + + Notification parameters: <none> + + Opcode 0x84 - List Player Values notification + + Notification parameters: Attribute (1 octet) + + Valid attribute values: Same as in List Player Attributes + + Opcode 0x85 - Get Player Values notification + + Notification parameters: Number of attributes (1 octet) + Attribute # (1 octet) + ... + + Valid attribute values: Same as in List Player Attributes + + Opcode 0x86 - Get Player Attributes Text notification + + Notification parameters: Number of attributes (1 octet) + Attribute # (1 octet) + ... + + Valid attribute values: Same as in List Player Attributes + + Opcode 0x87 - Get Player Values Text notification + + Notification parameters: Attribute (1 octet) + Number of values (1 octet) + Value # (1 octet) + ... + + Valid attribute values: Same as in List Player Attributes + + Opcode 0x88 - Set Player Values notification + + Notification parameters: Number of attributes (1 octet) + Attribute # (1 octet) + Value # (1 octet) + ... + + Valid attribute values: Same as in List Player Attributes + + Opcode 0x89 - Get Element Attributes notification + + Notification parameters: Number of attributes (1 octet) + Attribute # (1 octet) + ... + + Valid attribute values: Same as in Get Element Attribute + + Opcode 0x8a - Register Notification notification + + Notification parameters: Event (1 octet) + Parameter (4 octets) + + Valid event values: Same as in Register Notification + + Opcode 0x8b - Volume Changed notification + + Notification parameters: Volume (1 octet) + Type (1 octet) + + Valid type values: Same as in Register Notification + + Opcode 0x8c - Passthrough Command notification + + Notification parameters: ID (1 octet) + State (1 octet) + + +Bluetooth GATT HAL (ID 9) +========================= + +Android HAL name: "gatt" (BT_PROFILE_GATT_ID) + +Commands and responses: + + Opcode 0x00 - Error response + + Response parameters: Status (1 octet) + + Valid status values: 0x01 = Fail + 0x02 = Not ready + 0x03 = No memory + 0x04 = Busy + 0x05 = Done (already completed) + 0x06 = Unsupported + 0x07 = Parameter invalid + 0x08 = Unhandled + 0x09 = Authentication failure + 0x0a = Remote device down + + Opcode 0x01 - Register Client command/response + + Command parameters: Service UUID (16 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x02 - Unregister Client command/response + + Command parameters: Client Interface (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x03 - Scan command/response + + Command parameters: Client Interface (4 octets) + Start (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x04 - Connect Device command/response + + Command parameters: Client Interface (4 octets) + Remote address (6 octets) + Is Direct (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x05 - Disconnect Device command/response + + Command parameters: Client Interface (4 octets) + Remote address (6 octets) + Connection ID (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x06 - Listen command/response + + Command parameters: Client Interface (4 octets) + Start (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x07 - Refresh command/response + + Command parameters: Client Interface (4 octets) + Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x08 - Search Service command/response + + Command parameters: Connection ID (4 octets) + Number of UUID Filters (1 octet) + UUID Filter # (16 octets) + ... + Response parameters: <none> + + Valid Number of UUID Filters: 0x00 + 0x01 + + In case of an error, the error response will be returned. + + Opcode 0x09 - Get Included Service command/response + + Command parameters: Connection ID (4 octets) + Number of GATT Service ID Elements (1 octet) + GATT Service ID # UUID (16 octets) + GATT Service ID # Instance ID (1 octet) + GATT Service ID # Is Primary (1 octet) + ... + Response parameters: <none> + + Valid Number of GATT Service ID Elements: 0x01 + 0x02 + + In case of an error, the error response will be returned. + + Opcode 0x0a - Get Characteristic command/response + + Command parameters: Connection ID (4 octets) + GATT Service ID (18 octets) + Number of GATT ID Elements (1 octet) + GATT ID # UUID (16 octets) + GATT ID # Instance ID (1 octet) + ... + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Valid Number of GATT ID Elements: 0x00 + 0x01 + + In case of an error, the error response will be returned. + + Opcode 0x0b - Get Descriptor command/response + + Command parameters: Connection ID (4 octets) + GATT Service ID (18 octets) + Number of GATT ID Elements (1 octet) + GATT ID # UUID (16 octets) + GATT ID # Instance ID (1 octet) + ... + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Valid Number of GATT ID Elements: 0x01 + 0x02 + + In case of an error, the error response will be returned. + + Opcode 0x0c - Read Characteristic command/response + + Command parameters: Connection ID (4 octets) + GATT Service ID (18 octets) + GATT ID (17 octets) + Authorization (4 octets) + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Valid GATT ID: UUID (16 octets) + Instance ID (1 octet) + + In case of an error, the error response will be returned. + + Opcode 0x0d - Write Characteristic command/response + + Command parameters: Connection ID (4 octets) + GATT Service ID (18 octets) + GATT ID (17 octets) + Write Type (4 octets) + Length (4 octets) + Authorization Req. (4 octets) + Value (variable) + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Valid GATT ID: UUID (16 octets) + Instance ID (1 octet) + + In case of an error, the error response will be returned. + + Opcode 0x0e - Read Descriptor command/response + + Command parameters: Connection ID (4 octets) + GATT Service ID (18 octets) + GATT ID (17 octets) + Descr. GATT ID (17 octets) + Authorization Req. (4 octets) + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Valid GATT ID: UUID (16 octets) + Instance ID (1 octet) + + Valid Descr. GATT ID: UUID (16 octets) + Instance ID (1 octet) + + In case of an error, the error response will be returned. + + Opcode 0x0f - Write Descriptor command/response + + Command parameters: Connection ID (4 octets) + GATT Service ID (18 octets) + GATT ID (17 octets) + Descr. GATT ID (17 octets) + Write Type (4 octets) + Length (4 octets) + Authorization Req. (4 octets) + Value (variable) + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Valid GATT ID: UUID (16 octets) + Instance ID (1 octet) + + Valid Descr. GATT ID: UUID (16 octets) + Instance ID (1 octet) + + In case of an error, the error response will be returned. + + Opcode 0x10 - Execute Write command/response + + Command parameters: Connection ID (4 octets) + Execute (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x11 - Register For Notification command/response + + Command parameters: Client Interface (4 octets) + Remote address (6 octets) + GATT Service ID (18 octets) + GATT ID (17 octets) + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Valid GATT ID: UUID (16 octets) + Instance ID (1 octet) + + In case of an error, the error response will be returned. + + Opcode 0x12 - Deregister For Notification command/response + + Command parameters: Client Interface (4 octets) + Remote address (6 octets) + GATT Service ID (18 octets) + GATT ID (17 octets) + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Valid GATT ID: UUID (16 octets) + Instance ID (1 octet) + + In case of an error, the error response will be returned. + + Opcode 0x13 - Read Remote RSSI command/response + + Command parameters: Client Interface (4 octets) + Remote address (6 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x14 - Get Device Type command/response + + Command parameters: Remote address (6 octets) + Response parameters: Device Type + + Valid Device Type: 0x01 = BREDR + 0x02 = BLE + 0x03 = DUAL + + In case of an error, the error response will be returned. + + Opcode 0x15 - Set Advertising data command/response + + Command parameters: Server Interface (4 octets) + Set Scan Resp. (1 octet) + Include Name (1 octet) + Include TX Power (1 octet) + Min. Interval (4 octets) + Max. Interval (4 octets) + Appearance (4 octets) + Manufacturer Len. (2 octets) + Manufacturer Data (variable) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x16 - Test Command command/response + + Command parameters: Command (4 octets) + Address (6 octets) + UUID (16 octets) + U1 (2 octets) + U2 (2 octets) + U3 (2 octets) + U4 (2 octets) + U5 (2 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x17 - Register Server command/response + + Command parameters: UUID (16 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x18 - Unregister Server command/response + + Command parameters: Server (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x19 - Connect Peripheral command/response + + Command parameters: Server (4 octets) + Remote address (6 octes) + Is Direct (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x1a - Disconnect Peripheral command/response + + Command parameters: Server (4 octets) + Remote address (6 octes) + Connection ID (1 octet) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x1b - Add Service command/response + + Command parameters: Server (4 octets) + GATT Service ID (18 octets) + Number of Handles (4 octet) + Response parameters: <none> + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + In case of an error, the error response will be returned. + + Opcode 0x1c - Add Included Service command/response + + Command parameters: Server (4 octets) + Service handle (4 octets) + Included handle (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x1d - Add Characteristic command/response + + Command parameters: Server (4 octets) + Service handle (4 octets) + UUID (16 octets) + Properties (4 octets) + Permissions (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x1e - Add Descriptor command/response + + Command parameters: Server (4 octets) + Service handle (4 octets) + UUID (16 octets) + Permissions (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x1f - Start Service command/response + + Command parameters: Server (4 octets) + Service handle (4 octets) + Transport (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x20 - Stop Service command/response + + Command parameters: Server (4 octets) + Service handle (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x21 - Delete Service command/response + + Command parameters: Server (4 octets) + Service handle (4 octets) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x22 - Send Indication command/response + + Command parameters: Server (4 octets) + Attribute handle (4 octets) + Connection ID (4 octets) + Length (4 octets) + Confirmation (4 octets) + Value (variable) + Response parameters: <none> + + In case of an error, the error response will be returned. + + Opcode 0x23 - Send Response command/response + + Command parameters: Connection ID (4 octets) + Transaction ID (4 octets) + Status (4 octets) + GATT Response (4 octets) + Response parameters: <none> + + Valid GATT Response: GATT Value (607 octets) + Handle (2 octets) + + Valid GATT Value: Value (600 octets) + Handle (2 octets) + Offset (2 octets) + Length (2 octets) + Authentication Request (1 octet) + + In case of an error, the error response will be returned. + +Notifications: + + Opcode 0x81 - Register Client notification + + Notification parameters: Status (4 octets) + Client Interface (4 octets) + UUID (16 octets) + + Opcode 0x82 - Scan Result notification + + Notification parameters: Address (6 octets) + RSSI (4 octets) + Length (2 octets) + Data (variable) + + Opcode 0x83 - Connect Device notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + Client Interface (4 octets) + Address (6 octets) + + Opcode 0x84 - Disconnect Device notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + Client Interface (4 octets) + Address (6 octets) + + Opcode 0x85 - Search Complete notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + + Opcode 0x86 - Search Result notification + + Notification parameters: Connection ID (4 octets) + GATT Service ID (18 octets) + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octets) + Is Primary (1 octet) + + Opcode 0x87 - Get Characteristic notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + GATT Service ID (18 octets) + GATT Char. ID (17 octets) + Char Prop. (4 octets) + + Valid GATT Service: As described in Search Result + + Valid GATT Char. ID: UUID (16 octets) + Instance ID (1 octet) + + Opcode 0x88 - Get Descriptor notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + GATT Service ID (18 octets) + GATT Char. ID (17 octets) + GATT Descr. ID (17 octets) + + Valid GATT Service & Char. ID: As described in Get Characteristic + + Valid GATT Descr. ID: UUID (16 octets) + Instance ID (1 octet) + + Opcode 0x89 - Get Included Service notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + GATT Service ID (18 octets) + GATT Incl. Service ID (18 octets) + + Valid GATT Service & Incl. Service ID: As described in Search Result + + Opcode 0x8a - Register For Notification notification + + Notification parameters: Connection ID (4 octets) + Registered (4 octets) + Status (4 octets) + GATT Service ID (18 octets) + GATT Char. ID (17 octets) + + Valid GATT Service ID: As described in Get Characteristic + + Valid GATT Char. ID: As described in Get Characteristic + + Opcode 0x8b - Notify notification + + Notification parameters: Connection ID (4 octets) + Address (6 octets) + GATT Service ID (18 octets) + GATT Char. ID (17 octets) + Is Notify (1 octet) + Length (2 octets) + Value (variable) + + Valid GATT Service ID: As described in Get Characteristic + + Valid GATT Char. ID: As described in Get Characteristic + + Opcode 0x8c - Read Characteristic notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + GATT Read Parameters (variable) + + Valid GATT Read Parameters: GATT Service ID (18 octets) + GATT Char. ID (17 octets) + GATT Descr. ID (17 octets) + Value Type (4 octets) + Status (1 octet) + Length (2 octets) + Value (variable) + + Valid GATT Service ID: As described in Get Characteristic + + Valid GATT Char. & Decr. ID: As described in Get Descriptor + + Opcode 0x8d - Write Characteristic notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + GATT Write Parameters (53 octets) + + Valid GATT Write Parameters: GATT Service ID (18 octets) + GATT Characteristic ID (17 octets) + GATT Description ID (17 octets) + Status (1 octet) + + Valid GATT Service ID: As described in Get Descriptor + + Valid GATT Char. & Decr. ID: As described in Get Descriptor + + Opcode 0x8e - Read Descriptor notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + GATT Read Parameters (variable) + + Valid GATT Read Parameters: As described in Read Characteristic + + Opcode 0x8f - Write Descriptor notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + GATT Write Parameters (53 octets) + + Valid GATT Write Parameters: As described in Write Characteristic + + Opcode 0x90 - Execute Write notification + + Notification parameters: Connection ID (4 octets) + Status (4 octets) + + Opcode 0x91 - Read Remote RSSI notification + + Notification parameters: Client (4 octets) + Address (6 octets) + RSSI (4 octets) + Status (4 octets) + + Opcode 0x92 - Listen notification + + Notification parameters: Status (4 octets) + Server Interface (4 octets) + + Opcode 0x93 - Register Server notification + + Notification parameters: Status (4 octets) + Server (4 octets) + UUID (16 octets) + + Opcode 0x94 - Connection notification + + Notification parameters: Connection ID (4 octets) + Server (4 octets) + Connected (4 octets) + Address (6 octets) + + Opcode 0x95 - Service Added notification + + Notification parameters: Status (4 octets) + Server (4 octets) + GATT Service ID (18 octets) + Service Handle (4 octets) + + Valid GATT Service ID: UUID (16 octets) + Instance ID (1 octet) + Is Primary (1 octet) + + Opcode 0x96 - Included Service Added notification + + Notification patemeters: Status (4 octets) + Server (4 octets) + Service Handle (4 octets) + Included Service Handle (4 octets) + + Opcode 0x97 - Characteristic Added notification + + Notification parameters: Status (4 octets) + Server (4 octets) + UUID (16 octets) + Service Handle (4 octets) + Characteristic Handle (4 octets) + + Opcode 0x98 - Descriptor Added notification + + Notification parameters: Status (4 octets) + Server (4 octets) + UUID (6 octets) + Service Handle (4 octets) + Descriptor Handle (4 octets) + + Opcode 0x99 - Service Started notification + + Notification parameters: Status (4 octets) + Server (4 octets) + Service Handle (4 octets) + + Opcode 0x9a - Service Stopped notification + + Notification parameters: Status (4 octets) + Server (4 octets) + Service Handle (4 octets) + + Opcode 0x9b - Service Deleted notification + + Notification parameters: Status (4 octets) + Server (4 octets) + Service Handle (4 octets) + + Opcode 0x9c - Request Read notification + + Notification parameters: Connection ID (4 octets) + Trans ID (4 octets) + Address (6 octets) + Attribute Handle (4 octets) + Offset (4 octets) + Is Long (1 octet) + + Opcode 0x9d - Request Write notification + + Notification parameters: Connection ID (4 octets) + Trans ID (4 octets) + Address (6 octets) + Attribute Handle (4 octets) + Offset (4 octets) + Length (4 octets) + Need Response (4 octets) + Is Prepare (1 octet) + Value (variable) + + Opcode 0x9e - Request Execute Write notification + + Notification parameters: Connection ID (4 octets) + Trans ID (4 octets) + Address (6 octets) + Execute Write (4 octets) + + Opcode 0x9f - Response Confirmation notification + + Notification parameters: Status (4 octets) + Handle (4 octets)
diff --git a/bluez/android/hal-ipc.c b/bluez/android/hal-ipc.c new file mode 100644 index 0000000..5bef281 --- /dev/null +++ b/bluez/android/hal-ipc.c
@@ -0,0 +1,456 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <pthread.h> +#include <errno.h> +#include <sys/socket.h> +#include <sys/un.h> +#include <stdbool.h> +#include <poll.h> +#include <unistd.h> +#include <stdint.h> +#include <stdlib.h> + +#include <cutils/properties.h> + +#include "hal.h" +#include "hal-msg.h" +#include "hal-log.h" +#include "ipc-common.h" +#include "hal-ipc.h" + +#define CONNECT_TIMEOUT (5 * 1000) + +static int cmd_sk = -1; +static int notif_sk = -1; + +static pthread_mutex_t cmd_sk_mutex = PTHREAD_MUTEX_INITIALIZER; + +static pthread_t notif_th = 0; + +struct service_handler { + const struct hal_ipc_handler *handler; + uint8_t size; +}; + +static struct service_handler services[HAL_SERVICE_ID_MAX + 1]; + +void hal_ipc_register(uint8_t service, const struct hal_ipc_handler *handlers, + uint8_t size) +{ + services[service].handler = handlers; + services[service].size = size; +} + +void hal_ipc_unregister(uint8_t service) +{ + services[service].handler = NULL; + services[service].size = 0; +} + +static void handle_msg(void *buf, ssize_t len) +{ + struct ipc_hdr *msg = buf; + const struct hal_ipc_handler *handler; + uint8_t opcode; + + if (len < (ssize_t) sizeof(*msg)) { + error("IPC: message too small (%zd bytes), aborting", len); + exit(EXIT_FAILURE); + } + + if (len != (ssize_t) (sizeof(*msg) + msg->len)) { + error("IPC: message malformed (%zd bytes), aborting", len); + exit(EXIT_FAILURE); + } + + /* if service is valid */ + if (msg->service_id > HAL_SERVICE_ID_MAX) { + error("IPC: unknown service (0x%x), aborting", + msg->service_id); + exit(EXIT_FAILURE); + } + + /* if service is registered */ + if (!services[msg->service_id].handler) { + error("IPC: unregistered service (0x%x), aborting", + msg->service_id); + exit(EXIT_FAILURE); + } + + /* if opcode fit valid range */ + if (msg->opcode < HAL_MINIMUM_EVENT) { + error("IPC: invalid opcode for service 0x%x (0x%x), aborting", + msg->service_id, msg->opcode); + exit(EXIT_FAILURE); + } + + /* opcode is used as table offset and must be adjusted as events start + * with HAL_MINIMUM_EVENT offset */ + opcode = msg->opcode - HAL_MINIMUM_EVENT; + + /* if opcode is valid */ + if (opcode >= services[msg->service_id].size) { + error("IPC: invalid opcode for service 0x%x (0x%x), aborting", + msg->service_id, msg->opcode); + exit(EXIT_FAILURE); + } + + handler = &services[msg->service_id].handler[opcode]; + + /* if payload size is valid */ + if ((handler->var_len && handler->data_len > msg->len) || + (!handler->var_len && handler->data_len != msg->len)) { + error("IPC: message size invalid for service 0x%x opcode 0x%x " + "(%u bytes), aborting", + msg->service_id, msg->opcode, msg->len); + exit(EXIT_FAILURE); + } + + handler->handler(msg->payload, msg->len); +} + +static void *notification_handler(void *data) +{ + struct msghdr msg; + struct iovec iv; + struct cmsghdr *cmsg; + char cmsgbuf[CMSG_SPACE(sizeof(int))]; + char buf[IPC_MTU]; + ssize_t ret; + int fd; + + bt_thread_associate(); + + while (true) { + memset(&msg, 0, sizeof(msg)); + memset(buf, 0, sizeof(buf)); + memset(cmsgbuf, 0, sizeof(cmsgbuf)); + + iv.iov_base = buf; + iv.iov_len = sizeof(buf); + + msg.msg_iov = &iv; + msg.msg_iovlen = 1; + + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); + + ret = recvmsg(notif_sk, &msg, 0); + if (ret < 0) { + error("Receiving notifications failed, aborting :%s", + strerror(errno)); + exit(EXIT_FAILURE); + } + + /* socket was shutdown */ + if (ret == 0) { + pthread_mutex_lock(&cmd_sk_mutex); + if (cmd_sk == -1) { + pthread_mutex_unlock(&cmd_sk_mutex); + break; + } + pthread_mutex_unlock(&cmd_sk_mutex); + + error("Notification socket closed, aborting"); + exit(EXIT_FAILURE); + } + + fd = -1; + + /* Receive auxiliary data in msg */ + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET + && cmsg->cmsg_type == SCM_RIGHTS) { + memcpy(&fd, CMSG_DATA(cmsg), sizeof(int)); + break; + } + } + + handle_msg(buf, ret); + } + + close(notif_sk); + notif_sk = -1; + + bt_thread_disassociate(); + + DBG("exit"); + + return NULL; +} + +static int accept_connection(int sk) +{ + int err; + struct pollfd pfd; + int new_sk; + + memset(&pfd, 0 , sizeof(pfd)); + pfd.fd = sk; + pfd.events = POLLIN; + + err = poll(&pfd, 1, CONNECT_TIMEOUT); + if (err < 0) { + err = errno; + error("Failed to poll: %d (%s)", err, strerror(err)); + return -1; + } + + if (err == 0) { + error("bluetoothd connect timeout"); + return -1; + } + + new_sk = accept(sk, NULL, NULL); + if (new_sk < 0) { + err = errno; + error("Failed to accept socket: %d (%s)", err, strerror(err)); + return -1; + } + + return new_sk; +} + +bool hal_ipc_init(void) +{ + struct sockaddr_un addr; + int sk; + int err; + + sk = socket(AF_LOCAL, SOCK_SEQPACKET, 0); + if (sk < 0) { + err = errno; + error("Failed to create socket: %d (%s)", err, + strerror(err)); + return false; + } + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + + memcpy(addr.sun_path, BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH)); + + if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + err = errno; + error("Failed to bind socket: %d (%s)", err, strerror(err)); + close(sk); + return false; + } + + if (listen(sk, 2) < 0) { + err = errno; + error("Failed to listen on socket: %d (%s)", err, + strerror(err)); + close(sk); + return false; + } + + /* Start Android Bluetooth daemon service */ + if (property_set("bluetooth.start", "daemon") < 0) { + error("Failed to set bluetooth.start=daemon"); + close(sk); + return false; + } + + cmd_sk = accept_connection(sk); + if (cmd_sk < 0) { + close(sk); + return false; + } + + notif_sk = accept_connection(sk); + if (notif_sk < 0) { + close(sk); + close(cmd_sk); + cmd_sk = -1; + return false; + } + + info("bluetoothd connected"); + + close(sk); + + err = pthread_create(¬if_th, NULL, notification_handler, NULL); + if (err) { + notif_th = 0; + error("Failed to start notification thread: %d (%s)", err, + strerror(err)); + close(cmd_sk); + cmd_sk = -1; + close(notif_sk); + notif_sk = -1; + return false; + } + + return true; +} + +void hal_ipc_cleanup(void) +{ + pthread_mutex_lock(&cmd_sk_mutex); + close(cmd_sk); + cmd_sk = -1; + pthread_mutex_unlock(&cmd_sk_mutex); + + shutdown(notif_sk, SHUT_RD); + + pthread_join(notif_th, NULL); + notif_th = 0; +} + +int hal_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len, void *param, + size_t *rsp_len, void *rsp, int *fd) +{ + ssize_t ret; + struct msghdr msg; + struct iovec iv[2]; + struct ipc_hdr cmd; + char cmsgbuf[CMSG_SPACE(sizeof(int))]; + struct ipc_status s; + size_t s_len = sizeof(s); + + if (cmd_sk < 0) { + error("Invalid cmd socket passed to hal_ipc_cmd, aborting"); + exit(EXIT_FAILURE); + } + + if (!rsp || !rsp_len) { + memset(&s, 0, s_len); + rsp_len = &s_len; + rsp = &s; + } + + memset(&msg, 0, sizeof(msg)); + memset(&cmd, 0, sizeof(cmd)); + + cmd.service_id = service_id; + cmd.opcode = opcode; + cmd.len = len; + + iv[0].iov_base = &cmd; + iv[0].iov_len = sizeof(cmd); + + iv[1].iov_base = param; + iv[1].iov_len = len; + + msg.msg_iov = iv; + msg.msg_iovlen = 2; + + pthread_mutex_lock(&cmd_sk_mutex); + + ret = sendmsg(cmd_sk, &msg, 0); + if (ret < 0) { + error("Sending command failed, aborting :%s", strerror(errno)); + pthread_mutex_unlock(&cmd_sk_mutex); + exit(EXIT_FAILURE); + } + + /* socket was shutdown */ + if (ret == 0) { + error("Command socket closed, aborting"); + exit(EXIT_FAILURE); + } + + memset(&msg, 0, sizeof(msg)); + memset(&cmd, 0, sizeof(cmd)); + + iv[0].iov_base = &cmd; + iv[0].iov_len = sizeof(cmd); + + iv[1].iov_base = rsp; + iv[1].iov_len = *rsp_len; + + msg.msg_iov = iv; + msg.msg_iovlen = 2; + + if (fd) { + memset(cmsgbuf, 0, sizeof(cmsgbuf)); + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); + } + + ret = recvmsg(cmd_sk, &msg, 0); + if (ret < 0) { + error("Receiving command response failed, aborting :%s", + strerror(errno)); + pthread_mutex_unlock(&cmd_sk_mutex); + exit(EXIT_FAILURE); + } + + pthread_mutex_unlock(&cmd_sk_mutex); + + if (ret < (ssize_t) sizeof(cmd)) { + error("Too small response received(%zd bytes), aborting", ret); + exit(EXIT_FAILURE); + } + + if (cmd.service_id != service_id) { + error("Invalid service id (0x%x vs 0x%x), aborting", + cmd.service_id, service_id); + exit(EXIT_FAILURE); + } + + if (ret != (ssize_t) (sizeof(cmd) + cmd.len)) { + error("Malformed response received(%zd bytes), aborting", ret); + exit(EXIT_FAILURE); + } + + if (cmd.opcode != opcode && cmd.opcode != HAL_OP_STATUS) { + error("Invalid opcode received (0x%x vs 0x%x), aborting", + cmd.opcode, opcode); + exit(EXIT_FAILURE); + } + + if (cmd.opcode == HAL_OP_STATUS) { + struct ipc_status *s = rsp; + + if (sizeof(*s) != cmd.len) { + error("Invalid status length, aborting"); + exit(EXIT_FAILURE); + } + + if (s->code == HAL_STATUS_SUCCESS) { + error("Invalid success status response, aborting"); + exit(EXIT_FAILURE); + } + + return s->code; + } + + /* Receive auxiliary data in msg */ + if (fd) { + struct cmsghdr *cmsg; + + *fd = -1; + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET + && cmsg->cmsg_type == SCM_RIGHTS) { + memcpy(fd, CMSG_DATA(cmsg), sizeof(int)); + break; + } + } + } + + if (rsp_len) + *rsp_len = cmd.len; + + return BT_STATUS_SUCCESS; +}
diff --git a/bluez/android/hal-ipc.h b/bluez/android/hal-ipc.h new file mode 100644 index 0000000..2fbf30f --- /dev/null +++ b/bluez/android/hal-ipc.h
@@ -0,0 +1,32 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +struct hal_ipc_handler { + void (*handler) (void *buf, uint16_t len); + bool var_len; + size_t data_len; +}; + +bool hal_ipc_init(void); +void hal_ipc_cleanup(void); + +int hal_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len, void *param, + size_t *rsp_len, void *rsp, int *fd); + +void hal_ipc_register(uint8_t service, const struct hal_ipc_handler *handlers, + uint8_t size); +void hal_ipc_unregister(uint8_t service);
diff --git a/bluez/android/hal-log.h b/bluez/android/hal-log.h new file mode 100644 index 0000000..63ff61b --- /dev/null +++ b/bluez/android/hal-log.h
@@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#define LOG_TAG "BlueZ" + +#ifdef __BIONIC__ +#include <cutils/log.h> +#else +#include <stdio.h> +#define LOG_INFO " I" +#define LOG_WARN " W" +#define LOG_ERROR " E" +#define LOG_DEBUG " D" +#define ALOG(pri, tag, fmt, arg...) fprintf(stderr, tag pri": " fmt"\n", ##arg) +#endif + +#define info(fmt, arg...) ALOG(LOG_INFO, LOG_TAG, fmt, ##arg) +#define warn(fmt, arg...) ALOG(LOG_WARN, LOG_TAG, fmt, ##arg) +#define error(fmt, arg...) ALOG(LOG_ERROR, LOG_TAG, fmt, ##arg) +#define DBG(fmt, arg...) ALOG(LOG_DEBUG, LOG_TAG, "%s:%s() "fmt, __FILE__, \ + __func__, ##arg)
diff --git a/bluez/android/hal-msg.h b/bluez/android/hal-msg.h new file mode 100644 index 0000000..b7fa8fc --- /dev/null +++ b/bluez/android/hal-msg.h
@@ -0,0 +1,1570 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +static const char BLUEZ_HAL_SK_PATH[] = "\0bluez_hal_socket"; + +#define HAL_MINIMUM_EVENT 0x81 + +#define HAL_SERVICE_ID_CORE 0 +#define HAL_SERVICE_ID_BLUETOOTH 1 +#define HAL_SERVICE_ID_SOCKET 2 +#define HAL_SERVICE_ID_HIDHOST 3 +#define HAL_SERVICE_ID_PAN 4 +#define HAL_SERVICE_ID_HANDSFREE 5 +#define HAL_SERVICE_ID_A2DP 6 +#define HAL_SERVICE_ID_HEALTH 7 +#define HAL_SERVICE_ID_AVRCP 8 +#define HAL_SERVICE_ID_GATT 9 + +#define HAL_SERVICE_ID_MAX HAL_SERVICE_ID_GATT + +/* Core Service */ + +#define HAL_STATUS_SUCCESS IPC_STATUS_SUCCESS +#define HAL_STATUS_FAILED 0x01 +#define HAL_STATUS_NOT_READY 0x02 +#define HAL_STATUS_NOMEM 0x03 +#define HAL_STATUS_BUSY 0x04 +#define HAL_STATUS_DONE 0x05 +#define HAL_STATUS_UNSUPPORTED 0x06 +#define HAL_STATUS_INVALID 0x07 +#define HAL_STATUS_UNHANDLED 0x08 +#define HAL_STATUS_AUTH_FAILURE 0x09 +#define HAL_STATUS_REMOTE_DEVICE_DOWN 0x0a + +#define HAL_OP_STATUS IPC_OP_STATUS + +#define HAL_MODE_DEFAULT 0x00 + +#define HAL_OP_REGISTER_MODULE 0x01 +struct hal_cmd_register_module { + uint8_t service_id; + uint8_t mode; +} __attribute__((packed)); + +#define HAL_OP_UNREGISTER_MODULE 0x02 +struct hal_cmd_unregister_module { + uint8_t service_id; +} __attribute__((packed)); + +/* Bluetooth Core HAL API */ + +#define HAL_OP_ENABLE 0x01 + +#define HAL_OP_DISABLE 0x02 + +#define HAL_OP_GET_ADAPTER_PROPS 0x03 + +#define HAL_OP_GET_ADAPTER_PROP 0x04 +struct hal_cmd_get_adapter_prop { + uint8_t type; +} __attribute__((packed)); + +#define HAL_MAX_NAME_LENGTH 249 + +#define HAL_PROP_ADAPTER_NAME 0x01 +#define HAL_PROP_ADAPTER_ADDR 0x02 +#define HAL_PROP_ADAPTER_UUIDS 0x03 +#define HAL_PROP_ADAPTER_CLASS 0x04 +#define HAL_PROP_ADAPTER_TYPE 0x05 +#define HAL_PROP_ADAPTER_SERVICE_REC 0x06 +#define HAL_PROP_ADAPTER_SCAN_MODE 0x07 +#define HAL_PROP_ADAPTER_BONDED_DEVICES 0x08 +#define HAL_PROP_ADAPTER_DISC_TIMEOUT 0x09 + +#define HAL_PROP_DEVICE_NAME 0x01 +#define HAL_PROP_DEVICE_ADDR 0x02 +#define HAL_PROP_DEVICE_UUIDS 0x03 +#define HAL_PROP_DEVICE_CLASS 0x04 +#define HAL_PROP_DEVICE_TYPE 0x05 +#define HAL_PROP_DEVICE_SERVICE_REC 0x06 +struct hal_prop_device_service_rec { + uint8_t uuid[16]; + uint16_t channel; + uint8_t name_len; + uint8_t name[]; +} __attribute__((packed)); + +#define HAL_PROP_DEVICE_FRIENDLY_NAME 0x0a +#define HAL_PROP_DEVICE_RSSI 0x0b +#define HAL_PROP_DEVICE_VERSION_INFO 0x0c +struct hal_prop_device_info { + uint8_t version; + uint16_t sub_version; + uint16_t manufacturer; +} __attribute__((packed)); + +#define HAL_PROP_DEVICE_TIMESTAMP 0xFF + +#define HAL_ADAPTER_SCAN_MODE_NONE 0x00 +#define HAL_ADAPTER_SCAN_MODE_CONN 0x01 +#define HAL_ADAPTER_SCAN_MODE_CONN_DISC 0x02 + +#define HAL_TYPE_BREDR 0x01 +#define HAL_TYPE_LE 0x02 +#define HAL_TYPE_DUAL 0x03 + +#define HAL_OP_SET_ADAPTER_PROP 0x05 +struct hal_cmd_set_adapter_prop { + uint8_t type; + uint16_t len; + uint8_t val[0]; +} __attribute__((packed)); + +#define HAL_OP_GET_REMOTE_DEVICE_PROPS 0x06 +struct hal_cmd_get_remote_device_props { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_GET_REMOTE_DEVICE_PROP 0x07 +struct hal_cmd_get_remote_device_prop { + uint8_t bdaddr[6]; + uint8_t type; +} __attribute__((packed)); + +#define HAL_OP_SET_REMOTE_DEVICE_PROP 0x08 +struct hal_cmd_set_remote_device_prop { + uint8_t bdaddr[6]; + uint8_t type; + uint16_t len; + uint8_t val[0]; +} __attribute__((packed)); + +#define HAL_OP_GET_REMOTE_SERVICE_REC 0x09 +struct hal_cmd_get_remote_service_rec { + uint8_t bdaddr[6]; + uint8_t uuid[16]; +} __attribute__((packed)); + +#define HAL_OP_GET_REMOTE_SERVICES 0x0a +struct hal_cmd_get_remote_services { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_START_DISCOVERY 0x0b + +#define HAL_OP_CANCEL_DISCOVERY 0x0c + +#define HAL_OP_CREATE_BOND 0x0d +struct hal_cmd_create_bond { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_REMOVE_BOND 0x0e +struct hal_cmd_remove_bond { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_CANCEL_BOND 0x0f +struct hal_cmd_cancel_bond { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_PIN_REPLY 0x10 +struct hal_cmd_pin_reply { + uint8_t bdaddr[6]; + uint8_t accept; + uint8_t pin_len; + uint8_t pin_code[16]; +} __attribute__((packed)); + +#define HAL_SSP_VARIANT_CONFIRM 0x00 +#define HAL_SSP_VARIANT_ENTRY 0x01 +#define HAL_SSP_VARIANT_CONSENT 0x02 +#define HAL_SSP_VARIANT_NOTIF 0x03 + +#define HAL_OP_SSP_REPLY 0x11 +struct hal_cmd_ssp_reply { + uint8_t bdaddr[6]; + uint8_t ssp_variant; + uint8_t accept; + uint32_t passkey; +} __attribute__((packed)); + +#define HAL_OP_DUT_MODE_CONF 0x12 +struct hal_cmd_dut_mode_conf { + uint8_t enable; +} __attribute__((packed)); + +#define HAL_OP_DUT_MODE_SEND 0x13 +struct hal_cmd_dut_mode_send { + uint16_t opcode; + uint8_t len; + uint8_t data[0]; +} __attribute__((packed)); + +#define HAL_OP_LE_TEST_MODE 0x14 +struct hal_cmd_le_test_mode { + uint16_t opcode; + uint8_t len; + uint8_t data[0]; +} __attribute__((packed)); + +/* Bluetooth Socket HAL api */ + +#define HAL_SOCK_RFCOMM 0x01 +#define HAL_SOCK_SCO 0x02 +#define HAL_SOCK_L2CAP 0x03 + +#define HAL_SOCK_FLAG_ENCRYPT 0x01 +#define HAL_SOCK_FLAG_AUTH 0x02 + +#define HAL_OP_SOCKET_LISTEN 0x01 +struct hal_cmd_socket_listen { + uint8_t type; + uint8_t name[256]; + uint8_t uuid[16]; + int32_t channel; + uint8_t flags; +} __attribute__((packed)); + +#define HAL_OP_SOCKET_CONNECT 0x02 +struct hal_cmd_socket_connect { + uint8_t bdaddr[6]; + uint8_t type; + uint8_t uuid[16]; + int32_t channel; + uint8_t flags; +} __attribute__((packed)); + +/* Bluetooth HID Host HAL API */ + +#define HAL_OP_HIDHOST_CONNECT 0x01 +struct hal_cmd_hidhost_connect { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_HIDHOST_DISCONNECT 0x02 +struct hal_cmd_hidhost_disconnect { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_HIDHOST_VIRTUAL_UNPLUG 0x03 +struct hal_cmd_hidhost_virtual_unplug { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_HIDHOST_SET_INFO 0x04 +struct hal_cmd_hidhost_set_info { + uint8_t bdaddr[6]; + uint8_t attr; + uint8_t subclass; + uint8_t app_id; + uint16_t vendor; + uint16_t product; + uint16_t country; + uint16_t descr_len; + uint8_t descr[0]; +} __attribute__((packed)); + +#define HAL_HIDHOST_REPORT_PROTOCOL 0x00 +#define HAL_HIDHOST_BOOT_PROTOCOL 0x01 +#define HAL_HIDHOST_UNSUPPORTED_PROTOCOL 0xff + +#define HAL_OP_HIDHOST_GET_PROTOCOL 0x05 +struct hal_cmd_hidhost_get_protocol { + uint8_t bdaddr[6]; + uint8_t mode; +} __attribute__((packed)); + +#define HAL_OP_HIDHOST_SET_PROTOCOL 0x06 +struct hal_cmd_hidhost_set_protocol { + uint8_t bdaddr[6]; + uint8_t mode; +} __attribute__((packed)); + +#define HAL_HIDHOST_INPUT_REPORT 0x01 +#define HAL_HIDHOST_OUTPUT_REPORT 0x02 +#define HAL_HIDHOST_FEATURE_REPORT 0x03 + +#define HAL_OP_HIDHOST_GET_REPORT 0x07 +struct hal_cmd_hidhost_get_report { + uint8_t bdaddr[6]; + uint8_t type; + uint8_t id; + uint16_t buf_size; +} __attribute__((packed)); + +#define HAL_OP_HIDHOST_SET_REPORT 0x08 +struct hal_cmd_hidhost_set_report { + uint8_t bdaddr[6]; + uint8_t type; + uint16_t len; + uint8_t data[0]; +} __attribute__((packed)); + +#define HAL_OP_HIDHOST_SEND_DATA 0x09 +struct hal_cmd_hidhost_send_data { + uint8_t bdaddr[6]; + uint16_t len; + uint8_t data[0]; +} __attribute__((packed)); + +/* a2dp HAL API */ + +#define HAL_OP_A2DP_CONNECT 0x01 +struct hal_cmd_a2dp_connect { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_A2DP_DISCONNECT 0x02 +struct hal_cmd_a2dp_disconnect { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +/* PAN HAL API */ + +/* PAN Roles */ +#define HAL_PAN_ROLE_NONE 0x00 +#define HAL_PAN_ROLE_NAP 0x01 +#define HAL_PAN_ROLE_PANU 0x02 + +/* PAN Control states */ +#define HAL_PAN_CTRL_ENABLED 0x00 +#define HAL_PAN_CTRL_DISABLED 0x01 + +/* PAN Connection states */ +#define HAL_PAN_STATE_CONNECTED 0x00 +#define HAL_PAN_STATE_CONNECTING 0x01 +#define HAL_PAN_STATE_DISCONNECTED 0x02 +#define HAL_PAN_STATE_DISCONNECTING 0x03 + +/* PAN status values */ +#define HAL_PAN_STATUS_FAIL 0x01 +#define HAL_PAN_STATUS_NOT_READY 0x02 +#define HAL_PAN_STATUS_NO_MEMORY 0x03 +#define HAL_PAN_STATUS_BUSY 0x04 +#define HAL_PAN_STATUS_DONE 0x05 +#define HAL_PAN_STATUS_UNSUPORTED 0x06 +#define HAL_PAN_STATUS_INVAL 0x07 +#define HAL_PAN_STATUS_UNHANDLED 0x08 +#define HAL_PAN_STATUS_AUTH_FAILED 0x09 +#define HAL_PAN_STATUS_DEVICE_DOWN 0x0A + +#define HAL_OP_PAN_ENABLE 0x01 +struct hal_cmd_pan_enable { + uint8_t local_role; +} __attribute__((packed)); + +#define HAL_OP_PAN_GET_ROLE 0x02 +struct hal_rsp_pan_get_role { + uint8_t local_role; +} __attribute__((packed)); + +#define HAL_OP_PAN_CONNECT 0x03 +struct hal_cmd_pan_connect { + uint8_t bdaddr[6]; + uint8_t local_role; + uint8_t remote_role; +} __attribute__((packed)); + +#define HAL_OP_PAN_DISCONNECT 0x04 +struct hal_cmd_pan_disconnect { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +struct hal_string { + uint8_t len; + uint8_t data[0]; +}; + +#define HAL_OP_HEALTH_REG_APP 0x01 +struct hal_cmd_health_reg_app { + struct hal_string app_name; + struct hal_string provider_name; + struct hal_string service_name; + struct hal_string service_descr; + uint8_t num_of_mdep; + + struct { + uint8_t role; + uint8_t data_type; + uint8_t channel_type; + struct hal_string descr; + } mdep_cfg[0]; +} __attribute__((packed)); + +struct hal_rsp_health_reg_app { + uint16_t app_id; +} __attribute__((packed)); + +#define HAL_OP_HEALTH_UNREG_APP 0x02 +struct hal_cmd_health_unreg_app { + uint16_t app_id; +} __attribute__((packed)); + +#define HAL_OP_HEALTH_CONNECT_CHANNEL 0x03 +struct hal_cmd_health_connect_channel { + uint16_t app_id; + uint8_t bdaddr[6]; + uint8_t mdep_index; +} __attribute__((packed)); + +struct hal_rsp_health_connect_channel { + uint16_t channel_id; +} __attribute__((packed)); + +#define HAL_OP_HEALTH_DESTROY_CHANNEL 0x04 +struct hal_cmd_health_destroy_channel { + uint16_t channel_id; +} __attribute__((packed)); + +/* Handsfree HAL API */ + +#define HAL_MODE_HANDSFREE_HSP_ONLY HAL_MODE_DEFAULT +#define HAL_MODE_HANDSFREE_HFP 0x01 +#define HAL_MODE_HANDSFREE_HFP_WBS 0x02 + +#define HAL_OP_HANDSFREE_CONNECT 0x01 +struct hal_cmd_handsfree_connect { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_HANDSFREE_DISCONNECT 0x02 +struct hal_cmd_handsfree_disconnect { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_HANDSFREE_CONNECT_AUDIO 0x03 +struct hal_cmd_handsfree_connect_audio { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_HANDSFREE_DISCONNECT_AUDIO 0x04 +struct hal_cmd_handsfree_disconnect_audio { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_HANDSFREE_START_VR 0x05 + +#define HAL_OP_HANDSFREE_STOP_VR 0x06 + +#define HAL_HANDSFREE_VOLUME_TYPE_SPEAKER 0x00 +#define HAL_HANDSFREE_VOLUME_TYPE_MIC 0x01 + +#define HAL_OP_HANDSFREE_VOLUME_CONTROL 0x07 +struct hal_cmd_handsfree_volume_control { + uint8_t type; + uint8_t volume; +} __attribute__((packed)); + +#define HAL_HANDSFREE_NETWORK_STATE_NOT_AVAILABLE 0x00 +#define HAL_HANDSFREE_NETWORK_STATE_AVAILABLE 0x01 + +#define HAL_HANDSFREE_SERVICE_TYPE_HOME 0x00 +#define HAL_HANDSFREE_SERVICE_TYPE_ROAMING 0x01 + +#define HAL_OP_HANDSFREE_DEVICE_STATUS_NOTIF 0x08 +struct hal_cmd_handsfree_device_status_notif { + uint8_t state; + uint8_t type; + uint8_t signal; + uint8_t battery; +} __attribute__((packed)); + +#define HAL_OP_HANDSFREE_COPS_RESPONSE 0x09 +struct hal_cmd_handsfree_cops_response { + uint16_t len; + uint8_t buf[0]; +} __attribute__((packed)); + +#define HAL_HANDSFREE_CALL_STATE_ACTIVE 0x00 +#define HAL_HANDSFREE_CALL_STATE_HELD 0x01 +#define HAL_HANDSFREE_CALL_STATE_DIALING 0x02 +#define HAL_HANDSFREE_CALL_STATE_ALERTING 0x03 +#define HAL_HANDSFREE_CALL_STATE_INCOMING 0x04 +#define HAL_HANDSFREE_CALL_STATE_WAITING 0x05 +#define HAL_HANDSFREE_CALL_STATE_IDLE 0x06 + +#define HAL_OP_HANDSFREE_CIND_RESPONSE 0x0A +struct hal_cmd_handsfree_cind_response { + uint8_t svc; + uint8_t num_active; + uint8_t num_held; + uint8_t state; + uint8_t signal; + uint8_t roam; + uint8_t batt_chg; +} __attribute__((packed)); + +#define HAL_OP_HANDSFREE_FORMATTED_AT_RESPONSE 0x0B +struct hal_cmd_handsfree_formatted_at_response { + uint16_t len; + uint8_t buf[0]; +} __attribute__((packed)); + +#define HAL_HANDSFREE_AT_RESPONSE_ERROR 0x00 +#define HAL_HANDSFREE_AT_RESPONSE_OK 0x01 + +#define HAL_OP_HANDSFREE_AT_RESPONSE 0x0C +struct hal_cmd_handsfree_at_response { + uint8_t response; + uint8_t error; +} __attribute__((packed)); + +#define HAL_HANDSFREE_CALL_DIRECTION_OUTGOING 0x00 +#define HAL_HANDSFREE_CALL_DIRECTION_INCOMING 0x01 + +#define HAL_HANDSFREE_CALL_TYPE_VOICE 0x00 +#define HAL_HANDSFREE_CALL_TYPE_DATA 0x01 +#define HAL_HANDSFREE_CALL_TYPE_FAX 0x02 + +#define HAL_HANDSFREE_CALL_MPTY_TYPE_SINGLE 0x00 +#define HAL_HANDSFREE_CALL_MPTY_TYPE_MULTI 0x01 + +#define HAL_HANDSFREE_CALL_ADDRTYPE_UNKNOWN 0x81 +#define HAL_HANDSFREE_CALL_ADDRTYPE_INTERNATIONAL 0x91 + +#define HAL_OP_HANDSFREE_CLCC_RESPONSE 0x0D +struct hal_cmd_handsfree_clcc_response { + uint8_t index; + uint8_t dir; + uint8_t state; + uint8_t mode; + uint8_t mpty; + uint8_t type; + uint16_t number_len; + uint8_t number[0]; +} __attribute__((packed)); + +#define HAL_OP_HANDSFREE_PHONE_STATE_CHANGE 0x0E +struct hal_cmd_handsfree_phone_state_change { + uint8_t num_active; + uint8_t num_held; + uint8_t state; + uint8_t type; + uint16_t number_len; + uint8_t number[0]; +} __attribute__((packed)); + +/* GATT HAL API */ + +#define HAL_OP_GATT_CLIENT_REGISTER 0x01 +struct hal_cmd_gatt_client_register { + uint8_t uuid[16]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_UNREGISTER 0x02 +struct hal_cmd_gatt_client_unregister { + int32_t client_if; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_SCAN 0x03 +struct hal_cmd_gatt_client_scan { + int32_t client_if; + uint8_t start; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_CONNECT 0x04 +struct hal_cmd_gatt_client_connect { + int32_t client_if; + uint8_t bdaddr[6]; + uint8_t is_direct; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_DISCONNECT 0x05 +struct hal_cmd_gatt_client_disconnect { + int32_t client_if; + uint8_t bdaddr[6]; + int32_t conn_id; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_LISTEN 0x06 +struct hal_cmd_gatt_client_listen { + int32_t client_if; + uint8_t start; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_REFRESH 0x07 +struct hal_cmd_gatt_client_refresh { + int32_t client_if; + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_SEARCH_SERVICE 0x08 +struct hal_cmd_gatt_client_search_service { + int32_t conn_id; + uint8_t number; + uint8_t filter_uuid[0]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_GET_INCLUDED_SERVICE 0x09 +struct hal_gatt_srvc_id { + uint8_t uuid[16]; + uint8_t inst_id; + uint8_t is_primary; +} __attribute__((packed)); + +struct hal_cmd_gatt_client_get_included_service { + int32_t conn_id; + uint8_t number; + struct hal_gatt_srvc_id srvc_id[0]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_GET_CHARACTERISTIC 0x0a +struct hal_gatt_gatt_id { + uint8_t uuid[16]; + uint8_t inst_id; +} __attribute__((packed)); + +struct hal_cmd_gatt_client_get_characteristic { + int32_t conn_id; + struct hal_gatt_srvc_id srvc_id; + uint8_t number; + struct hal_gatt_gatt_id gatt_id[0]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_GET_DESCRIPTOR 0x0b +struct hal_cmd_gatt_client_get_descriptor { + int32_t conn_id; + struct hal_gatt_srvc_id srvc_id; + uint8_t number; + struct hal_gatt_gatt_id gatt_id[0]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_READ_CHARACTERISTIC 0x0c +struct hal_cmd_gatt_client_read_characteristic { + int32_t conn_id; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id gatt_id; + int32_t auth_req; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_WRITE_CHARACTERISTIC 0x0d +struct hal_cmd_gatt_client_write_characteristic { + int32_t conn_id; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id gatt_id; + int32_t write_type; + int32_t len; + int32_t auth_req; + uint8_t value[0]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_READ_DESCRIPTOR 0x0e +struct hal_cmd_gatt_client_read_descriptor { + int32_t conn_id; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; + struct hal_gatt_gatt_id descr_id; + int32_t auth_req; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_WRITE_DESCRIPTOR 0x0f +struct hal_cmd_gatt_client_write_descriptor { + int32_t conn_id; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; + struct hal_gatt_gatt_id descr_id; + int32_t write_type; + int32_t len; + int32_t auth_req; + uint8_t value[0]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_EXECUTE_WRITE 0x10 +struct hal_cmd_gatt_client_execute_write { + int32_t conn_id; + int32_t execute; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_REGISTER_FOR_NOTIFICATION 0x11 +struct hal_cmd_gatt_client_register_for_notification { + int32_t client_if; + uint8_t bdaddr[6]; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_DEREGISTER_FOR_NOTIFICATION 0x12 +struct hal_cmd_gatt_client_deregister_for_notification { + int32_t client_if; + uint8_t bdaddr[6]; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_READ_REMOTE_RSSI 0x13 +struct hal_cmd_gatt_client_read_remote_rssi { + int32_t client_if; + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_GET_DEVICE_TYPE 0x14 +struct hal_cmd_gatt_client_get_device_type { + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_SET_ADV_DATA 0x015 +struct hal_cmd_gatt_client_set_adv_data { + int32_t server_if; + uint8_t set_scan_rsp; + uint8_t include_name; + uint8_t include_txpower; + int32_t min_interval; + int32_t max_interval; + int32_t appearance; + uint16_t manufacturer_len; + uint8_t manufacturer_data[0]; +} __attribute__((packed)); + +#define HAL_OP_GATT_CLIENT_TEST_COMMAND 0x16 +struct hal_cmd_gatt_client_test_command { + int32_t command; + uint8_t bda1[6]; + uint8_t uuid1[16]; + uint16_t u1; + uint16_t u2; + uint16_t u3; + uint16_t u4; + uint16_t u5; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_REGISTER 0x17 +struct hal_cmd_gatt_server_register { + uint8_t uuid[16]; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_UNREGISTER 0x18 +struct hal_cmd_gatt_server_unregister { + int32_t server_if; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_CONNECT 0x19 +struct hal_cmd_gatt_server_connect { + int32_t server_if; + uint8_t bdaddr[6]; + uint8_t is_direct; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_DISCONNECT 0x1a +struct hal_cmd_gatt_server_disconnect { + int32_t server_if; + uint8_t bdaddr[6]; + int32_t conn_id; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_ADD_SERVICE 0x1b +struct hal_cmd_gatt_server_add_service { + int32_t server_if; + struct hal_gatt_srvc_id srvc_id; + int32_t num_handles; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_ADD_INC_SERVICE 0x1c +struct hal_cmd_gatt_server_add_inc_service { + int32_t server_if; + int32_t service_handle; + int32_t included_handle; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_ADD_CHARACTERISTIC 0x1d +struct hal_cmd_gatt_server_add_characteristic { + int32_t server_if; + int32_t service_handle; + uint8_t uuid[16]; + int32_t properties; + int32_t permissions; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_ADD_DESCRIPTOR 0x1e +struct hal_cmd_gatt_server_add_descriptor { + int32_t server_if; + int32_t service_handle; + uint8_t uuid[16]; + int32_t permissions; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_START_SERVICE 0x1f +struct hal_cmd_gatt_server_start_service { + int32_t server_if; + int32_t service_handle; + int32_t transport; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_STOP_SERVICE 0x20 +struct hal_cmd_gatt_server_stop_service { + int32_t server_if; + int32_t service_handle; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_DELETE_SERVICE 0x21 +struct hal_cmd_gatt_server_delete_service { + int32_t server_if; + int32_t service_handle; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_SEND_INDICATION 0x22 +struct hal_cmd_gatt_server_send_indication { + int32_t server_if; + int32_t attribute_handle; + int32_t conn_id; + int32_t len; + int32_t confirm; + uint8_t value[0]; +} __attribute__((packed)); + +#define HAL_OP_GATT_SERVER_SEND_RESPONSE 0x23 +struct hal_cmd_gatt_server_send_response { + int32_t conn_id; + int32_t trans_id; + int32_t status; + uint16_t len; + uint8_t data[0]; +} __attribute__((packed)); + +/* Notifications and confirmations */ + +#define HAL_POWER_OFF 0x00 +#define HAL_POWER_ON 0x01 + +#define HAL_EV_ADAPTER_STATE_CHANGED 0x81 +struct hal_ev_adapter_state_changed { + uint8_t state; +} __attribute__((packed)); + +#define HAL_EV_ADAPTER_PROPS_CHANGED 0x82 +struct hal_property { + uint8_t type; + uint16_t len; + uint8_t val[0]; +} __attribute__((packed)); +struct hal_ev_adapter_props_changed { + uint8_t status; + uint8_t num_props; + struct hal_property props[0]; +} __attribute__((packed)); + +#define HAL_EV_REMOTE_DEVICE_PROPS 0x83 +struct hal_ev_remote_device_props { + uint8_t status; + uint8_t bdaddr[6]; + uint8_t num_props; + struct hal_property props[0]; +} __attribute__((packed)); + +#define HAL_EV_DEVICE_FOUND 0x84 +struct hal_ev_device_found { + uint8_t num_props; + struct hal_property props[0]; +} __attribute__((packed)); + +#define HAL_DISCOVERY_STATE_STOPPED 0x00 +#define HAL_DISCOVERY_STATE_STARTED 0x01 + +#define HAL_EV_DISCOVERY_STATE_CHANGED 0x85 +struct hal_ev_discovery_state_changed { + uint8_t state; +} __attribute__((packed)); + +#define HAL_EV_PIN_REQUEST 0x86 +struct hal_ev_pin_request { + uint8_t bdaddr[6]; + uint8_t name[249]; + uint32_t class_of_dev; +} __attribute__((packed)); + +#define HAL_EV_SSP_REQUEST 0x87 +struct hal_ev_ssp_request { + uint8_t bdaddr[6]; + uint8_t name[249]; + uint32_t class_of_dev; + uint8_t pairing_variant; + uint32_t passkey; +} __attribute__((packed)); + +#define HAL_BOND_STATE_NONE 0 +#define HAL_BOND_STATE_BONDING 1 +#define HAL_BOND_STATE_BONDED 2 + +#define HAL_EV_BOND_STATE_CHANGED 0x88 +struct hal_ev_bond_state_changed { + uint8_t status; + uint8_t bdaddr[6]; + uint8_t state; +} __attribute__((packed)); + +#define HAL_ACL_STATE_CONNECTED 0x00 +#define HAL_ACL_STATE_DISCONNECTED 0x01 + +#define HAL_EV_ACL_STATE_CHANGED 0x89 +struct hal_ev_acl_state_changed { + uint8_t status; + uint8_t bdaddr[6]; + uint8_t state; +} __attribute__((packed)); + +#define HAL_EV_DUT_MODE_RECEIVE 0x8a +struct hal_ev_dut_mode_receive { + uint16_t opcode; + uint8_t len; + uint8_t data[0]; +} __attribute__((packed)); + +#define HAL_EV_LE_TEST_MODE 0x8b +struct hal_ev_le_test_mode { + uint8_t status; + uint16_t num_packets; +} __attribute__((packed)); + +#define HAL_HIDHOST_STATE_CONNECTED 0x00 +#define HAL_HIDHOST_STATE_CONNECTING 0x01 +#define HAL_HIDHOST_STATE_DISCONNECTED 0x02 +#define HAL_HIDHOST_STATE_DISCONNECTING 0x03 +#define HAL_HIDHOST_STATE_NO_HID 0x07 +#define HAL_HIDHOST_STATE_FAILED 0x08 +#define HAL_HIDHOST_STATE_UNKNOWN 0x09 + +#define HAL_EV_HIDHOST_CONN_STATE 0x81 +struct hal_ev_hidhost_conn_state { + uint8_t bdaddr[6]; + uint8_t state; +} __attribute__((packed)); + +#define HAL_HIDHOST_STATUS_OK 0x00 +#define HAL_HIDHOST_GENERAL_ERROR 0x06 + +#define HAL_EV_HIDHOST_INFO 0x82 +struct hal_ev_hidhost_info { + uint8_t bdaddr[6]; + uint8_t attr; + uint8_t subclass; + uint8_t app_id; + uint16_t vendor; + uint16_t product; + uint16_t version; + uint8_t country; + uint16_t descr_len; + uint8_t descr[884]; +} __attribute__((packed)); + +#define HAL_EV_HIDHOST_PROTO_MODE 0x83 +struct hal_ev_hidhost_proto_mode { + uint8_t bdaddr[6]; + uint8_t status; + uint8_t mode; +} __attribute__((packed)); + +#define HAL_EV_HIDHOST_IDLE_TIME 0x84 +struct hal_ev_hidhost_idle_time { + uint8_t bdaddr[6]; + uint8_t status; + uint32_t idle_rate; +} __attribute__((packed)); + +#define HAL_EV_HIDHOST_GET_REPORT 0x85 +struct hal_ev_hidhost_get_report { + uint8_t bdaddr[6]; + uint8_t status; + uint16_t len; + uint8_t data[0]; +} __attribute__((packed)); + +#define HAL_EV_HIDHOST_VIRTUAL_UNPLUG 0x86 +struct hal_ev_hidhost_virtual_unplug { + uint8_t bdaddr[6]; + uint8_t status; +} __attribute__((packed)); + +#define HAL_EV_PAN_CTRL_STATE 0x81 +struct hal_ev_pan_ctrl_state { + uint8_t state; + uint8_t status; + uint8_t local_role; + uint8_t name[17]; +} __attribute__((packed)); + +#define HAL_EV_PAN_CONN_STATE 0x82 +struct hal_ev_pan_conn_state { + uint8_t state; + uint8_t status; + uint8_t bdaddr[6]; + uint8_t local_role; + uint8_t remote_role; +} __attribute__((packed)); + +#define HAL_HEALTH_APP_REG_SUCCESS 0x00 +#define HAL_HEALTH_APP_REG_FAILED 0x01 +#define HAL_HEALTH_APP_DEREG_SUCCESS 0x02 +#define HAL_HEALTH_APP_DEREG_FAILED 0x03 + +#define HAL_HEALTH_CHANNEL_CONNECTING 0x00 +#define HAL_HEALTH_CHANNEL_CONNECTED 0x01 +#define HAL_HEALTH_CHANNEL_DISCONNECTING 0x02 +#define HAL_HEALTH_CHANNEL_DISCONNECTED 0x03 +#define HAL_HEALTH_CHANNEL_DESTROYED 0x04 + +#define HAL_EV_HEALTH_APP_REG_STATE 0x81 +struct hal_ev_health_app_reg_state { + uint16_t id; + uint8_t state; +} __attribute__((packed)); + +#define HAL_EV_HEALTH_CHANNEL_STATE 0x82 +struct hal_ev_health_channel_state { + uint16_t app_id; + uint8_t bdaddr[6]; + uint8_t mdep_index; + uint16_t channel_id; + uint8_t channel_state; +} __attribute__((packed)); + +#define HAL_A2DP_STATE_DISCONNECTED 0x00 +#define HAL_A2DP_STATE_CONNECTING 0x01 +#define HAL_A2DP_STATE_CONNECTED 0x02 +#define HAL_A2DP_STATE_DISCONNECTING 0x03 + +#define HAL_EV_A2DP_CONN_STATE 0x81 +struct hal_ev_a2dp_conn_state { + uint8_t state; + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_AUDIO_SUSPEND 0x00 +#define HAL_AUDIO_STOPPED 0x01 +#define HAL_AUDIO_STARTED 0x02 + +#define HAL_EV_A2DP_AUDIO_STATE 0x82 +struct hal_ev_a2dp_audio_state { + uint8_t state; + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTED 0x00 +#define HAL_EV_HANDSFREE_CONN_STATE_CONNECTING 0x01 +#define HAL_EV_HANDSFREE_CONN_STATE_CONNECTED 0x02 +#define HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED 0x03 +#define HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTING 0x04 + +#define HAL_EV_HANDSFREE_CONN_STATE 0x81 +struct hal_ev_handsfree_conn_state { + uint8_t state; + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED 0x00 +#define HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTING 0x01 +#define HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTED 0x02 +#define HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTING 0x03 + +#define HAL_EV_HANDSFREE_AUDIO_STATE 0x82 +struct hal_ev_handsfree_audio_state { + uint8_t state; + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_HANDSFREE_VR_STOPPED 0x00 +#define HAL_HANDSFREE_VR_STARTED 0x01 + +#define HAL_EV_HANDSFREE_VR 0x83 +struct hal_ev_handsfree_vr_state { + uint8_t state; +} __attribute__((packed)); + +#define HAL_EV_HANDSFREE_ANSWER 0x84 + +#define HAL_EV_HANDSFREE_HANGUP 0x85 + +#define HAL_EV_HANDSFREE_VOLUME 0x86 +struct hal_ev_handsfree_volume { + uint8_t type; + uint8_t volume; +} __attribute__((packed)); + +#define HAL_EV_HANDSFREE_DIAL 0x87 +struct hal_ev_handsfree_dial { + uint16_t number_len; + uint8_t number[0]; +} __attribute__((packed)); + +#define HAL_EV_HANDSFREE_DTMF 0x88 +struct hal_ev_handsfree_dtmf { + uint8_t tone; +} __attribute__((packed)); + +#define HAL_HANDSFREE_NREC_STOP 0x00 +#define HAL_HANDSFREE_NREC_START 0x01 + +#define HAL_EV_HANDSFREE_NREC 0x89 +struct hal_ev_handsfree_nrec { + uint8_t nrec; +} __attribute__((packed)); + +#define HAL_HANDSFREE_CHLD_TYPE_RELEASEHELD 0x00 +#define HAL_HANDSFREE_CHLD_TYPE_RELEASEACTIVE_ACCEPTHELD 0x01 +#define HAL_HANDSFREE_CHLD_TYPE_HOLDACTIVE_ACCEPTHELD 0x02 +#define HAL_HANDSFREE_CHLD_TYPE_ADDHELDTOCONF 0x03 + +#define HAL_EV_HANDSFREE_CHLD 0x8A +struct hal_ev_handsfree_chld { + uint8_t chld; +} __attribute__((packed)); + +#define HAL_EV_HANDSFREE_CNUM 0x8B + +#define HAL_EV_HANDSFREE_CIND 0x8C + +#define HAL_EV_HANDSFREE_COPS 0x8D + +#define HAL_EV_HANDSFREE_CLCC 0x8E + +#define HAL_EV_HANDSFREE_UNKNOWN_AT 0x8F +struct hal_ev_handsfree_unknown_at { + uint16_t len; + uint8_t buf[0]; +} __attribute__((packed)); + +#define HAL_EV_HANDSFREE_HSP_KEY_PRESS 0x90 + +/* AVRCP HAL API */ + +#define HAL_AVRCP_PLAY_STATUS_STOPPED 0x00 +#define HAL_AVRCP_PLAY_STATUS_PLAYING 0x01 +#define HAL_AVRCP_PLAY_STATUS_PAUSED 0x02 +#define HAL_AVRCP_PLAY_STATUS_FWD_SEEK 0x03 +#define HAL_AVRCP_PLAY_STATUS_REV_SEEK 0x04 +#define HAL_AVRCP_PLAY_STATUS_ERROR 0xff + +#define HAL_OP_AVRCP_GET_PLAY_STATUS 0x01 +struct hal_cmd_avrcp_get_play_status { + uint8_t status; + uint32_t duration; + uint32_t position; +} __attribute__((packed)); + +#define HAL_AVRCP_PLAYER_ATTR_EQUALIZER 0x01 +#define HAL_AVRCP_PLAYER_ATTR_REPEAT 0x02 +#define HAL_AVRCP_PLAYER_ATTR_SHUFFLE 0x03 +#define HAL_AVRCP_PLAYER_ATTR_SCAN 0x04 + +#define HAL_OP_AVRCP_LIST_PLAYER_ATTRS 0x02 +struct hal_cmd_avrcp_list_player_attrs { + uint8_t number; + uint8_t attrs[0]; +} __attribute__((packed)); + +#define HAL_OP_AVRCP_LIST_PLAYER_VALUES 0x03 +struct hal_cmd_avrcp_list_player_values { + uint8_t number; + uint8_t values[0]; +} __attribute__((packed)); + +struct hal_avrcp_player_attr_value { + uint8_t attr; + uint8_t value; +} __attribute__((packed)); + +#define HAL_OP_AVRCP_GET_PLAYER_ATTRS 0x04 +struct hal_cmd_avrcp_get_player_attrs { + uint8_t number; + struct hal_avrcp_player_attr_value attrs[0]; +} __attribute__((packed)); + +struct hal_avrcp_player_setting_text { + uint8_t id; + uint8_t len; + uint8_t text[0]; +} __attribute__((packed)); + +#define HAL_OP_AVRCP_GET_PLAYER_ATTRS_TEXT 0x05 +struct hal_cmd_avrcp_get_player_attrs_text { + uint8_t number; + struct hal_avrcp_player_setting_text attrs[0]; +} __attribute__((packed)); + +#define HAL_OP_AVRCP_GET_PLAYER_VALUES_TEXT 0x06 +struct hal_cmd_avrcp_get_player_values_text { + uint8_t number; + struct hal_avrcp_player_setting_text values[0]; +} __attribute__((packed)); + +#define HAL_AVRCP_MEDIA_ATTR_TITLE 0x01 +#define HAL_AVRCP_MEDIA_ATTR_ARTIST 0x02 +#define HAL_AVRCP_MEDIA_ATTR_ALBUM 0x03 +#define HAL_AVRCP_MEDIA_ATTR_TRACK_NUM 0x04 +#define HAL_AVRCP_MEDIA_ATTR_NUM_TRACKS 0x05 +#define HAL_AVRCP_MEDIA_ATTR_GENRE 0x06 +#define HAL_AVRCP_MEDIA_ATTR_DURATION 0x07 + +#define HAL_OP_AVRCP_GET_ELEMENT_ATTRS_TEXT 0x07 +struct hal_cmd_avrcp_get_element_attrs_text { + uint8_t number; + struct hal_avrcp_player_setting_text values[0]; +} __attribute__((packed)); + +#define HAL_OP_AVRCP_SET_PLAYER_ATTRS_VALUE 0x08 +struct hal_cmd_avrcp_set_player_attrs_value { + uint8_t status; +} __attribute__((packed)); + +#define HAL_AVRCP_EVENT_STATUS_CHANGED 0x01 +#define HAL_AVRCP_EVENT_TRACK_CHANGED 0x02 +#define HAL_AVRCP_EVENT_TRACK_REACHED_END 0x03 +#define HAL_AVRCP_EVENT_TRACK_REACHED_START 0x04 +#define HAL_AVRCP_EVENT_POSITION_CHANGED 0x05 +#define HAL_AVRCP_EVENT_SETTING_CHANGED 0x08 + +#define HAL_AVRCP_EVENT_TYPE_INTERIM 0x00 +#define HAL_AVRCP_EVENT_TYPE_CHANGED 0x01 + +#define HAL_OP_AVRCP_REGISTER_NOTIFICATION 0x09 +struct hal_cmd_avrcp_register_notification { + uint8_t event; + uint8_t type; + uint8_t len; + uint8_t data[0]; +} __attribute__((packed)); + +#define HAL_OP_AVRCP_SET_VOLUME 0x0a +struct hal_cmd_avrcp_set_volume { + uint8_t value; +} __attribute__((packed)); + +#define HAL_AVRCP_FEATURE_NONE 0x00 +#define HAL_AVRCP_FEATURE_METADATA 0x01 +#define HAL_AVRCP_FEATURE_ABSOLUTE_VOLUME 0x02 +#define HAL_AVRCP_FEATURE_BROWSE 0x04 + +#define HAL_EV_AVRCP_REMOTE_FEATURES 0x81 +struct hal_ev_avrcp_remote_features { + uint8_t bdaddr[6]; + uint8_t features; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_GET_PLAY_STATUS 0x82 +#define HAL_EV_AVRCP_LIST_PLAYER_ATTRS 0x83 + +#define HAL_EV_AVRCP_LIST_PLAYER_VALUES 0x84 +struct hal_ev_avrcp_list_player_values { + uint8_t attr; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_GET_PLAYER_VALUES 0x85 +struct hal_ev_avrcp_get_player_values { + uint8_t number; + uint8_t attrs[0]; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_GET_PLAYER_ATTRS_TEXT 0x86 +struct hal_ev_avrcp_get_player_attrs_text { + uint8_t number; + uint8_t attrs[0]; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_GET_PLAYER_VALUES_TEXT 0x87 +struct hal_ev_avrcp_get_player_values_text { + uint8_t attr; + uint8_t number; + uint8_t values[0]; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_SET_PLAYER_VALUES 0x88 +struct hal_ev_avrcp_set_player_values { + uint8_t number; + struct hal_avrcp_player_attr_value attrs[0]; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_GET_ELEMENT_ATTRS 0x89 +struct hal_ev_avrcp_get_element_attrs { + uint8_t number; + uint8_t attrs[0]; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_REGISTER_NOTIFICATION 0x8a +struct hal_ev_avrcp_register_notification { + uint8_t event; + uint32_t param; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_VOLUME_CHANGED 0x8b +struct hal_ev_avrcp_volume_changed { + uint8_t volume; + uint8_t type; +} __attribute__((packed)); + +#define HAL_EV_AVRCP_PASSTHROUGH_CMD 0x8c +struct hal_ev_avrcp_passthrough_cmd { + uint8_t id; + uint8_t state; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_REGISTER_CLIENT 0x81 +struct hal_ev_gatt_client_register_client { + int32_t status; + int32_t client_if; + uint8_t app_uuid[16]; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_SCAN_RESULT 0x82 +struct hal_ev_gatt_client_scan_result { + uint8_t bda[6]; + int32_t rssi; + uint16_t len; + uint8_t adv_data[0]; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_CONNECT 0x83 +struct hal_ev_gatt_client_connect { + int32_t conn_id; + int32_t status; + int32_t client_if; + uint8_t bda[6]; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_DISCONNECT 0x84 +struct hal_ev_gatt_client_disconnect { + int32_t conn_id; + int32_t status; + int32_t client_if; + uint8_t bda[6]; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_SEARCH_COMPLETE 0x85 +struct hal_ev_gatt_client_search_complete { + int32_t conn_id; + int32_t status; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_SEARCH_RESULT 0x86 +struct hal_ev_gatt_client_search_result { + int32_t conn_id; + struct hal_gatt_srvc_id srvc_id; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_GET_CHARACTERISTIC 0x87 +struct hal_ev_gatt_client_get_characteristic { + int32_t conn_id; + int32_t status; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; + int32_t char_prop; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_GET_DESCRIPTOR 0x88 +struct hal_ev_gatt_client_get_descriptor { + int32_t conn_id; + int32_t status; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; + struct hal_gatt_gatt_id descr_id; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_GET_INC_SERVICE 0X89 +struct hal_ev_gatt_client_get_inc_service { + int32_t conn_id; + int32_t status; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_srvc_id incl_srvc_id; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_REGISTER_FOR_NOTIF 0x8a +struct hal_ev_gatt_client_reg_for_notif { + int32_t conn_id; + int32_t registered; + int32_t status; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_NOTIFY 0x8b +struct hal_ev_gatt_client_notify { + int32_t conn_id; + uint8_t bda[6]; + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; + uint8_t is_notify; + uint16_t len; + uint8_t value[0]; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_READ_CHARACTERISTIC 0x8c +struct hal_gatt_read_params { + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; + struct hal_gatt_gatt_id descr_id; + uint8_t status; + uint16_t value_type; + uint16_t len; + uint8_t value[0]; +} __attribute__((packed)); + +struct hal_ev_gatt_client_read_characteristic { + int32_t conn_id; + int32_t status; + struct hal_gatt_read_params data; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_WRITE_CHARACTERISTIC 0x8d +struct hal_gatt_write_params { + struct hal_gatt_srvc_id srvc_id; + struct hal_gatt_gatt_id char_id; + struct hal_gatt_gatt_id descr_id; + uint8_t status; +} __attribute__((packed)); + +struct hal_ev_gatt_client_write_characteristic { + int32_t conn_id; + int32_t status; + struct hal_gatt_write_params data; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_READ_DESCRIPTOR 0x8e +struct hal_ev_gatt_client_read_descriptor { + int32_t conn_id; + int32_t status; + struct hal_gatt_read_params data; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_WRITE_DESCRIPTOR 0x8f +struct hal_ev_gatt_client_write_descriptor { + int32_t conn_id; + int32_t status; + struct hal_gatt_write_params data; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_EXEC_WRITE 0x90 +struct hal_ev_gatt_client_exec_write { + int32_t conn_id; + int32_t status; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_READ_REMOTE_RSSI 0x91 +struct hal_ev_gatt_client_read_remote_rssi { + int32_t client_if; + uint8_t address[6]; + int32_t rssi; + int32_t status; +} __attribute__((packed)); + +#define HAL_EV_GATT_CLIENT_LISTEN 0x92 +struct hal_ev_gatt_client_listen { + int32_t status; + int32_t server_if; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_REGISTER 0x93 +struct hal_ev_gatt_server_register { + int32_t status; + int32_t server_if; + uint8_t uuid[16]; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_CONNECTION 0x94 +struct hal_ev_gatt_server_connection { + int32_t conn_id; + int32_t server_if; + int32_t connected; + uint8_t bdaddr[6]; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_SERVICE_ADDED 0x95 +struct hal_ev_gatt_server_service_added { + int32_t status; + int32_t server_if; + struct hal_gatt_srvc_id srvc_id; + int32_t srvc_handle; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_INC_SRVC_ADDED 0x96 +struct hal_ev_gatt_server_inc_srvc_added { + int32_t status; + int32_t server_if; + int32_t srvc_handle; + int32_t incl_srvc_handle; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_CHAR_ADDED 0x97 +struct hal_ev_gatt_server_characteristic_added { + int32_t status; + int32_t server_if; + uint8_t uuid[16]; + int32_t srvc_handle; + int32_t char_handle; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_DESCRIPTOR_ADDED 0x98 +struct hal_ev_gatt_server_descriptor_added { + int32_t status; + int32_t server_if; + uint8_t uuid[16]; + int32_t srvc_handle; + int32_t descr_handle; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_SERVICE_STARTED 0x99 +struct hal_ev_gatt_server_service_started { + int32_t status; + int32_t server_if; + int32_t srvc_handle; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_SERVICE_STOPPED 0x9a +struct hal_ev_gatt_server_service_stopped { + int32_t status; + int32_t server_if; + int32_t srvc_handle; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_SERVICE_DELETED 0x9b +struct hal_ev_gatt_server_service_deleted { + int32_t status; + int32_t server_if; + int32_t srvc_handle; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_REQUEST_READ 0x9c +struct hal_ev_gatt_server_request_read { + int32_t conn_id; + int32_t trans_id; + uint8_t bdaddr[6]; + int32_t attr_handle; + int32_t offset; + uint8_t is_long; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_REQUEST_WRITE 0x9d +struct hal_ev_gatt_server_request_write { + int32_t conn_id; + int32_t trans_id; + uint8_t bdaddr[6]; + int32_t attr_handle; + int32_t offset; + int32_t length; + uint8_t need_rsp; + uint8_t is_prep; + uint8_t value[0]; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_REQUEST_EXEC_WRITE 0x9e +struct hal_ev_gatt_server_request_exec_write { + int32_t conn_id; + int32_t trans_id; + uint8_t bdaddr[6]; + int32_t exec_write; +} __attribute__((packed)); + +#define HAL_EV_GATT_SERVER_RSP_CONFIRMATION 0x9f +struct hal_ev_gatt_server_rsp_confirmation { + int32_t status; + int32_t handle; +} __attribute__((packed));
diff --git a/bluez/android/hal-pan.c b/bluez/android/hal-pan.c new file mode 100644 index 0000000..f383081 --- /dev/null +++ b/bluez/android/hal-pan.c
@@ -0,0 +1,205 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdbool.h> +#include <stddef.h> +#include <string.h> + +#include "hal-log.h" +#include "hal.h" +#include "hal-msg.h" +#include "hal-ipc.h" + +static const btpan_callbacks_t *cbs = NULL; + +static bool interface_ready(void) +{ + return cbs != NULL; +} + +static void handle_conn_state(void *buf, uint16_t len) +{ + struct hal_ev_pan_conn_state *ev = buf; + + if (cbs->connection_state_cb) + cbs->connection_state_cb(ev->state, ev->status, + (bt_bdaddr_t *) ev->bdaddr, + ev->local_role, ev->remote_role); +} + +static void handle_ctrl_state(void *buf, uint16_t len) +{ + struct hal_ev_pan_ctrl_state *ev = buf; + + /* FIXME: Callback declared in bt_pan.h is 'typedef void + * (*btpan_control_state_callback)(btpan_control_state_t state, + * bt_status_t error, int local_role, const char* ifname); + * But PanService.Java defined it wrong way. + * private void onControlStateChanged(int local_role, int state, + * int error, String ifname). + * First and third parameters are misplaced, so sending data according + * to PanService.Java, fix this if issue fixed in PanService.Java. + */ + if (cbs->control_state_cb) + cbs->control_state_cb(ev->local_role, ev->state, ev->status, + (char *)ev->name); +} + +/* handlers will be called from notification thread context, + * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ +static const struct hal_ipc_handler ev_handlers[] = { + { /* HAL_EV_PAN_CTRL_STATE */ + .handler = handle_ctrl_state, + .var_len = false, + .data_len = sizeof(struct hal_ev_pan_ctrl_state), + }, + { /* HAL_EV_PAN_CONN_STATE */ + .handler = handle_conn_state, + .var_len = false, + .data_len = sizeof(struct hal_ev_pan_conn_state), + }, +}; + +static bt_status_t pan_enable(int local_role) +{ + struct hal_cmd_pan_enable cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + cmd.local_role = local_role; + + return hal_ipc_cmd(HAL_SERVICE_ID_PAN, HAL_OP_PAN_ENABLE, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static int pan_get_local_role(void) +{ + struct hal_rsp_pan_get_role rsp; + size_t len = sizeof(rsp); + bt_status_t status; + + DBG(""); + + if (!interface_ready()) + return BTPAN_ROLE_NONE; + + status = hal_ipc_cmd(HAL_SERVICE_ID_PAN, HAL_OP_PAN_GET_ROLE, 0, NULL, + &len, &rsp, NULL); + if (status != BT_STATUS_SUCCESS) + return BTPAN_ROLE_NONE; + + return rsp.local_role; +} + +static bt_status_t pan_connect(const bt_bdaddr_t *bd_addr, int local_role, + int remote_role) +{ + struct hal_cmd_pan_connect cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + cmd.local_role = local_role; + cmd.remote_role = remote_role; + + return hal_ipc_cmd(HAL_SERVICE_ID_PAN, HAL_OP_PAN_CONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t pan_disconnect(const bt_bdaddr_t *bd_addr) +{ + struct hal_cmd_pan_disconnect cmd; + + DBG(""); + + if (!interface_ready()) + return BT_STATUS_NOT_READY; + + memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_PAN, HAL_OP_PAN_DISCONNECT, + sizeof(cmd), &cmd, 0, NULL, NULL); +} + +static bt_status_t pan_init(const btpan_callbacks_t *callbacks) +{ + struct hal_cmd_register_module cmd; + int ret; + + DBG(""); + + if (interface_ready()) + return BT_STATUS_DONE; + + cbs = callbacks; + + hal_ipc_register(HAL_SERVICE_ID_PAN, ev_handlers, + sizeof(ev_handlers)/sizeof(ev_handlers[0])); + + cmd.service_id = HAL_SERVICE_ID_PAN; + cmd.mode = HAL_MODE_DEFAULT; + + ret = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + if (ret != BT_STATUS_SUCCESS) { + cbs = NULL; + hal_ipc_unregister(HAL_SERVICE_ID_PAN); + } + + return ret; +} + +static void pan_cleanup(void) +{ + struct hal_cmd_unregister_module cmd; + + DBG(""); + + if (!interface_ready()) + return; + + cbs = NULL; + + cmd.service_id = HAL_SERVICE_ID_PAN; + + hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, + sizeof(cmd), &cmd, 0, NULL, NULL); + + hal_ipc_unregister(HAL_SERVICE_ID_PAN); +} + +static btpan_interface_t pan_if = { + .size = sizeof(pan_if), + .init = pan_init, + .enable = pan_enable, + .get_local_role = pan_get_local_role, + .connect = pan_connect, + .disconnect = pan_disconnect, + .cleanup = pan_cleanup +}; + +btpan_interface_t *bt_get_pan_interface() +{ + return &pan_if; +}
diff --git a/bluez/android/hal-socket.c b/bluez/android/hal-socket.c new file mode 100644 index 0000000..cfd50d1 --- /dev/null +++ b/bluez/android/hal-socket.c
@@ -0,0 +1,96 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#include "hal-ipc.h" +#include "hal-log.h" +#include "hal-msg.h" +#include "hal-utils.h" +#include "hal.h" + +static bt_status_t socket_listen(btsock_type_t type, const char *service_name, + const uint8_t *uuid, int chan, + int *sock, int flags) +{ + struct hal_cmd_socket_listen cmd; + + if (!sock) + return BT_STATUS_PARM_INVALID; + + DBG("uuid %s chan %d sock %p type %d service_name %s flags 0x%02x", + btuuid2str(uuid), chan, sock, type, service_name, flags); + + memset(&cmd, 0, sizeof(cmd)); + + /* type match IPC type */ + cmd.type = type; + cmd.flags = flags; + cmd.channel = chan; + + if (uuid) + memcpy(cmd.uuid, uuid, sizeof(cmd.uuid)); + + if (service_name) + memcpy(cmd.name, service_name, strlen(service_name)); + + return hal_ipc_cmd(HAL_SERVICE_ID_SOCKET, HAL_OP_SOCKET_LISTEN, + sizeof(cmd), &cmd, NULL, NULL, sock); +} + +static bt_status_t socket_connect(const bt_bdaddr_t *bdaddr, btsock_type_t type, + const uint8_t *uuid, int chan, + int *sock, int flags) +{ + struct hal_cmd_socket_connect cmd; + + if (!sock) + return BT_STATUS_PARM_INVALID; + + DBG("bdaddr %s uuid %s chan %d sock %p type %d flags 0x%02x", + bdaddr2str(bdaddr), btuuid2str(uuid), chan, sock, type, flags); + + memset(&cmd, 0, sizeof(cmd)); + + /* type match IPC type */ + cmd.type = type; + cmd.flags = flags; + cmd.channel = chan; + + if (uuid) + memcpy(cmd.uuid, uuid, sizeof(cmd.uuid)); + + if (bdaddr) + memcpy(cmd.bdaddr, bdaddr, sizeof(cmd.bdaddr)); + + return hal_ipc_cmd(HAL_SERVICE_ID_SOCKET, HAL_OP_SOCKET_CONNECT, + sizeof(cmd), &cmd, NULL, NULL, sock); +} + +static btsock_interface_t socket_if = { + sizeof(socket_if), + socket_listen, + socket_connect +}; + +btsock_interface_t *bt_get_socket_interface(void) +{ + return &socket_if; +}
diff --git a/bluez/android/hal-utils.c b/bluez/android/hal-utils.c new file mode 100644 index 0000000..ceefefc --- /dev/null +++ b/bluez/android/hal-utils.c
@@ -0,0 +1,330 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <stdio.h> +#include <string.h> +#include <stdint.h> + +#include "hal-utils.h" + +/* + * converts uuid to string + * buf should be at least 39 bytes + * + * returns string representation of uuid + */ +const char *bt_uuid_t2str(const uint8_t *uuid, char *buf) +{ + int shift = 0; + unsigned int i; + int is_bt; + + if (!uuid) + return strcpy(buf, "NULL"); + + is_bt = !memcmp(&uuid[4], &BT_BASE_UUID[4], HAL_UUID_LEN - 4); + + for (i = 0; i < HAL_UUID_LEN; i++) { + if (i == 4 && is_bt) + break; + + if (i == 4 || i == 6 || i == 8 || i == 10) { + buf[i * 2 + shift] = '-'; + shift++; + } + sprintf(buf + i * 2 + shift, "%02x", uuid[i]); + } + + return buf; +} + +const char *btuuid2str(const uint8_t *uuid) +{ + static char buf[MAX_UUID_STR_LEN]; + + return bt_uuid_t2str(uuid, buf); +} + +INTMAP(bt_status_t, -1, "(unknown)") + DELEMENT(BT_STATUS_SUCCESS), + DELEMENT(BT_STATUS_FAIL), + DELEMENT(BT_STATUS_NOT_READY), + DELEMENT(BT_STATUS_NOMEM), + DELEMENT(BT_STATUS_BUSY), + DELEMENT(BT_STATUS_DONE), + DELEMENT(BT_STATUS_UNSUPPORTED), + DELEMENT(BT_STATUS_PARM_INVALID), + DELEMENT(BT_STATUS_UNHANDLED), + DELEMENT(BT_STATUS_AUTH_FAILURE), + DELEMENT(BT_STATUS_RMT_DEV_DOWN), +ENDMAP + +INTMAP(bt_state_t, -1, "(unknown)") + DELEMENT(BT_STATE_OFF), + DELEMENT(BT_STATE_ON), +ENDMAP + +INTMAP(bt_device_type_t, -1, "(unknown)") + DELEMENT(BT_DEVICE_DEVTYPE_BREDR), + DELEMENT(BT_DEVICE_DEVTYPE_BLE), + DELEMENT(BT_DEVICE_DEVTYPE_DUAL), +ENDMAP + +INTMAP(bt_scan_mode_t, -1, "(unknown)") + DELEMENT(BT_SCAN_MODE_NONE), + DELEMENT(BT_SCAN_MODE_CONNECTABLE), + DELEMENT(BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE), +ENDMAP + +INTMAP(bt_discovery_state_t, -1, "(unknown)") + DELEMENT(BT_DISCOVERY_STOPPED), + DELEMENT(BT_DISCOVERY_STARTED), +ENDMAP + +INTMAP(bt_acl_state_t, -1, "(unknown)") + DELEMENT(BT_ACL_STATE_CONNECTED), + DELEMENT(BT_ACL_STATE_DISCONNECTED), +ENDMAP + +INTMAP(bt_bond_state_t, -1, "(unknown)") + DELEMENT(BT_BOND_STATE_NONE), + DELEMENT(BT_BOND_STATE_BONDING), + DELEMENT(BT_BOND_STATE_BONDED), +ENDMAP + +INTMAP(bt_ssp_variant_t, -1, "(unknown)") + DELEMENT(BT_SSP_VARIANT_PASSKEY_CONFIRMATION), + DELEMENT(BT_SSP_VARIANT_PASSKEY_ENTRY), + DELEMENT(BT_SSP_VARIANT_CONSENT), + DELEMENT(BT_SSP_VARIANT_PASSKEY_NOTIFICATION), +ENDMAP + +INTMAP(bt_property_type_t, -1, "(unknown)") + DELEMENT(BT_PROPERTY_BDNAME), + DELEMENT(BT_PROPERTY_BDADDR), + DELEMENT(BT_PROPERTY_UUIDS), + DELEMENT(BT_PROPERTY_CLASS_OF_DEVICE), + DELEMENT(BT_PROPERTY_TYPE_OF_DEVICE), + DELEMENT(BT_PROPERTY_SERVICE_RECORD), + DELEMENT(BT_PROPERTY_ADAPTER_SCAN_MODE), + DELEMENT(BT_PROPERTY_ADAPTER_BONDED_DEVICES), + DELEMENT(BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT), + DELEMENT(BT_PROPERTY_REMOTE_FRIENDLY_NAME), + DELEMENT(BT_PROPERTY_REMOTE_RSSI), + DELEMENT(BT_PROPERTY_REMOTE_VERSION_INFO), + DELEMENT(BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP), +ENDMAP + +INTMAP(bt_cb_thread_evt, -1, "(unknown)") + DELEMENT(ASSOCIATE_JVM), + DELEMENT(DISASSOCIATE_JVM), +ENDMAP + +/* Find first index of given value in table m */ +int int2str_findint(int v, const struct int2str m[]) +{ + int i; + + for (i = 0; m[i].str; ++i) { + if (m[i].val == v) + return i; + } + return -1; +} + +/* Find first index of given string in table m */ +int int2str_findstr(const char *str, const struct int2str m[]) +{ + int i; + + for (i = 0; m[i].str; ++i) { + if (strcmp(m[i].str, str) == 0) + return i; + } + return -1; +} + +/* + * convert bd_addr to string + * buf must be at least 18 char long + * + * returns buf + */ +const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf) +{ + const uint8_t *p = bd_addr->address; + + if (!bd_addr) + return strcpy(buf, "NULL"); + + snprintf(buf, MAX_ADDR_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x", + p[0], p[1], p[2], p[3], p[4], p[5]); + + return buf; +} + +/* converts string to bt_bdaddr_t */ +void str2bt_bdaddr_t(const char *str, bt_bdaddr_t *bd_addr) +{ + uint8_t *p = bd_addr->address; + + sscanf(str, "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", + &p[0], &p[1], &p[2], &p[3], &p[4], &p[5]); +} + +/* converts string to uuid */ +void str2bt_uuid_t(const char *str, bt_uuid_t *uuid) +{ + int i = 0; + + memcpy(uuid, BT_BASE_UUID, sizeof(bt_uuid_t)); + + while (*str && i < (int) sizeof(bt_uuid_t)) { + while (*str == '-') + str++; + + if (sscanf(str, "%02hhx", &uuid->uu[i]) != 1) + break; + + i++; + str += 2; + } +} + +const char *enum_defines(void *v, int i) +{ + const struct int2str *m = v; + + return m[i].str != NULL ? m[i].str : NULL; +} + +const char *enum_strings(void *v, int i) +{ + const char **m = v; + + return m[i] != NULL ? m[i] : NULL; +} + +const char *enum_one_string(void *v, int i) +{ + const char *m = v; + + return (i == 0) && (m[0] != 0) ? m : NULL; +} + +const char *bdaddr2str(const bt_bdaddr_t *bd_addr) +{ + static char buf[MAX_ADDR_STR_LEN]; + + return bt_bdaddr_t2str(bd_addr, buf); +} + +const char *btproperty2str(const bt_property_t *property) +{ + static char buf[4096]; + char *p; + + p = buf + sprintf(buf, "type=%s len=%d val=", + bt_property_type_t2str(property->type), + property->len); + + switch (property->type) { + case BT_PROPERTY_BDNAME: + case BT_PROPERTY_REMOTE_FRIENDLY_NAME: + snprintf(p, property->len + 1, "%s", + ((bt_bdname_t *) property->val)->name); + break; + + case BT_PROPERTY_BDADDR: + sprintf(p, "%s", bdaddr2str((bt_bdaddr_t *) property->val)); + break; + + case BT_PROPERTY_CLASS_OF_DEVICE: + sprintf(p, "%06x", *((int *) property->val)); + break; + + case BT_PROPERTY_TYPE_OF_DEVICE: + sprintf(p, "%s", bt_device_type_t2str( + *((bt_device_type_t *) property->val))); + break; + + case BT_PROPERTY_REMOTE_RSSI: + sprintf(p, "%d", *((char *) property->val)); + break; + + case BT_PROPERTY_ADAPTER_SCAN_MODE: + sprintf(p, "%s", + bt_scan_mode_t2str(*((bt_scan_mode_t *) property->val))); + break; + + case BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT: + sprintf(p, "%d", *((int *) property->val)); + break; + + case BT_PROPERTY_ADAPTER_BONDED_DEVICES: + { + int count = property->len / sizeof(bt_bdaddr_t); + char *ptr = property->val; + + strcat(p, "{"); + + while (count--) { + strcat(p, bdaddr2str((bt_bdaddr_t *) ptr)); + if (count) + strcat(p, ", "); + ptr += sizeof(bt_bdaddr_t); + } + + strcat(p, "}"); + + } + break; + + case BT_PROPERTY_UUIDS: + { + int count = property->len / sizeof(bt_uuid_t); + uint8_t *ptr = property->val; + + strcat(p, "{"); + + while (count--) { + strcat(p, btuuid2str(ptr)); + if (count) + strcat(p, ", "); + ptr += sizeof(bt_uuid_t); + } + + strcat(p, "}"); + + } + break; + + case BT_PROPERTY_SERVICE_RECORD: + { + bt_service_record_t *rec = property->val; + + sprintf(p, "{%s, %d, %s}", btuuid2str(rec->uuid.uu), + rec->channel, rec->name); + } + break; + + default: + sprintf(p, "%p", property->val); + } + + return buf; +}
diff --git a/bluez/android/hal-utils.h b/bluez/android/hal-utils.h new file mode 100644 index 0000000..75de7e9 --- /dev/null +++ b/bluez/android/hal-utils.h
@@ -0,0 +1,130 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <hardware/bluetooth.h> + +#define MAX_UUID_STR_LEN 37 +#define HAL_UUID_LEN 16 +#define MAX_ADDR_STR_LEN 18 + +static const char BT_BASE_UUID[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb +}; + +const char *bt_uuid_t2str(const uint8_t *uuid, char *buf); +const char *btuuid2str(const uint8_t *uuid); +const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf); +void str2bt_bdaddr_t(const char *str, bt_bdaddr_t *bd_addr); +void str2bt_uuid_t(const char *str, bt_uuid_t *uuid); +const char *btproperty2str(const bt_property_t *property); +const char *bdaddr2str(const bt_bdaddr_t *bd_addr); + +/** + * Begin mapping section + * + * There are some mappings between integer values (enums) and strings + * to be presented to user. To make it easier to convert between those two + * set of macros is given. It is specially useful when we want to have + * strings that match constants from header files like: + * BT_STATUS_SUCCESS (0) and corresponding "BT_STATUS_SUCCESS" + * Example of usage: + * + * INTMAP(int, -1, "invalid") + * DELEMENT(BT_STATUS_SUCCESS) + * DELEMENT(BT_STATUS_FAIL) + * MELEMENT(123, "Some strange value") + * ENDMAP + * + * Just by doing this we have mapping table plus two functions: + * int str2int(const char *str); + * const char *int2str(int v); + * + * second argument to INTMAP specifies value to be returned from + * str2int function when there is not mapping for such number + * third argument specifies default value to be returned from int2str + * + * If same mapping is to be used in several source files put + * INTMAP in c file and DECINTMAP in h file. + * + * For mappings that are to be used in single file only + * use SINTMAP which will create the same but everything will be marked + * as static. + */ + +struct int2str { + int val; /* int value */ + const char *str; /* corresponding string */ +}; + +int int2str_findint(int v, const struct int2str m[]); +int int2str_findstr(const char *str, const struct int2str m[]); +const char *enum_defines(void *v, int i); +const char *enum_strings(void *v, int i); +const char *enum_one_string(void *v, int i); + +#define TYPE_ENUM(type) ((void *) &__##type##2str[0]) +#define DECINTMAP(type) \ +extern struct int2str __##type##2str[]; \ +const char *type##2##str(type v); \ +type str##2##type(const char *str); \ + +#define INTMAP(type, deft, defs) \ +const char *type##2##str(type v) \ +{ \ + int i = int2str_findint((int) v, __##type##2str); \ + return (i < 0) ? defs : __##type##2str[i].str; \ +} \ +type str##2##type(const char *str) \ +{ \ + int i = int2str_findstr(str, __##type##2str); \ + return (i < 0) ? (type) deft : (type) (__##type##2str[i].val); \ +} \ +struct int2str __##type##2str[] = { + +#define SINTMAP(type, deft, defs) \ +static struct int2str __##type##2str[]; \ +static inline const char *type##2##str(type v) \ +{ \ + int i = int2str_findint((int) v, __##type##2str); \ + return (i < 0) ? defs : __##type##2str[i].str; \ +} \ +static inline type str##2##type(const char *str) \ +{ \ + int i = int2str_findstr(str, __##type##2str); \ + return (i < 0) ? (type) deft : (type) (__##type##2str[i].val); \ +} \ +static struct int2str __##type##2str[] = { + +#define ENDMAP {0, NULL} }; + +/* use this to generate string from header file constant */ +#define MELEMENT(v, s) {v, s} +/* use this to have arbitrary mapping from int to string */ +#define DELEMENT(s) {s, #s} +/* End of mapping section */ + +DECINTMAP(bt_status_t); +DECINTMAP(bt_state_t); +DECINTMAP(bt_device_type_t); +DECINTMAP(bt_scan_mode_t); +DECINTMAP(bt_discovery_state_t); +DECINTMAP(bt_acl_state_t); +DECINTMAP(bt_bond_state_t); +DECINTMAP(bt_ssp_variant_t); +DECINTMAP(bt_property_type_t); +DECINTMAP(bt_cb_thread_evt);
diff --git a/bluez/android/hal.h b/bluez/android/hal.h new file mode 100644 index 0000000..6998e9a --- /dev/null +++ b/bluez/android/hal.h
@@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include <hardware/bluetooth.h> +#include <hardware/bt_sock.h> +#include <hardware/bt_hh.h> +#include <hardware/bt_pan.h> +#include <hardware/bt_av.h> +#include <hardware/bt_rc.h> +#include <hardware/bt_hf.h> +#include <hardware/bt_gatt.h> +#include <hardware/bt_gatt_client.h> +#include <hardware/bt_gatt_server.h> +#include <hardware/bt_hl.h> + +btsock_interface_t *bt_get_socket_interface(void); +bthh_interface_t *bt_get_hidhost_interface(void); +btpan_interface_t *bt_get_pan_interface(void); +btav_interface_t *bt_get_a2dp_interface(void); +btrc_interface_t *bt_get_avrcp_interface(void); +bthf_interface_t *bt_get_handsfree_interface(void); +btgatt_interface_t *bt_get_gatt_interface(void); +bthl_interface_t *bt_get_health_interface(void); + +void bt_thread_associate(void); +void bt_thread_disassociate(void);
diff --git a/bluez/android/handsfree.c b/bluez/android/handsfree.c new file mode 100644 index 0000000..7dfc6dc --- /dev/null +++ b/bluez/android/handsfree.c
@@ -0,0 +1,2600 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdlib.h> +#include <stdbool.h> +#include <errno.h> +#include <unistd.h> +#include <glib.h> + +#include "lib/bluetooth.h" +#include "lib/sdp.h" +#include "lib/sdp_lib.h" +#include "src/sdp-client.h" +#include "src/uuid-helper.h" +#include "src/shared/hfp.h" +#include "btio/btio.h" +#include "hal-msg.h" +#include "ipc-common.h" +#include "ipc.h" +#include "handsfree.h" +#include "bluetooth.h" +#include "src/log.h" +#include "utils.h" + +#define HSP_AG_CHANNEL 12 +#define HFP_AG_CHANNEL 13 + +#define HFP_AG_FEAT_3WAY 0x00000001 +#define HFP_AG_FEAT_ECNR 0x00000002 +#define HFP_AG_FEAT_VR 0x00000004 +#define HFP_AG_FEAT_INBAND 0x00000008 +#define HFP_AG_FEAT_VTAG 0x00000010 +#define HFP_AG_FEAT_REJ_CALL 0x00000020 +#define HFP_AG_FEAT_ECS 0x00000040 +#define HFP_AG_FEAT_ECC 0x00000080 +#define HFP_AG_FEAT_EXT_ERR 0x00000100 +#define HFP_AG_FEAT_CODEC 0x00000200 + +#define HFP_HF_FEAT_ECNR 0x00000001 +#define HFP_HF_FEAT_3WAY 0x00000002 +#define HFP_HF_FEAT_CLI 0x00000004 +#define HFP_HF_FEAT_VR 0x00000008 +#define HFP_HF_FEAT_RVC 0x00000010 +#define HFP_HF_FEAT_ECS 0x00000020 +#define HFP_HF_FEAT_ECC 0x00000040 +#define HFP_HF_FEAT_CODEC 0x00000080 + +#define HFP_AG_FEATURES (HFP_AG_FEAT_3WAY | HFP_AG_FEAT_ECNR |\ + HFP_AG_FEAT_VR | HFP_AG_FEAT_REJ_CALL |\ + HFP_AG_FEAT_ECS | HFP_AG_FEAT_EXT_ERR) + +#define HFP_AG_CHLD "0,1,2,3" + +/* offsets in indicators table, should be incremented when sending CIEV */ +#define IND_SERVICE 0 +#define IND_CALL 1 +#define IND_CALLSETUP 2 +#define IND_CALLHELD 3 +#define IND_SIGNAL 4 +#define IND_ROAM 5 +#define IND_BATTCHG 6 +#define IND_COUNT (IND_BATTCHG + 1) + +#define RING_TIMEOUT 2 + +#define CVSD_OFFSET 0 +#define MSBC_OFFSET 1 +#define CODECS_COUNT (MSBC_OFFSET + 1) + +#define CODEC_ID_CVSD 0x01 +#define CODEC_ID_MSBC 0x02 + +struct indicator { + const char *name; + int min; + int max; + int val; + bool always_active; + bool active; +}; + +struct hfp_codec { + uint8_t type; + bool local_supported; + bool remote_supported; +}; + +static const struct indicator inds_defaults[] = { + { "service", 0, 1, 0, false, true }, + { "call", 0, 1, 0, true, true }, + { "callsetup", 0, 3, 0, true, true }, + { "callheld", 0, 2, 0, true, true }, + { "signal", 0, 5, 0, false, true }, + { "roam", 0, 1, 0, false, true }, + { "battchg", 0, 5, 0, false, true }, +}; + +static const struct hfp_codec codecs_defaults[] = { + { CODEC_ID_CVSD, true, false}, + { CODEC_ID_MSBC, false, false}, +}; + +static struct { + bdaddr_t bdaddr; + uint8_t state; + uint8_t audio_state; + uint32_t features; + + bool clip_enabled; + bool cmee_enabled; + bool ccwa_enabled; + bool indicators_enabled; + struct indicator inds[IND_COUNT]; + int num_active; + int num_held; + int setup_state; + bool call_hanging_up; + + uint8_t negotiated_codec; + uint8_t proposed_codec; + struct hfp_codec codecs[CODECS_COUNT]; + + guint ring; + bool hsp; + + struct hfp_gw *gw; + + GIOChannel *sco; + guint sco_watch; +} device; + +static uint32_t hfp_ag_features = 0; + +static bdaddr_t adapter_addr; +static struct ipc *hal_ipc = NULL; + +static uint32_t hfp_record_id = 0; +static GIOChannel *hfp_server = NULL; + +static uint32_t hsp_record_id = 0; +static GIOChannel *hsp_server = NULL; + +static GIOChannel *sco_server = NULL; + +static void device_set_state(uint8_t state) +{ + struct hal_ev_handsfree_conn_state ev; + char address[18]; + + if (device.state == state) + return; + + device.state = state; + + ba2str(&device.bdaddr, address); + DBG("device %s state %u", address, state); + + bdaddr2android(&device.bdaddr, ev.bdaddr); + ev.state = state; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_CONN_STATE, sizeof(ev), &ev); +} + +static void device_set_audio_state(uint8_t state) +{ + struct hal_ev_handsfree_audio_state ev; + char address[18]; + + if (device.audio_state == state) + return; + + device.audio_state = state; + + ba2str(&device.bdaddr, address); + DBG("device %s audio state %u", address, state); + + bdaddr2android(&device.bdaddr, ev.bdaddr); + ev.state = state; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_AUDIO_STATE, sizeof(ev), &ev); +} + +static void init_codecs(void) +{ + memcpy(device.codecs, codecs_defaults, sizeof(device.codecs)); + + if (hfp_ag_features & HFP_AG_FEAT_CODEC) + device.codecs[MSBC_OFFSET].local_supported = true; +} + +static void device_init(const bdaddr_t *bdaddr) +{ + bacpy(&device.bdaddr, bdaddr); + + device.setup_state = HAL_HANDSFREE_CALL_STATE_IDLE; + + memcpy(device.inds, inds_defaults, sizeof(device.inds)); + + init_codecs(); + + device_set_state(HAL_EV_HANDSFREE_CONN_STATE_CONNECTING); +} + +static void device_cleanup(void) +{ + if (device.gw) { + hfp_gw_unref(device.gw); + device.gw = NULL; + } + + device_set_state(HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTED); + + if (device.sco_watch) { + g_source_remove(device.sco_watch); + device.sco_watch = 0; + } + + if (device.sco) { + g_io_channel_shutdown(device.sco, TRUE, NULL); + g_io_channel_unref(device.sco); + device.sco = NULL; + } + + if (device.ring) { + g_source_remove(device.ring); + device.ring = 0; + } + + device_set_audio_state(HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED); + + memset(&device, 0, sizeof(device)); +} + +static void disconnect_watch(void *user_data) +{ + DBG(""); + + device_cleanup(); +} + +static void at_cmd_unknown(const char *command, void *user_data) +{ + uint8_t buf[IPC_MTU]; + struct hal_ev_handsfree_unknown_at *ev = (void *) buf; + + if (device.state != HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED) { + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); + hfp_gw_disconnect(device.gw); + return; + } + + /* copy while string including terminating NULL */ + ev->len = strlen(command) + 1; + memcpy(ev->buf, command, ev->len); + + if (ev->len > IPC_MTU - sizeof(*ev)) { + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); + return; + } + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_UNKNOWN_AT, sizeof(*ev) + ev->len, ev); +} + +static void at_cmd_vgm(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + struct hal_ev_handsfree_volume ev; + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val > 15) + break; + + if (hfp_gw_result_has_next(result)) + break; + + ev.type = HAL_HANDSFREE_VOLUME_TYPE_MIC; + ev.volume = val; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_VOLUME, sizeof(ev), &ev); + + /* Framework is not replying with result for AT+VGM */ + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_vgs(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + struct hal_ev_handsfree_volume ev; + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val > 15) + break; + + if (hfp_gw_result_has_next(result)) + break; + + ev.type = HAL_HANDSFREE_VOLUME_TYPE_SPEAKER; + ev.volume = val; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_VOLUME, sizeof(ev), &ev); + + /* Framework is not replying with result for AT+VGS */ + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_cops(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val; + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val != 3) + break; + + if (!hfp_gw_result_get_number(result, &val) || val != 0) + break; + + if (hfp_gw_result_has_next(result)) + break; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_COPS, 0, NULL); + return; + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_bia(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val, i, def; + bool tmp[IND_COUNT]; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + for (i = 0; i < IND_COUNT; i++) + tmp[i] = device.inds[i].active; + + i = 0; + + do { + def = (i < IND_COUNT) ? device.inds[i].active : 0; + + if (!hfp_gw_result_get_number_default(result, &val, def)) + goto failed; + + if (val > 1) + goto failed; + + if (i < IND_COUNT) { + tmp[i] = val || device.inds[i].always_active; + i++; + } + } while (hfp_gw_result_has_next(result)); + + for (i = 0; i < IND_COUNT; i++) + device.inds[i].active = tmp[i]; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + +failed: + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_a(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_COMMAND: + if (hfp_gw_result_has_next(result)) + break; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_ANSWER, 0, NULL); + + /* Framework is not replying with result for ATA */ + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_SET: + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_d(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + char buf[IPC_MTU]; + struct hal_ev_handsfree_dial *ev = (void *) buf; + int cnt; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_unquoted_string(result, + (char *) ev->number, 255)) + break; + + ev->number_len = strlen((char *) ev->number); + + if (ev->number[ev->number_len - 1] != ';') + break; + + if (ev->number[0] == '>') + cnt = strspn((char *) ev->number + 1, "0123456789") + 1; + else + cnt = strspn((char *) ev->number, "0123456789ABC*#+"); + + if (cnt != ev->number_len - 1) + break; + + ev->number_len++; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_DIAL, + sizeof(*ev) + ev->number_len, ev); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_ccwa(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val > 1) + break; + + if (hfp_gw_result_has_next(result)) + break; + + device.ccwa_enabled = val; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_chup(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_COMMAND: + if (hfp_gw_result_has_next(result)) + break; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_HANGUP, 0, NULL); + + /* Framework is not replying with result for AT+CHUP */ + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_SET: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_clcc(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_COMMAND: + if (hfp_gw_result_has_next(result)) + break; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_CLCC, 0, NULL); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_SET: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_cmee(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val > 1) + break; + + if (hfp_gw_result_has_next(result)) + break; + + device.cmee_enabled = val; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_clip(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val > 1) + break; + + if (hfp_gw_result_has_next(result)) + break; + + device.clip_enabled = val; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_vts(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + struct hal_ev_handsfree_dtmf ev; + char str[2]; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_unquoted_string(result, str, 2)) + break; + + if (!((str[0] >= '0' && str[0] <= '9') || + (str[0] >= 'A' && str[0] <= 'D') || + str[0] == '*' || str[0] == '#')) + break; + + if (hfp_gw_result_has_next(result)) + break; + + ev.tone = str[0]; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_DTMF, sizeof(ev), &ev); + + /* Framework is not replying with result for AT+VTS */ + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_cnum(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_COMMAND: + if (hfp_gw_result_has_next(result)) + break; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_CNUM, 0, NULL); + return; + case HFP_GW_CMD_TYPE_SET: + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_binp(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + DBG(""); + + /* TODO */ + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_bldn(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + struct hal_ev_handsfree_dial ev; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_COMMAND: + if (hfp_gw_result_has_next(result)) + break; + + ev.number_len = 0; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_DIAL, sizeof(ev), &ev); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_SET: + break; + } +} + +static void at_cmd_bvra(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + struct hal_ev_handsfree_vr_state ev; + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val > 1) + break; + + if (hfp_gw_result_has_next(result)) + break; + + if (val) + ev.state = HAL_HANDSFREE_VR_STARTED; + else + ev.state = HAL_HANDSFREE_VR_STOPPED; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_VR, sizeof(ev), &ev); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_nrec(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + struct hal_ev_handsfree_nrec ev; + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + /* Android HAL defines start and stop parameter for NREC + * callback, but spec allows HF to only disable AG's NREC + * feature for SLC duration. Follow spec here. + */ + if (!hfp_gw_result_get_number(result, &val) || val != 0) + break; + + if (hfp_gw_result_has_next(result)) + break; + + ev.nrec = HAL_HANDSFREE_NREC_STOP; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_NREC, sizeof(ev), &ev); + + /* Framework is not replying with result for AT+NREC */ + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_bsir(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + DBG(""); + + /* TODO */ + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_btrh(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + DBG(""); + + /* TODO */ + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static gboolean sco_watch_cb(GIOChannel *chan, GIOCondition cond, + gpointer user_data) +{ + g_io_channel_shutdown(device.sco, TRUE, NULL); + g_io_channel_unref(device.sco); + device.sco = NULL; + + device.sco_watch = 0; + + device_set_audio_state(HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED); + + return FALSE; +} + +static void select_codec(uint8_t codec_type) +{ + uint8_t type = CODEC_ID_CVSD; + int i; + + if (codec_type > 0) { + type = codec_type; + goto done; + } + + for (i = CODECS_COUNT - 1; i >= CVSD_OFFSET; i--) { + if (!device.codecs[i].local_supported) + continue; + + if (!device.codecs[i].remote_supported) + continue; + + type = device.codecs[i].type; + break; + } + +done: + device.proposed_codec = type; + + hfp_gw_send_info(device.gw, "+BCS: %u", type); +} + +static void connect_sco_cb(GIOChannel *chan, GError *err, gpointer user_data) +{ + if (err) { + uint8_t status; + + error("handsfree: audio connect failed (%s)", err->message); + + status = HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED; + device_set_audio_state(status); + + if (!(device.features & HFP_HF_FEAT_CODEC)) + return; + + /* If other failed, try connecting with CVSD */ + if (device.negotiated_codec != CODEC_ID_CVSD) { + info("handsfree: trying fallback with CVSD"); + select_codec(CODEC_ID_CVSD); + } + + return; + } + + g_io_channel_set_close_on_unref(chan, TRUE); + + device.sco = g_io_channel_ref(chan); + device.sco_watch = g_io_add_watch(chan, G_IO_ERR | G_IO_HUP | G_IO_NVAL, + sco_watch_cb, NULL); + + device_set_audio_state(HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTED); +} + +static bool connect_sco(void) +{ + GIOChannel *io; + GError *gerr = NULL; + uint16_t voice_settings; + + if (device.sco) + return false; + + if ((device.features & HFP_HF_FEAT_CODEC) && + device.negotiated_codec != CODEC_ID_CVSD) + voice_settings = BT_VOICE_TRANSPARENT; + else + voice_settings = BT_VOICE_CVSD_16BIT; + + io = bt_io_connect(connect_sco_cb, NULL, NULL, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_DEST_BDADDR, &device.bdaddr, + BT_IO_OPT_VOICE, voice_settings, + BT_IO_OPT_INVALID); + + if (!io) { + error("handsfree: unable to connect audio: %s", gerr->message); + g_error_free(gerr); + return false; + } + + g_io_channel_unref(io); + + device_set_audio_state(HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTING); + + return true; +} + +static void at_cmd_bcc(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_COMMAND: + if (!(device.features & HFP_HF_FEAT_CODEC)) + break; + + if (hfp_gw_result_has_next(result)) + break; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + /* we haven't negotiated codec, start selection */ + if (!device.negotiated_codec) { + select_codec(0); + return; + } + /* we try connect to negotiated codec. If it fails, and it isn't + * CVSD codec, try connect CVSD + */ + if (!connect_sco() && device.negotiated_codec != CODEC_ID_CVSD) + select_codec(CODEC_ID_CVSD); + + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_SET: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_bcs(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val)) + break; + + if (hfp_gw_result_has_next(result)) + break; + + /* Remote replied with other codec. Reply with error */ + if (device.proposed_codec != val) { + device.proposed_codec = 0; + break; + } + + device.proposed_codec = 0; + device.negotiated_codec = val; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + /* Connect sco with negotiated parameters */ + connect_sco(); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_ckpd(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val != 200) + break; + + if (hfp_gw_result_has_next(result)) + break; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_HSP_KEY_PRESS, 0, NULL); + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void register_post_slc_at(void) +{ + if (device.hsp) { + hfp_gw_register(device.gw, at_cmd_ckpd, "+CKPD", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_vgs, "+VGS", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_vgm, "+VGM", NULL, NULL); + return; + } + + hfp_gw_register(device.gw, at_cmd_a, "A", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_d, "D", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_ccwa, "+CCWA", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_chup, "+CHUP", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_clcc, "+CLCC", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_cops, "+COPS", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_cmee, "+CMEE", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_clip, "+CLIP", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_vts, "+VTS", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_cnum, "+CNUM", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_bia, "+BIA", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_binp, "+BINP", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_bldn, "+BLDN", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_bvra, "+BVRA", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_nrec, "+NREC", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_vgs, "+VGS", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_vgm, "+VGM", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_bsir, "+BSIR", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_btrh, "+BTRH", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_bcc, "+BCC", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_bcs, "+BCS", NULL, NULL); +} + +static void at_cmd_cmer(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val; + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + /* mode must be =3 */ + if (!hfp_gw_result_get_number(result, &val) || val != 3) + break; + + /* keyp is don't care */ + if (!hfp_gw_result_get_number(result, &val)) + break; + + /* disp is don't care */ + if (!hfp_gw_result_get_number(result, &val)) + break; + + /* ind must be 0 or 1 */ + if (!hfp_gw_result_get_number(result, &val) || val > 1) + break; + + if (hfp_gw_result_has_next(result)) + break; + + device.indicators_enabled = val; + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + if (device.features & HFP_HF_FEAT_3WAY) + return; + + register_post_slc_at(); + device_set_state(HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED); + return; + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_cind(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + char *buf, *ptr; + int len; + unsigned int i; + + switch (type) { + case HFP_GW_CMD_TYPE_TEST: + + /* If device supports Codec Negotiation, AT+BAC should be + * received first + */ + if ((device.features & HFP_HF_FEAT_CODEC) && + !device.codecs[CVSD_OFFSET].remote_supported) + break; + + len = strlen("+CIND:") + 1; + + for (i = 0; i < IND_COUNT; i++) { + len += strlen("(\"\",(X,X)),"); + len += strlen(device.inds[i].name); + } + + buf = g_malloc(len); + + ptr = buf + sprintf(buf, "+CIND:"); + + for (i = 0; i < IND_COUNT; i++) { + ptr += sprintf(ptr, "(\"%s\",(%d%c%d)),", + device.inds[i].name, + device.inds[i].min, + device.inds[i].max == 1 ? ',' : '-', + device.inds[i].max); + } + + ptr--; + *ptr = '\0'; + + hfp_gw_send_info(device.gw, "%s", buf); + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + g_free(buf); + return; + case HFP_GW_CMD_TYPE_READ: + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_CIND, 0, NULL); + return; + case HFP_GW_CMD_TYPE_SET: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_brsf(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int feat; + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &feat)) + break; + + if (hfp_gw_result_has_next(result)) + break; + + /* TODO verify features */ + device.features = feat; + + hfp_gw_send_info(device.gw, "+BRSF: %u", hfp_ag_features); + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void at_cmd_chld(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + struct hal_ev_handsfree_chld ev; + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!hfp_gw_result_get_number(result, &val) || val > 3) + break; + + /* No ECC support */ + if (hfp_gw_result_has_next(result)) + break; + + /* value match HAL type */ + ev.chld = val; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_EV_HANDSFREE_CHLD, sizeof(ev), &ev); + return; + case HFP_GW_CMD_TYPE_TEST: + hfp_gw_send_info(device.gw, "+CHLD: (%s)", HFP_AG_CHLD); + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + register_post_slc_at(); + device_set_state(HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED); + return; + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static struct hfp_codec *find_codec_by_type(uint8_t type) +{ + int i; + + for (i = 0; i < CODECS_COUNT; i++) + if (type == device.codecs[i].type) + return &device.codecs[i]; + + return NULL; +} + +static void at_cmd_bac(struct hfp_gw_result *result, enum hfp_gw_cmd_type type, + void *user_data) +{ + unsigned int val; + + DBG(""); + + switch (type) { + case HFP_GW_CMD_TYPE_SET: + if (!(device.features & HFP_HF_FEAT_CODEC)) + goto failed; + + /* set codecs to defaults */ + init_codecs(); + device.negotiated_codec = 0; + + /* At least CVSD mandatory codec must exist + * HFP V1.6 4.34.1 + */ + if (!hfp_gw_result_get_number(result, &val) || + val != CODEC_ID_CVSD) + goto failed; + + device.codecs[CVSD_OFFSET].remote_supported = true; + + if (hfp_gw_result_get_number(result, &val)) { + if (val != CODEC_ID_MSBC) + goto failed; + + device.codecs[MSBC_OFFSET].remote_supported = true; + } + + while (hfp_gw_result_has_next(result)) { + struct hfp_codec *codec; + + if (!hfp_gw_result_get_number(result, &val)) + goto failed; + + codec = find_codec_by_type(val); + if (!codec) + continue; + + codec->remote_supported = true; + } + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + if (device.proposed_codec) + select_codec(0); + return; + case HFP_GW_CMD_TYPE_TEST: + case HFP_GW_CMD_TYPE_READ: + case HFP_GW_CMD_TYPE_COMMAND: + break; + } + +failed: + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); +} + +static void register_slc_at(void) +{ + hfp_gw_register(device.gw, at_cmd_brsf, "+BRSF", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_cind, "+CIND", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_cmer, "+CMER", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_chld, "+CHLD", NULL, NULL); + hfp_gw_register(device.gw, at_cmd_bac, "+BAC", NULL, NULL); +} + +static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data) +{ + DBG(""); + + if (err) { + error("handsfree: connect failed (%s)", err->message); + goto failed; + } + + device.gw = hfp_gw_new(g_io_channel_unix_get_fd(chan)); + if (!device.gw) + goto failed; + + g_io_channel_set_close_on_unref(chan, FALSE); + + hfp_gw_set_close_on_unref(device.gw, true); + hfp_gw_set_command_handler(device.gw, at_cmd_unknown, NULL, NULL); + hfp_gw_set_disconnect_handler(device.gw, disconnect_watch, NULL, NULL); + + if (device.hsp) { + register_post_slc_at(); + device_set_state(HAL_EV_HANDSFREE_CONN_STATE_CONNECTED); + device_set_state(HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED); + return; + } + + register_slc_at(); + device_set_state(HAL_EV_HANDSFREE_CONN_STATE_CONNECTED); + return; + +failed: + g_io_channel_shutdown(chan, TRUE, NULL); + device_cleanup(); +} + +static void confirm_cb(GIOChannel *chan, gpointer data) +{ + char address[18]; + bdaddr_t bdaddr; + GError *err = NULL; + + bt_io_get(chan, &err, + BT_IO_OPT_DEST, address, + BT_IO_OPT_DEST_BDADDR, &bdaddr, + BT_IO_OPT_INVALID); + if (err) { + error("handsfree: confirm failed (%s)", err->message); + g_error_free(err); + goto drop; + } + + DBG("incoming connect from %s", address); + + if (device.state != HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTED) { + info("handsfree: refusing connection from %s", address); + goto drop; + } + + device_init(&bdaddr); + + if (!bt_io_accept(chan, connect_cb, NULL, NULL, NULL)) { + error("handsfree: failed to accept connection"); + device_cleanup(); + goto drop; + } + + device.hsp = GPOINTER_TO_INT(data); + return; + +drop: + g_io_channel_shutdown(chan, TRUE, NULL); +} + +static void sdp_hsp_search_cb(sdp_list_t *recs, int err, gpointer data) +{ + sdp_list_t *protos, *classes; + GError *gerr = NULL; + GIOChannel *io; + uuid_t uuid; + int channel; + + DBG(""); + + if (err < 0) { + error("handsfree: unable to get SDP record: %s", + strerror(-err)); + goto fail; + } + + if (!recs || !recs->data) { + info("handsfree: no HSP SDP records found"); + goto fail; + } + + if (sdp_get_service_classes(recs->data, &classes) < 0) { + error("handsfree: unable to get service classes from record"); + goto fail; + } + + if (sdp_get_access_protos(recs->data, &protos) < 0) { + error("handsfree: unable to get access protocols from record"); + sdp_list_free(classes, free); + goto fail; + } + + /* TODO read remote version? */ + /* TODO read volume control support */ + + memcpy(&uuid, classes->data, sizeof(uuid)); + sdp_list_free(classes, free); + + if (!sdp_uuid128_to_uuid(&uuid) || uuid.type != SDP_UUID16 || + uuid.value.uuid16 != HEADSET_SVCLASS_ID) { + sdp_list_free(protos, NULL); + error("handsfree: invalid service record or not HSP"); + goto fail; + } + + channel = sdp_get_proto_port(protos, RFCOMM_UUID); + sdp_list_foreach(protos, (sdp_list_func_t) sdp_list_free, NULL); + sdp_list_free(protos, NULL); + if (channel <= 0) { + error("handsfree: unable to get RFCOMM channel from record"); + goto fail; + } + + io = bt_io_connect(connect_cb, NULL, NULL, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_DEST_BDADDR, &device.bdaddr, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_CHANNEL, channel, + BT_IO_OPT_INVALID); + if (!io) { + error("handsfree: unable to connect: %s", gerr->message); + g_error_free(gerr); + goto fail; + } + + device.hsp = true; + + g_io_channel_unref(io); + return; + +fail: + device_cleanup(); +} + +static int sdp_search_hsp(void) +{ + uuid_t uuid; + + sdp_uuid16_create(&uuid, HEADSET_SVCLASS_ID); + + return bt_search_service(&adapter_addr, &device.bdaddr, &uuid, + sdp_hsp_search_cb, NULL, NULL, 0); +} + +static void sdp_hfp_search_cb(sdp_list_t *recs, int err, gpointer data) +{ + sdp_list_t *protos, *classes; + GError *gerr = NULL; + GIOChannel *io; + uuid_t uuid; + int channel; + + DBG(""); + + if (err < 0) { + error("handsfree: unable to get SDP record: %s", + strerror(-err)); + goto fail; + } + + if (!recs || !recs->data) { + info("handsfree: no HFP SDP records found, trying HSP"); + + if (sdp_search_hsp() < 0) { + error("handsfree: HSP SDP search failed"); + goto fail; + } + + return; + } + + if (sdp_get_service_classes(recs->data, &classes) < 0) { + error("handsfree: unable to get service classes from record"); + goto fail; + } + + if (sdp_get_access_protos(recs->data, &protos) < 0) { + error("handsfree: unable to get access protocols from record"); + sdp_list_free(classes, free); + goto fail; + } + + /* TODO read remote version? */ + + memcpy(&uuid, classes->data, sizeof(uuid)); + sdp_list_free(classes, free); + + if (!sdp_uuid128_to_uuid(&uuid) || uuid.type != SDP_UUID16 || + uuid.value.uuid16 != HANDSFREE_SVCLASS_ID) { + sdp_list_free(protos, NULL); + error("handsfree: invalid service record or not HFP"); + goto fail; + } + + channel = sdp_get_proto_port(protos, RFCOMM_UUID); + sdp_list_foreach(protos, (sdp_list_func_t) sdp_list_free, NULL); + sdp_list_free(protos, NULL); + if (channel <= 0) { + error("handsfree: unable to get RFCOMM channel from record"); + goto fail; + } + + io = bt_io_connect(connect_cb, NULL, NULL, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_DEST_BDADDR, &device.bdaddr, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_CHANNEL, channel, + BT_IO_OPT_INVALID); + if (!io) { + error("handsfree: unable to connect: %s", gerr->message); + g_error_free(gerr); + goto fail; + } + + g_io_channel_unref(io); + return; + +fail: + device_cleanup(); +} + +static int sdp_search_hfp(void) +{ + uuid_t uuid; + + sdp_uuid16_create(&uuid, HANDSFREE_SVCLASS_ID); + + return bt_search_service(&adapter_addr, &device.bdaddr, &uuid, + sdp_hfp_search_cb, NULL, NULL, 0); +} + +static void handle_connect(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_connect *cmd = buf; + char addr[18]; + uint8_t status; + bdaddr_t bdaddr; + int ret; + + DBG(""); + + if (device.state != HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTED) { + status = HAL_STATUS_FAILED; + goto failed; + } + + android2bdaddr(&cmd->bdaddr, &bdaddr); + + ba2str(&bdaddr, addr); + DBG("connecting to %s", addr); + + device_init(&bdaddr); + + /* prefer HFP over HSP */ + ret = hfp_server ? sdp_search_hfp() : sdp_search_hsp(); + if (ret < 0) { + error("handsfree: SDP search failed"); + device_cleanup(); + status = HAL_STATUS_FAILED; + goto failed; + } + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_CONNECT, status); +} + +static void handle_disconnect(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_disconnect *cmd = buf; + bdaddr_t bdaddr; + uint8_t status; + + DBG(""); + + android2bdaddr(cmd->bdaddr, &bdaddr); + + if (device.state == HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTED || + bacmp(&device.bdaddr, &bdaddr)) { + status = HAL_STATUS_FAILED; + goto failed; + + } + + if (device.state == HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTING) { + status = HAL_STATUS_SUCCESS; + goto failed; + } + + if (device.state == HAL_EV_HANDSFREE_CONN_STATE_CONNECTING) { + device_cleanup(); + } else { + device_set_state(HAL_EV_HANDSFREE_CONN_STATE_DISCONNECTING); + hfp_gw_disconnect(device.gw); + } + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_DISCONNECT, status); +} + +static bool disconnect_sco(void) +{ + if (!device.sco) + return false; + + device_set_audio_state(HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTING); + + if (device.sco_watch) { + g_source_remove(device.sco_watch); + device.sco_watch = 0; + } + + g_io_channel_shutdown(device.sco, TRUE, NULL); + g_io_channel_unref(device.sco); + device.sco = NULL; + + device_set_audio_state(HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED); + return true; +} + +static bool connect_audio(void) +{ + if (device.audio_state != HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED) + return false; + + /* we haven't negotiated codec, start selection */ + if ((device.features & HFP_HF_FEAT_CODEC) && !device.negotiated_codec) { + select_codec(0); + return true; + } + + return connect_sco(); +} + +static void handle_connect_audio(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_connect_audio *cmd = buf; + bdaddr_t bdaddr; + uint8_t status; + + DBG(""); + + android2bdaddr(cmd->bdaddr, &bdaddr); + + if (device.audio_state != HAL_EV_HANDSFREE_AUDIO_STATE_DISCONNECTED || + bacmp(&device.bdaddr, &bdaddr)) { + status = HAL_STATUS_FAILED; + goto done; + } + + status = connect_audio() ? HAL_STATUS_SUCCESS : HAL_STATUS_FAILED; + +done: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_CONNECT_AUDIO, status); +} + +static void handle_disconnect_audio(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_disconnect_audio *cmd = buf; + bdaddr_t bdaddr; + uint8_t status; + + DBG(""); + + android2bdaddr(cmd->bdaddr, &bdaddr); + + if (device.audio_state != HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTED || + bacmp(&device.bdaddr, &bdaddr)) { + status = HAL_STATUS_FAILED; + goto done; + } + + status = disconnect_sco() ? HAL_STATUS_SUCCESS : HAL_STATUS_FAILED; + +done: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_DISCONNECT_AUDIO, status); +} + +static void handle_start_vr(const void *buf, uint16_t len) +{ + uint8_t status; + + DBG(""); + + if (device.features & HFP_HF_FEAT_VR) { + hfp_gw_send_info(device.gw, "+BVRA: 1"); + status = HAL_STATUS_SUCCESS; + } else { + status = HAL_STATUS_FAILED; + } + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_START_VR, status); +} + +static void handle_stop_vr(const void *buf, uint16_t len) +{ + uint8_t status; + + DBG(""); + + if (device.features & HFP_HF_FEAT_VR) { + hfp_gw_send_info(device.gw, "+BVRA: 0"); + status = HAL_STATUS_SUCCESS; + } else { + status = HAL_STATUS_FAILED; + } + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_STOP_VR, status); +} + +static void handle_volume_control(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_volume_control *cmd = buf; + uint8_t status, volume; + + DBG("type=%u volume=%u", cmd->type, cmd->volume); + + volume = cmd->volume > 15 ? 15 : cmd->volume; + + switch (cmd->type) { + case HAL_HANDSFREE_VOLUME_TYPE_MIC: + hfp_gw_send_info(device.gw, "+VGM: %u", volume); + + status = HAL_STATUS_SUCCESS; + break; + case HAL_HANDSFREE_VOLUME_TYPE_SPEAKER: + hfp_gw_send_info(device.gw, "+VGS: %u", volume); + + status = HAL_STATUS_SUCCESS; + break; + default: + status = HAL_STATUS_FAILED; + break; + } + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_VOLUME_CONTROL, status); +} + +static void update_indicator(int ind, uint8_t val) +{ + DBG("ind=%u new=%u old=%u", ind, val, device.inds[ind].val); + + if (device.inds[ind].val == val) + return; + + device.inds[ind].val = val; + + if (!device.indicators_enabled) + return; + + if (!device.inds[ind].active) + return; + + /* indicator numbers in CIEV start from 1 */ + hfp_gw_send_info(device.gw, "+CIEV: %u,%u", ind + 1, val); +} + +static void handle_device_status_notif(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_device_status_notif *cmd = buf; + + DBG(""); + + update_indicator(IND_SERVICE, cmd->state); + update_indicator(IND_ROAM, cmd->type); + update_indicator(IND_SIGNAL, cmd->signal); + update_indicator(IND_BATTCHG, cmd->battery); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_DEVICE_STATUS_NOTIF, + HAL_STATUS_SUCCESS); +} + +static void handle_cops(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_cops_response *cmd = buf; + + if (len != sizeof(*cmd) + cmd->len || + (cmd->len != 0 && cmd->buf[cmd->len - 1] != '\0')) { + error("Invalid cops response command, terminating"); + raise(SIGTERM); + return; + } + + DBG(""); + + hfp_gw_send_info(device.gw, "+COPS: 0,0,\"%.16s\"", + cmd->len ? (char *) cmd->buf : ""); + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_COPS_RESPONSE, HAL_STATUS_SUCCESS); +} + +static unsigned int get_callsetup(uint8_t state) +{ + switch (state) { + case HAL_HANDSFREE_CALL_STATE_INCOMING: + return 1; + case HAL_HANDSFREE_CALL_STATE_DIALING: + return 2; + case HAL_HANDSFREE_CALL_STATE_ALERTING: + return 3; + default: + return 0; + } +} + +static void handle_cind(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_cind_response *cmd = buf; + + DBG(""); + + /* HAL doesn't provide indicators values so need to convert here */ + device.inds[IND_SERVICE].val = cmd->svc; + device.inds[IND_CALL].val = !!(cmd->num_active + cmd->num_held); + device.inds[IND_CALLSETUP].val = get_callsetup(cmd->state); + device.inds[IND_CALLHELD].val = cmd->num_held ? + (cmd->num_active ? 1 : 2) : 0; + device.inds[IND_SIGNAL].val = cmd->signal; + device.inds[IND_ROAM].val = cmd->roam; + device.inds[IND_BATTCHG].val = cmd->batt_chg; + + /* Order must match indicators_defaults table */ + hfp_gw_send_info(device.gw, "+CIND: %u,%u,%u,%u,%u,%u,%u", + device.inds[IND_SERVICE].val, + device.inds[IND_CALL].val, + device.inds[IND_CALLSETUP].val, + device.inds[IND_CALLHELD].val, + device.inds[IND_SIGNAL].val, + device.inds[IND_ROAM].val, + device.inds[IND_BATTCHG].val); + + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_CIND_RESPONSE, HAL_STATUS_SUCCESS); +} + +static void handle_formatted_at_resp(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_formatted_at_response *cmd = buf; + + DBG(""); + + if (len != sizeof(*cmd) + cmd->len || + (cmd->len != 0 && cmd->buf[cmd->len - 1] != '\0')) { + error("Invalid formatted AT response command, terminating"); + raise(SIGTERM); + return; + } + + DBG(""); + + hfp_gw_send_info(device.gw, "%s", cmd->len ? (char *) cmd->buf : ""); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_FORMATTED_AT_RESPONSE, + HAL_STATUS_SUCCESS); +} + +static void handle_at_resp(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_at_response *cmd = buf; + + DBG(""); + + if (cmd->response == HAL_HANDSFREE_AT_RESPONSE_OK) + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + else if (device.cmee_enabled) + hfp_gw_send_error(device.gw, cmd->error); + else + hfp_gw_send_result(device.gw, HFP_RESULT_ERROR); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_AT_RESPONSE, HAL_STATUS_SUCCESS); +} + +static void handle_clcc_resp(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_clcc_response *cmd = buf; + uint8_t status; + char *number; + + if (len != sizeof(*cmd) + cmd->number_len || (cmd->number_len != 0 && + cmd->number[cmd->number_len - 1] != '\0')) { + error("Invalid CLCC response command, terminating"); + raise(SIGTERM); + return; + } + + DBG(""); + + if (!cmd->index) { + hfp_gw_send_result(device.gw, HFP_RESULT_OK); + + status = HAL_STATUS_SUCCESS; + goto done; + } + + number = cmd->number_len ? (char *) cmd->number : ""; + + switch (cmd->state) { + case HAL_HANDSFREE_CALL_STATE_INCOMING: + case HAL_HANDSFREE_CALL_STATE_WAITING: + case HAL_HANDSFREE_CALL_STATE_ACTIVE: + case HAL_HANDSFREE_CALL_STATE_HELD: + case HAL_HANDSFREE_CALL_STATE_DIALING: + case HAL_HANDSFREE_CALL_STATE_ALERTING: + if (cmd->type == HAL_HANDSFREE_CALL_ADDRTYPE_INTERNATIONAL && + number[0] != '+') + hfp_gw_send_info(device.gw, + "+CLCC: %u,%u,%u,%u,%u,\"+%s\",%u", + cmd->index, cmd->dir, cmd->state, + cmd->mode, cmd->mpty, number, + cmd->type); + else + hfp_gw_send_info(device.gw, + "+CLCC: %u,%u,%u,%u,%u,\"%s\",%u", + cmd->index, cmd->dir, cmd->state, + cmd->mode, cmd->mpty, number, + cmd->type); + + status = HAL_STATUS_SUCCESS; + break; + case HAL_HANDSFREE_CALL_STATE_IDLE: + default: + status = HAL_STATUS_FAILED; + break; + } + +done: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_CLCC_RESPONSE, status); +} + +static gboolean ring_cb(gpointer user_data) +{ + char *clip = user_data; + + hfp_gw_send_info(device.gw, "RING"); + + if (device.clip_enabled && clip) + hfp_gw_send_info(device.gw, "%s", clip); + + return TRUE; +} + +static void phone_state_dialing(int num_active, int num_held) +{ + update_indicator(IND_CALLSETUP, 2); + + if (num_active == 0 && num_held > 0) + update_indicator(IND_CALLHELD, 2); + + if (device.num_active == 0 && device.num_held == 0) + connect_audio(); +} + +static void phone_state_alerting(int num_active, int num_held) +{ + update_indicator(IND_CALLSETUP, 3); +} + +static void phone_state_waiting(int num_active, int num_held, uint8_t type, + const uint8_t *number, int number_len) +{ + char *num; + + if (!device.ccwa_enabled) + return; + + num = number_len ? (char *) number : ""; + + if (type == HAL_HANDSFREE_CALL_ADDRTYPE_INTERNATIONAL && num[0] != '+') + hfp_gw_send_info(device.gw, "+CCWA: \"+%s\",%u", num, type); + else + hfp_gw_send_info(device.gw, "+CCWA: \"%s\",%u", num, type); + + update_indicator(IND_CALLSETUP, 1); +} + +static void phone_state_incoming(int num_active, int num_held, uint8_t type, + const uint8_t *number, int number_len) +{ + char *clip, *num; + + if (device.setup_state == HAL_HANDSFREE_CALL_STATE_INCOMING) { + if (device.num_active != num_active || + device.num_held != num_held) { + /* calls changed while waiting call ie. due to + * termination of active call + */ + update_indicator(IND_CALLHELD, + num_held ? (num_active ? 1 : 2) : 0); + update_indicator(IND_CALL, !!(num_active + num_held)); + } + + return; + } + + if (device.call_hanging_up) + return; + + if (num_active > 0 || num_held > 0) { + phone_state_waiting(num_active, num_held, type, number, + number_len); + return; + } + + update_indicator(IND_CALLSETUP, 1); + + num = number_len ? (char *) number : ""; + + if (type == HAL_HANDSFREE_CALL_ADDRTYPE_INTERNATIONAL && num[0] != '+') + clip = g_strdup_printf("+CLIP: \"+%s\",%u", num, type); + else + clip = g_strdup_printf("+CLIP: \"%s\",%u", num, type); + + /* send first RING */ + ring_cb(clip); + + device.ring = g_timeout_add_seconds_full(G_PRIORITY_DEFAULT, + RING_TIMEOUT, ring_cb, + clip, g_free); + + if (!device.ring) + g_free(clip); +} + +static void phone_state_idle(int num_active, int num_held) +{ + if (device.ring) { + g_source_remove(device.ring); + device.ring = 0; + } + + switch (device.setup_state) { + case HAL_HANDSFREE_CALL_STATE_INCOMING: + if (num_active > device.num_active) { + update_indicator(IND_CALL, 1); + + if (device.num_active == 0 && device.num_held == 0) + connect_audio(); + } + + if (num_held > device.num_held) + update_indicator(IND_CALLHELD, 1); + + update_indicator(IND_CALLSETUP, 0); + + if (num_active == device.num_active && + num_held == device.num_held) + device.call_hanging_up = true; + + break; + case HAL_HANDSFREE_CALL_STATE_DIALING: + case HAL_HANDSFREE_CALL_STATE_ALERTING: + if (num_active > device.num_active) + update_indicator(IND_CALL, 1); + + update_indicator(IND_CALLHELD, + num_held ? (num_active ? 1 : 2) : 0); + + update_indicator(IND_CALLSETUP, 0); + break; + case HAL_HANDSFREE_CALL_STATE_IDLE: + + if (device.call_hanging_up) { + device.call_hanging_up = false; + return; + } + + /* check if calls swapped */ + if (num_held != 0 && num_active != 0 && + device.num_active == num_held && + device.num_held == num_active) { + /* TODO better way for forcing indicator */ + device.inds[IND_CALLHELD].val = 0; + } else if ((num_active > 0 || num_held > 0) && + device.num_active == 0 && + device.num_held == 0) { + /* If number of active or held calls change but there + * was no call setup change this means that there were + * calls present when headset was connected. + */ + connect_audio(); + } else if (num_active == 0 && num_held == 0) { + disconnect_sco(); + } + + update_indicator(IND_CALLHELD, + num_held ? (num_active ? 1 : 2) : 0); + update_indicator(IND_CALL, !!(num_active + num_held)); + update_indicator(IND_CALLSETUP, 0); + + /* If call was terminated due to carrier lost send NO CARRIER */ + if (num_active == 0 && num_held == 0 && + device.inds[IND_SERVICE].val == 0 && + (device.num_active > 0 || device.num_held > 0)) + hfp_gw_send_info(device.gw, "NO CARRIER"); + + break; + default: + DBG("unhandled state %u", device.setup_state); + break; + } +} + +static void handle_phone_state_change(const void *buf, uint16_t len) +{ + const struct hal_cmd_handsfree_phone_state_change *cmd = buf; + uint8_t status; + + if (len != sizeof(*cmd) + cmd->number_len || (cmd->number_len != 0 && + cmd->number[cmd->number_len - 1] != '\0')) { + error("Invalid phone state change command, terminating"); + raise(SIGTERM); + return; + } + + DBG("active=%u hold=%u state=%u", cmd->num_active, cmd->num_held, + cmd->state); + + switch (cmd->state) { + case HAL_HANDSFREE_CALL_STATE_DIALING: + phone_state_dialing(cmd->num_active, cmd->num_held); + break; + case HAL_HANDSFREE_CALL_STATE_ALERTING: + phone_state_alerting(cmd->num_active, cmd->num_held); + break; + case HAL_HANDSFREE_CALL_STATE_INCOMING: + phone_state_incoming(cmd->num_active, cmd->num_held, cmd->type, + cmd->number, cmd->number_len); + break; + case HAL_HANDSFREE_CALL_STATE_IDLE: + phone_state_idle(cmd->num_active, cmd->num_held); + break; + default: + DBG("unhandled new state %u (current state %u)", cmd->state, + device.setup_state); + + status = HAL_STATUS_FAILED; + goto failed; + } + + device.num_active = cmd->num_active; + device.num_held = cmd->num_held; + device.setup_state = cmd->state; + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE, + HAL_OP_HANDSFREE_PHONE_STATE_CHANGE, status); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_HANDSFREE_CONNECT */ + { handle_connect, false, sizeof(struct hal_cmd_handsfree_connect)}, + /* HAL_OP_HANDSFREE_DISCONNECT */ + {handle_disconnect, false, sizeof(struct hal_cmd_handsfree_disconnect)}, + /*HAL_OP_HANDSFREE_CONNECT_AUDIO*/ + {handle_connect_audio, false, + sizeof(struct hal_cmd_handsfree_connect_audio)}, + /*HAL_OP_HANDSFREE_DISCONNECT_AUDIO*/ + {handle_disconnect_audio, false, + sizeof(struct hal_cmd_handsfree_disconnect_audio)}, + /* define HAL_OP_HANDSFREE_START_VR */ + {handle_start_vr, false, 0 }, + /* define HAL_OP_HANDSFREE_STOP_VR */ + {handle_stop_vr, false, 0 }, + /* HAL_OP_HANDSFREE_VOLUME_CONTROL */ + {handle_volume_control, false, + sizeof(struct hal_cmd_handsfree_volume_control)}, + /* HAL_OP_HANDSFREE_DEVICE_STATUS_NOTIF */ + {handle_device_status_notif, false, + sizeof(struct hal_cmd_handsfree_device_status_notif)}, + /* HAL_OP_HANDSFREE_COPS_RESPONSE */ + {handle_cops, true, sizeof(struct hal_cmd_handsfree_cops_response)}, + /* HAL_OP_HANDSFREE_CIND_RESPONSE */ + { handle_cind, false, sizeof(struct hal_cmd_handsfree_cind_response)}, + /* HAL_OP_HANDSFREE_FORMATTED_AT_RESPONSE */ + {handle_formatted_at_resp, true, + sizeof(struct hal_cmd_handsfree_formatted_at_response)}, + /* HAL_OP_HANDSFREE_AT_RESPONSE */ + {handle_at_resp, false, sizeof(struct hal_cmd_handsfree_at_response)}, + /* HAL_OP_HANDSFREE_CLCC_RESPONSE */ + {handle_clcc_resp, true, + sizeof(struct hal_cmd_handsfree_clcc_response)}, + /* HAL_OP_HANDSFREE_PHONE_STATE_CHANGE */ + {handle_phone_state_change, true, + sizeof(struct hal_cmd_handsfree_phone_state_change)}, +}; + +static sdp_record_t *headset_ag_record(void) +{ + sdp_list_t *svclass_id, *pfseq, *apseq, *root; + uuid_t root_uuid, svclass_uuid, ga_svclass_uuid; + uuid_t l2cap_uuid, rfcomm_uuid; + sdp_profile_desc_t profile; + sdp_list_t *aproto, *proto[2]; + sdp_record_t *record; + sdp_data_t *channel; + uint8_t netid = 0x01; + sdp_data_t *network; + uint8_t ch = HSP_AG_CHANNEL; + + record = sdp_record_alloc(); + if (!record) + return NULL; + + network = sdp_data_alloc(SDP_UINT8, &netid); + if (!network) { + sdp_record_free(record); + return NULL; + } + + sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP); + root = sdp_list_append(0, &root_uuid); + sdp_set_browse_groups(record, root); + + sdp_uuid16_create(&svclass_uuid, HEADSET_AGW_SVCLASS_ID); + svclass_id = sdp_list_append(0, &svclass_uuid); + sdp_uuid16_create(&ga_svclass_uuid, GENERIC_AUDIO_SVCLASS_ID); + svclass_id = sdp_list_append(svclass_id, &ga_svclass_uuid); + sdp_set_service_classes(record, svclass_id); + + sdp_uuid16_create(&profile.uuid, HEADSET_PROFILE_ID); + profile.version = 0x0102; + pfseq = sdp_list_append(0, &profile); + sdp_set_profile_descs(record, pfseq); + + sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID); + proto[0] = sdp_list_append(0, &l2cap_uuid); + apseq = sdp_list_append(0, proto[0]); + + sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID); + proto[1] = sdp_list_append(0, &rfcomm_uuid); + channel = sdp_data_alloc(SDP_UINT8, &ch); + proto[1] = sdp_list_append(proto[1], channel); + apseq = sdp_list_append(apseq, proto[1]); + + aproto = sdp_list_append(0, apseq); + sdp_set_access_protos(record, aproto); + + sdp_set_info_attr(record, "Voice Gateway", 0, 0); + + sdp_attr_add(record, SDP_ATTR_EXTERNAL_NETWORK, network); + + sdp_data_free(channel); + sdp_list_free(proto[0], NULL); + sdp_list_free(proto[1], NULL); + sdp_list_free(apseq, NULL); + sdp_list_free(pfseq, NULL); + sdp_list_free(aproto, NULL); + sdp_list_free(root, NULL); + sdp_list_free(svclass_id, NULL); + + return record; +} + +static void confirm_sco_cb(GIOChannel *chan, gpointer user_data) +{ + char address[18]; + bdaddr_t bdaddr; + GError *err = NULL; + + if (device.sco) + goto drop; + + bt_io_get(chan, &err, + BT_IO_OPT_DEST, address, + BT_IO_OPT_DEST_BDADDR, &bdaddr, + BT_IO_OPT_INVALID); + if (err) { + error("handsfree: audio confirm failed (%s)", err->message); + g_error_free(err); + goto drop; + } + + DBG("incoming SCO connection from %s", address); + + if (device.state != HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED || + bacmp(&device.bdaddr, &bdaddr)) { + error("handsfree: audio connection from %s rejected", address); + goto drop; + } + + if (!bt_io_accept(chan, connect_sco_cb, NULL, NULL, NULL)) { + error("handsfree: failed to accept audio connection"); + goto drop; + } + + device_set_audio_state(HAL_EV_HANDSFREE_AUDIO_STATE_CONNECTING); + return; + +drop: + g_io_channel_shutdown(chan, TRUE, NULL); +} + +static bool enable_hsp_ag(void) +{ + sdp_record_t *rec; + GError *err = NULL; + + DBG(""); + + hsp_server = bt_io_listen(NULL, confirm_cb, GINT_TO_POINTER(true), + NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_CHANNEL, HSP_AG_CHANNEL, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_INVALID); + if (!hsp_server) { + error("Failed to listen on Headset rfcomm: %s", err->message); + g_error_free(err); + return false; + } + + rec = headset_ag_record(); + if (!rec) { + error("Failed to allocate Headset record"); + goto failed; + } + + if (bt_adapter_add_record(rec, 0) < 0) { + error("Failed to register Headset record"); + sdp_record_free(rec); + goto failed; + } + + hsp_record_id = rec->handle; + return true; + +failed: + g_io_channel_shutdown(hsp_server, TRUE, NULL); + g_io_channel_unref(hsp_server); + hsp_server = NULL; + + return false; +} + +static void cleanup_hsp_ag(void) +{ + if (hsp_server) { + g_io_channel_shutdown(hsp_server, TRUE, NULL); + g_io_channel_unref(hsp_server); + hsp_server = NULL; + } + + if (hsp_record_id > 0) { + bt_adapter_remove_record(hsp_record_id); + hsp_record_id = 0; + } +} + +static sdp_record_t *hfp_ag_record(void) +{ + sdp_list_t *svclass_id, *pfseq, *apseq, *root; + uuid_t root_uuid, svclass_uuid, ga_svclass_uuid; + uuid_t l2cap_uuid, rfcomm_uuid; + sdp_profile_desc_t profile; + sdp_list_t *aproto, *proto[2]; + sdp_record_t *record; + sdp_data_t *channel, *features; + uint8_t netid = 0x01; + uint16_t sdpfeat; + sdp_data_t *network; + uint8_t ch = HFP_AG_CHANNEL; + + record = sdp_record_alloc(); + if (!record) + return NULL; + + network = sdp_data_alloc(SDP_UINT8, &netid); + if (!network) { + sdp_record_free(record); + return NULL; + } + + sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP); + root = sdp_list_append(NULL, &root_uuid); + sdp_set_browse_groups(record, root); + + sdp_uuid16_create(&svclass_uuid, HANDSFREE_AGW_SVCLASS_ID); + svclass_id = sdp_list_append(NULL, &svclass_uuid); + sdp_uuid16_create(&ga_svclass_uuid, GENERIC_AUDIO_SVCLASS_ID); + svclass_id = sdp_list_append(svclass_id, &ga_svclass_uuid); + sdp_set_service_classes(record, svclass_id); + + sdp_uuid16_create(&profile.uuid, HANDSFREE_PROFILE_ID); + profile.version = 0x0106; + pfseq = sdp_list_append(NULL, &profile); + sdp_set_profile_descs(record, pfseq); + + sdp_uuid16_create(&l2cap_uuid, L2CAP_UUID); + proto[0] = sdp_list_append(0, &l2cap_uuid); + apseq = sdp_list_append(NULL, proto[0]); + + sdp_uuid16_create(&rfcomm_uuid, RFCOMM_UUID); + proto[1] = sdp_list_append(NULL, &rfcomm_uuid); + channel = sdp_data_alloc(SDP_UINT8, &ch); + proto[1] = sdp_list_append(proto[1], channel); + apseq = sdp_list_append(apseq, proto[1]); + + /* Codec Negotiation bit in SDP feature is different then in BRSF */ + sdpfeat = hfp_ag_features & 0x0000003F; + if (hfp_ag_features & HFP_AG_FEAT_CODEC) + sdpfeat |= 0x00000020; + else + sdpfeat &= ~0x00000020; + + features = sdp_data_alloc(SDP_UINT16, &sdpfeat); + sdp_attr_add(record, SDP_ATTR_SUPPORTED_FEATURES, features); + + aproto = sdp_list_append(NULL, apseq); + sdp_set_access_protos(record, aproto); + + sdp_set_info_attr(record, "Hands-Free Audio Gateway", NULL, NULL); + + sdp_attr_add(record, SDP_ATTR_EXTERNAL_NETWORK, network); + + sdp_data_free(channel); + sdp_list_free(proto[0], NULL); + sdp_list_free(proto[1], NULL); + sdp_list_free(apseq, NULL); + sdp_list_free(pfseq, NULL); + sdp_list_free(aproto, NULL); + sdp_list_free(root, NULL); + sdp_list_free(svclass_id, NULL); + + return record; +} + +static bool enable_hfp_ag(void) +{ + sdp_record_t *rec; + GError *err = NULL; + + DBG(""); + + if (hfp_server) + return false; + + hfp_server = bt_io_listen(NULL, confirm_cb, GINT_TO_POINTER(false), + NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_CHANNEL, HFP_AG_CHANNEL, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_INVALID); + if (!hfp_server) { + error("Failed to listen on Handsfree rfcomm: %s", err->message); + g_error_free(err); + return false; + } + + rec = hfp_ag_record(); + if (!rec) { + error("Failed to allocate Handsfree record"); + goto failed; + } + + if (bt_adapter_add_record(rec, 0) < 0) { + error("Failed to register Handsfree record"); + sdp_record_free(rec); + goto failed; + } + + hfp_record_id = rec->handle; + return true; + +failed: + g_io_channel_shutdown(hfp_server, TRUE, NULL); + g_io_channel_unref(hfp_server); + hfp_server = NULL; + + return false; +} + +static void cleanup_hfp_ag(void) +{ + if (hfp_server) { + g_io_channel_shutdown(hfp_server, TRUE, NULL); + g_io_channel_unref(hfp_server); + hfp_server = NULL; + } + + if (hfp_record_id > 0) { + bt_adapter_remove_record(hfp_record_id); + hfp_record_id = 0; + } +} + +static bool enable_sco_server(void) +{ + GError *err = NULL; + + sco_server = bt_io_listen(NULL, confirm_sco_cb, NULL, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_INVALID); + if (!sco_server) { + error("handsfree: Failed to listen on SCO: %s", err->message); + g_error_free(err); + cleanup_hsp_ag(); + cleanup_hfp_ag(); + return false; + } + + return true; +} + +static void disable_sco_server(void) +{ + if (sco_server) { + g_io_channel_shutdown(sco_server, TRUE, NULL); + g_io_channel_unref(sco_server); + sco_server = NULL; + } +} + +bool bt_handsfree_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode) +{ + DBG("mode 0x%x", mode); + + bacpy(&adapter_addr, addr); + + if (!enable_hsp_ag()) + return false; + + if (!enable_sco_server()) { + cleanup_hsp_ag(); + return false; + } + + if (mode == HAL_MODE_HANDSFREE_HSP_ONLY) + goto done; + + hfp_ag_features = HFP_AG_FEATURES; + + if (mode == HAL_MODE_HANDSFREE_HFP_WBS) + hfp_ag_features |= HFP_AG_FEAT_CODEC; + + if (enable_hfp_ag()) + goto done; + + cleanup_hsp_ag(); + disable_sco_server(); + hfp_ag_features = 0; + return false; + +done: + hal_ipc = ipc; + ipc_register(hal_ipc, HAL_SERVICE_ID_HANDSFREE, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); + return true; +} + +void bt_handsfree_unregister(void) +{ + DBG(""); + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_HANDSFREE); + hal_ipc = NULL; + + cleanup_hfp_ag(); + cleanup_hsp_ag(); + disable_sco_server(); + + hfp_ag_features = 0; +}
diff --git a/bluez/android/handsfree.h b/bluez/android/handsfree.h new file mode 100644 index 0000000..e5eff47 --- /dev/null +++ b/bluez/android/handsfree.h
@@ -0,0 +1,25 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +bool bt_handsfree_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode); +void bt_handsfree_unregister(void);
diff --git a/bluez/android/hardware/audio.h b/bluez/android/hardware/audio.h new file mode 100644 index 0000000..61d92db --- /dev/null +++ b/bluez/android/hardware/audio.h
@@ -0,0 +1,564 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef ANDROID_AUDIO_HAL_INTERFACE_H +#define ANDROID_AUDIO_HAL_INTERFACE_H + +#include <stdint.h> +#include <strings.h> +#include <sys/cdefs.h> +#include <sys/types.h> + +#include <hardware/hardware.h> +#include <system/audio.h> +#include <hardware/audio_effect.h> + +__BEGIN_DECLS + +/** + * The id of this module + */ +#define AUDIO_HARDWARE_MODULE_ID "audio" + +/** + * Name of the audio devices to open + */ +#define AUDIO_HARDWARE_INTERFACE "audio_hw_if" + + +/* Use version 0.1 to be compatible with first generation of audio hw module with version_major + * hardcoded to 1. No audio module API change. + */ +#define AUDIO_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) +#define AUDIO_MODULE_API_VERSION_CURRENT AUDIO_MODULE_API_VERSION_0_1 + +/* First generation of audio devices had version hardcoded to 0. all devices with versions < 1.0 + * will be considered of first generation API. + */ +#define AUDIO_DEVICE_API_VERSION_0_0 HARDWARE_DEVICE_API_VERSION(0, 0) +#define AUDIO_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) +#define AUDIO_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) +#define AUDIO_DEVICE_API_VERSION_CURRENT AUDIO_DEVICE_API_VERSION_2_0 + +/** + * List of known audio HAL modules. This is the base name of the audio HAL + * library composed of the "audio." prefix, one of the base names below and + * a suffix specific to the device. + * e.g: audio.primary.goldfish.so or audio.a2dp.default.so + */ + +#define AUDIO_HARDWARE_MODULE_ID_PRIMARY "primary" +#define AUDIO_HARDWARE_MODULE_ID_A2DP "a2dp" +#define AUDIO_HARDWARE_MODULE_ID_USB "usb" +#define AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX "r_submix" +#define AUDIO_HARDWARE_MODULE_ID_CODEC_OFFLOAD "codec_offload" + +/**************************************/ + +/** + * standard audio parameters that the HAL may need to handle + */ + +/** + * audio device parameters + */ + +/* BT SCO Noise Reduction + Echo Cancellation parameters */ +#define AUDIO_PARAMETER_KEY_BT_NREC "bt_headset_nrec" +#define AUDIO_PARAMETER_VALUE_ON "on" +#define AUDIO_PARAMETER_VALUE_OFF "off" + +/* TTY mode selection */ +#define AUDIO_PARAMETER_KEY_TTY_MODE "tty_mode" +#define AUDIO_PARAMETER_VALUE_TTY_OFF "tty_off" +#define AUDIO_PARAMETER_VALUE_TTY_VCO "tty_vco" +#define AUDIO_PARAMETER_VALUE_TTY_HCO "tty_hco" +#define AUDIO_PARAMETER_VALUE_TTY_FULL "tty_full" + +/* A2DP sink address set by framework */ +#define AUDIO_PARAMETER_A2DP_SINK_ADDRESS "a2dp_sink_address" + +/* Screen state */ +#define AUDIO_PARAMETER_KEY_SCREEN_STATE "screen_state" + +/** + * audio stream parameters + */ + +#define AUDIO_PARAMETER_STREAM_ROUTING "routing" // audio_devices_t +#define AUDIO_PARAMETER_STREAM_FORMAT "format" // audio_format_t +#define AUDIO_PARAMETER_STREAM_CHANNELS "channels" // audio_channel_mask_t +#define AUDIO_PARAMETER_STREAM_FRAME_COUNT "frame_count" // size_t +#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE "input_source" // audio_source_t +#define AUDIO_PARAMETER_STREAM_SAMPLING_RATE "sampling_rate" // uint32_t + +/* Query supported formats. The response is a '|' separated list of strings from + * audio_format_t enum e.g: "sup_formats=AUDIO_FORMAT_PCM_16_BIT" */ +#define AUDIO_PARAMETER_STREAM_SUP_FORMATS "sup_formats" +/* Query supported channel masks. The response is a '|' separated list of strings from + * audio_channel_mask_t enum e.g: "sup_channels=AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO" */ +#define AUDIO_PARAMETER_STREAM_SUP_CHANNELS "sup_channels" +/* Query supported sampling rates. The response is a '|' separated list of integer values e.g: + * "sup_sampling_rates=44100|48000" */ +#define AUDIO_PARAMETER_STREAM_SUP_SAMPLING_RATES "sup_sampling_rates" + +/** + * audio codec parameters + */ + +#define AUDIO_OFFLOAD_CODEC_PARAMS "music_offload_codec_param" +#define AUDIO_OFFLOAD_CODEC_BIT_PER_SAMPLE "music_offload_bit_per_sample" +#define AUDIO_OFFLOAD_CODEC_BIT_RATE "music_offload_bit_rate" +#define AUDIO_OFFLOAD_CODEC_AVG_BIT_RATE "music_offload_avg_bit_rate" +#define AUDIO_OFFLOAD_CODEC_ID "music_offload_codec_id" +#define AUDIO_OFFLOAD_CODEC_BLOCK_ALIGN "music_offload_block_align" +#define AUDIO_OFFLOAD_CODEC_SAMPLE_RATE "music_offload_sample_rate" +#define AUDIO_OFFLOAD_CODEC_ENCODE_OPTION "music_offload_encode_option" +#define AUDIO_OFFLOAD_CODEC_NUM_CHANNEL "music_offload_num_channels" +#define AUDIO_OFFLOAD_CODEC_DOWN_SAMPLING "music_offload_down_sampling" +#define AUDIO_OFFLOAD_CODEC_DELAY_SAMPLES "delay_samples" +#define AUDIO_OFFLOAD_CODEC_PADDING_SAMPLES "padding_samples" + +/**************************************/ + +/* common audio stream configuration parameters + * You should memset() the entire structure to zero before use to + * ensure forward compatibility + */ +struct audio_config { + uint32_t sample_rate; + audio_channel_mask_t channel_mask; + audio_format_t format; + audio_offload_info_t offload_info; +}; +typedef struct audio_config audio_config_t; + +/* common audio stream parameters and operations */ +struct audio_stream { + + /** + * Return the sampling rate in Hz - eg. 44100. + */ + uint32_t (*get_sample_rate)(const struct audio_stream *stream); + + /* currently unused - use set_parameters with key + * AUDIO_PARAMETER_STREAM_SAMPLING_RATE + */ + int (*set_sample_rate)(struct audio_stream *stream, uint32_t rate); + + /** + * Return size of input/output buffer in bytes for this stream - eg. 4800. + * It should be a multiple of the frame size. See also get_input_buffer_size. + */ + size_t (*get_buffer_size)(const struct audio_stream *stream); + + /** + * Return the channel mask - + * e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO + */ + audio_channel_mask_t (*get_channels)(const struct audio_stream *stream); + + /** + * Return the audio format - e.g. AUDIO_FORMAT_PCM_16_BIT + */ + audio_format_t (*get_format)(const struct audio_stream *stream); + + /* currently unused - use set_parameters with key + * AUDIO_PARAMETER_STREAM_FORMAT + */ + int (*set_format)(struct audio_stream *stream, audio_format_t format); + + /** + * Put the audio hardware input/output into standby mode. + * Driver should exit from standby mode at the next I/O operation. + * Returns 0 on success and <0 on failure. + */ + int (*standby)(struct audio_stream *stream); + + /** dump the state of the audio input/output device */ + int (*dump)(const struct audio_stream *stream, int fd); + + /** Return the set of device(s) which this stream is connected to */ + audio_devices_t (*get_device)(const struct audio_stream *stream); + + /** + * Currently unused - set_device() corresponds to set_parameters() with key + * AUDIO_PARAMETER_STREAM_ROUTING for both input and output. + * AUDIO_PARAMETER_STREAM_INPUT_SOURCE is an additional information used by + * input streams only. + */ + int (*set_device)(struct audio_stream *stream, audio_devices_t device); + + /** + * set/get audio stream parameters. The function accepts a list of + * parameter key value pairs in the form: key1=value1;key2=value2;... + * + * Some keys are reserved for standard parameters (See AudioParameter class) + * + * If the implementation does not accept a parameter change while + * the output is active but the parameter is acceptable otherwise, it must + * return -ENOSYS. + * + * The audio flinger will put the stream in standby and then change the + * parameter value. + */ + int (*set_parameters)(struct audio_stream *stream, const char *kv_pairs); + + /* + * Returns a pointer to a heap allocated string. The caller is responsible + * for freeing the memory for it using free(). + */ + char * (*get_parameters)(const struct audio_stream *stream, + const char *keys); + int (*add_audio_effect)(const struct audio_stream *stream, + effect_handle_t effect); + int (*remove_audio_effect)(const struct audio_stream *stream, + effect_handle_t effect); +}; +typedef struct audio_stream audio_stream_t; + +/* type of asynchronous write callback events. Mutually exclusive */ +typedef enum { + STREAM_CBK_EVENT_WRITE_READY, /* non blocking write completed */ + STREAM_CBK_EVENT_DRAIN_READY /* drain completed */ +} stream_callback_event_t; + +typedef int (*stream_callback_t)(stream_callback_event_t event, void *param, void *cookie); + +/* type of drain requested to audio_stream_out->drain(). Mutually exclusive */ +typedef enum { + AUDIO_DRAIN_ALL, /* drain() returns when all data has been played */ + AUDIO_DRAIN_EARLY_NOTIFY /* drain() returns a short time before all data + from the current track has been played to + give time for gapless track switch */ +} audio_drain_type_t; + +/** + * audio_stream_out is the abstraction interface for the audio output hardware. + * + * It provides information about various properties of the audio output + * hardware driver. + */ + +struct audio_stream_out { + struct audio_stream common; + + /** + * Return the audio hardware driver estimated latency in milliseconds. + */ + uint32_t (*get_latency)(const struct audio_stream_out *stream); + + /** + * Use this method in situations where audio mixing is done in the + * hardware. This method serves as a direct interface with hardware, + * allowing you to directly set the volume as apposed to via the framework. + * This method might produce multiple PCM outputs or hardware accelerated + * codecs, such as MP3 or AAC. + */ + int (*set_volume)(struct audio_stream_out *stream, float left, float right); + + /** + * Write audio buffer to driver. Returns number of bytes written, or a + * negative status_t. If at least one frame was written successfully prior to the error, + * it is suggested that the driver return that successful (short) byte count + * and then return an error in the subsequent call. + * + * If set_callback() has previously been called to enable non-blocking mode + * the write() is not allowed to block. It must write only the number of + * bytes that currently fit in the driver/hardware buffer and then return + * this byte count. If this is less than the requested write size the + * callback function must be called when more space is available in the + * driver/hardware buffer. + */ + ssize_t (*write)(struct audio_stream_out *stream, const void* buffer, + size_t bytes); + + /* return the number of audio frames written by the audio dsp to DAC since + * the output has exited standby + */ + int (*get_render_position)(const struct audio_stream_out *stream, + uint32_t *dsp_frames); + + /** + * get the local time at which the next write to the audio driver will be presented. + * The units are microseconds, where the epoch is decided by the local audio HAL. + */ + int (*get_next_write_timestamp)(const struct audio_stream_out *stream, + int64_t *timestamp); + + /** + * set the callback function for notifying completion of non-blocking + * write and drain. + * Calling this function implies that all future write() and drain() + * must be non-blocking and use the callback to signal completion. + */ + int (*set_callback)(struct audio_stream_out *stream, + stream_callback_t callback, void *cookie); + + /** + * Notifies to the audio driver to stop playback however the queued buffers are + * retained by the hardware. Useful for implementing pause/resume. Empty implementation + * if not supported however should be implemented for hardware with non-trivial + * latency. In the pause state audio hardware could still be using power. User may + * consider calling suspend after a timeout. + * + * Implementation of this function is mandatory for offloaded playback. + */ + int (*pause)(struct audio_stream_out* stream); + + /** + * Notifies to the audio driver to resume playback following a pause. + * Returns error if called without matching pause. + * + * Implementation of this function is mandatory for offloaded playback. + */ + int (*resume)(struct audio_stream_out* stream); + + /** + * Requests notification when data buffered by the driver/hardware has + * been played. If set_callback() has previously been called to enable + * non-blocking mode, the drain() must not block, instead it should return + * quickly and completion of the drain is notified through the callback. + * If set_callback() has not been called, the drain() must block until + * completion. + * If type==AUDIO_DRAIN_ALL, the drain completes when all previously written + * data has been played. + * If type==AUDIO_DRAIN_EARLY_NOTIFY, the drain completes shortly before all + * data for the current track has played to allow time for the framework + * to perform a gapless track switch. + * + * Drain must return immediately on stop() and flush() call + * + * Implementation of this function is mandatory for offloaded playback. + */ + int (*drain)(struct audio_stream_out* stream, audio_drain_type_t type ); + + /** + * Notifies to the audio driver to flush the queued data. Stream must already + * be paused before calling flush(). + * + * Implementation of this function is mandatory for offloaded playback. + */ + int (*flush)(struct audio_stream_out* stream); + + /** + * Return a recent count of the number of audio frames presented to an external observer. + * This excludes frames which have been written but are still in the pipeline. + * The count is not reset to zero when output enters standby. + * Also returns the value of CLOCK_MONOTONIC as of this presentation count. + * The returned count is expected to be 'recent', + * but does not need to be the most recent possible value. + * However, the associated time should correspond to whatever count is returned. + * Example: assume that N+M frames have been presented, where M is a 'small' number. + * Then it is permissible to return N instead of N+M, + * and the timestamp should correspond to N rather than N+M. + * The terms 'recent' and 'small' are not defined. + * They reflect the quality of the implementation. + * + * 3.0 and higher only. + */ + int (*get_presentation_position)(const struct audio_stream_out *stream, + uint64_t *frames, struct timespec *timestamp); + +}; +typedef struct audio_stream_out audio_stream_out_t; + +struct audio_stream_in { + struct audio_stream common; + + /** set the input gain for the audio driver. This method is for + * for future use */ + int (*set_gain)(struct audio_stream_in *stream, float gain); + + /** Read audio buffer in from audio driver. Returns number of bytes read, or a + * negative status_t. If at least one frame was read prior to the error, + * read should return that byte count and then return an error in the subsequent call. + */ + ssize_t (*read)(struct audio_stream_in *stream, void* buffer, + size_t bytes); + + /** + * Return the amount of input frames lost in the audio driver since the + * last call of this function. + * Audio driver is expected to reset the value to 0 and restart counting + * upon returning the current value by this function call. + * Such loss typically occurs when the user space process is blocked + * longer than the capacity of audio driver buffers. + * + * Unit: the number of input audio frames + */ + uint32_t (*get_input_frames_lost)(struct audio_stream_in *stream); +}; +typedef struct audio_stream_in audio_stream_in_t; + +/** + * return the frame size (number of bytes per sample). + */ +static inline size_t audio_stream_frame_size(const struct audio_stream *s) +{ + size_t chan_samp_sz; + audio_format_t format = s->get_format(s); + + if (audio_is_linear_pcm(format)) { + chan_samp_sz = audio_bytes_per_sample(format); + return popcount(s->get_channels(s)) * chan_samp_sz; + } + + return sizeof(int8_t); +} + + +/**********************************************************************/ + +/** + * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM + * and the fields of this data structure must begin with hw_module_t + * followed by module specific information. + */ +struct audio_module { + struct hw_module_t common; +}; + +struct audio_hw_device { + struct hw_device_t common; + + /** + * used by audio flinger to enumerate what devices are supported by + * each audio_hw_device implementation. + * + * Return value is a bitmask of 1 or more values of audio_devices_t + * + * NOTE: audio HAL implementations starting with + * AUDIO_DEVICE_API_VERSION_2_0 do not implement this function. + * All supported devices should be listed in audio_policy.conf + * file and the audio policy manager must choose the appropriate + * audio module based on information in this file. + */ + uint32_t (*get_supported_devices)(const struct audio_hw_device *dev); + + /** + * check to see if the audio hardware interface has been initialized. + * returns 0 on success, -ENODEV on failure. + */ + int (*init_check)(const struct audio_hw_device *dev); + + /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */ + int (*set_voice_volume)(struct audio_hw_device *dev, float volume); + + /** + * set the audio volume for all audio activities other than voice call. + * Range between 0.0 and 1.0. If any value other than 0 is returned, + * the software mixer will emulate this capability. + */ + int (*set_master_volume)(struct audio_hw_device *dev, float volume); + + /** + * Get the current master volume value for the HAL, if the HAL supports + * master volume control. AudioFlinger will query this value from the + * primary audio HAL when the service starts and use the value for setting + * the initial master volume across all HALs. HALs which do not support + * this method may leave it set to NULL. + */ + int (*get_master_volume)(struct audio_hw_device *dev, float *volume); + + /** + * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode + * is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is + * playing, and AUDIO_MODE_IN_CALL when a call is in progress. + */ + int (*set_mode)(struct audio_hw_device *dev, audio_mode_t mode); + + /* mic mute */ + int (*set_mic_mute)(struct audio_hw_device *dev, bool state); + int (*get_mic_mute)(const struct audio_hw_device *dev, bool *state); + + /* set/get global audio parameters */ + int (*set_parameters)(struct audio_hw_device *dev, const char *kv_pairs); + + /* + * Returns a pointer to a heap allocated string. The caller is responsible + * for freeing the memory for it using free(). + */ + char * (*get_parameters)(const struct audio_hw_device *dev, + const char *keys); + + /* Returns audio input buffer size according to parameters passed or + * 0 if one of the parameters is not supported. + * See also get_buffer_size which is for a particular stream. + */ + size_t (*get_input_buffer_size)(const struct audio_hw_device *dev, + const struct audio_config *config); + + /** This method creates and opens the audio hardware output stream */ + int (*open_output_stream)(struct audio_hw_device *dev, + audio_io_handle_t handle, + audio_devices_t devices, + audio_output_flags_t flags, + struct audio_config *config, + struct audio_stream_out **stream_out); + + void (*close_output_stream)(struct audio_hw_device *dev, + struct audio_stream_out* stream_out); + + /** This method creates and opens the audio hardware input stream */ + int (*open_input_stream)(struct audio_hw_device *dev, + audio_io_handle_t handle, + audio_devices_t devices, + struct audio_config *config, + struct audio_stream_in **stream_in); + + void (*close_input_stream)(struct audio_hw_device *dev, + struct audio_stream_in *stream_in); + + /** This method dumps the state of the audio hardware */ + int (*dump)(const struct audio_hw_device *dev, int fd); + + /** + * set the audio mute status for all audio activities. If any value other + * than 0 is returned, the software mixer will emulate this capability. + */ + int (*set_master_mute)(struct audio_hw_device *dev, bool mute); + + /** + * Get the current master mute status for the HAL, if the HAL supports + * master mute control. AudioFlinger will query this value from the primary + * audio HAL when the service starts and use the value for setting the + * initial master mute across all HALs. HALs which do not support this + * method may leave it set to NULL. + */ + int (*get_master_mute)(struct audio_hw_device *dev, bool *mute); +}; +typedef struct audio_hw_device audio_hw_device_t; + +/** convenience API for opening and closing a supported device */ + +static inline int audio_hw_device_open(const struct hw_module_t* module, + struct audio_hw_device** device) +{ + return module->methods->open(module, AUDIO_HARDWARE_INTERFACE, + (struct hw_device_t**)device); +} + +static inline int audio_hw_device_close(struct audio_hw_device* device) +{ + return device->common.close(&device->common); +} + + +__END_DECLS + +#endif // ANDROID_AUDIO_INTERFACE_H
diff --git a/bluez/android/hardware/audio_effect.h b/bluez/android/hardware/audio_effect.h new file mode 100644 index 0000000..857a300 --- /dev/null +++ b/bluez/android/hardware/audio_effect.h
@@ -0,0 +1,1009 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef ANDROID_AUDIO_EFFECT_H +#define ANDROID_AUDIO_EFFECT_H + +#include <errno.h> +#include <stdint.h> +#include <strings.h> +#include <sys/cdefs.h> +#include <sys/types.h> + +#include <system/audio.h> + +__BEGIN_DECLS + + +///////////////////////////////////////////////// +// Common Definitions +///////////////////////////////////////////////// + +// +//--- Effect descriptor structure effect_descriptor_t +// + +// Unique effect ID (can be generated from the following site: +// http://www.itu.int/ITU-T/asn1/uuid.html) +// This format is used for both "type" and "uuid" fields of the effect descriptor structure. +// - When used for effect type and the engine is implementing and effect corresponding to a standard +// OpenSL ES interface, this ID must be the one defined in OpenSLES_IID.h for that interface. +// - When used as uuid, it should be a unique UUID for this particular implementation. +typedef struct effect_uuid_s { + uint32_t timeLow; + uint16_t timeMid; + uint16_t timeHiAndVersion; + uint16_t clockSeq; + uint8_t node[6]; +} effect_uuid_t; + +// Maximum length of character strings in structures defines by this API. +#define EFFECT_STRING_LEN_MAX 64 + +// NULL UUID definition (matches SL_IID_NULL_) +#define EFFECT_UUID_INITIALIZER { 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, \ + { 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } } +static const effect_uuid_t EFFECT_UUID_NULL_ = EFFECT_UUID_INITIALIZER; +static const effect_uuid_t * const EFFECT_UUID_NULL = &EFFECT_UUID_NULL_; +static const char * const EFFECT_UUID_NULL_STR = "ec7178ec-e5e1-4432-a3f4-4657e6795210"; + + +// The effect descriptor contains necessary information to facilitate the enumeration of the effect +// engines present in a library. +typedef struct effect_descriptor_s { + effect_uuid_t type; // UUID of to the OpenSL ES interface implemented by this effect + effect_uuid_t uuid; // UUID for this particular implementation + uint32_t apiVersion; // Version of the effect control API implemented + uint32_t flags; // effect engine capabilities/requirements flags (see below) + uint16_t cpuLoad; // CPU load indication (see below) + uint16_t memoryUsage; // Data Memory usage (see below) + char name[EFFECT_STRING_LEN_MAX]; // human readable effect name + char implementor[EFFECT_STRING_LEN_MAX]; // human readable effect implementor name +} effect_descriptor_t; + +// CPU load and memory usage indication: each effect implementation must provide an indication of +// its CPU and memory usage for the audio effect framework to limit the number of effects +// instantiated at a given time on a given platform. +// The CPU load is expressed in 0.1 MIPS units as estimated on an ARM9E core (ARMv5TE) with 0 WS. +// The memory usage is expressed in KB and includes only dynamically allocated memory + +// Definitions for flags field of effect descriptor. +// +---------------------------+-----------+----------------------------------- +// | description | bits | values +// +---------------------------+-----------+----------------------------------- +// | connection mode | 0..2 | 0 insert: after track process +// | | | 1 auxiliary: connect to track auxiliary +// | | | output and use send level +// | | | 2 replace: replaces track process function; +// | | | must implement SRC, volume and mono to stereo. +// | | | 3 pre processing: applied below audio HAL on input +// | | | 4 post processing: applied below audio HAL on output +// | | | 5 - 7 reserved +// +---------------------------+-----------+----------------------------------- +// | insertion preference | 3..5 | 0 none +// | | | 1 first of the chain +// | | | 2 last of the chain +// | | | 3 exclusive (only effect in the insert chain) +// | | | 4..7 reserved +// +---------------------------+-----------+----------------------------------- +// | Volume management | 6..8 | 0 none +// | | | 1 implements volume control +// | | | 2 requires volume indication +// | | | 4 reserved +// +---------------------------+-----------+----------------------------------- +// | Device indication | 9..11 | 0 none +// | | | 1 requires device updates +// | | | 2, 4 reserved +// +---------------------------+-----------+----------------------------------- +// | Sample input mode | 12..13 | 1 direct: process() function or EFFECT_CMD_SET_CONFIG +// | | | command must specify a buffer descriptor +// | | | 2 provider: process() function uses the +// | | | bufferProvider indicated by the +// | | | EFFECT_CMD_SET_CONFIG command to request input. +// | | | buffers. +// | | | 3 both: both input modes are supported +// +---------------------------+-----------+----------------------------------- +// | Sample output mode | 14..15 | 1 direct: process() function or EFFECT_CMD_SET_CONFIG +// | | | command must specify a buffer descriptor +// | | | 2 provider: process() function uses the +// | | | bufferProvider indicated by the +// | | | EFFECT_CMD_SET_CONFIG command to request output +// | | | buffers. +// | | | 3 both: both output modes are supported +// +---------------------------+-----------+----------------------------------- +// | Hardware acceleration | 16..17 | 0 No hardware acceleration +// | | | 1 non tunneled hw acceleration: the process() function +// | | | reads the samples, send them to HW accelerated +// | | | effect processor, reads back the processed samples +// | | | and returns them to the output buffer. +// | | | 2 tunneled hw acceleration: the process() function is +// | | | transparent. The effect interface is only used to +// | | | control the effect engine. This mode is relevant for +// | | | global effects actually applied by the audio +// | | | hardware on the output stream. +// +---------------------------+-----------+----------------------------------- +// | Audio Mode indication | 18..19 | 0 none +// | | | 1 requires audio mode updates +// | | | 2..3 reserved +// +---------------------------+-----------+----------------------------------- +// | Audio source indication | 20..21 | 0 none +// | | | 1 requires audio source updates +// | | | 2..3 reserved +// +---------------------------+-----------+----------------------------------- +// | Effect offload supported | 22 | 0 The effect cannot be offloaded to an audio DSP +// | | | 1 The effect can be offloaded to an audio DSP +// +---------------------------+-----------+----------------------------------- + +// Insert mode +#define EFFECT_FLAG_TYPE_SHIFT 0 +#define EFFECT_FLAG_TYPE_SIZE 3 +#define EFFECT_FLAG_TYPE_MASK (((1 << EFFECT_FLAG_TYPE_SIZE) -1) \ + << EFFECT_FLAG_TYPE_SHIFT) +#define EFFECT_FLAG_TYPE_INSERT (0 << EFFECT_FLAG_TYPE_SHIFT) +#define EFFECT_FLAG_TYPE_AUXILIARY (1 << EFFECT_FLAG_TYPE_SHIFT) +#define EFFECT_FLAG_TYPE_REPLACE (2 << EFFECT_FLAG_TYPE_SHIFT) +#define EFFECT_FLAG_TYPE_PRE_PROC (3 << EFFECT_FLAG_TYPE_SHIFT) +#define EFFECT_FLAG_TYPE_POST_PROC (4 << EFFECT_FLAG_TYPE_SHIFT) + +// Insert preference +#define EFFECT_FLAG_INSERT_SHIFT (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE) +#define EFFECT_FLAG_INSERT_SIZE 3 +#define EFFECT_FLAG_INSERT_MASK (((1 << EFFECT_FLAG_INSERT_SIZE) -1) \ + << EFFECT_FLAG_INSERT_SHIFT) +#define EFFECT_FLAG_INSERT_ANY (0 << EFFECT_FLAG_INSERT_SHIFT) +#define EFFECT_FLAG_INSERT_FIRST (1 << EFFECT_FLAG_INSERT_SHIFT) +#define EFFECT_FLAG_INSERT_LAST (2 << EFFECT_FLAG_INSERT_SHIFT) +#define EFFECT_FLAG_INSERT_EXCLUSIVE (3 << EFFECT_FLAG_INSERT_SHIFT) + + +// Volume control +#define EFFECT_FLAG_VOLUME_SHIFT (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE) +#define EFFECT_FLAG_VOLUME_SIZE 3 +#define EFFECT_FLAG_VOLUME_MASK (((1 << EFFECT_FLAG_VOLUME_SIZE) -1) \ + << EFFECT_FLAG_VOLUME_SHIFT) +#define EFFECT_FLAG_VOLUME_CTRL (1 << EFFECT_FLAG_VOLUME_SHIFT) +#define EFFECT_FLAG_VOLUME_IND (2 << EFFECT_FLAG_VOLUME_SHIFT) +#define EFFECT_FLAG_VOLUME_NONE (0 << EFFECT_FLAG_VOLUME_SHIFT) + +// Device indication +#define EFFECT_FLAG_DEVICE_SHIFT (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE) +#define EFFECT_FLAG_DEVICE_SIZE 3 +#define EFFECT_FLAG_DEVICE_MASK (((1 << EFFECT_FLAG_DEVICE_SIZE) -1) \ + << EFFECT_FLAG_DEVICE_SHIFT) +#define EFFECT_FLAG_DEVICE_IND (1 << EFFECT_FLAG_DEVICE_SHIFT) +#define EFFECT_FLAG_DEVICE_NONE (0 << EFFECT_FLAG_DEVICE_SHIFT) + +// Sample input modes +#define EFFECT_FLAG_INPUT_SHIFT (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE) +#define EFFECT_FLAG_INPUT_SIZE 2 +#define EFFECT_FLAG_INPUT_MASK (((1 << EFFECT_FLAG_INPUT_SIZE) -1) \ + << EFFECT_FLAG_INPUT_SHIFT) +#define EFFECT_FLAG_INPUT_DIRECT (1 << EFFECT_FLAG_INPUT_SHIFT) +#define EFFECT_FLAG_INPUT_PROVIDER (2 << EFFECT_FLAG_INPUT_SHIFT) +#define EFFECT_FLAG_INPUT_BOTH (3 << EFFECT_FLAG_INPUT_SHIFT) + +// Sample output modes +#define EFFECT_FLAG_OUTPUT_SHIFT (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE) +#define EFFECT_FLAG_OUTPUT_SIZE 2 +#define EFFECT_FLAG_OUTPUT_MASK (((1 << EFFECT_FLAG_OUTPUT_SIZE) -1) \ + << EFFECT_FLAG_OUTPUT_SHIFT) +#define EFFECT_FLAG_OUTPUT_DIRECT (1 << EFFECT_FLAG_OUTPUT_SHIFT) +#define EFFECT_FLAG_OUTPUT_PROVIDER (2 << EFFECT_FLAG_OUTPUT_SHIFT) +#define EFFECT_FLAG_OUTPUT_BOTH (3 << EFFECT_FLAG_OUTPUT_SHIFT) + +// Hardware acceleration mode +#define EFFECT_FLAG_HW_ACC_SHIFT (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE) +#define EFFECT_FLAG_HW_ACC_SIZE 2 +#define EFFECT_FLAG_HW_ACC_MASK (((1 << EFFECT_FLAG_HW_ACC_SIZE) -1) \ + << EFFECT_FLAG_HW_ACC_SHIFT) +#define EFFECT_FLAG_HW_ACC_SIMPLE (1 << EFFECT_FLAG_HW_ACC_SHIFT) +#define EFFECT_FLAG_HW_ACC_TUNNEL (2 << EFFECT_FLAG_HW_ACC_SHIFT) + +// Audio mode indication +#define EFFECT_FLAG_AUDIO_MODE_SHIFT (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE) +#define EFFECT_FLAG_AUDIO_MODE_SIZE 2 +#define EFFECT_FLAG_AUDIO_MODE_MASK (((1 << EFFECT_FLAG_AUDIO_MODE_SIZE) -1) \ + << EFFECT_FLAG_AUDIO_MODE_SHIFT) +#define EFFECT_FLAG_AUDIO_MODE_IND (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT) +#define EFFECT_FLAG_AUDIO_MODE_NONE (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT) + +// Audio source indication +#define EFFECT_FLAG_AUDIO_SOURCE_SHIFT (EFFECT_FLAG_AUDIO_MODE_SHIFT + EFFECT_FLAG_AUDIO_MODE_SIZE) +#define EFFECT_FLAG_AUDIO_SOURCE_SIZE 2 +#define EFFECT_FLAG_AUDIO_SOURCE_MASK (((1 << EFFECT_FLAG_AUDIO_SOURCE_SIZE) -1) \ + << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) +#define EFFECT_FLAG_AUDIO_SOURCE_IND (1 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) +#define EFFECT_FLAG_AUDIO_SOURCE_NONE (0 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) + +// Effect offload indication +#define EFFECT_FLAG_OFFLOAD_SHIFT (EFFECT_FLAG_AUDIO_SOURCE_SHIFT + \ + EFFECT_FLAG_AUDIO_SOURCE_SIZE) +#define EFFECT_FLAG_OFFLOAD_SIZE 1 +#define EFFECT_FLAG_OFFLOAD_MASK (((1 << EFFECT_FLAG_OFFLOAD_SIZE) -1) \ + << EFFECT_FLAG_OFFLOAD_SHIFT) +#define EFFECT_FLAG_OFFLOAD_SUPPORTED (1 << EFFECT_FLAG_OFFLOAD_SHIFT) + +#define EFFECT_MAKE_API_VERSION(M, m) (((M)<<16) | ((m) & 0xFFFF)) +#define EFFECT_API_VERSION_MAJOR(v) ((v)>>16) +#define EFFECT_API_VERSION_MINOR(v) ((m) & 0xFFFF) + + + +///////////////////////////////////////////////// +// Effect control interface +///////////////////////////////////////////////// + +// Effect control interface version 2.0 +#define EFFECT_CONTROL_API_VERSION EFFECT_MAKE_API_VERSION(2,0) + +// Effect control interface structure: effect_interface_s +// The effect control interface is exposed by each effect engine implementation. It consists of +// a set of functions controlling the configuration, activation and process of the engine. +// The functions are grouped in a structure of type effect_interface_s. +// +// Effect control interface handle: effect_handle_t +// The effect_handle_t serves two purposes regarding the implementation of the effect engine: +// - 1 it is the address of a pointer to an effect_interface_s structure where the functions +// of the effect control API for a particular effect are located. +// - 2 it is the address of the context of a particular effect instance. +// A typical implementation in the effect library would define a structure as follows: +// struct effect_module_s { +// const struct effect_interface_s *itfe; +// effect_config_t config; +// effect_context_t context; +// } +// The implementation of EffectCreate() function would then allocate a structure of this +// type and return its address as effect_handle_t +typedef struct effect_interface_s **effect_handle_t; + + +// Forward definition of type audio_buffer_t +typedef struct audio_buffer_s audio_buffer_t; + + + + + + +// Effect control interface definition +struct effect_interface_s { + //////////////////////////////////////////////////////////////////////////////// + // + // Function: process + // + // Description: Effect process function. Takes input samples as specified + // (count and location) in input buffer descriptor and output processed + // samples as specified in output buffer descriptor. If the buffer descriptor + // is not specified the function must use either the buffer or the + // buffer provider function installed by the EFFECT_CMD_SET_CONFIG command. + // The effect framework will call the process() function after the EFFECT_CMD_ENABLE + // command is received and until the EFFECT_CMD_DISABLE is received. When the engine + // receives the EFFECT_CMD_DISABLE command it should turn off the effect gracefully + // and when done indicate that it is OK to stop calling the process() function by + // returning the -ENODATA status. + // + // NOTE: the process() function implementation should be "real-time safe" that is + // it should not perform blocking calls: malloc/free, sleep, read/write/open/close, + // pthread_cond_wait/pthread_mutex_lock... + // + // Input: + // self: handle to the effect interface this function + // is called on. + // inBuffer: buffer descriptor indicating where to read samples to process. + // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG command. + // + // outBuffer: buffer descriptor indicating where to write processed samples. + // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG command. + // + // Output: + // returned value: 0 successful operation + // -ENODATA the engine has finished the disable phase and the framework + // can stop calling process() + // -EINVAL invalid interface handle or + // invalid input/output buffer description + //////////////////////////////////////////////////////////////////////////////// + int32_t (*process)(effect_handle_t self, + audio_buffer_t *inBuffer, + audio_buffer_t *outBuffer); + //////////////////////////////////////////////////////////////////////////////// + // + // Function: command + // + // Description: Send a command and receive a response to/from effect engine. + // + // Input: + // self: handle to the effect interface this function + // is called on. + // cmdCode: command code: the command can be a standardized command defined in + // effect_command_e (see below) or a proprietary command. + // cmdSize: size of command in bytes + // pCmdData: pointer to command data + // pReplyData: pointer to reply data + // + // Input/Output: + // replySize: maximum size of reply data as input + // actual size of reply data as output + // + // Output: + // returned value: 0 successful operation + // -EINVAL invalid interface handle or + // invalid command/reply size or format according to command code + // The return code should be restricted to indicate problems related to the this + // API specification. Status related to the execution of a particular command should be + // indicated as part of the reply field. + // + // *pReplyData updated with command response + // + //////////////////////////////////////////////////////////////////////////////// + int32_t (*command)(effect_handle_t self, + uint32_t cmdCode, + uint32_t cmdSize, + void *pCmdData, + uint32_t *replySize, + void *pReplyData); + //////////////////////////////////////////////////////////////////////////////// + // + // Function: get_descriptor + // + // Description: Returns the effect descriptor + // + // Input: + // self: handle to the effect interface this function + // is called on. + // + // Input/Output: + // pDescriptor: address where to return the effect descriptor. + // + // Output: + // returned value: 0 successful operation. + // -EINVAL invalid interface handle or invalid pDescriptor + // *pDescriptor: updated with the effect descriptor. + // + //////////////////////////////////////////////////////////////////////////////// + int32_t (*get_descriptor)(effect_handle_t self, + effect_descriptor_t *pDescriptor); + //////////////////////////////////////////////////////////////////////////////// + // + // Function: process_reverse + // + // Description: Process reverse stream function. This function is used to pass + // a reference stream to the effect engine. If the engine does not need a reference + // stream, this function pointer can be set to NULL. + // This function would typically implemented by an Echo Canceler. + // + // Input: + // self: handle to the effect interface this function + // is called on. + // inBuffer: buffer descriptor indicating where to read samples to process. + // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG_REVERSE command. + // + // outBuffer: buffer descriptor indicating where to write processed samples. + // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG_REVERSE command. + // If the buffer and buffer provider in the configuration received by + // EFFECT_CMD_SET_CONFIG_REVERSE are also NULL, do not return modified reverse + // stream data + // + // Output: + // returned value: 0 successful operation + // -ENODATA the engine has finished the disable phase and the framework + // can stop calling process_reverse() + // -EINVAL invalid interface handle or + // invalid input/output buffer description + //////////////////////////////////////////////////////////////////////////////// + int32_t (*process_reverse)(effect_handle_t self, + audio_buffer_t *inBuffer, + audio_buffer_t *outBuffer); +}; + + +// +//--- Standardized command codes for command() function +// +enum effect_command_e { + EFFECT_CMD_INIT, // initialize effect engine + EFFECT_CMD_SET_CONFIG, // configure effect engine (see effect_config_t) + EFFECT_CMD_RESET, // reset effect engine + EFFECT_CMD_ENABLE, // enable effect process + EFFECT_CMD_DISABLE, // disable effect process + EFFECT_CMD_SET_PARAM, // set parameter immediately (see effect_param_t) + EFFECT_CMD_SET_PARAM_DEFERRED, // set parameter deferred + EFFECT_CMD_SET_PARAM_COMMIT, // commit previous set parameter deferred + EFFECT_CMD_GET_PARAM, // get parameter + EFFECT_CMD_SET_DEVICE, // set audio device (see audio.h, audio_devices_t) + EFFECT_CMD_SET_VOLUME, // set volume + EFFECT_CMD_SET_AUDIO_MODE, // set the audio mode (normal, ring, ...) + EFFECT_CMD_SET_CONFIG_REVERSE, // configure effect engine reverse stream(see effect_config_t) + EFFECT_CMD_SET_INPUT_DEVICE, // set capture device (see audio.h, audio_devices_t) + EFFECT_CMD_GET_CONFIG, // read effect engine configuration + EFFECT_CMD_GET_CONFIG_REVERSE, // read configure effect engine reverse stream configuration + EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS,// get all supported configurations for a feature. + EFFECT_CMD_GET_FEATURE_CONFIG, // get current feature configuration + EFFECT_CMD_SET_FEATURE_CONFIG, // set current feature configuration + EFFECT_CMD_SET_AUDIO_SOURCE, // set the audio source (see audio.h, audio_source_t) + EFFECT_CMD_OFFLOAD, // set if effect thread is an offload one, + // send the ioHandle of the effect thread + EFFECT_CMD_FIRST_PROPRIETARY = 0x10000 // first proprietary command code +}; + +//================================================================================================== +// command: EFFECT_CMD_INIT +//-------------------------------------------------------------------------------------------------- +// description: +// Initialize effect engine: All configurations return to default +//-------------------------------------------------------------------------------------------------- +// command format: +// size: 0 +// data: N/A +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(int) +// data: status +//================================================================================================== +// command: EFFECT_CMD_SET_CONFIG +//-------------------------------------------------------------------------------------------------- +// description: +// Apply new audio parameters configurations for input and output buffers +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(effect_config_t) +// data: effect_config_t +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(int) +// data: status +//================================================================================================== +// command: EFFECT_CMD_RESET +//-------------------------------------------------------------------------------------------------- +// description: +// Reset the effect engine. Keep configuration but resets state and buffer content +//-------------------------------------------------------------------------------------------------- +// command format: +// size: 0 +// data: N/A +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: 0 +// data: N/A +//================================================================================================== +// command: EFFECT_CMD_ENABLE +//-------------------------------------------------------------------------------------------------- +// description: +// Enable the process. Called by the framework before the first call to process() +//-------------------------------------------------------------------------------------------------- +// command format: +// size: 0 +// data: N/A +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(int) +// data: status +//================================================================================================== +// command: EFFECT_CMD_DISABLE +//-------------------------------------------------------------------------------------------------- +// description: +// Disable the process. Called by the framework after the last call to process() +//-------------------------------------------------------------------------------------------------- +// command format: +// size: 0 +// data: N/A +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(int) +// data: status +//================================================================================================== +// command: EFFECT_CMD_SET_PARAM +//-------------------------------------------------------------------------------------------------- +// description: +// Set a parameter and apply it immediately +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(effect_param_t) + size of param and value +// data: effect_param_t + param + value. See effect_param_t definition below for value offset +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(int) +// data: status +//================================================================================================== +// command: EFFECT_CMD_SET_PARAM_DEFERRED +//-------------------------------------------------------------------------------------------------- +// description: +// Set a parameter but apply it only when receiving EFFECT_CMD_SET_PARAM_COMMIT command +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(effect_param_t) + size of param and value +// data: effect_param_t + param + value. See effect_param_t definition below for value offset +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: 0 +// data: N/A +//================================================================================================== +// command: EFFECT_CMD_SET_PARAM_COMMIT +//-------------------------------------------------------------------------------------------------- +// description: +// Apply all previously received EFFECT_CMD_SET_PARAM_DEFERRED commands +//-------------------------------------------------------------------------------------------------- +// command format: +// size: 0 +// data: N/A +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(int) +// data: status +//================================================================================================== +// command: EFFECT_CMD_GET_PARAM +//-------------------------------------------------------------------------------------------------- +// description: +// Get a parameter value +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(effect_param_t) + size of param +// data: effect_param_t + param +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(effect_param_t) + size of param and value +// data: effect_param_t + param + value. See effect_param_t definition below for value offset +//================================================================================================== +// command: EFFECT_CMD_SET_DEVICE +//-------------------------------------------------------------------------------------------------- +// description: +// Set the rendering device the audio output path is connected to. See audio.h, audio_devices_t +// for device values. +// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this +// command when the device changes +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(uint32_t) +// data: uint32_t +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: 0 +// data: N/A +//================================================================================================== +// command: EFFECT_CMD_SET_VOLUME +//-------------------------------------------------------------------------------------------------- +// description: +// Set and get volume. Used by audio framework to delegate volume control to effect engine. +// The effect implementation must set EFFECT_FLAG_VOLUME_IND or EFFECT_FLAG_VOLUME_CTRL flag in +// its descriptor to receive this command before every call to process() function +// If EFFECT_FLAG_VOLUME_CTRL flag is set in the effect descriptor, the effect engine must return +// the volume that should be applied before the effect is processed. The overall volume (the volume +// actually applied by the effect engine multiplied by the returned value) should match the value +// indicated in the command. +//-------------------------------------------------------------------------------------------------- +// command format: +// size: n * sizeof(uint32_t) +// data: volume for each channel defined in effect_config_t for output buffer expressed in +// 8.24 fixed point format +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: n * sizeof(uint32_t) / 0 +// data: - if EFFECT_FLAG_VOLUME_CTRL is set in effect descriptor: +// volume for each channel defined in effect_config_t for output buffer expressed in +// 8.24 fixed point format +// - if EFFECT_FLAG_VOLUME_CTRL is not set in effect descriptor: +// N/A +// It is legal to receive a null pointer as pReplyData in which case the effect framework has +// delegated volume control to another effect +//================================================================================================== +// command: EFFECT_CMD_SET_AUDIO_MODE +//-------------------------------------------------------------------------------------------------- +// description: +// Set the audio mode. The effect implementation must set EFFECT_FLAG_AUDIO_MODE_IND flag in its +// descriptor to receive this command when the audio mode changes. +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(uint32_t) +// data: audio_mode_t +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: 0 +// data: N/A +//================================================================================================== +// command: EFFECT_CMD_SET_CONFIG_REVERSE +//-------------------------------------------------------------------------------------------------- +// description: +// Apply new audio parameters configurations for input and output buffers of reverse stream. +// An example of reverse stream is the echo reference supplied to an Acoustic Echo Canceler. +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(effect_config_t) +// data: effect_config_t +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(int) +// data: status +//================================================================================================== +// command: EFFECT_CMD_SET_INPUT_DEVICE +//-------------------------------------------------------------------------------------------------- +// description: +// Set the capture device the audio input path is connected to. See audio.h, audio_devices_t +// for device values. +// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this +// command when the device changes +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(uint32_t) +// data: uint32_t +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: 0 +// data: N/A +//================================================================================================== +// command: EFFECT_CMD_GET_CONFIG +//-------------------------------------------------------------------------------------------------- +// description: +// Read audio parameters configurations for input and output buffers +//-------------------------------------------------------------------------------------------------- +// command format: +// size: 0 +// data: N/A +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(effect_config_t) +// data: effect_config_t +//================================================================================================== +// command: EFFECT_CMD_GET_CONFIG_REVERSE +//-------------------------------------------------------------------------------------------------- +// description: +// Read audio parameters configurations for input and output buffers of reverse stream +//-------------------------------------------------------------------------------------------------- +// command format: +// size: 0 +// data: N/A +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(effect_config_t) +// data: effect_config_t +//================================================================================================== +// command: EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS +//-------------------------------------------------------------------------------------------------- +// description: +// Queries for supported configurations for a particular feature (e.g. get the supported +// combinations of main and auxiliary channels for a noise suppressor). +// The command parameter is the feature identifier (See effect_feature_e for a list of defined +// features) followed by the maximum number of configuration descriptor to return. +// The reply is composed of: +// - status (uint32_t): +// - 0 if feature is supported +// - -ENOSYS if the feature is not supported, +// - -ENOMEM if the feature is supported but the total number of supported configurations +// exceeds the maximum number indicated by the caller. +// - total number of supported configurations (uint32_t) +// - an array of configuration descriptors. +// The actual number of descriptors returned must not exceed the maximum number indicated by +// the caller. +//-------------------------------------------------------------------------------------------------- +// command format: +// size: 2 x sizeof(uint32_t) +// data: effect_feature_e + maximum number of configurations to return +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: 2 x sizeof(uint32_t) + n x sizeof (<config descriptor>) +// data: status + total number of configurations supported + array of n config descriptors +//================================================================================================== +// command: EFFECT_CMD_GET_FEATURE_CONFIG +//-------------------------------------------------------------------------------------------------- +// description: +// Retrieves current configuration for a given feature. +// The reply status is: +// - 0 if feature is supported +// - -ENOSYS if the feature is not supported, +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(uint32_t) +// data: effect_feature_e +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(uint32_t) + sizeof (<config descriptor>) +// data: status + config descriptor +//================================================================================================== +// command: EFFECT_CMD_SET_FEATURE_CONFIG +//-------------------------------------------------------------------------------------------------- +// description: +// Sets current configuration for a given feature. +// The reply status is: +// - 0 if feature is supported +// - -ENOSYS if the feature is not supported, +// - -EINVAL if the configuration is invalid +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(uint32_t) + sizeof (<config descriptor>) +// data: effect_feature_e + config descriptor +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(uint32_t) +// data: status +//================================================================================================== +// command: EFFECT_CMD_SET_AUDIO_SOURCE +//-------------------------------------------------------------------------------------------------- +// description: +// Set the audio source the capture path is configured for (Camcorder, voice recognition...). +// See audio.h, audio_source_t for values. +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(uint32_t) +// data: uint32_t +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: 0 +// data: N/A +//================================================================================================== +// command: EFFECT_CMD_OFFLOAD +//-------------------------------------------------------------------------------------------------- +// description: +// 1.indicate if the playback thread the effect is attached to is offloaded or not +// 2.update the io handle of the playback thread the effect is attached to +//-------------------------------------------------------------------------------------------------- +// command format: +// size: sizeof(effect_offload_param_t) +// data: effect_offload_param_t +//-------------------------------------------------------------------------------------------------- +// reply format: +// size: sizeof(uint32_t) +// data: uint32_t +//-------------------------------------------------------------------------------------------------- +// command: EFFECT_CMD_FIRST_PROPRIETARY +//-------------------------------------------------------------------------------------------------- +// description: +// All proprietary effect commands must use command codes above this value. The size and format of +// command and response fields is free in this case +//================================================================================================== + + +// Audio buffer descriptor used by process(), bufferProvider() functions and buffer_config_t +// structure. Multi-channel audio is always interleaved. The channel order is from LSB to MSB with +// regard to the channel mask definition in audio.h, audio_channel_mask_t e.g : +// Stereo: left, right +// 5 point 1: front left, front right, front center, low frequency, back left, back right +// The buffer size is expressed in frame count, a frame being composed of samples for all +// channels at a given time. Frame size for unspecified format (AUDIO_FORMAT_OTHER) is 8 bit by +// definition +struct audio_buffer_s { + size_t frameCount; // number of frames in buffer + union { + void* raw; // raw pointer to start of buffer + int32_t* s32; // pointer to signed 32 bit data at start of buffer + int16_t* s16; // pointer to signed 16 bit data at start of buffer + uint8_t* u8; // pointer to unsigned 8 bit data at start of buffer + }; +}; + +// The buffer_provider_s structure contains functions that can be used +// by the effect engine process() function to query and release input +// or output audio buffer. +// The getBuffer() function is called to retrieve a buffer where data +// should read from or written to by process() function. +// The releaseBuffer() function MUST be called when the buffer retrieved +// with getBuffer() is not needed anymore. +// The process function should use the buffer provider mechanism to retrieve +// input or output buffer if the inBuffer or outBuffer passed as argument is NULL +// and the buffer configuration (buffer_config_t) given by the EFFECT_CMD_SET_CONFIG +// command did not specify an audio buffer. + +typedef int32_t (* buffer_function_t)(void *cookie, audio_buffer_t *buffer); + +typedef struct buffer_provider_s { + buffer_function_t getBuffer; // retrieve next buffer + buffer_function_t releaseBuffer; // release used buffer + void *cookie; // for use by client of buffer provider functions +} buffer_provider_t; + + +// The buffer_config_s structure specifies the input or output audio format +// to be used by the effect engine. It is part of the effect_config_t +// structure that defines both input and output buffer configurations and is +// passed by the EFFECT_CMD_SET_CONFIG or EFFECT_CMD_SET_CONFIG_REVERSE command. +typedef struct buffer_config_s { + audio_buffer_t buffer; // buffer for use by process() function if not passed explicitly + uint32_t samplingRate; // sampling rate + uint32_t channels; // channel mask (see audio_channel_mask_t in audio.h) + buffer_provider_t bufferProvider; // buffer provider + uint8_t format; // Audio format (see see audio_format_t in audio.h) + uint8_t accessMode; // read/write or accumulate in buffer (effect_buffer_access_e) + uint16_t mask; // indicates which of the above fields is valid +} buffer_config_t; + +// Values for "accessMode" field of buffer_config_t: +// overwrite, read only, accumulate (read/modify/write) +enum effect_buffer_access_e { + EFFECT_BUFFER_ACCESS_WRITE, + EFFECT_BUFFER_ACCESS_READ, + EFFECT_BUFFER_ACCESS_ACCUMULATE + +}; + +// feature identifiers for EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS command +enum effect_feature_e { + EFFECT_FEATURE_AUX_CHANNELS, // supports auxiliary channels (e.g. dual mic noise suppressor) + EFFECT_FEATURE_CNT +}; + +// EFFECT_FEATURE_AUX_CHANNELS feature configuration descriptor. Describe a combination +// of main and auxiliary channels supported +typedef struct channel_config_s { + audio_channel_mask_t main_channels; // channel mask for main channels + audio_channel_mask_t aux_channels; // channel mask for auxiliary channels +} channel_config_t; + + +// Values for bit field "mask" in buffer_config_t. If a bit is set, the corresponding field +// in buffer_config_t must be taken into account when executing the EFFECT_CMD_SET_CONFIG command +#define EFFECT_CONFIG_BUFFER 0x0001 // buffer field must be taken into account +#define EFFECT_CONFIG_SMP_RATE 0x0002 // samplingRate field must be taken into account +#define EFFECT_CONFIG_CHANNELS 0x0004 // channels field must be taken into account +#define EFFECT_CONFIG_FORMAT 0x0008 // format field must be taken into account +#define EFFECT_CONFIG_ACC_MODE 0x0010 // accessMode field must be taken into account +#define EFFECT_CONFIG_PROVIDER 0x0020 // bufferProvider field must be taken into account +#define EFFECT_CONFIG_ALL (EFFECT_CONFIG_BUFFER | EFFECT_CONFIG_SMP_RATE | \ + EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT | \ + EFFECT_CONFIG_ACC_MODE | EFFECT_CONFIG_PROVIDER) + + +// effect_config_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_CONFIG +// command to configure audio parameters and buffers for effect engine input and output. +typedef struct effect_config_s { + buffer_config_t inputCfg; + buffer_config_t outputCfg; +} effect_config_t; + + +// effect_param_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_PARAM +// command and pCmdData and pReplyData of EFFECT_CMD_GET_PARAM command. +// psize and vsize represent the actual size of parameter and value. +// +// NOTE: the start of value field inside the data field is always on a 32 bit boundary: +// +// +-----------+ +// | status | sizeof(int) +// +-----------+ +// | psize | sizeof(int) +// +-----------+ +// | vsize | sizeof(int) +// +-----------+ +// | | | | +// ~ parameter ~ > psize | +// | | | > ((psize - 1)/sizeof(int) + 1) * sizeof(int) +// +-----------+ | +// | padding | | +// +-----------+ +// | | | +// ~ value ~ > vsize +// | | | +// +-----------+ + +typedef struct effect_param_s { + int32_t status; // Transaction status (unused for command, used for reply) + uint32_t psize; // Parameter size + uint32_t vsize; // Value size + char data[]; // Start of Parameter + Value data +} effect_param_t; + +// structure used by EFFECT_CMD_OFFLOAD command +typedef struct effect_offload_param_s { + bool isOffload; // true if the playback thread the effect is attached to is offloaded + int ioHandle; // io handle of the playback thread the effect is attached to +} effect_offload_param_t; + + +///////////////////////////////////////////////// +// Effect library interface +///////////////////////////////////////////////// + +// Effect library interface version 3.0 +// Note that EffectsFactory.c only checks the major version component, so changes to the minor +// number can only be used for fully backwards compatible changes +#define EFFECT_LIBRARY_API_VERSION EFFECT_MAKE_API_VERSION(3,0) + +#define AUDIO_EFFECT_LIBRARY_TAG ((('A') << 24) | (('E') << 16) | (('L') << 8) | ('T')) + +// Every effect library must have a data structure named AUDIO_EFFECT_LIBRARY_INFO_SYM +// and the fields of this data structure must begin with audio_effect_library_t + +typedef struct audio_effect_library_s { + // tag must be initialized to AUDIO_EFFECT_LIBRARY_TAG + uint32_t tag; + // Version of the effect library API : 0xMMMMmmmm MMMM: Major, mmmm: minor + uint32_t version; + // Name of this library + const char *name; + // Author/owner/implementor of the library + const char *implementor; + + //////////////////////////////////////////////////////////////////////////////// + // + // Function: create_effect + // + // Description: Creates an effect engine of the specified implementation uuid and + // returns an effect control interface on this engine. The function will allocate the + // resources for an instance of the requested effect engine and return + // a handle on the effect control interface. + // + // Input: + // uuid: pointer to the effect uuid. + // sessionId: audio session to which this effect instance will be attached. All effects + // created with the same session ID are connected in series and process the same signal + // stream. Knowing that two effects are part of the same effect chain can help the + // library implement some kind of optimizations. + // ioId: identifies the output or input stream this effect is directed to at audio HAL. + // For future use especially with tunneled HW accelerated effects + // + // Input/Output: + // pHandle: address where to return the effect interface handle. + // + // Output: + // returned value: 0 successful operation. + // -ENODEV library failed to initialize + // -EINVAL invalid pEffectUuid or pHandle + // -ENOENT no effect with this uuid found + // *pHandle: updated with the effect interface handle. + // + //////////////////////////////////////////////////////////////////////////////// + int32_t (*create_effect)(const effect_uuid_t *uuid, + int32_t sessionId, + int32_t ioId, + effect_handle_t *pHandle); + + //////////////////////////////////////////////////////////////////////////////// + // + // Function: release_effect + // + // Description: Releases the effect engine whose handle is given as argument. + // All resources allocated to this particular instance of the effect are + // released. + // + // Input: + // handle: handle on the effect interface to be released. + // + // Output: + // returned value: 0 successful operation. + // -ENODEV library failed to initialize + // -EINVAL invalid interface handle + // + //////////////////////////////////////////////////////////////////////////////// + int32_t (*release_effect)(effect_handle_t handle); + + //////////////////////////////////////////////////////////////////////////////// + // + // Function: get_descriptor + // + // Description: Returns the descriptor of the effect engine which implementation UUID is + // given as argument. + // + // Input/Output: + // uuid: pointer to the effect uuid. + // pDescriptor: address where to return the effect descriptor. + // + // Output: + // returned value: 0 successful operation. + // -ENODEV library failed to initialize + // -EINVAL invalid pDescriptor or uuid + // *pDescriptor: updated with the effect descriptor. + // + //////////////////////////////////////////////////////////////////////////////// + int32_t (*get_descriptor)(const effect_uuid_t *uuid, + effect_descriptor_t *pDescriptor); +} audio_effect_library_t; + +// Name of the hal_module_info +#define AUDIO_EFFECT_LIBRARY_INFO_SYM AELI + +// Name of the hal_module_info as a string +#define AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR "AELI" + +__END_DECLS + +#endif // ANDROID_AUDIO_EFFECT_H
diff --git a/bluez/android/hardware/bluetooth.h b/bluez/android/hardware/bluetooth.h new file mode 100644 index 0000000..c00a8f7 --- /dev/null +++ b/bluez/android/hardware/bluetooth.h
@@ -0,0 +1,470 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_BLUETOOTH_H +#define ANDROID_INCLUDE_BLUETOOTH_H + +#include <stdint.h> +#include <sys/cdefs.h> +#include <sys/types.h> + +#include <hardware/hardware.h> + +__BEGIN_DECLS + +/** + * The Bluetooth Hardware Module ID + */ + +#define BT_HARDWARE_MODULE_ID "bluetooth" +#define BT_STACK_MODULE_ID "bluetooth" +#define BT_STACK_TEST_MODULE_ID "bluetooth_test" + + +/* Bluetooth profile interface IDs */ + +#define BT_PROFILE_HANDSFREE_ID "handsfree" +#define BT_PROFILE_ADVANCED_AUDIO_ID "a2dp" +#define BT_PROFILE_HEALTH_ID "health" +#define BT_PROFILE_SOCKETS_ID "socket" +#define BT_PROFILE_HIDHOST_ID "hidhost" +#define BT_PROFILE_PAN_ID "pan" + +#define BT_PROFILE_GATT_ID "gatt" +#define BT_PROFILE_AV_RC_ID "avrcp" + +/** Bluetooth Address */ +typedef struct { + uint8_t address[6]; +} __attribute__((packed))bt_bdaddr_t; + +/** Bluetooth Device Name */ +typedef struct { + uint8_t name[249]; +} __attribute__((packed))bt_bdname_t; + +/** Bluetooth Adapter Visibility Modes*/ +typedef enum { + BT_SCAN_MODE_NONE, + BT_SCAN_MODE_CONNECTABLE, + BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE +} bt_scan_mode_t; + +/** Bluetooth Adapter State */ +typedef enum { + BT_STATE_OFF, + BT_STATE_ON +} bt_state_t; + +/** Bluetooth Error Status */ +/** We need to build on this */ + +typedef enum { + BT_STATUS_SUCCESS, + BT_STATUS_FAIL, + BT_STATUS_NOT_READY, + BT_STATUS_NOMEM, + BT_STATUS_BUSY, + BT_STATUS_DONE, /* request already completed */ + BT_STATUS_UNSUPPORTED, + BT_STATUS_PARM_INVALID, + BT_STATUS_UNHANDLED, + BT_STATUS_AUTH_FAILURE, + BT_STATUS_RMT_DEV_DOWN + +} bt_status_t; + +/** Bluetooth PinKey Code */ +typedef struct { + uint8_t pin[16]; +} __attribute__((packed))bt_pin_code_t; + +/** Bluetooth Adapter Discovery state */ +typedef enum { + BT_DISCOVERY_STOPPED, + BT_DISCOVERY_STARTED +} bt_discovery_state_t; + +/** Bluetooth ACL connection state */ +typedef enum { + BT_ACL_STATE_CONNECTED, + BT_ACL_STATE_DISCONNECTED +} bt_acl_state_t; + +/** Bluetooth 128-bit UUID */ +typedef struct { + uint8_t uu[16]; +} bt_uuid_t; + +/** Bluetooth SDP service record */ +typedef struct +{ + bt_uuid_t uuid; + uint16_t channel; + char name[256]; // what's the maximum length +} bt_service_record_t; + + +/** Bluetooth Remote Version info */ +typedef struct +{ + int version; + int sub_ver; + int manufacturer; +} bt_remote_version_t; + +/* Bluetooth Adapter and Remote Device property types */ +typedef enum { + /* Properties common to both adapter and remote device */ + /** + * Description - Bluetooth Device Name + * Access mode - Adapter name can be GET/SET. Remote device can be GET + * Data type - bt_bdname_t + */ + BT_PROPERTY_BDNAME = 0x1, + /** + * Description - Bluetooth Device Address + * Access mode - Only GET. + * Data type - bt_bdaddr_t + */ + BT_PROPERTY_BDADDR, + /** + * Description - Bluetooth Service 128-bit UUIDs + * Access mode - Only GET. + * Data type - Array of bt_uuid_t (Array size inferred from property length). + */ + BT_PROPERTY_UUIDS, + /** + * Description - Bluetooth Class of Device as found in Assigned Numbers + * Access mode - Only GET. + * Data type - uint32_t. + */ + BT_PROPERTY_CLASS_OF_DEVICE, + /** + * Description - Device Type - BREDR, BLE or DUAL Mode + * Access mode - Only GET. + * Data type - bt_device_type_t + */ + BT_PROPERTY_TYPE_OF_DEVICE, + /** + * Description - Bluetooth Service Record + * Access mode - Only GET. + * Data type - bt_service_record_t + */ + BT_PROPERTY_SERVICE_RECORD, + + /* Properties unique to adapter */ + /** + * Description - Bluetooth Adapter scan mode + * Access mode - GET and SET + * Data type - bt_scan_mode_t. + */ + BT_PROPERTY_ADAPTER_SCAN_MODE, + /** + * Description - List of bonded devices + * Access mode - Only GET. + * Data type - Array of bt_bdaddr_t of the bonded remote devices + * (Array size inferred from property length). + */ + BT_PROPERTY_ADAPTER_BONDED_DEVICES, + /** + * Description - Bluetooth Adapter Discovery timeout (in seconds) + * Access mode - GET and SET + * Data type - uint32_t + */ + BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT, + + /* Properties unique to remote device */ + /** + * Description - User defined friendly name of the remote device + * Access mode - GET and SET + * Data type - bt_bdname_t. + */ + BT_PROPERTY_REMOTE_FRIENDLY_NAME, + /** + * Description - RSSI value of the inquired remote device + * Access mode - Only GET. + * Data type - int32_t. + */ + BT_PROPERTY_REMOTE_RSSI, + /** + * Description - Remote version info + * Access mode - SET/GET. + * Data type - bt_remote_version_t. + */ + + BT_PROPERTY_REMOTE_VERSION_INFO, + + BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP = 0xFF, +} bt_property_type_t; + +/** Bluetooth Adapter Property data structure */ +typedef struct +{ + bt_property_type_t type; + int len; + void *val; +} bt_property_t; + +/** Bluetooth Device Type */ +typedef enum { + BT_DEVICE_DEVTYPE_BREDR = 0x1, + BT_DEVICE_DEVTYPE_BLE, + BT_DEVICE_DEVTYPE_DUAL +} bt_device_type_t; +/** Bluetooth Bond state */ +typedef enum { + BT_BOND_STATE_NONE, + BT_BOND_STATE_BONDING, + BT_BOND_STATE_BONDED +} bt_bond_state_t; + +/** Bluetooth SSP Bonding Variant */ +typedef enum { + BT_SSP_VARIANT_PASSKEY_CONFIRMATION, + BT_SSP_VARIANT_PASSKEY_ENTRY, + BT_SSP_VARIANT_CONSENT, + BT_SSP_VARIANT_PASSKEY_NOTIFICATION +} bt_ssp_variant_t; + +#define BT_MAX_NUM_UUIDS 32 + +/** Bluetooth Interface callbacks */ + +/** Bluetooth Enable/Disable Callback. */ +typedef void (*adapter_state_changed_callback)(bt_state_t state); + +/** GET/SET Adapter Properties callback */ +/* TODO: For the GET/SET property APIs/callbacks, we may need a session + * identifier to associate the call with the callback. This would be needed + * whenever more than one simultaneous instance of the same adapter_type + * is get/set. + * + * If this is going to be handled in the Java framework, then we do not need + * to manage sessions here. + */ +typedef void (*adapter_properties_callback)(bt_status_t status, + int num_properties, + bt_property_t *properties); + +/** GET/SET Remote Device Properties callback */ +/** TODO: For remote device properties, do not see a need to get/set + * multiple properties - num_properties shall be 1 + */ +typedef void (*remote_device_properties_callback)(bt_status_t status, + bt_bdaddr_t *bd_addr, + int num_properties, + bt_property_t *properties); + +/** New device discovered callback */ +/** If EIR data is not present, then BD_NAME and RSSI shall be NULL and -1 + * respectively */ +typedef void (*device_found_callback)(int num_properties, + bt_property_t *properties); + +/** Discovery state changed callback */ +typedef void (*discovery_state_changed_callback)(bt_discovery_state_t state); + +/** Bluetooth Legacy PinKey Request callback */ +typedef void (*pin_request_callback)(bt_bdaddr_t *remote_bd_addr, + bt_bdname_t *bd_name, uint32_t cod); + +/** Bluetooth SSP Request callback - Just Works & Numeric Comparison*/ +/** pass_key - Shall be 0 for BT_SSP_PAIRING_VARIANT_CONSENT & + * BT_SSP_PAIRING_PASSKEY_ENTRY */ +/* TODO: Passkey request callback shall not be needed for devices with display + * capability. We still need support this in the stack for completeness */ +typedef void (*ssp_request_callback)(bt_bdaddr_t *remote_bd_addr, + bt_bdname_t *bd_name, + uint32_t cod, + bt_ssp_variant_t pairing_variant, + uint32_t pass_key); + +/** Bluetooth Bond state changed callback */ +/* Invoked in response to create_bond, cancel_bond or remove_bond */ +typedef void (*bond_state_changed_callback)(bt_status_t status, + bt_bdaddr_t *remote_bd_addr, + bt_bond_state_t state); + +/** Bluetooth ACL connection state changed callback */ +typedef void (*acl_state_changed_callback)(bt_status_t status, bt_bdaddr_t *remote_bd_addr, + bt_acl_state_t state); + +typedef enum { + ASSOCIATE_JVM, + DISASSOCIATE_JVM +} bt_cb_thread_evt; + +/** Thread Associate/Disassociate JVM Callback */ +/* Callback that is invoked by the callback thread to allow upper layer to attach/detach to/from + * the JVM */ +typedef void (*callback_thread_event)(bt_cb_thread_evt evt); + +/** Bluetooth Test Mode Callback */ +/* Receive any HCI event from controller. Must be in DUT Mode for this callback to be received */ +typedef void (*dut_mode_recv_callback)(uint16_t opcode, uint8_t *buf, uint8_t len); + +/* LE Test mode callbacks +* This callback shall be invoked whenever the le_tx_test, le_rx_test or le_test_end is invoked +* The num_packets is valid only for le_test_end command */ +typedef void (*le_test_mode_callback)(bt_status_t status, uint16_t num_packets); +/** TODO: Add callbacks for Link Up/Down and other generic + * notifications/callbacks */ + +/** Bluetooth DM callback structure. */ +typedef struct { + /** set to sizeof(bt_callbacks_t) */ + size_t size; + adapter_state_changed_callback adapter_state_changed_cb; + adapter_properties_callback adapter_properties_cb; + remote_device_properties_callback remote_device_properties_cb; + device_found_callback device_found_cb; + discovery_state_changed_callback discovery_state_changed_cb; + pin_request_callback pin_request_cb; + ssp_request_callback ssp_request_cb; + bond_state_changed_callback bond_state_changed_cb; + acl_state_changed_callback acl_state_changed_cb; + callback_thread_event thread_evt_cb; + dut_mode_recv_callback dut_mode_recv_cb; + le_test_mode_callback le_test_mode_cb; +} bt_callbacks_t; + +/** NOTE: By default, no profiles are initialized at the time of init/enable. + * Whenever the application invokes the 'init' API of a profile, then one of + * the following shall occur: + * + * 1.) If Bluetooth is not enabled, then the Bluetooth core shall mark the + * profile as enabled. Subsequently, when the application invokes the + * Bluetooth 'enable', as part of the enable sequence the profile that were + * marked shall be enabled by calling appropriate stack APIs. The + * 'adapter_properties_cb' shall return the list of UUIDs of the + * enabled profiles. + * + * 2.) If Bluetooth is enabled, then the Bluetooth core shall invoke the stack + * profile API to initialize the profile and trigger a + * 'adapter_properties_cb' with the current list of UUIDs including the + * newly added profile's UUID. + * + * The reverse shall occur whenever the profile 'cleanup' APIs are invoked + */ + +/** Represents the standard Bluetooth DM interface. */ +typedef struct { + /** set to sizeof(bt_interface_t) */ + size_t size; + /** + * Opens the interface and provides the callback routines + * to the implemenation of this interface. + */ + int (*init)(bt_callbacks_t* callbacks ); + + /** Enable Bluetooth. */ + int (*enable)(void); + + /** Disable Bluetooth. */ + int (*disable)(void); + + /** Closes the interface. */ + void (*cleanup)(void); + + /** Get all Bluetooth Adapter properties at init */ + int (*get_adapter_properties)(void); + + /** Get Bluetooth Adapter property of 'type' */ + int (*get_adapter_property)(bt_property_type_t type); + + /** Set Bluetooth Adapter property of 'type' */ + /* Based on the type, val shall be one of + * bt_bdaddr_t or bt_bdname_t or bt_scanmode_t etc + */ + int (*set_adapter_property)(const bt_property_t *property); + + /** Get all Remote Device properties */ + int (*get_remote_device_properties)(bt_bdaddr_t *remote_addr); + + /** Get Remote Device property of 'type' */ + int (*get_remote_device_property)(bt_bdaddr_t *remote_addr, + bt_property_type_t type); + + /** Set Remote Device property of 'type' */ + int (*set_remote_device_property)(bt_bdaddr_t *remote_addr, + const bt_property_t *property); + + /** Get Remote Device's service record for the given UUID */ + int (*get_remote_service_record)(bt_bdaddr_t *remote_addr, + bt_uuid_t *uuid); + + /** Start SDP to get remote services */ + int (*get_remote_services)(bt_bdaddr_t *remote_addr); + + /** Start Discovery */ + int (*start_discovery)(void); + + /** Cancel Discovery */ + int (*cancel_discovery)(void); + + /** Create Bluetooth Bonding */ + int (*create_bond)(const bt_bdaddr_t *bd_addr); + + /** Remove Bond */ + int (*remove_bond)(const bt_bdaddr_t *bd_addr); + + /** Cancel Bond */ + int (*cancel_bond)(const bt_bdaddr_t *bd_addr); + + /** BT Legacy PinKey Reply */ + /** If accept==FALSE, then pin_len and pin_code shall be 0x0 */ + int (*pin_reply)(const bt_bdaddr_t *bd_addr, uint8_t accept, + uint8_t pin_len, bt_pin_code_t *pin_code); + + /** BT SSP Reply - Just Works, Numeric Comparison and Passkey + * passkey shall be zero for BT_SSP_VARIANT_PASSKEY_COMPARISON & + * BT_SSP_VARIANT_CONSENT + * For BT_SSP_VARIANT_PASSKEY_ENTRY, if accept==FALSE, then passkey + * shall be zero */ + int (*ssp_reply)(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t variant, + uint8_t accept, uint32_t passkey); + + /** Get Bluetooth profile interface */ + const void* (*get_profile_interface) (const char *profile_id); + + /** Bluetooth Test Mode APIs - Bluetooth must be enabled for these APIs */ + /* Configure DUT Mode - Use this mode to enter/exit DUT mode */ + int (*dut_mode_configure)(uint8_t enable); + + /* Send any test HCI (vendor-specific) command to the controller. Must be in DUT Mode */ + int (*dut_mode_send)(uint16_t opcode, uint8_t *buf, uint8_t len); + /** BLE Test Mode APIs */ + /* opcode MUST be one of: LE_Receiver_Test, LE_Transmitter_Test, LE_Test_End */ + int (*le_test_mode)(uint16_t opcode, uint8_t *buf, uint8_t len); + + /* enable or disable bluetooth HCI snoop log */ + int (*config_hci_snoop_log)(uint8_t enable); +} bt_interface_t; + +/** TODO: Need to add APIs for Service Discovery, Service authorization and + * connection management. Also need to add APIs for configuring + * properties of remote bonded devices such as name, UUID etc. */ + +typedef struct { + struct hw_device_t common; + const bt_interface_t* (*get_bluetooth_interface)(); +} bluetooth_device_t; + +typedef bluetooth_device_t bluetooth_module_t; +__END_DECLS + +#endif /* ANDROID_INCLUDE_BLUETOOTH_H */
diff --git a/bluez/android/hardware/bt_av.h b/bluez/android/hardware/bt_av.h new file mode 100644 index 0000000..2ec00c3 --- /dev/null +++ b/bluez/android/hardware/bt_av.h
@@ -0,0 +1,90 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_BT_AV_H +#define ANDROID_INCLUDE_BT_AV_H + +__BEGIN_DECLS + +/* Bluetooth AV connection states */ +typedef enum { + BTAV_CONNECTION_STATE_DISCONNECTED = 0, + BTAV_CONNECTION_STATE_CONNECTING, + BTAV_CONNECTION_STATE_CONNECTED, + BTAV_CONNECTION_STATE_DISCONNECTING +} btav_connection_state_t; + +/* Bluetooth AV datapath states */ +typedef enum { + BTAV_AUDIO_STATE_REMOTE_SUSPEND = 0, + BTAV_AUDIO_STATE_STOPPED, + BTAV_AUDIO_STATE_STARTED, +} btav_audio_state_t; + + +/** Callback for connection state change. + * state will have one of the values from btav_connection_state_t + */ +typedef void (* btav_connection_state_callback)(btav_connection_state_t state, + bt_bdaddr_t *bd_addr); + +/** Callback for audiopath state change. + * state will have one of the values from btav_audio_state_t + */ +typedef void (* btav_audio_state_callback)(btav_audio_state_t state, + bt_bdaddr_t *bd_addr); + +/** BT-AV callback structure. */ +typedef struct { + /** set to sizeof(btav_callbacks_t) */ + size_t size; + btav_connection_state_callback connection_state_cb; + btav_audio_state_callback audio_state_cb; +} btav_callbacks_t; + +/** + * NOTE: + * + * 1. AVRCP 1.0 shall be supported initially. AVRCP passthrough commands + * shall be handled internally via uinput + * + * 2. A2DP data path shall be handled via a socket pipe between the AudioFlinger + * android_audio_hw library and the Bluetooth stack. + * + */ +/** Represents the standard BT-AV interface. */ +typedef struct { + + /** set to sizeof(btav_interface_t) */ + size_t size; + /** + * Register the BtAv callbacks + */ + bt_status_t (*init)( btav_callbacks_t* callbacks ); + + /** connect to headset */ + bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); + + /** dis-connect from headset */ + bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); + + /** Closes the interface. */ + void (*cleanup)( void ); +} btav_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_AV_H */
diff --git a/bluez/android/hardware/bt_gatt.h b/bluez/android/hardware/bt_gatt.h new file mode 100644 index 0000000..42e14c2 --- /dev/null +++ b/bluez/android/hardware/bt_gatt.h
@@ -0,0 +1,61 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef ANDROID_INCLUDE_BT_GATT_H +#define ANDROID_INCLUDE_BT_GATT_H + +#include <stdint.h> +#include "bt_gatt_client.h" +#include "bt_gatt_server.h" + +__BEGIN_DECLS + +/** BT-GATT callbacks */ +typedef struct { + /** Set to sizeof(btgatt_callbacks_t) */ + size_t size; + + /** GATT Client callbacks */ + const btgatt_client_callbacks_t* client; + + /** GATT Server callbacks */ + const btgatt_server_callbacks_t* server; +} btgatt_callbacks_t; + +/** Represents the standard Bluetooth GATT interface. */ +typedef struct { + /** Set to sizeof(btgatt_interface_t) */ + size_t size; + + /** + * Initializes the interface and provides callback routines + */ + bt_status_t (*init)( const btgatt_callbacks_t* callbacks ); + + /** Closes the interface */ + void (*cleanup)( void ); + + /** Pointer to the GATT client interface methods.*/ + const btgatt_client_interface_t* client; + + /** Pointer to the GATT server interface methods.*/ + const btgatt_server_interface_t* server; +} btgatt_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_GATT_H */
diff --git a/bluez/android/hardware/bt_gatt_client.h b/bluez/android/hardware/bt_gatt_client.h new file mode 100644 index 0000000..d6b0cb4 --- /dev/null +++ b/bluez/android/hardware/bt_gatt_client.h
@@ -0,0 +1,289 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef ANDROID_INCLUDE_BT_GATT_CLIENT_H +#define ANDROID_INCLUDE_BT_GATT_CLIENT_H + +#include <stdint.h> +#include "bt_gatt_types.h" + +__BEGIN_DECLS + +/** + * Buffer sizes for maximum attribute length and maximum read/write + * operation buffer size. + */ +#define BTGATT_MAX_ATTR_LEN 600 + +/** Buffer type for unformatted reads/writes */ +typedef struct +{ + uint8_t value[BTGATT_MAX_ATTR_LEN]; + uint16_t len; +} btgatt_unformatted_value_t; + +/** Parameters for GATT read operations */ +typedef struct +{ + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + btgatt_gatt_id_t descr_id; + btgatt_unformatted_value_t value; + uint16_t value_type; + uint8_t status; +} btgatt_read_params_t; + +/** Parameters for GATT write operations */ +typedef struct +{ + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + btgatt_gatt_id_t descr_id; + uint8_t status; +} btgatt_write_params_t; + +/** Attribute change notification parameters */ +typedef struct +{ + uint8_t value[BTGATT_MAX_ATTR_LEN]; + bt_bdaddr_t bda; + btgatt_srvc_id_t srvc_id; + btgatt_gatt_id_t char_id; + uint16_t len; + uint8_t is_notify; +} btgatt_notify_params_t; + +typedef struct +{ + bt_bdaddr_t *bda1; + bt_uuid_t *uuid1; + uint16_t u1; + uint16_t u2; + uint16_t u3; + uint16_t u4; + uint16_t u5; +} btgatt_test_params_t; + +/** BT-GATT Client callback structure. */ + +/** Callback invoked in response to register_client */ +typedef void (*register_client_callback)(int status, int client_if, + bt_uuid_t *app_uuid); + +/** Callback for scan results */ +typedef void (*scan_result_callback)(bt_bdaddr_t* bda, int rssi, uint8_t* adv_data); + +/** GATT open callback invoked in response to open */ +typedef void (*connect_callback)(int conn_id, int status, int client_if, bt_bdaddr_t* bda); + +/** Callback invoked in response to close */ +typedef void (*disconnect_callback)(int conn_id, int status, + int client_if, bt_bdaddr_t* bda); + +/** + * Invoked in response to search_service when the GATT service search + * has been completed. + */ +typedef void (*search_complete_callback)(int conn_id, int status); + +/** Reports GATT services on a remote device */ +typedef void (*search_result_callback)( int conn_id, btgatt_srvc_id_t *srvc_id); + +/** GATT characteristic enumeration result callback */ +typedef void (*get_characteristic_callback)(int conn_id, int status, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, + int char_prop); + +/** GATT descriptor enumeration result callback */ +typedef void (*get_descriptor_callback)(int conn_id, int status, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, + btgatt_gatt_id_t *descr_id); + +/** GATT included service enumeration result callback */ +typedef void (*get_included_service_callback)(int conn_id, int status, + btgatt_srvc_id_t *srvc_id, btgatt_srvc_id_t *incl_srvc_id); + +/** Callback invoked in response to [de]register_for_notification */ +typedef void (*register_for_notification_callback)(int conn_id, + int registered, int status, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id); + +/** + * Remote device notification callback, invoked when a remote device sends + * a notification or indication that a client has registered for. + */ +typedef void (*notify_callback)(int conn_id, btgatt_notify_params_t *p_data); + +/** Reports result of a GATT read operation */ +typedef void (*read_characteristic_callback)(int conn_id, int status, + btgatt_read_params_t *p_data); + +/** GATT write characteristic operation callback */ +typedef void (*write_characteristic_callback)(int conn_id, int status, + btgatt_write_params_t *p_data); + +/** GATT execute prepared write callback */ +typedef void (*execute_write_callback)(int conn_id, int status); + +/** Callback invoked in response to read_descriptor */ +typedef void (*read_descriptor_callback)(int conn_id, int status, + btgatt_read_params_t *p_data); + +/** Callback invoked in response to write_descriptor */ +typedef void (*write_descriptor_callback)(int conn_id, int status, + btgatt_write_params_t *p_data); + +/** Callback triggered in response to read_remote_rssi */ +typedef void (*read_remote_rssi_callback)(int client_if, bt_bdaddr_t* bda, + int rssi, int status); + +/** + * Callback indicationg the status of a listen() operation + */ +typedef void (*listen_callback)(int status, int server_if); + +typedef struct { + register_client_callback register_client_cb; + scan_result_callback scan_result_cb; + connect_callback open_cb; + disconnect_callback close_cb; + search_complete_callback search_complete_cb; + search_result_callback search_result_cb; + get_characteristic_callback get_characteristic_cb; + get_descriptor_callback get_descriptor_cb; + get_included_service_callback get_included_service_cb; + register_for_notification_callback register_for_notification_cb; + notify_callback notify_cb; + read_characteristic_callback read_characteristic_cb; + write_characteristic_callback write_characteristic_cb; + read_descriptor_callback read_descriptor_cb; + write_descriptor_callback write_descriptor_cb; + execute_write_callback execute_write_cb; + read_remote_rssi_callback read_remote_rssi_cb; + listen_callback listen_cb; +} btgatt_client_callbacks_t; + +/** Represents the standard BT-GATT client interface. */ + +typedef struct { + /** Registers a GATT client application with the stack */ + bt_status_t (*register_client)( bt_uuid_t *uuid ); + + /** Unregister a client application from the stack */ + bt_status_t (*unregister_client)(int client_if ); + + /** Start or stop LE device scanning */ + bt_status_t (*scan)( int client_if, bool start ); + + /** Create a connection to a remote LE or dual-mode device */ + bt_status_t (*connect)( int client_if, const bt_bdaddr_t *bd_addr, + bool is_direct ); + + /** Disconnect a remote device or cancel a pending connection */ + bt_status_t (*disconnect)( int client_if, const bt_bdaddr_t *bd_addr, + int conn_id); + + /** Start or stop advertisements to listen for incoming connections */ + bt_status_t (*listen)(int client_if, bool start); + + /** Clear the attribute cache for a given device */ + bt_status_t (*refresh)( int client_if, const bt_bdaddr_t *bd_addr ); + + /** + * Enumerate all GATT services on a connected device. + * Optionally, the results can be filtered for a given UUID. + */ + bt_status_t (*search_service)(int conn_id, bt_uuid_t *filter_uuid ); + + /** + * Enumerate included services for a given service. + * Set start_incl_srvc_id to NULL to get the first included service. + */ + bt_status_t (*get_included_service)( int conn_id, btgatt_srvc_id_t *srvc_id, + btgatt_srvc_id_t *start_incl_srvc_id); + + /** + * Enumerate characteristics for a given service. + * Set start_char_id to NULL to get the first characteristic. + */ + bt_status_t (*get_characteristic)( int conn_id, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *start_char_id); + + /** + * Enumerate descriptors for a given characteristic. + * Set start_descr_id to NULL to get the first descriptor. + */ + bt_status_t (*get_descriptor)( int conn_id, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, + btgatt_gatt_id_t *start_descr_id); + + /** Read a characteristic on a remote device */ + bt_status_t (*read_characteristic)( int conn_id, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, + int auth_req ); + + /** Write a remote characteristic */ + bt_status_t (*write_characteristic)(int conn_id, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, + int write_type, int len, int auth_req, + char* p_value); + + /** Read the descriptor for a given characteristic */ + bt_status_t (*read_descriptor)(int conn_id, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, + btgatt_gatt_id_t *descr_id, int auth_req); + + /** Write a remote descriptor for a given characteristic */ + bt_status_t (*write_descriptor)( int conn_id, + btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, + btgatt_gatt_id_t *descr_id, int write_type, int len, + int auth_req, char* p_value); + + /** Execute a prepared write operation */ + bt_status_t (*execute_write)(int conn_id, int execute); + + /** + * Register to receive notifications or indications for a given + * characteristic + */ + bt_status_t (*register_for_notification)( int client_if, + const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id); + + /** Deregister a previous request for notifications/indications */ + bt_status_t (*deregister_for_notification)( int client_if, + const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id, + btgatt_gatt_id_t *char_id); + + /** Request RSSI for a given remote device */ + bt_status_t (*read_remote_rssi)( int client_if, const bt_bdaddr_t *bd_addr); + + /** Determine the type of the remote device (LE, BR/EDR, Dual-mode) */ + int (*get_device_type)( const bt_bdaddr_t *bd_addr ); + + /** Set the advertising data or scan response data */ + bt_status_t (*set_adv_data)(int server_if, bool set_scan_rsp, bool include_name, + bool include_txpower, int min_interval, int max_interval, int appearance, + uint16_t manufacturer_len, char* manufacturer_data); + + /** Test mode interface */ + bt_status_t (*test_command)( int command, btgatt_test_params_t* params); +} btgatt_client_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_GATT_CLIENT_H */
diff --git a/bluez/android/hardware/bt_gatt_server.h b/bluez/android/hardware/bt_gatt_server.h new file mode 100644 index 0000000..1a5a400 --- /dev/null +++ b/bluez/android/hardware/bt_gatt_server.h
@@ -0,0 +1,175 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef ANDROID_INCLUDE_BT_GATT_SERVER_H +#define ANDROID_INCLUDE_BT_GATT_SERVER_H + +#include <stdint.h> + +#include "bt_gatt_types.h" + +__BEGIN_DECLS + +/** GATT value type used in response to remote read requests */ +typedef struct +{ + uint8_t value[BTGATT_MAX_ATTR_LEN]; + uint16_t handle; + uint16_t offset; + uint16_t len; + uint8_t auth_req; +} btgatt_value_t; + +/** GATT remote read request response type */ +typedef union +{ + btgatt_value_t attr_value; + uint16_t handle; +} btgatt_response_t; + +/** BT-GATT Server callback structure. */ + +/** Callback invoked in response to register_server */ +typedef void (*register_server_callback)(int status, int server_if, + bt_uuid_t *app_uuid); + +/** Callback indicating that a remote device has connected or been disconnected */ +typedef void (*connection_callback)(int conn_id, int server_if, int connected, + bt_bdaddr_t *bda); + +/** Callback invoked in response to create_service */ +typedef void (*service_added_callback)(int status, int server_if, + btgatt_srvc_id_t *srvc_id, int srvc_handle); + +/** Callback indicating that an included service has been added to a service */ +typedef void (*included_service_added_callback)(int status, int server_if, + int srvc_handle, int incl_srvc_handle); + +/** Callback invoked when a characteristic has been added to a service */ +typedef void (*characteristic_added_callback)(int status, int server_if, + bt_uuid_t *uuid, int srvc_handle, int char_handle); + +/** Callback invoked when a descriptor has been added to a characteristic */ +typedef void (*descriptor_added_callback)(int status, int server_if, + bt_uuid_t *uuid, int srvc_handle, int descr_handle); + +/** Callback invoked in response to start_service */ +typedef void (*service_started_callback)(int status, int server_if, + int srvc_handle); + +/** Callback invoked in response to stop_service */ +typedef void (*service_stopped_callback)(int status, int server_if, + int srvc_handle); + +/** Callback triggered when a service has been deleted */ +typedef void (*service_deleted_callback)(int status, int server_if, + int srvc_handle); + +/** + * Callback invoked when a remote device has requested to read a characteristic + * or descriptor. The application must respond by calling send_response + */ +typedef void (*request_read_callback)(int conn_id, int trans_id, bt_bdaddr_t *bda, + int attr_handle, int offset, bool is_long); + +/** + * Callback invoked when a remote device has requested to write to a + * characteristic or descriptor. + */ +typedef void (*request_write_callback)(int conn_id, int trans_id, bt_bdaddr_t *bda, + int attr_handle, int offset, int length, + bool need_rsp, bool is_prep, uint8_t* value); + +/** Callback invoked when a previously prepared write is to be executed */ +typedef void (*request_exec_write_callback)(int conn_id, int trans_id, + bt_bdaddr_t *bda, int exec_write); + +/** + * Callback triggered in response to send_response if the remote device + * sends a confirmation. + */ +typedef void (*response_confirmation_callback)(int status, int handle); + +typedef struct { + register_server_callback register_server_cb; + connection_callback connection_cb; + service_added_callback service_added_cb; + included_service_added_callback included_service_added_cb; + characteristic_added_callback characteristic_added_cb; + descriptor_added_callback descriptor_added_cb; + service_started_callback service_started_cb; + service_stopped_callback service_stopped_cb; + service_deleted_callback service_deleted_cb; + request_read_callback request_read_cb; + request_write_callback request_write_cb; + request_exec_write_callback request_exec_write_cb; + response_confirmation_callback response_confirmation_cb; +} btgatt_server_callbacks_t; + +/** Represents the standard BT-GATT server interface. */ +typedef struct { + /** Registers a GATT server application with the stack */ + bt_status_t (*register_server)( bt_uuid_t *uuid ); + + /** Unregister a server application from the stack */ + bt_status_t (*unregister_server)(int server_if ); + + /** Create a connection to a remote peripheral */ + bt_status_t (*connect)(int server_if, const bt_bdaddr_t *bd_addr, bool is_direct ); + + /** Disconnect an established connection or cancel a pending one */ + bt_status_t (*disconnect)(int server_if, const bt_bdaddr_t *bd_addr, + int conn_id ); + + /** Create a new service */ + bt_status_t (*add_service)( int server_if, btgatt_srvc_id_t *srvc_id, int num_handles); + + /** Assign an included service to it's parent service */ + bt_status_t (*add_included_service)( int server_if, int service_handle, int included_handle); + + /** Add a characteristic to a service */ + bt_status_t (*add_characteristic)( int server_if, + int service_handle, bt_uuid_t *uuid, + int properties, int permissions); + + /** Add a descriptor to a given service */ + bt_status_t (*add_descriptor)(int server_if, int service_handle, + bt_uuid_t *uuid, int permissions); + + /** Starts a local service */ + bt_status_t (*start_service)(int server_if, int service_handle, + int transport); + + /** Stops a local service */ + bt_status_t (*stop_service)(int server_if, int service_handle); + + /** Delete a local service */ + bt_status_t (*delete_service)(int server_if, int service_handle); + + /** Send value indication to a remote device */ + bt_status_t (*send_indication)(int server_if, int attribute_handle, + int conn_id, int len, int confirm, + char* p_value); + + /** Send a response to a read/write operation */ + bt_status_t (*send_response)(int conn_id, int trans_id, + int status, btgatt_response_t *response); +} btgatt_server_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_GATT_CLIENT_H */
diff --git a/bluez/android/hardware/bt_gatt_types.h b/bluez/android/hardware/bt_gatt_types.h new file mode 100644 index 0000000..0ac217e --- /dev/null +++ b/bluez/android/hardware/bt_gatt_types.h
@@ -0,0 +1,48 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef ANDROID_INCLUDE_BT_GATT_TYPES_H +#define ANDROID_INCLUDE_BT_GATT_TYPES_H + +#include <stdint.h> +#include <stdbool.h> + +__BEGIN_DECLS + +/** + * GATT Service types + */ +#define BTGATT_SERVICE_TYPE_PRIMARY 0 +#define BTGATT_SERVICE_TYPE_SECONDARY 1 + +/** GATT ID adding instance id tracking to the UUID */ +typedef struct +{ + bt_uuid_t uuid; + uint8_t inst_id; +} btgatt_gatt_id_t; + +/** GATT Service ID also identifies the service type (primary/secondary) */ +typedef struct +{ + btgatt_gatt_id_t id; + uint8_t is_primary; +} btgatt_srvc_id_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_GATT_TYPES_H */
diff --git a/bluez/android/hardware/bt_hf.h b/bluez/android/hardware/bt_hf.h new file mode 100644 index 0000000..6135ac4 --- /dev/null +++ b/bluez/android/hardware/bt_hf.h
@@ -0,0 +1,284 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_BT_HF_H +#define ANDROID_INCLUDE_BT_HF_H + +__BEGIN_DECLS + +/* AT response code - OK/Error */ +typedef enum { + BTHF_AT_RESPONSE_ERROR = 0, + BTHF_AT_RESPONSE_OK +} bthf_at_response_t; + +typedef enum { + BTHF_CONNECTION_STATE_DISCONNECTED = 0, + BTHF_CONNECTION_STATE_CONNECTING, + BTHF_CONNECTION_STATE_CONNECTED, + BTHF_CONNECTION_STATE_SLC_CONNECTED, + BTHF_CONNECTION_STATE_DISCONNECTING +} bthf_connection_state_t; + +typedef enum { + BTHF_AUDIO_STATE_DISCONNECTED = 0, + BTHF_AUDIO_STATE_CONNECTING, + BTHF_AUDIO_STATE_CONNECTED, + BTHF_AUDIO_STATE_DISCONNECTING +} bthf_audio_state_t; + +typedef enum { + BTHF_VR_STATE_STOPPED = 0, + BTHF_VR_STATE_STARTED +} bthf_vr_state_t; + +typedef enum { + BTHF_VOLUME_TYPE_SPK = 0, + BTHF_VOLUME_TYPE_MIC +} bthf_volume_type_t; + +/* Noise Reduction and Echo Cancellation */ +typedef enum +{ + BTHF_NREC_STOP, + BTHF_NREC_START +} bthf_nrec_t; + +/* CHLD - Call held handling */ +typedef enum +{ + BTHF_CHLD_TYPE_RELEASEHELD, // Terminate all held or set UDUB("busy") to a waiting call + BTHF_CHLD_TYPE_RELEASEACTIVE_ACCEPTHELD, // Terminate all active calls and accepts a waiting/held call + BTHF_CHLD_TYPE_HOLDACTIVE_ACCEPTHELD, // Hold all active calls and accepts a waiting/held call + BTHF_CHLD_TYPE_ADDHELDTOCONF, // Add all held calls to a conference +} bthf_chld_type_t; + +/** Callback for connection state change. + * state will have one of the values from BtHfConnectionState + */ +typedef void (* bthf_connection_state_callback)(bthf_connection_state_t state, bt_bdaddr_t *bd_addr); + +/** Callback for audio connection state change. + * state will have one of the values from BtHfAudioState + */ +typedef void (* bthf_audio_state_callback)(bthf_audio_state_t state, bt_bdaddr_t *bd_addr); + +/** Callback for VR connection state change. + * state will have one of the values from BtHfVRState + */ +typedef void (* bthf_vr_cmd_callback)(bthf_vr_state_t state); + +/** Callback for answer incoming call (ATA) + */ +typedef void (* bthf_answer_call_cmd_callback)(); + +/** Callback for disconnect call (AT+CHUP) + */ +typedef void (* bthf_hangup_call_cmd_callback)(); + +/** Callback for disconnect call (AT+CHUP) + * type will denote Speaker/Mic gain (BtHfVolumeControl). + */ +typedef void (* bthf_volume_cmd_callback)(bthf_volume_type_t type, int volume); + +/** Callback for dialing an outgoing call + * If number is NULL, redial + */ +typedef void (* bthf_dial_call_cmd_callback)(char *number); + +/** Callback for sending DTMF tones + * tone contains the dtmf character to be sent + */ +typedef void (* bthf_dtmf_cmd_callback)(char tone); + +/** Callback for enabling/disabling noise reduction/echo cancellation + * value will be 1 to enable, 0 to disable + */ +typedef void (* bthf_nrec_cmd_callback)(bthf_nrec_t nrec); + +/** Callback for call hold handling (AT+CHLD) + * value will contain the call hold command (0, 1, 2, 3) + */ +typedef void (* bthf_chld_cmd_callback)(bthf_chld_type_t chld); + +/** Callback for CNUM (subscriber number) + */ +typedef void (* bthf_cnum_cmd_callback)(); + +/** Callback for indicators (CIND) + */ +typedef void (* bthf_cind_cmd_callback)(); + +/** Callback for operator selection (COPS) + */ +typedef void (* bthf_cops_cmd_callback)(); + +/** Callback for call list (AT+CLCC) + */ +typedef void (* bthf_clcc_cmd_callback) (); + +/** Callback for unknown AT command recd from HF + * at_string will contain the unparsed AT string + */ +typedef void (* bthf_unknown_at_cmd_callback)(char *at_string); + +/** Callback for keypressed (HSP) event. + */ +typedef void (* bthf_key_pressed_cmd_callback)(); + +/** BT-HF callback structure. */ +typedef struct { + /** set to sizeof(BtHfCallbacks) */ + size_t size; + bthf_connection_state_callback connection_state_cb; + bthf_audio_state_callback audio_state_cb; + bthf_vr_cmd_callback vr_cmd_cb; + bthf_answer_call_cmd_callback answer_call_cmd_cb; + bthf_hangup_call_cmd_callback hangup_call_cmd_cb; + bthf_volume_cmd_callback volume_cmd_cb; + bthf_dial_call_cmd_callback dial_call_cmd_cb; + bthf_dtmf_cmd_callback dtmf_cmd_cb; + bthf_nrec_cmd_callback nrec_cmd_cb; + bthf_chld_cmd_callback chld_cmd_cb; + bthf_cnum_cmd_callback cnum_cmd_cb; + bthf_cind_cmd_callback cind_cmd_cb; + bthf_cops_cmd_callback cops_cmd_cb; + bthf_clcc_cmd_callback clcc_cmd_cb; + bthf_unknown_at_cmd_callback unknown_at_cmd_cb; + bthf_key_pressed_cmd_callback key_pressed_cmd_cb; +} bthf_callbacks_t; + +/** Network Status */ +typedef enum +{ + BTHF_NETWORK_STATE_NOT_AVAILABLE = 0, + BTHF_NETWORK_STATE_AVAILABLE +} bthf_network_state_t; + +/** Service type */ +typedef enum +{ + BTHF_SERVICE_TYPE_HOME = 0, + BTHF_SERVICE_TYPE_ROAMING +} bthf_service_type_t; + +typedef enum { + BTHF_CALL_STATE_ACTIVE = 0, + BTHF_CALL_STATE_HELD, + BTHF_CALL_STATE_DIALING, + BTHF_CALL_STATE_ALERTING, + BTHF_CALL_STATE_INCOMING, + BTHF_CALL_STATE_WAITING, + BTHF_CALL_STATE_IDLE +} bthf_call_state_t; + +typedef enum { + BTHF_CALL_DIRECTION_OUTGOING = 0, + BTHF_CALL_DIRECTION_INCOMING +} bthf_call_direction_t; + +typedef enum { + BTHF_CALL_TYPE_VOICE = 0, + BTHF_CALL_TYPE_DATA, + BTHF_CALL_TYPE_FAX +} bthf_call_mode_t; + +typedef enum { + BTHF_CALL_MPTY_TYPE_SINGLE = 0, + BTHF_CALL_MPTY_TYPE_MULTI +} bthf_call_mpty_type_t; + +typedef enum { + BTHF_CALL_ADDRTYPE_UNKNOWN = 0x81, + BTHF_CALL_ADDRTYPE_INTERNATIONAL = 0x91 +} bthf_call_addrtype_t; +/** Represents the standard BT-HF interface. */ +typedef struct { + + /** set to sizeof(BtHfInterface) */ + size_t size; + /** + * Register the BtHf callbacks + */ + bt_status_t (*init)( bthf_callbacks_t* callbacks ); + + /** connect to headset */ + bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); + + /** dis-connect from headset */ + bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); + + /** create an audio connection */ + bt_status_t (*connect_audio)( bt_bdaddr_t *bd_addr ); + + /** close the audio connection */ + bt_status_t (*disconnect_audio)( bt_bdaddr_t *bd_addr ); + + /** start voice recognition */ + bt_status_t (*start_voice_recognition)(); + + /** stop voice recognition */ + bt_status_t (*stop_voice_recognition)(); + + /** volume control */ + bt_status_t (*volume_control) (bthf_volume_type_t type, int volume); + + /** Combined device status change notification */ + bt_status_t (*device_status_notification)(bthf_network_state_t ntk_state, bthf_service_type_t svc_type, int signal, + int batt_chg); + + /** Response for COPS command */ + bt_status_t (*cops_response)(const char *cops); + + /** Response for CIND command */ + bt_status_t (*cind_response)(int svc, int num_active, int num_held, bthf_call_state_t call_setup_state, + int signal, int roam, int batt_chg); + + /** Pre-formatted AT response, typically in response to unknown AT cmd */ + bt_status_t (*formatted_at_response)(const char *rsp); + + /** ok/error response + * ERROR (0) + * OK (1) + */ + bt_status_t (*at_response) (bthf_at_response_t response_code, int error_code); + + /** response for CLCC command + * Can be iteratively called for each call index + * Call index of 0 will be treated as NULL termination (Completes response) + */ + bt_status_t (*clcc_response) (int index, bthf_call_direction_t dir, + bthf_call_state_t state, bthf_call_mode_t mode, + bthf_call_mpty_type_t mpty, const char *number, + bthf_call_addrtype_t type); + + /** notify of a call state change + * Each update notifies + * 1. Number of active/held/ringing calls + * 2. call_state: This denotes the state change that triggered this msg + * This will take one of the values from BtHfCallState + * 3. number & type: valid only for incoming & waiting call + */ + bt_status_t (*phone_state_change) (int num_active, int num_held, bthf_call_state_t call_setup_state, + const char *number, bthf_call_addrtype_t type); + + /** Closes the interface. */ + void (*cleanup)( void ); +} bthf_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_HF_H */
diff --git a/bluez/android/hardware/bt_hh.h b/bluez/android/hardware/bt_hh.h new file mode 100644 index 0000000..09f547b --- /dev/null +++ b/bluez/android/hardware/bt_hh.h
@@ -0,0 +1,179 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_BT_HH_H +#define ANDROID_INCLUDE_BT_HH_H + +#include <stdint.h> + +__BEGIN_DECLS + +#define BTHH_MAX_DSC_LEN 884 + +/* HH connection states */ +typedef enum +{ + BTHH_CONN_STATE_CONNECTED = 0, + BTHH_CONN_STATE_CONNECTING, + BTHH_CONN_STATE_DISCONNECTED, + BTHH_CONN_STATE_DISCONNECTING, + BTHH_CONN_STATE_FAILED_MOUSE_FROM_HOST, + BTHH_CONN_STATE_FAILED_KBD_FROM_HOST, + BTHH_CONN_STATE_FAILED_TOO_MANY_DEVICES, + BTHH_CONN_STATE_FAILED_NO_BTHID_DRIVER, + BTHH_CONN_STATE_FAILED_GENERIC, + BTHH_CONN_STATE_UNKNOWN +} bthh_connection_state_t; + +typedef enum +{ + BTHH_OK = 0, + BTHH_HS_HID_NOT_READY, /* handshake error : device not ready */ + BTHH_HS_INVALID_RPT_ID, /* handshake error : invalid report ID */ + BTHH_HS_TRANS_NOT_SPT, /* handshake error : transaction not spt */ + BTHH_HS_INVALID_PARAM, /* handshake error : invalid paremter */ + BTHH_HS_ERROR, /* handshake error : unspecified HS error */ + BTHH_ERR, /* general BTA HH error */ + BTHH_ERR_SDP, /* SDP error */ + BTHH_ERR_PROTO, /* SET_Protocol error, + only used in BTA_HH_OPEN_EVT callback */ + BTHH_ERR_DB_FULL, /* device database full error, used */ + BTHH_ERR_TOD_UNSPT, /* type of device not supported */ + BTHH_ERR_NO_RES, /* out of system resources */ + BTHH_ERR_AUTH_FAILED, /* authentication fail */ + BTHH_ERR_HDL +}bthh_status_t; + +/* Protocol modes */ +typedef enum { + BTHH_REPORT_MODE = 0x00, + BTHH_BOOT_MODE = 0x01, + BTHH_UNSUPPORTED_MODE = 0xff +}bthh_protocol_mode_t; + +/* Report types */ +typedef enum { + BTHH_INPUT_REPORT = 1, + BTHH_OUTPUT_REPORT, + BTHH_FEATURE_REPORT +}bthh_report_type_t; + +typedef struct +{ + int attr_mask; + uint8_t sub_class; + uint8_t app_id; + int vendor_id; + int product_id; + int version; + uint8_t ctry_code; + int dl_len; + uint8_t dsc_list[BTHH_MAX_DSC_LEN]; +} bthh_hid_info_t; + +/** Callback for connection state change. + * state will have one of the values from bthh_connection_state_t + */ +typedef void (* bthh_connection_state_callback)(bt_bdaddr_t *bd_addr, bthh_connection_state_t state); + +/** Callback for vitual unplug api. + * the status of the vitual unplug + */ +typedef void (* bthh_virtual_unplug_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status); + +/** Callback for get hid info + * hid_info will contain attr_mask, sub_class, app_id, vendor_id, product_id, version, ctry_code, len + */ +typedef void (* bthh_hid_info_callback)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info); + +/** Callback for get/set protocal api. + * the protocol mode is one of the value from bthh_protocol_mode_t + */ +typedef void (* bthh_protocol_mode_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status,bthh_protocol_mode_t mode); + +/** Callback for get/set_idle_time api. + */ +typedef void (* bthh_idle_time_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, int idle_rate); + + +/** Callback for get report api. + * if staus is ok rpt_data contains the report data + */ +typedef void (* bthh_get_report_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, uint8_t* rpt_data, int rpt_size); + + +/** BT-HH callback structure. */ +typedef struct { + /** set to sizeof(BtHfCallbacks) */ + size_t size; + bthh_connection_state_callback connection_state_cb; + bthh_hid_info_callback hid_info_cb; + bthh_protocol_mode_callback protocol_mode_cb; + bthh_idle_time_callback idle_time_cb; + bthh_get_report_callback get_report_cb; + bthh_virtual_unplug_callback virtual_unplug_cb; + +} bthh_callbacks_t; + + + +/** Represents the standard BT-HH interface. */ +typedef struct { + + /** set to sizeof(BtHhInterface) */ + size_t size; + + /** + * Register the BtHh callbacks + */ + bt_status_t (*init)( bthh_callbacks_t* callbacks ); + + /** connect to hid device */ + bt_status_t (*connect)( bt_bdaddr_t *bd_addr); + + /** dis-connect from hid device */ + bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); + + /** Virtual UnPlug (VUP) the specified HID device */ + bt_status_t (*virtual_unplug)(bt_bdaddr_t *bd_addr); + + /** Set the HID device descriptor for the specified HID device. */ + bt_status_t (*set_info)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info ); + + /** Get the HID proto mode. */ + bt_status_t (*get_protocol) (bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode); + + /** Set the HID proto mode. */ + bt_status_t (*set_protocol)(bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode); + + /** Send a GET_REPORT to HID device. */ + bt_status_t (*get_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, uint8_t reportId, int bufferSize); + + /** Send a SET_REPORT to HID device. */ + bt_status_t (*set_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, char* report); + + /** Send data to HID device. */ + bt_status_t (*send_data)(bt_bdaddr_t *bd_addr, char* data); + + /** Closes the interface. */ + void (*cleanup)( void ); + +} bthh_interface_t; +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_HH_H */ + +
diff --git a/bluez/android/hardware/bt_hl.h b/bluez/android/hardware/bt_hl.h new file mode 100644 index 0000000..bd29e3a --- /dev/null +++ b/bluez/android/hardware/bt_hl.h
@@ -0,0 +1,123 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_BT_HL_H +#define ANDROID_INCLUDE_BT_HL_H + +__BEGIN_DECLS + +/* HL connection states */ + +typedef enum +{ + BTHL_MDEP_ROLE_SOURCE, + BTHL_MDEP_ROLE_SINK +} bthl_mdep_role_t; + +typedef enum { + BTHL_APP_REG_STATE_REG_SUCCESS, + BTHL_APP_REG_STATE_REG_FAILED, + BTHL_APP_REG_STATE_DEREG_SUCCESS, + BTHL_APP_REG_STATE_DEREG_FAILED +} bthl_app_reg_state_t; + +typedef enum +{ + BTHL_CHANNEL_TYPE_RELIABLE, + BTHL_CHANNEL_TYPE_STREAMING, + BTHL_CHANNEL_TYPE_ANY +} bthl_channel_type_t; + + +/* HL connection states */ +typedef enum { + BTHL_CONN_STATE_CONNECTING, + BTHL_CONN_STATE_CONNECTED, + BTHL_CONN_STATE_DISCONNECTING, + BTHL_CONN_STATE_DISCONNECTED, + BTHL_CONN_STATE_DESTROYED +} bthl_channel_state_t; + +typedef struct +{ + bthl_mdep_role_t mdep_role; + int data_type; + bthl_channel_type_t channel_type; + const char *mdep_description; /* MDEP description to be used in the SDP (optional); null terminated */ +} bthl_mdep_cfg_t; + +typedef struct +{ + const char *application_name; + const char *provider_name; /* provider name to be used in the SDP (optional); null terminated */ + const char *srv_name; /* service name to be used in the SDP (optional); null terminated*/ + const char *srv_desp; /* service description to be used in the SDP (optional); null terminated */ + int number_of_mdeps; + bthl_mdep_cfg_t *mdep_cfg; /* Dynamic array */ +} bthl_reg_param_t; + +/** Callback for application registration status. + * state will have one of the values from bthl_app_reg_state_t + */ +typedef void (* bthl_app_reg_state_callback)(int app_id, bthl_app_reg_state_t state); + +/** Callback for channel connection state change. + * state will have one of the values from + * bthl_connection_state_t and fd (file descriptor) + */ +typedef void (* bthl_channel_state_callback)(int app_id, bt_bdaddr_t *bd_addr, int mdep_cfg_index, int channel_id, bthl_channel_state_t state, int fd); + +/** BT-HL callback structure. */ +typedef struct { + /** set to sizeof(bthl_callbacks_t) */ + size_t size; + bthl_app_reg_state_callback app_reg_state_cb; + bthl_channel_state_callback channel_state_cb; +} bthl_callbacks_t; + + +/** Represents the standard BT-HL interface. */ +typedef struct { + + /** set to sizeof(bthl_interface_t) */ + size_t size; + + /** + * Register the Bthl callbacks + */ + bt_status_t (*init)( bthl_callbacks_t* callbacks ); + + /** Register HL application */ + bt_status_t (*register_application) ( bthl_reg_param_t *p_reg_param, int *app_id); + + /** Unregister HL application */ + bt_status_t (*unregister_application) (int app_id); + + /** connect channel */ + bt_status_t (*connect_channel)(int app_id, bt_bdaddr_t *bd_addr, int mdep_cfg_index, int *channel_id); + + /** destroy channel */ + bt_status_t (*destroy_channel)(int channel_id); + + /** Close the Bthl callback **/ + void (*cleanup)(void); + +} bthl_interface_t; +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_HL_H */ + +
diff --git a/bluez/android/hardware/bt_pan.h b/bluez/android/hardware/bt_pan.h new file mode 100644 index 0000000..c8b36b4 --- /dev/null +++ b/bluez/android/hardware/bt_pan.h
@@ -0,0 +1,87 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_BT_PAN_H +#define ANDROID_INCLUDE_BT_PAN_H + +__BEGIN_DECLS + +#define BTPAN_ROLE_NONE 0 +#define BTPAN_ROLE_PANNAP 1 +#define BTPAN_ROLE_PANU 2 + +typedef enum { + BTPAN_STATE_CONNECTED = 0, + BTPAN_STATE_CONNECTING = 1, + BTPAN_STATE_DISCONNECTED = 2, + BTPAN_STATE_DISCONNECTING = 3 +} btpan_connection_state_t; + +typedef enum { + BTPAN_STATE_ENABLED = 0, + BTPAN_STATE_DISABLED = 1 +} btpan_control_state_t; + +/** +* Callback for pan connection state +*/ +typedef void (*btpan_connection_state_callback)(btpan_connection_state_t state, bt_status_t error, + const bt_bdaddr_t *bd_addr, int local_role, int remote_role); +typedef void (*btpan_control_state_callback)(btpan_control_state_t state, bt_status_t error, + int local_role, const char* ifname); + +typedef struct { + size_t size; + btpan_control_state_callback control_state_cb; + btpan_connection_state_callback connection_state_cb; +} btpan_callbacks_t; +typedef struct { + /** set to size of this struct*/ + size_t size; + /** + * Initialize the pan interface and register the btpan callbacks + */ + bt_status_t (*init)(const btpan_callbacks_t* callbacks); + /* + * enable the pan service by specified role. The result state of + * enabl will be returned by btpan_control_state_callback. when pan-nap is enabled, + * the state of connecting panu device will be notified by btpan_connection_state_callback + */ + bt_status_t (*enable)(int local_role); + /* + * get current pan local role + */ + int (*get_local_role)(void); + /** + * start bluetooth pan connection to the remote device by specified pan role. The result state will be + * returned by btpan_connection_state_callback + */ + bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, int local_role, int remote_role); + /** + * stop bluetooth pan connection. The result state will be returned by btpan_connection_state_callback + */ + bt_status_t (*disconnect)(const bt_bdaddr_t *bd_addr); + + /** + * Cleanup the pan interface + */ + void (*cleanup)(void); + +} btpan_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_PAN_H */
diff --git a/bluez/android/hardware/bt_rc.h b/bluez/android/hardware/bt_rc.h new file mode 100644 index 0000000..d455543 --- /dev/null +++ b/bluez/android/hardware/bt_rc.h
@@ -0,0 +1,266 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_BT_RC_H +#define ANDROID_INCLUDE_BT_RC_H + +__BEGIN_DECLS + +/* Macros */ +#define BTRC_MAX_ATTR_STR_LEN 255 +#define BTRC_UID_SIZE 8 +#define BTRC_MAX_APP_SETTINGS 8 +#define BTRC_MAX_FOLDER_DEPTH 4 +#define BTRC_MAX_APP_ATTR_SIZE 16 +#define BTRC_MAX_ELEM_ATTR_SIZE 7 + +typedef uint8_t btrc_uid_t[BTRC_UID_SIZE]; + +typedef enum { + BTRC_FEAT_NONE = 0x00, /* AVRCP 1.0 */ + BTRC_FEAT_METADATA = 0x01, /* AVRCP 1.3 */ + BTRC_FEAT_ABSOLUTE_VOLUME = 0x02, /* Supports TG role and volume sync */ + BTRC_FEAT_BROWSE = 0x04, /* AVRCP 1.4 and up, with Browsing support */ +} btrc_remote_features_t; + +typedef enum { + BTRC_PLAYSTATE_STOPPED = 0x00, /* Stopped */ + BTRC_PLAYSTATE_PLAYING = 0x01, /* Playing */ + BTRC_PLAYSTATE_PAUSED = 0x02, /* Paused */ + BTRC_PLAYSTATE_FWD_SEEK = 0x03, /* Fwd Seek*/ + BTRC_PLAYSTATE_REV_SEEK = 0x04, /* Rev Seek*/ + BTRC_PLAYSTATE_ERROR = 0xFF, /* Error */ +} btrc_play_status_t; + +typedef enum { + BTRC_EVT_PLAY_STATUS_CHANGED = 0x01, + BTRC_EVT_TRACK_CHANGE = 0x02, + BTRC_EVT_TRACK_REACHED_END = 0x03, + BTRC_EVT_TRACK_REACHED_START = 0x04, + BTRC_EVT_PLAY_POS_CHANGED = 0x05, + BTRC_EVT_APP_SETTINGS_CHANGED = 0x08, +} btrc_event_id_t; + +typedef enum { + BTRC_NOTIFICATION_TYPE_INTERIM = 0, + BTRC_NOTIFICATION_TYPE_CHANGED = 1, +} btrc_notification_type_t; + +typedef enum { + BTRC_PLAYER_ATTR_EQUALIZER = 0x01, + BTRC_PLAYER_ATTR_REPEAT = 0x02, + BTRC_PLAYER_ATTR_SHUFFLE = 0x03, + BTRC_PLAYER_ATTR_SCAN = 0x04, +} btrc_player_attr_t; + +typedef enum { + BTRC_MEDIA_ATTR_TITLE = 0x01, + BTRC_MEDIA_ATTR_ARTIST = 0x02, + BTRC_MEDIA_ATTR_ALBUM = 0x03, + BTRC_MEDIA_ATTR_TRACK_NUM = 0x04, + BTRC_MEDIA_ATTR_NUM_TRACKS = 0x05, + BTRC_MEDIA_ATTR_GENRE = 0x06, + BTRC_MEDIA_ATTR_PLAYING_TIME = 0x07, +} btrc_media_attr_t; + +typedef enum { + BTRC_PLAYER_VAL_OFF_REPEAT = 0x01, + BTRC_PLAYER_VAL_SINGLE_REPEAT = 0x02, + BTRC_PLAYER_VAL_ALL_REPEAT = 0x03, + BTRC_PLAYER_VAL_GROUP_REPEAT = 0x04 +} btrc_player_repeat_val_t; + +typedef enum { + BTRC_PLAYER_VAL_OFF_SHUFFLE = 0x01, + BTRC_PLAYER_VAL_ALL_SHUFFLE = 0x02, + BTRC_PLAYER_VAL_GROUP_SHUFFLE = 0x03 +} btrc_player_shuffle_val_t; + +typedef enum { + BTRC_STS_BAD_CMD = 0x00, /* Invalid command */ + BTRC_STS_BAD_PARAM = 0x01, /* Invalid parameter */ + BTRC_STS_NOT_FOUND = 0x02, /* Specified parameter is wrong or not found */ + BTRC_STS_INTERNAL_ERR = 0x03, /* Internal Error */ + BTRC_STS_NO_ERROR = 0x04 /* Operation Success */ +} btrc_status_t; + +typedef struct { + uint8_t num_attr; + uint8_t attr_ids[BTRC_MAX_APP_SETTINGS]; + uint8_t attr_values[BTRC_MAX_APP_SETTINGS]; +} btrc_player_settings_t; + +typedef union +{ + btrc_play_status_t play_status; + btrc_uid_t track; /* queue position in NowPlaying */ + uint32_t song_pos; + btrc_player_settings_t player_setting; +} btrc_register_notification_t; + +typedef struct { + uint8_t id; /* can be attr_id or value_id */ + uint8_t text[BTRC_MAX_ATTR_STR_LEN]; +} btrc_player_setting_text_t; + +typedef struct { + uint32_t attr_id; + uint8_t text[BTRC_MAX_ATTR_STR_LEN]; +} btrc_element_attr_val_t; + +/** Callback for the controller's supported feautres */ +typedef void (* btrc_remote_features_callback)(bt_bdaddr_t *bd_addr, + btrc_remote_features_t features); + +/** Callback for play status request */ +typedef void (* btrc_get_play_status_callback)(); + +/** Callback for list player application attributes (Shuffle, Repeat,...) */ +typedef void (* btrc_list_player_app_attr_callback)(); + +/** Callback for list player application attributes (Shuffle, Repeat,...) */ +typedef void (* btrc_list_player_app_values_callback)(btrc_player_attr_t attr_id); + +/** Callback for getting the current player application settings value +** num_attr: specifies the number of attribute ids contained in p_attrs +*/ +typedef void (* btrc_get_player_app_value_callback) (uint8_t num_attr, btrc_player_attr_t *p_attrs); + +/** Callback for getting the player application settings attributes' text +** num_attr: specifies the number of attribute ids contained in p_attrs +*/ +typedef void (* btrc_get_player_app_attrs_text_callback) (uint8_t num_attr, btrc_player_attr_t *p_attrs); + +/** Callback for getting the player application settings values' text +** num_attr: specifies the number of value ids contained in p_vals +*/ +typedef void (* btrc_get_player_app_values_text_callback) (uint8_t attr_id, uint8_t num_val, uint8_t *p_vals); + +/** Callback for setting the player application settings values */ +typedef void (* btrc_set_player_app_value_callback) (btrc_player_settings_t *p_vals); + +/** Callback to fetch the get element attributes of the current song +** num_attr: specifies the number of attributes requested in p_attrs +*/ +typedef void (* btrc_get_element_attr_callback) (uint8_t num_attr, btrc_media_attr_t *p_attrs); + +/** Callback for register notification (Play state change/track change/...) +** param: Is only valid if event_id is BTRC_EVT_PLAY_POS_CHANGED +*/ +typedef void (* btrc_register_notification_callback) (btrc_event_id_t event_id, uint32_t param); + +/* AVRCP 1.4 Enhancements */ +/** Callback for volume change on CT +** volume: Current volume setting on the CT (0-127) +*/ +typedef void (* btrc_volume_change_callback) (uint8_t volume, uint8_t ctype); + +/** Callback for passthrough commands */ +typedef void (* btrc_passthrough_cmd_callback) (int id, int key_state); + +/** BT-RC callback structure. */ +typedef struct { + /** set to sizeof(BtRcCallbacks) */ + size_t size; + btrc_remote_features_callback remote_features_cb; + btrc_get_play_status_callback get_play_status_cb; + btrc_list_player_app_attr_callback list_player_app_attr_cb; + btrc_list_player_app_values_callback list_player_app_values_cb; + btrc_get_player_app_value_callback get_player_app_value_cb; + btrc_get_player_app_attrs_text_callback get_player_app_attrs_text_cb; + btrc_get_player_app_values_text_callback get_player_app_values_text_cb; + btrc_set_player_app_value_callback set_player_app_value_cb; + btrc_get_element_attr_callback get_element_attr_cb; + btrc_register_notification_callback register_notification_cb; + btrc_volume_change_callback volume_change_cb; + btrc_passthrough_cmd_callback passthrough_cmd_cb; +} btrc_callbacks_t; + +/** Represents the standard BT-RC interface. */ +typedef struct { + + /** set to sizeof(BtRcInterface) */ + size_t size; + /** + * Register the BtRc callbacks + */ + bt_status_t (*init)( btrc_callbacks_t* callbacks ); + + /** Respose to GetPlayStatus request. Contains the current + ** 1. Play status + ** 2. Song duration/length + ** 3. Song position + */ + bt_status_t (*get_play_status_rsp)( btrc_play_status_t play_status, uint32_t song_len, uint32_t song_pos); + + /** Lists the support player application attributes (Shuffle/Repeat/...) + ** num_attr: Specifies the number of attributes contained in the pointer p_attrs + */ + bt_status_t (*list_player_app_attr_rsp)( int num_attr, btrc_player_attr_t *p_attrs); + + /** Lists the support player application attributes (Shuffle Off/On/Group) + ** num_val: Specifies the number of values contained in the pointer p_vals + */ + bt_status_t (*list_player_app_value_rsp)( int num_val, uint8_t *p_vals); + + /** Returns the current application attribute values for each of the specified attr_id */ + bt_status_t (*get_player_app_value_rsp)( btrc_player_settings_t *p_vals); + + /** Returns the application attributes text ("Shuffle"/"Repeat"/...) + ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs + */ + bt_status_t (*get_player_app_attr_text_rsp)( int num_attr, btrc_player_setting_text_t *p_attrs); + + /** Returns the application attributes text ("Shuffle"/"Repeat"/...) + ** num_attr: Specifies the number of attribute values' text contained in the pointer p_vals + */ + bt_status_t (*get_player_app_value_text_rsp)( int num_val, btrc_player_setting_text_t *p_vals); + + /** Returns the current songs' element attributes text ("Title"/"Album"/"Artist") + ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs + */ + bt_status_t (*get_element_attr_rsp)( uint8_t num_attr, btrc_element_attr_val_t *p_attrs); + + /** Response to set player attribute request ("Shuffle"/"Repeat") + ** rsp_status: Status of setting the player attributes for the current media player + */ + bt_status_t (*set_player_app_value_rsp)(btrc_status_t rsp_status); + + /* Response to the register notification request (Play state change/track change/...). + ** event_id: Refers to the event_id this notification change corresponds too + ** type: Response type - interim/changed + ** p_params: Based on the event_id, this parameter should be populated + */ + bt_status_t (*register_notification_rsp)(btrc_event_id_t event_id, + btrc_notification_type_t type, + btrc_register_notification_t *p_param); + + /* AVRCP 1.4 enhancements */ + + /**Send current volume setting to remote side. Support limited to SetAbsoluteVolume + ** This can be enhanced to support Relative Volume (AVRCP 1.0). + ** With RelateVolume, we will send VOLUME_UP/VOLUME_DOWN opposed to absolute volume level + ** volume: Should be in the range 0-127. bit7 is reseved and cannot be set + */ + bt_status_t (*set_volume)(uint8_t volume); + + /** Closes the interface. */ + void (*cleanup)( void ); +} btrc_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_RC_H */
diff --git a/bluez/android/hardware/bt_sock.h b/bluez/android/hardware/bt_sock.h new file mode 100644 index 0000000..a4aa046 --- /dev/null +++ b/bluez/android/hardware/bt_sock.h
@@ -0,0 +1,58 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_BT_SOCK_H +#define ANDROID_INCLUDE_BT_SOCK_H + +__BEGIN_DECLS + +#define BTSOCK_FLAG_ENCRYPT 1 +#define BTSOCK_FLAG_AUTH (1 << 1) + +typedef enum { + BTSOCK_RFCOMM = 1, + BTSOCK_SCO = 2, + BTSOCK_L2CAP = 3 +} btsock_type_t; + +/** Represents the standard BT SOCKET interface. */ +typedef struct { + short size; + bt_bdaddr_t bd_addr; + int channel; + int status; +} __attribute__((packed)) sock_connect_signal_t; + +typedef struct { + + /** set to size of this struct*/ + size_t size; + /** + * listen to a rfcomm uuid or channel. It returns the socket fd from which + * btsock_connect_signal can be read out when a remote device connected + */ + bt_status_t (*listen)(btsock_type_t type, const char* service_name, const uint8_t* service_uuid, int channel, int* sock_fd, int flags); + /* + * connect to a rfcomm uuid channel of remote device, It returns the socket fd from which + * the btsock_connect_signal and a new socket fd to be accepted can be read out when connected + */ + bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, btsock_type_t type, const uint8_t* uuid, int channel, int* sock_fd, int flags); + +} btsock_interface_t; + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_SOCK_H */
diff --git a/bluez/android/hardware/hardware.c b/bluez/android/hardware/hardware.c new file mode 100644 index 0000000..4bd5eba --- /dev/null +++ b/bluez/android/hardware/hardware.c
@@ -0,0 +1,124 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <hardware/hardware.h> + +#include <dlfcn.h> +#include <string.h> +#include <pthread.h> +#include <errno.h> +#include <limits.h> +#include <stdio.h> + +#define LOG_TAG "HAL" + +#define LOG_INFO " I" +#define LOG_WARN " W" +#define LOG_ERROR " E" +#define LOG_DEBUG " D" +#define ALOG(pri, tag, fmt, arg...) fprintf(stderr, tag pri": " fmt"\n", ##arg) + +#define info(fmt, arg...) ALOG(LOG_INFO, LOG_TAG, fmt, ##arg) +#define warn(fmt, arg...) ALOG(LOG_WARN, LOG_TAG, fmt, ##arg) +#define error(fmt, arg...) ALOG(LOG_ERROR, LOG_TAG, fmt, ##arg) + +/** + * Load the file defined by the variant and if successful + * return the dlopen handle and the hmi. + * @return 0 = success, !0 = failure. + */ +static int load(const char *id, + const char *path, + const struct hw_module_t **pHmi) +{ + int status; + void *handle; + struct hw_module_t *hmi; + const char *sym = HAL_MODULE_INFO_SYM_AS_STR; + + /* + * load the symbols resolving undefined symbols before + * dlopen returns. Since RTLD_GLOBAL is not or'd in with + * RTLD_NOW the external symbols will not be global + */ + handle = dlopen(path, RTLD_NOW); + if (handle == NULL) { + char const *err_str = dlerror(); + error("load: module=%s\n%s", path, err_str?err_str:"unknown"); + status = -EINVAL; + goto done; + } + + /* Get the address of the struct hal_module_info. */ + hmi = (struct hw_module_t *)dlsym(handle, sym); + if (hmi == NULL) { + error("load: couldn't find symbol %s", sym); + status = -EINVAL; + goto done; + } + + /* Check that the id matches */ + if (strcmp(id, hmi->id) != 0) { + error("load: id=%s != hmi->id=%s", id, hmi->id); + status = -EINVAL; + goto done; + } + + hmi->dso = handle; + + *pHmi = hmi; + + info("loaded HAL id=%s path=%s hmi=%p handle=%p", + id, path, *pHmi, handle); + + return 0; + +done: + hmi = NULL; + if (handle != NULL) { + dlclose(handle); + handle = NULL; + } + + return status; +} + +int hw_get_module_by_class(const char *class_id, const char *inst, + const struct hw_module_t **module) +{ + char path[PATH_MAX]; + char name[PATH_MAX]; + + if (inst) + snprintf(name, PATH_MAX, "%s.%s", class_id, inst); + else + snprintf(name, PATH_MAX, "%s", class_id); + + /* + * Here we rely on the fact that calling dlopen multiple times on + * the same .so will simply increment a refcount (and not load + * a new copy of the library). + * We also assume that dlopen() is thread-safe. + */ + snprintf(path, sizeof(path), "%s/%s.default.so", PLUGINDIR, name); + + return load(class_id, path, module); +} + +int hw_get_module(const char *id, const struct hw_module_t **module) +{ + return hw_get_module_by_class(id, NULL, module); +}
diff --git a/bluez/android/hardware/hardware.h b/bluez/android/hardware/hardware.h new file mode 100644 index 0000000..c7e8cc7 --- /dev/null +++ b/bluez/android/hardware/hardware.h
@@ -0,0 +1,227 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_INCLUDE_HARDWARE_HARDWARE_H +#define ANDROID_INCLUDE_HARDWARE_HARDWARE_H + +#include <stdint.h> +#include <sys/cdefs.h> + +__BEGIN_DECLS + +/* + * Value for the hw_module_t.tag field + */ + +#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D)) + +#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T') +#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T') + +#define HARDWARE_MAKE_API_VERSION(maj,min) \ + ((((maj) & 0xff) << 8) | ((min) & 0xff)) + +#define HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) \ + ((((maj) & 0xff) << 24) | (((min) & 0xff) << 16) | ((hdr) & 0xffff)) +#define HARDWARE_API_VERSION_2_MAJ_MIN_MASK 0xffff0000 +#define HARDWARE_API_VERSION_2_HEADER_MASK 0x0000ffff + + +/* + * The current HAL API version. + * + * All module implementations must set the hw_module_t.hal_api_version field + * to this value when declaring the module with HAL_MODULE_INFO_SYM. + * + * Note that previous implementations have always set this field to 0. + * Therefore, libhardware HAL API will always consider versions 0.0 and 1.0 + * to be 100% binary compatible. + * + */ +#define HARDWARE_HAL_API_VERSION HARDWARE_MAKE_API_VERSION(1, 0) + +/* + * Helper macros for module implementors. + * + * The derived modules should provide convenience macros for supported + * versions so that implementations can explicitly specify module/device + * versions at definition time. + * + * Use this macro to set the hw_module_t.module_api_version field. + */ +#define HARDWARE_MODULE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min) +#define HARDWARE_MODULE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) + +/* + * Use this macro to set the hw_device_t.version field + */ +#define HARDWARE_DEVICE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min) +#define HARDWARE_DEVICE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) + +struct hw_module_t; +struct hw_module_methods_t; +struct hw_device_t; + +/** + * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM + * and the fields of this data structure must begin with hw_module_t + * followed by module specific information. + */ +typedef struct hw_module_t { + /** tag must be initialized to HARDWARE_MODULE_TAG */ + uint32_t tag; + + /** + * The API version of the implemented module. The module owner is + * responsible for updating the version when a module interface has + * changed. + * + * The derived modules such as gralloc and audio own and manage this field. + * The module user must interpret the version field to decide whether or + * not to inter-operate with the supplied module implementation. + * For example, SurfaceFlinger is responsible for making sure that + * it knows how to manage different versions of the gralloc-module API, + * and AudioFlinger must know how to do the same for audio-module API. + * + * The module API version should include a major and a minor component. + * For example, version 1.0 could be represented as 0x0100. This format + * implies that versions 0x0100-0x01ff are all API-compatible. + * + * In the future, libhardware will expose a hw_get_module_version() + * (or equivalent) function that will take minimum/maximum supported + * versions as arguments and would be able to reject modules with + * versions outside of the supplied range. + */ + uint16_t module_api_version; +#define version_major module_api_version + /** + * version_major/version_minor defines are supplied here for temporary + * source code compatibility. They will be removed in the next version. + * ALL clients must convert to the new version format. + */ + + /** + * The API version of the HAL module interface. This is meant to + * version the hw_module_t, hw_module_methods_t, and hw_device_t + * structures and definitions. + * + * The HAL interface owns this field. Module users/implementations + * must NOT rely on this value for version information. + * + * Presently, 0 is the only valid value. + */ + uint16_t hal_api_version; +#define version_minor hal_api_version + + /** Identifier of module */ + const char *id; + + /** Name of this module */ + const char *name; + + /** Author/owner/implementor of the module */ + const char *author; + + /** Modules methods */ + struct hw_module_methods_t* methods; + + /** module's dso */ + void* dso; + + /** padding to 128 bytes, reserved for future use */ + uint32_t reserved[32-7]; + +} hw_module_t; + +typedef struct hw_module_methods_t { + /** Open a specific device */ + int (*open)(const struct hw_module_t* module, const char* id, + struct hw_device_t** device); + +} hw_module_methods_t; + +/** + * Every device data structure must begin with hw_device_t + * followed by module specific public methods and attributes. + */ +typedef struct hw_device_t { + /** tag must be initialized to HARDWARE_DEVICE_TAG */ + uint32_t tag; + + /** + * Version of the module-specific device API. This value is used by + * the derived-module user to manage different device implementations. + * + * The module user is responsible for checking the module_api_version + * and device version fields to ensure that the user is capable of + * communicating with the specific module implementation. + * + * One module can support multiple devices with different versions. This + * can be useful when a device interface changes in an incompatible way + * but it is still necessary to support older implementations at the same + * time. One such example is the Camera 2.0 API. + * + * This field is interpreted by the module user and is ignored by the + * HAL interface itself. + */ + uint32_t version; + + /** reference to the module this device belongs to */ + struct hw_module_t* module; + + /** padding reserved for future use */ + uint32_t reserved[12]; + + /** Close this device */ + int (*close)(struct hw_device_t* device); + +} hw_device_t; + +/** + * Name of the hal_module_info + */ +#define HAL_MODULE_INFO_SYM HMI + +/** + * Name of the hal_module_info as a string + */ +#define HAL_MODULE_INFO_SYM_AS_STR "HMI" + +/** + * Get the module info associated with a module by id. + * + * @return: 0 == success, <0 == error and *module == NULL + */ +int hw_get_module(const char *id, const struct hw_module_t **module); + +/** + * Get the module info associated with a module instance by class 'class_id' + * and instance 'inst'. + * + * Some modules types necessitate multiple instances. For example audio supports + * multiple concurrent interfaces and thus 'audio' is the module class + * and 'primary' or 'a2dp' are module interfaces. This implies that the files + * providing these modules would be named audio.primary.<variant>.so and + * audio.a2dp.<variant>.so + * + * @return: 0 == success, <0 == error and *module == NULL + */ +int hw_get_module_by_class(const char *class_id, const char *inst, + const struct hw_module_t **module); + +__END_DECLS + +#endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */
diff --git a/bluez/android/health.c b/bluez/android/health.c new file mode 100644 index 0000000..e4f8cbd --- /dev/null +++ b/bluez/android/health.c
@@ -0,0 +1,115 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdint.h> +#include <stdbool.h> +#include <errno.h> +#include <unistd.h> +#include <glib.h> + +#include "lib/bluetooth.h" +#include "lib/sdp.h" +#include "lib/sdp_lib.h" +#include "src/log.h" + +#include "hal-msg.h" +#include "ipc-common.h" +#include "ipc.h" +#include "utils.h" +#include "bluetooth.h" +#include "health.h" + +static bdaddr_t adapter_addr; +static struct ipc *hal_ipc = NULL; + +static void bt_health_register_app(const void *buf, uint16_t len) +{ + DBG("Not implemented"); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_REG_APP, + HAL_STATUS_UNSUPPORTED); +} + +static void bt_health_unregister_app(const void *buf, uint16_t len) +{ + DBG("Not implemented"); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_UNREG_APP, + HAL_STATUS_UNSUPPORTED); +} + +static void bt_health_connect_channel(const void *buf, uint16_t len) +{ + DBG("Not implemented"); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, + HAL_OP_HEALTH_CONNECT_CHANNEL, HAL_STATUS_UNSUPPORTED); +} + +static void bt_health_destroy_channel(const void *buf, uint16_t len) +{ + DBG("Not implemented"); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, + HAL_OP_HEALTH_DESTROY_CHANNEL, HAL_STATUS_UNSUPPORTED); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_HEALTH_REG_APP */ + { bt_health_register_app, false, + sizeof(struct hal_cmd_health_reg_app) }, + /* HAL_OP_HEALTH_UNREG_APP */ + { bt_health_unregister_app, false, + sizeof(struct hal_cmd_health_unreg_app) }, + /* HAL_OP_HEALTH_CONNECT_CHANNEL */ + { bt_health_connect_channel, false, + sizeof(struct hal_cmd_health_connect_channel) }, + /* HAL_OP_HEALTH_DESTROY_CHANNEL */ + { bt_health_destroy_channel, false, + sizeof(struct hal_cmd_health_destroy_channel) }, +}; + +bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode) +{ + DBG(""); + + bacpy(&adapter_addr, addr); + + hal_ipc = ipc; + ipc_register(hal_ipc, HAL_SERVICE_ID_HEALTH, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); + + return true; +} + +void bt_health_unregister(void) +{ + DBG(""); + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_HEALTH); + hal_ipc = NULL; +}
diff --git a/bluez/android/health.h b/bluez/android/health.h new file mode 100644 index 0000000..0b32fd3 --- /dev/null +++ b/bluez/android/health.h
@@ -0,0 +1,25 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode); +void bt_health_unregister(void);
diff --git a/bluez/android/hidhost.c b/bluez/android/hidhost.c new file mode 100644 index 0000000..81e7eb8 --- /dev/null +++ b/bluez/android/hidhost.c
@@ -0,0 +1,1398 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdint.h> +#include <stdbool.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> + +#include <glib.h> + +#include "btio/btio.h" +#include "lib/bluetooth.h" +#include "lib/sdp.h" +#include "lib/sdp_lib.h" +#include "src/shared/mgmt.h" +#include "src/shared/util.h" +#include "src/sdp-client.h" +#include "src/uuid-helper.h" +#include "profiles/input/uhid_copy.h" +#include "src/log.h" + +#include "hal-msg.h" +#include "ipc-common.h" +#include "ipc.h" +#include "hidhost.h" +#include "utils.h" + +#define L2CAP_PSM_HIDP_CTRL 0x11 +#define L2CAP_PSM_HIDP_INTR 0x13 +#define UHID_DEVICE_FILE "/dev/uhid" + +/* HID message types */ +#define HID_MSG_CONTROL 0x10 +#define HID_MSG_GET_REPORT 0x40 +#define HID_MSG_SET_REPORT 0x50 +#define HID_MSG_GET_PROTOCOL 0x60 +#define HID_MSG_SET_PROTOCOL 0x70 +#define HID_MSG_DATA 0xa0 + +/* HID data types */ +#define HID_DATA_TYPE_INPUT 0x01 +#define HID_DATA_TYPE_OUTPUT 0x02 +#define HID_DATA_TYPE_FEATURE 0x03 + +/* HID protocol header parameters */ +#define HID_PROTO_BOOT 0x00 +#define HID_PROTO_REPORT 0x01 + +/* HID GET REPORT Size Field */ +#define HID_GET_REPORT_SIZE_FIELD 0x08 + +/* HID Virtual Cable Unplug */ +#define HID_VIRTUAL_CABLE_UNPLUG 0x05 + +static bdaddr_t adapter_addr; + +static GIOChannel *ctrl_io = NULL; +static GIOChannel *intr_io = NULL; +static GSList *devices = NULL; + +static struct ipc *hal_ipc = NULL; + +struct hid_device { + bdaddr_t dst; + uint8_t state; + uint8_t subclass; + uint16_t vendor; + uint16_t product; + uint16_t version; + uint8_t country; + int rd_size; + void *rd_data; + uint8_t boot_dev; + GIOChannel *ctrl_io; + GIOChannel *intr_io; + guint ctrl_watch; + guint intr_watch; + int uhid_fd; + guint uhid_watch_id; + uint8_t last_hid_msg; +}; + +static int device_cmp(gconstpointer s, gconstpointer user_data) +{ + const struct hid_device *dev = s; + const bdaddr_t *dst = user_data; + + return bacmp(&dev->dst, dst); +} + +static void uhid_destroy(int fd) +{ + struct uhid_event ev; + + /* destroy uHID device */ + memset(&ev, 0, sizeof(ev)); + ev.type = UHID_DESTROY; + + if (write(fd, &ev, sizeof(ev)) < 0) + error("Failed to destroy uHID device: %s (%d)", + strerror(errno), errno); + + close(fd); +} + +static void hid_device_free(void *data) +{ + struct hid_device *dev = data; + + if (dev->ctrl_watch > 0) + g_source_remove(dev->ctrl_watch); + + if (dev->intr_watch > 0) + g_source_remove(dev->intr_watch); + + if (dev->intr_io) + g_io_channel_unref(dev->intr_io); + + if (dev->ctrl_io) + g_io_channel_unref(dev->ctrl_io); + + if (dev->uhid_watch_id) { + g_source_remove(dev->uhid_watch_id); + dev->uhid_watch_id = 0; + } + + if (dev->uhid_fd > 0) + uhid_destroy(dev->uhid_fd); + + g_free(dev->rd_data); + g_free(dev); +} + +static void hid_device_remove(struct hid_device *dev) +{ + devices = g_slist_remove(devices, dev); + hid_device_free(dev); +} + +static void handle_uhid_output(struct hid_device *dev, + struct uhid_output_req *output) +{ + int fd, i; + uint8_t *req = NULL; + uint8_t req_size = 0; + + if (!(dev->ctrl_io)) + return; + + req_size = 1 + (output->size / 2); + req = g_try_malloc0(req_size); + if (!req) + return; + + req[0] = HID_MSG_SET_REPORT | output->rtype; + for (i = 0; i < (req_size - 1); i++) + sscanf((char *) &(output->data)[i * 2], "%hhx", &req[1 + i]); + + fd = g_io_channel_unix_get_fd(dev->ctrl_io); + + if (write(fd, req, req_size) < 0) + error("error writing set_report: %s (%d)", + strerror(errno), errno); + + g_free(req); +} + +static gboolean uhid_event_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct hid_device *dev = user_data; + struct uhid_event ev; + ssize_t bread; + int fd; + + DBG(""); + + if (cond & (G_IO_ERR | G_IO_NVAL)) + goto failed; + + fd = g_io_channel_unix_get_fd(io); + memset(&ev, 0, sizeof(ev)); + + bread = read(fd, &ev, sizeof(ev)); + if (bread < 0) { + DBG("read: %s (%d)", strerror(errno), errno); + goto failed; + } + + DBG("uHID event type %d received", ev.type); + + switch (ev.type) { + case UHID_START: + case UHID_STOP: + /* These are called to start and stop the underlying hardware. + * We open the channels before creating the device so the + * hardware is always ready. No need to handle these. + * The kernel never destroys a device itself! Only an explicit + * UHID_DESTROY request can remove a device. */ + + break; + case UHID_OPEN: + case UHID_CLOSE: + /* OPEN/CLOSE are sent whenever user-space opens any interface + * provided by the kernel HID device. Whenever the open-count + * is non-zero we must be ready for I/O. As long as it is zero, + * we can decide to drop all I/O and put the device + * asleep This is optional, though. */ + break; + case UHID_OUTPUT: + handle_uhid_output(dev, &ev.u.output); + break; + case UHID_FEATURE: + /* TODO */ + break; + case UHID_OUTPUT_EV: + /* This is only sent by kernels prior to linux-3.11. It + * requires us to parse HID-descriptors in user-space to + * properly handle it. This is redundant as the kernel + * does it already. That's why newer kernels assemble + * the output-reports and send it to us via UHID_OUTPUT. */ + DBG("UHID_OUTPUT_EV unsupported"); + break; + default: + warn("unexpected uHID event"); + } + + return TRUE; + +failed: + dev->uhid_watch_id = 0; + return FALSE; +} + +static gboolean intr_io_watch_cb(GIOChannel *chan, gpointer data) +{ + struct hid_device *dev = data; + uint8_t buf[UHID_DATA_MAX]; + struct uhid_event ev; + int fd, bread; + + /* Wait uHID if not ready */ + if (dev->uhid_fd < 0) + return TRUE; + + fd = g_io_channel_unix_get_fd(chan); + bread = read(fd, buf, sizeof(buf)); + if (bread < 0) { + error("read: %s(%d)", strerror(errno), -errno); + return TRUE; + } + + /* Discard non-data packets */ + if (bread == 0 || buf[0] != (HID_MSG_DATA | HID_DATA_TYPE_INPUT)) + return TRUE; + + /* send data to uHID device skipping HIDP header byte */ + memset(&ev, 0, sizeof(ev)); + ev.type = UHID_INPUT; + ev.u.input.size = bread - 1; + memcpy(ev.u.input.data, &buf[1], ev.u.input.size); + + if (write(dev->uhid_fd, &ev, sizeof(ev)) < 0) + DBG("uhid write: %s (%d)", strerror(errno), errno); + + return TRUE; +} + +static void bt_hid_notify_state(struct hid_device *dev, uint8_t state) +{ + struct hal_ev_hidhost_conn_state ev; + char address[18]; + + if (dev->state == state) + return; + + dev->state = state; + + ba2str(&dev->dst, address); + DBG("device %s state %u", address, state); + + bdaddr2android(&dev->dst, ev.bdaddr); + ev.state = state; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HIDHOST, + HAL_EV_HIDHOST_CONN_STATE, sizeof(ev), &ev); +} + +static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond, + gpointer data) +{ + struct hid_device *dev = data; + + if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) + goto error; + + if (cond & G_IO_IN) + return intr_io_watch_cb(chan, data); + +error: + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTED); + + /* Checking for ctrl_watch avoids a double g_io_channel_shutdown since + * it's likely that ctrl_watch_cb has been queued for dispatching in + * this mainloop iteration */ + if ((cond & (G_IO_HUP | G_IO_ERR)) && dev->ctrl_watch) + g_io_channel_shutdown(chan, TRUE, NULL); + + /* Close control channel */ + if (dev->ctrl_io && !(cond & G_IO_NVAL)) + g_io_channel_shutdown(dev->ctrl_io, TRUE, NULL); + + hid_device_remove(dev); + + return FALSE; +} + +static void bt_hid_notify_proto_mode(struct hid_device *dev, uint8_t *buf, + int len) +{ + struct hal_ev_hidhost_proto_mode ev; + char address[18]; + + ba2str(&dev->dst, address); + DBG("device %s", address); + + memset(&ev, 0, sizeof(ev)); + bdaddr2android(&dev->dst, ev.bdaddr); + + if (buf[0] == HID_MSG_DATA) { + ev.status = HAL_HIDHOST_STATUS_OK; + if (buf[1] == HID_PROTO_REPORT) + ev.mode = HAL_HIDHOST_REPORT_PROTOCOL; + else if (buf[1] == HID_PROTO_BOOT) + ev.mode = HAL_HIDHOST_BOOT_PROTOCOL; + else + ev.mode = HAL_HIDHOST_UNSUPPORTED_PROTOCOL; + + } else { + ev.status = buf[0]; + ev.mode = HAL_HIDHOST_UNSUPPORTED_PROTOCOL; + } + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HIDHOST, + HAL_EV_HIDHOST_PROTO_MODE, sizeof(ev), &ev); +} + +static void bt_hid_notify_get_report(struct hid_device *dev, uint8_t *buf, + int len) +{ + struct hal_ev_hidhost_get_report *ev; + int ev_len; + char address[18]; + + ba2str(&dev->dst, address); + DBG("device %s", address); + + ev_len = sizeof(*ev); + + if (!((buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_INPUT)) || + (buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_OUTPUT)) || + (buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_FEATURE)))) { + ev = g_malloc0(ev_len); + ev->status = buf[0]; + bdaddr2android(&dev->dst, ev->bdaddr); + goto send; + } + + /* Report porotocol mode reply contains id after hdr, in boot + * protocol mode id doesn't exist */ + ev_len += (dev->boot_dev) ? (len - 1) : (len - 2); + ev = g_malloc0(ev_len); + ev->status = HAL_HIDHOST_STATUS_OK; + bdaddr2android(&dev->dst, ev->bdaddr); + + /* Report porotocol mode reply contains id after hdr, in boot + * protocol mode id doesn't exist */ + if (dev->boot_dev) { + ev->len = len - 1; + memcpy(ev->data, buf + 1, ev->len); + } else { + ev->len = len - 2; + memcpy(ev->data, buf + 2, ev->len); + } + +send: + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HIDHOST, + HAL_EV_HIDHOST_GET_REPORT, ev_len, ev); + g_free(ev); +} + +static void bt_hid_notify_virtual_unplug(struct hid_device *dev, + uint8_t *buf, int len) +{ + struct hal_ev_hidhost_virtual_unplug ev; + char address[18]; + + ba2str(&dev->dst, address); + DBG("device %s", address); + bdaddr2android(&dev->dst, ev.bdaddr); + + ev.status = HAL_HIDHOST_GENERAL_ERROR; + + /* Wait either channels to HUP */ + if (dev->intr_io && dev->ctrl_io) { + g_io_channel_shutdown(dev->intr_io, TRUE, NULL); + g_io_channel_shutdown(dev->ctrl_io, TRUE, NULL); + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTING); + ev.status = HAL_HIDHOST_STATUS_OK; + } + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HIDHOST, + HAL_EV_HIDHOST_VIRTUAL_UNPLUG, sizeof(ev), &ev); +} + +static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data) +{ + struct hid_device *dev = data; + int fd, bread; + uint8_t buf[UHID_DATA_MAX]; + + DBG(""); + + fd = g_io_channel_unix_get_fd(chan); + bread = read(fd, buf, sizeof(buf)); + if (bread < 0) { + error("read: %s(%d)", strerror(errno), -errno); + return TRUE; + } + + switch (dev->last_hid_msg) { + case HID_MSG_GET_PROTOCOL: + case HID_MSG_SET_PROTOCOL: + bt_hid_notify_proto_mode(dev, buf, bread); + break; + case HID_MSG_GET_REPORT: + bt_hid_notify_get_report(dev, buf, bread); + break; + } + + if (buf[0] == (HID_MSG_CONTROL | HID_VIRTUAL_CABLE_UNPLUG)) + bt_hid_notify_virtual_unplug(dev, buf, bread); + + /* reset msg type request */ + dev->last_hid_msg = 0; + + return TRUE; +} + +static gboolean ctrl_watch_cb(GIOChannel *chan, GIOCondition cond, + gpointer data) +{ + struct hid_device *dev = data; + + if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) + goto error; + + if (cond & G_IO_IN) + return ctrl_io_watch_cb(chan, data); + +error: + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTED); + + /* Checking for intr_watch avoids a double g_io_channel_shutdown since + * it's likely that intr_watch_cb has been queued for dispatching in + * this mainloop iteration */ + if ((cond & (G_IO_HUP | G_IO_ERR)) && dev->intr_watch) + g_io_channel_shutdown(chan, TRUE, NULL); + + if (dev->intr_io && !(cond & G_IO_NVAL)) + g_io_channel_shutdown(dev->intr_io, TRUE, NULL); + + hid_device_remove(dev); + + return FALSE; +} + +static void bt_hid_set_info(struct hid_device *dev) +{ + struct hal_ev_hidhost_info ev; + + DBG(""); + + bdaddr2android(&dev->dst, ev.bdaddr); + ev.attr = 0; /* TODO: Check what is this field */ + ev.subclass = dev->subclass; + ev.app_id = 0; /* TODO: Check what is this field */ + ev.vendor = dev->vendor; + ev.product = dev->product; + ev.version = dev->version; + ev.country = dev->country; + ev.descr_len = dev->rd_size; + memset(ev.descr, 0, sizeof(ev.descr)); + memcpy(ev.descr, dev->rd_data, ev.descr_len); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HIDHOST, HAL_EV_HIDHOST_INFO, + sizeof(ev), &ev); +} + +static int uhid_create(struct hid_device *dev) +{ + GIOCondition cond = G_IO_IN | G_IO_ERR | G_IO_NVAL; + struct uhid_event ev; + GIOChannel *io; + int err; + + dev->uhid_fd = open(UHID_DEVICE_FILE, O_RDWR | O_CLOEXEC); + if (dev->uhid_fd < 0) { + err = -errno; + error("Failed to open uHID device: %s", strerror(errno)); + return err; + } + + memset(&ev, 0, sizeof(ev)); + ev.type = UHID_CREATE; + strcpy((char *) ev.u.create.name, "bluez-input-device"); + ev.u.create.bus = BUS_BLUETOOTH; + ev.u.create.vendor = dev->vendor; + ev.u.create.product = dev->product; + ev.u.create.version = dev->version; + ev.u.create.country = dev->country; + ev.u.create.rd_size = dev->rd_size; + ev.u.create.rd_data = dev->rd_data; + + if (write(dev->uhid_fd, &ev, sizeof(ev)) < 0) { + err = -errno; + error("Failed to create uHID device: %s", strerror(errno)); + close(dev->uhid_fd); + dev->uhid_fd = -1; + return err; + } + + io = g_io_channel_unix_new(dev->uhid_fd); + g_io_channel_set_encoding(io, NULL, NULL); + dev->uhid_watch_id = g_io_add_watch(io, cond, uhid_event_cb, dev); + g_io_channel_unref(io); + + bt_hid_set_info(dev); + + return 0; +} + +static void interrupt_connect_cb(GIOChannel *chan, GError *conn_err, + gpointer user_data) +{ + struct hid_device *dev = user_data; + uint8_t state; + + DBG(""); + + if (conn_err) { + error("%s", conn_err->message); + state = HAL_HIDHOST_STATE_FAILED; + goto failed; + } + + if (uhid_create(dev) < 0) { + state = HAL_HIDHOST_STATE_NO_HID; + goto failed; + } + + dev->intr_watch = g_io_add_watch(dev->intr_io, + G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, + intr_watch_cb, dev); + + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_CONNECTED); + + return; + +failed: + bt_hid_notify_state(dev, state); + hid_device_remove(dev); +} + +static void control_connect_cb(GIOChannel *chan, GError *conn_err, + gpointer user_data) +{ + struct hid_device *dev = user_data; + GError *err = NULL; + + DBG(""); + + if (conn_err) { + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTED); + error("%s", conn_err->message); + goto failed; + } + + /* Connect to the HID interrupt channel */ + dev->intr_io = bt_io_connect(interrupt_connect_cb, dev, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_DEST_BDADDR, &dev->dst, + BT_IO_OPT_PSM, L2CAP_PSM_HIDP_INTR, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW, + BT_IO_OPT_INVALID); + if (!dev->intr_io) { + error("%s", err->message); + g_error_free(err); + goto failed; + } + + dev->ctrl_watch = g_io_add_watch(dev->ctrl_io, + G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, + ctrl_watch_cb, dev); + + return; + +failed: + hid_device_remove(dev); +} + +static void hid_sdp_search_cb(sdp_list_t *recs, int err, gpointer data) +{ + struct hid_device *dev = data; + sdp_list_t *list; + GError *gerr = NULL; + + DBG(""); + + if (err < 0) { + error("Unable to get SDP record: %s", strerror(-err)); + goto fail; + } + + if (!recs || !recs->data) { + error("No SDP records found"); + goto fail; + } + + for (list = recs; list != NULL; list = list->next) { + sdp_record_t *rec = list->data; + sdp_data_t *data; + + data = sdp_data_get(rec, SDP_ATTR_HID_COUNTRY_CODE); + if (data) + dev->country = data->val.uint8; + + data = sdp_data_get(rec, SDP_ATTR_HID_DEVICE_SUBCLASS); + if (data) + dev->subclass = data->val.uint8; + + data = sdp_data_get(rec, SDP_ATTR_HID_BOOT_DEVICE); + if (data) + dev->boot_dev = data->val.uint8; + + data = sdp_data_get(rec, SDP_ATTR_HID_DESCRIPTOR_LIST); + if (data) { + if (!SDP_IS_SEQ(data->dtd)) + goto fail; + + /* First HIDDescriptor */ + data = data->val.dataseq; + if (!SDP_IS_SEQ(data->dtd)) + goto fail; + + /* ClassDescriptorType */ + data = data->val.dataseq; + if (data->dtd != SDP_UINT8) + goto fail; + + /* ClassDescriptorData */ + data = data->next; + if (!data || !SDP_IS_TEXT_STR(data->dtd)) + goto fail; + + dev->rd_size = data->unitSize; + dev->rd_data = g_memdup(data->val.str, data->unitSize); + } + } + + if (dev->ctrl_io) { + if (uhid_create(dev) < 0) + goto fail; + return; + } + + dev->ctrl_io = bt_io_connect(control_connect_cb, dev, NULL, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_DEST_BDADDR, &dev->dst, + BT_IO_OPT_PSM, L2CAP_PSM_HIDP_CTRL, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW, + BT_IO_OPT_INVALID); + if (gerr) { + error("%s", gerr->message); + g_error_free(gerr); + goto fail; + } + + return; + +fail: + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTED); + hid_device_remove(dev); +} + +static void hid_sdp_did_search_cb(sdp_list_t *recs, int err, gpointer data) +{ + struct hid_device *dev = data; + sdp_list_t *list; + uuid_t uuid; + + DBG(""); + + if (err < 0) { + error("Unable to get Device ID SDP record: %s", strerror(-err)); + goto fail; + } + + if (!recs || !recs->data) { + error("No SDP records found"); + goto fail; + } + + for (list = recs; list; list = list->next) { + sdp_record_t *rec = list->data; + sdp_data_t *data; + + data = sdp_data_get(rec, SDP_ATTR_VENDOR_ID); + if (data) + dev->vendor = data->val.uint16; + + data = sdp_data_get(rec, SDP_ATTR_PRODUCT_ID); + if (data) + dev->product = data->val.uint16; + + data = sdp_data_get(rec, SDP_ATTR_VERSION); + if (data) + dev->version = data->val.uint16; + } + + sdp_uuid16_create(&uuid, HID_SVCLASS_ID); + if (bt_search_service(&adapter_addr, &dev->dst, &uuid, + hid_sdp_search_cb, dev, NULL, 0) < 0) { + error("failed to search sdp details"); + goto fail; + } + + return; + +fail: + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTED); + hid_device_remove(dev); +} + +static void bt_hid_connect(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_connect *cmd = buf; + struct hid_device *dev; + uint8_t status; + char addr[18]; + bdaddr_t dst; + GSList *l; + uuid_t uuid; + + DBG(""); + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = g_new0(struct hid_device, 1); + bacpy(&dev->dst, &dst); + dev->uhid_fd = -1; + + ba2str(&dev->dst, addr); + DBG("connecting to %s", addr); + + sdp_uuid16_create(&uuid, PNP_INFO_SVCLASS_ID); + if (bt_search_service(&adapter_addr, &dev->dst, &uuid, + hid_sdp_did_search_cb, dev, NULL, 0) < 0) { + error("Failed to search DeviceID SDP details"); + hid_device_remove(dev); + status = HAL_STATUS_FAILED; + goto failed; + } + + devices = g_slist_append(devices, dev); + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_CONNECTING); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_CONNECT, + status); +} + +static void bt_hid_disconnect(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_disconnect *cmd = buf; + struct hid_device *dev; + uint8_t status; + GSList *l; + bdaddr_t dst; + + DBG(""); + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + + /* Wait either channels to HUP */ + if (dev->intr_io) + g_io_channel_shutdown(dev->intr_io, TRUE, NULL); + + if (dev->ctrl_io) + g_io_channel_shutdown(dev->ctrl_io, TRUE, NULL); + + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTING); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_DISCONNECT, + status); +} + +static void bt_hid_virtual_unplug(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_virtual_unplug *cmd = buf; + struct hid_device *dev; + GSList *l; + uint8_t status; + bdaddr_t dst; + uint8_t hdr; + int fd; + + DBG(""); + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + + if (!(dev->ctrl_io)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + hdr = HID_MSG_CONTROL | HID_VIRTUAL_CABLE_UNPLUG; + + fd = g_io_channel_unix_get_fd(dev->ctrl_io); + + if (write(fd, &hdr, sizeof(hdr)) < 0) { + error("error writing virtual unplug command: %s (%d)", + strerror(errno), errno); + status = HAL_STATUS_FAILED; + goto failed; + } + + /* Wait either channels to HUP */ + if (dev->intr_io) + g_io_channel_shutdown(dev->intr_io, TRUE, NULL); + + if (dev->ctrl_io) + g_io_channel_shutdown(dev->ctrl_io, TRUE, NULL); + + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTING); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_VIRTUAL_UNPLUG, status); +} + +static void bt_hid_info(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_set_info *cmd = buf; + + if (len != sizeof(*cmd) + cmd->descr_len) { + error("Invalid hid set info size (%u bytes), terminating", len); + raise(SIGTERM); + return; + } + + /* Data from hal_cmd_hidhost_set_info is usefull only when we create + * UHID device. Once device is created all the transactions will be + * done through the fd. There is no way to use this information + * once device is created with HID internals. */ + DBG("Not supported"); + + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_SET_INFO, + HAL_STATUS_UNSUPPORTED); +} + +static void bt_hid_get_protocol(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_get_protocol *cmd = buf; + struct hid_device *dev; + GSList *l; + bdaddr_t dst; + int fd; + uint8_t hdr; + uint8_t status; + + DBG(""); + + switch (cmd->mode) { + case HAL_HIDHOST_REPORT_PROTOCOL: + case HAL_HIDHOST_BOOT_PROTOCOL: + break; + default: + status = HAL_STATUS_INVALID; + goto failed; + } + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + + hdr = HID_MSG_GET_PROTOCOL | cmd->mode; + fd = g_io_channel_unix_get_fd(dev->ctrl_io); + + if (write(fd, &hdr, sizeof(hdr)) < 0) { + error("error writing device_get_protocol: %s (%d)", + strerror(errno), errno); + status = HAL_STATUS_FAILED; + goto failed; + } + + dev->last_hid_msg = HID_MSG_GET_PROTOCOL; + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_PROTOCOL, status); +} + +static void bt_hid_set_protocol(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_set_protocol *cmd = buf; + struct hid_device *dev; + GSList *l; + bdaddr_t dst; + int fd; + uint8_t hdr; + uint8_t status; + + DBG(""); + + switch (cmd->mode) { + case HAL_HIDHOST_REPORT_PROTOCOL: + case HAL_HIDHOST_BOOT_PROTOCOL: + break; + default: + status = HAL_STATUS_INVALID; + goto failed; + } + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + + hdr = HID_MSG_SET_PROTOCOL | cmd->mode; + fd = g_io_channel_unix_get_fd(dev->ctrl_io); + + if (write(fd, &hdr, sizeof(hdr)) < 0) { + error("error writing device_set_protocol: %s (%d)", + strerror(errno), errno); + status = HAL_STATUS_FAILED; + goto failed; + } + + dev->last_hid_msg = HID_MSG_SET_PROTOCOL; + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_PROTOCOL, status); +} + +static void bt_hid_get_report(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_get_report *cmd = buf; + struct hid_device *dev; + GSList *l; + bdaddr_t dst; + int fd; + uint8_t *req; + uint8_t req_size; + uint8_t status; + + DBG(""); + + switch (cmd->type) { + case HAL_HIDHOST_INPUT_REPORT: + case HAL_HIDHOST_OUTPUT_REPORT: + case HAL_HIDHOST_FEATURE_REPORT: + break; + default: + status = HAL_STATUS_INVALID; + goto failed; + } + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + req_size = (cmd->buf_size > 0) ? 4 : 2; + req = g_try_malloc0(req_size); + if (!req) { + status = HAL_STATUS_NOMEM; + goto failed; + } + + req[0] = HID_MSG_GET_REPORT | cmd->type; + req[1] = cmd->id; + + if (cmd->buf_size > 0) { + req[0] = req[0] | HID_GET_REPORT_SIZE_FIELD; + put_le16(cmd->buf_size, &req[2]); + } + + fd = g_io_channel_unix_get_fd(dev->ctrl_io); + + if (write(fd, req, req_size) < 0) { + error("error writing hid_get_report: %s (%d)", + strerror(errno), errno); + g_free(req); + status = HAL_STATUS_FAILED; + goto failed; + } + + dev->last_hid_msg = HID_MSG_GET_REPORT; + g_free(req); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_GET_REPORT, + status); +} + +static void bt_hid_set_report(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_set_report *cmd = buf; + struct hid_device *dev; + GSList *l; + bdaddr_t dst; + int i, fd; + uint8_t *req; + uint8_t req_size; + uint8_t status; + + DBG(""); + + if (len != sizeof(*cmd) + cmd->len) { + error("Invalid hid set report size (%u bytes), terminating", + len); + raise(SIGTERM); + return; + } + + switch (cmd->type) { + case HAL_HIDHOST_INPUT_REPORT: + case HAL_HIDHOST_OUTPUT_REPORT: + case HAL_HIDHOST_FEATURE_REPORT: + break; + default: + status = HAL_STATUS_INVALID; + goto failed; + } + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + + if (!(dev->ctrl_io)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + req_size = 1 + (cmd->len / 2); + req = g_try_malloc0(req_size); + if (!req) { + status = HAL_STATUS_NOMEM; + goto failed; + } + + req[0] = HID_MSG_SET_REPORT | cmd->type; + /* Report data coming to HAL is in ascii format, HAL sends + * data in hex to daemon, so convert to binary. */ + for (i = 0; i < (req_size - 1); i++) + sscanf((char *) &(cmd->data)[i * 2], "%hhx", &(req + 1)[i]); + + fd = g_io_channel_unix_get_fd(dev->ctrl_io); + + if (write(fd, req, req_size) < 0) { + error("error writing hid_set_report: %s (%d)", + strerror(errno), errno); + g_free(req); + status = HAL_STATUS_FAILED; + goto failed; + } + + dev->last_hid_msg = HID_MSG_SET_REPORT; + g_free(req); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_SET_REPORT, + status); +} + +static void bt_hid_send_data(const void *buf, uint16_t len) +{ + const struct hal_cmd_hidhost_send_data *cmd = buf; + struct hid_device *dev; + GSList *l; + bdaddr_t dst; + int i, fd; + uint8_t *req; + uint8_t req_size; + uint8_t status; + + DBG(""); + + if (len != sizeof(*cmd) + cmd->len) { + error("Invalid hid send data size (%u bytes), terminating", + len); + raise(SIGTERM); + return; + } + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + + if (!(dev->intr_io)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + req_size = 1 + (cmd->len / 2); + req = g_try_malloc0(req_size); + if (!req) { + status = HAL_STATUS_NOMEM; + goto failed; + } + + req[0] = HID_MSG_DATA | HID_DATA_TYPE_OUTPUT; + /* Report data coming to HAL is in ascii format, HAL sends + * data in hex to daemon, so convert to binary. */ + for (i = 0; i < (req_size - 1); i++) + sscanf((char *) &(cmd->data)[i * 2], "%hhx", &(req + 1)[i]); + + fd = g_io_channel_unix_get_fd(dev->intr_io); + + if (write(fd, req, req_size) < 0) { + error("error writing data to HID device: %s (%d)", + strerror(errno), errno); + g_free(req); + status = HAL_STATUS_FAILED; + goto failed; + } + + g_free(req); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HIDHOST, HAL_OP_HIDHOST_SEND_DATA, + status); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_HIDHOST_CONNECT */ + { bt_hid_connect, false, sizeof(struct hal_cmd_hidhost_connect) }, + /* HAL_OP_HIDHOST_DISCONNECT */ + { bt_hid_disconnect, false, sizeof(struct hal_cmd_hidhost_disconnect) }, + /* HAL_OP_HIDHOST_VIRTUAL_UNPLUG */ + { bt_hid_virtual_unplug, false, + sizeof(struct hal_cmd_hidhost_virtual_unplug) }, + /* HAL_OP_HIDHOST_SET_INFO */ + { bt_hid_info, true, sizeof(struct hal_cmd_hidhost_set_info) }, + /* HAL_OP_HIDHOST_GET_PROTOCOL */ + { bt_hid_get_protocol, false, + sizeof(struct hal_cmd_hidhost_get_protocol) }, + /* HAL_OP_HIDHOST_SET_PROTOCOL */ + { bt_hid_set_protocol, false, + sizeof(struct hal_cmd_hidhost_get_protocol) }, + /* HAL_OP_HIDHOST_GET_REPORT */ + { bt_hid_get_report, false, sizeof(struct hal_cmd_hidhost_get_report) }, + /* HAL_OP_HIDHOST_SET_REPORT */ + { bt_hid_set_report, true, sizeof(struct hal_cmd_hidhost_set_report) }, + /* HAL_OP_HIDHOST_SEND_DATA */ + { bt_hid_send_data, true, sizeof(struct hal_cmd_hidhost_send_data) }, +}; + +static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data) +{ + struct hid_device *dev; + bdaddr_t src, dst; + char address[18]; + uint16_t psm; + GError *gerr = NULL; + GSList *l; + uuid_t uuid; + + if (err) { + error("%s", err->message); + return; + } + + bt_io_get(chan, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &src, + BT_IO_OPT_DEST_BDADDR, &dst, + BT_IO_OPT_PSM, &psm, + BT_IO_OPT_INVALID); + if (gerr) { + error("%s", gerr->message); + g_io_channel_shutdown(chan, TRUE, NULL); + g_error_free(gerr); + return; + } + + ba2str(&dst, address); + DBG("Incoming connection from %s on PSM %d", address, psm); + + switch (psm) { + case L2CAP_PSM_HIDP_CTRL: + l = g_slist_find_custom(devices, &dst, device_cmp); + if (l) + return; + + dev = g_new0(struct hid_device, 1); + bacpy(&dev->dst, &dst); + dev->ctrl_io = g_io_channel_ref(chan); + dev->uhid_fd = -1; + + sdp_uuid16_create(&uuid, PNP_INFO_SVCLASS_ID); + if (bt_search_service(&src, &dev->dst, &uuid, + hid_sdp_did_search_cb, dev, NULL, 0) < 0) { + error("failed to search did sdp details"); + hid_device_remove(dev); + return; + } + + devices = g_slist_append(devices, dev); + + dev->ctrl_watch = g_io_add_watch(dev->ctrl_io, + G_IO_HUP | G_IO_ERR | G_IO_NVAL, + ctrl_watch_cb, dev); + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_CONNECTING); + break; + + case L2CAP_PSM_HIDP_INTR: + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) + return; + + dev = l->data; + dev->intr_io = g_io_channel_ref(chan); + dev->intr_watch = g_io_add_watch(dev->intr_io, + G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, + intr_watch_cb, dev); + bt_hid_notify_state(dev, HAL_HIDHOST_STATE_CONNECTED); + break; + } +} + +bool bt_hid_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode) +{ + GError *err = NULL; + + DBG(""); + + bacpy(&adapter_addr, addr); + + ctrl_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_PSM, L2CAP_PSM_HIDP_CTRL, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW, + BT_IO_OPT_INVALID); + if (!ctrl_io) { + error("Failed to listen on ctrl channel: %s", err->message); + g_error_free(err); + return false; + } + + intr_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_PSM, L2CAP_PSM_HIDP_INTR, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW, + BT_IO_OPT_INVALID); + if (!intr_io) { + error("Failed to listen on intr channel: %s", err->message); + g_error_free(err); + + g_io_channel_shutdown(ctrl_io, TRUE, NULL); + g_io_channel_unref(ctrl_io); + ctrl_io = NULL; + + return false; + } + + hal_ipc = ipc; + + ipc_register(hal_ipc, HAL_SERVICE_ID_HIDHOST, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); + + return true; +} + +void bt_hid_unregister(void) +{ + DBG(""); + + g_slist_free_full(devices, hid_device_free); + devices = NULL; + + if (ctrl_io) { + g_io_channel_shutdown(ctrl_io, TRUE, NULL); + g_io_channel_unref(ctrl_io); + ctrl_io = NULL; + } + + if (intr_io) { + g_io_channel_shutdown(intr_io, TRUE, NULL); + g_io_channel_unref(intr_io); + intr_io = NULL; + } + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_HIDHOST); + hal_ipc = NULL; +}
diff --git a/bluez/android/hidhost.h b/bluez/android/hidhost.h new file mode 100644 index 0000000..e6b87ed --- /dev/null +++ b/bluez/android/hidhost.h
@@ -0,0 +1,25 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +bool bt_hid_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode); +void bt_hid_unregister(void);
diff --git a/bluez/android/init.bluetooth.rc b/bluez/android/init.bluetooth.rc new file mode 100644 index 0000000..af62121 --- /dev/null +++ b/bluez/android/init.bluetooth.rc
@@ -0,0 +1,38 @@ +# required permissions +on boot + chown bluetooth bluetooth /data/misc/bluetooth + chown bluetooth bluetooth /dev/uhid + chown system bluetooth /dev/uinput + +# services +on property:bluetooth.start=daemon + setprop bluetooth.start none + start bluetoothd + +on property:bluetooth.stop=daemon + setprop bluetooth.stop none + stop bluetoothd + +on property:bluetooth.start=snoop + setprop bluetooth.start none + start bluetoothd-snoop + +on property:bluetooth.stop=snoop + setprop bluetooth.stop none + stop bluetoothd-snoop + +service bluetoothd /system/bin/logwrapper /system/bin/bluetoothd + class main + # init does not yet support setting capabilities so run as root, + # bluetoothd drop uid to bluetooth with the right linux capabilities + group bluetooth + disabled + oneshot + +service bluetoothd-snoop /system/bin/logwrapper /system/bin/bluetoothd-snoop + class main + # init does not yet support setting capabilities so run as root, + # bluetoothd-snoop drops unneeded linux capabilities + group nobody + disabled + oneshot
diff --git a/bluez/android/ipc-common.h b/bluez/android/ipc-common.h new file mode 100644 index 0000000..27736e4 --- /dev/null +++ b/bluez/android/ipc-common.h
@@ -0,0 +1,38 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#define IPC_MTU 1024 + +#define IPC_STATUS_SUCCESS 0x00 + +struct ipc_hdr { + uint8_t service_id; + uint8_t opcode; + uint16_t len; + uint8_t payload[0]; +} __attribute__((packed)); + +#define IPC_OP_STATUS 0x00 +struct ipc_status { + uint8_t code; +} __attribute__((packed));
diff --git a/bluez/android/ipc-tester.c b/bluez/android/ipc-tester.c new file mode 100644 index 0000000..63fd105 --- /dev/null +++ b/bluez/android/ipc-tester.c
@@ -0,0 +1,1261 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdlib.h> +#include <unistd.h> +#include <errno.h> +#include <poll.h> + +#include <sys/socket.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <sys/un.h> +#include <libgen.h> +#include <glib.h> + +#include "lib/bluetooth.h" +#include "lib/mgmt.h" + +#include "src/shared/tester.h" +#include "src/shared/mgmt.h" +#include "src/shared/hciemu.h" + +#include "hal-msg.h" +#include "ipc-common.h" + +#include <cutils/properties.h> + +#define WAIT_FOR_SIGNAL_TIME 2 /* in seconds */ +#define EMULATOR_SIGNAL "emulator_started" + +struct test_data { + struct mgmt *mgmt; + uint16_t mgmt_index; + struct hciemu *hciemu; + enum hciemu_type hciemu_type; + pid_t bluetoothd_pid; + bool setup_done; +}; + +struct ipc_data { + void *buffer; + size_t len; +}; + +struct generic_data { + struct ipc_data ipc_data; + + unsigned int num_services; + int init_services[]; +}; + +struct regmod_msg { + struct ipc_hdr header; + struct hal_cmd_register_module cmd; +} __attribute__((packed)); + +#define CONNECT_TIMEOUT (5 * 1000) +#define SERVICE_NAME "bluetoothd" + +static char exec_dir[PATH_MAX + 1]; + +static int cmd_sk = -1; +static int notif_sk = -1; + +static void read_info_callback(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + const struct mgmt_rp_read_info *rp = param; + char addr[18]; + uint16_t manufacturer; + uint32_t supported_settings, current_settings; + + tester_print("Read Info callback"); + tester_print(" Status: 0x%02x", status); + + if (status || !param) { + tester_pre_setup_failed(); + return; + } + + ba2str(&rp->bdaddr, addr); + manufacturer = btohs(rp->manufacturer); + supported_settings = btohl(rp->supported_settings); + current_settings = btohl(rp->current_settings); + + tester_print(" Address: %s", addr); + tester_print(" Version: 0x%02x", rp->version); + tester_print(" Manufacturer: 0x%04x", manufacturer); + tester_print(" Supported settings: 0x%08x", supported_settings); + tester_print(" Current settings: 0x%08x", current_settings); + tester_print(" Class: 0x%02x%02x%02x", + rp->dev_class[2], rp->dev_class[1], rp->dev_class[0]); + tester_print(" Name: %s", rp->name); + tester_print(" Short name: %s", rp->short_name); + + if (strcmp(hciemu_get_address(data->hciemu), addr)) { + tester_pre_setup_failed(); + return; + } + + tester_pre_setup_complete(); +} + +static void index_added_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + + tester_print("Index Added callback"); + tester_print(" Index: 0x%04x", index); + + data->mgmt_index = index; + + mgmt_send(data->mgmt, MGMT_OP_READ_INFO, data->mgmt_index, 0, NULL, + read_info_callback, NULL, NULL); +} + +static void index_removed_callback(uint16_t index, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + + tester_print("Index Removed callback"); + tester_print(" Index: 0x%04x", index); + + if (index != data->mgmt_index) + return; + + mgmt_unregister_index(data->mgmt, data->mgmt_index); + + mgmt_unref(data->mgmt); + data->mgmt = NULL; + + tester_post_teardown_complete(); +} + +static void read_index_list_callback(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + struct test_data *data = tester_get_data(); + + tester_print("Read Index List callback"); + tester_print(" Status: 0x%02x", status); + + if (status || !param) { + tester_pre_setup_failed(); + return; + } + + mgmt_register(data->mgmt, MGMT_EV_INDEX_ADDED, MGMT_INDEX_NONE, + index_added_callback, NULL, NULL); + + mgmt_register(data->mgmt, MGMT_EV_INDEX_REMOVED, MGMT_INDEX_NONE, + index_removed_callback, NULL, NULL); + + data->hciemu = hciemu_new(data->hciemu_type); + if (!data->hciemu) { + tester_warn("Failed to setup HCI emulation"); + tester_pre_setup_failed(); + return; + } + + tester_print("New hciemu instance created"); +} + +static void test_pre_setup(const void *data) +{ + struct test_data *test_data = tester_get_data(); + + if (!tester_use_debug()) + fclose(stderr); + + test_data->mgmt = mgmt_new_default(); + if (!test_data->mgmt) { + tester_warn("Failed to setup management interface"); + tester_pre_setup_failed(); + return; + } + + mgmt_send(test_data->mgmt, MGMT_OP_READ_INDEX_LIST, MGMT_INDEX_NONE, 0, + NULL, read_index_list_callback, NULL, NULL); +} + +static void test_post_teardown(const void *data) +{ + struct test_data *test_data = tester_get_data(); + + if (test_data->hciemu) { + hciemu_unref(test_data->hciemu); + test_data->hciemu = NULL; + } +} + +static void bluetoothd_start(int hci_index) +{ + char prg_name[PATH_MAX + 1]; + char index[8]; + char *prg_argv[4]; + + snprintf(prg_name, sizeof(prg_name), "%s/%s", exec_dir, "bluetoothd"); + snprintf(index, sizeof(index), "%d", hci_index); + + prg_argv[0] = prg_name; + prg_argv[1] = "-i"; + prg_argv[2] = index; + prg_argv[3] = NULL; + + if (!tester_use_debug()) + fclose(stderr); + + execve(prg_argv[0], prg_argv, NULL); +} + +static void emulator(int pipe, int hci_index) +{ + static const char SYSTEM_SOCKET_PATH[] = "\0android_system"; + char buf[1024]; + struct sockaddr_un addr; + struct timeval tv; + int fd; + ssize_t len; + + fd = socket(PF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0); + if (fd < 0) + goto failed; + + tv.tv_sec = WAIT_FOR_SIGNAL_TIME; + tv.tv_usec = 0; + setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(tv)); + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + memcpy(addr.sun_path, SYSTEM_SOCKET_PATH, sizeof(SYSTEM_SOCKET_PATH)); + + if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + perror("Failed to bind system socket"); + goto failed; + } + + len = write(pipe, EMULATOR_SIGNAL, sizeof(EMULATOR_SIGNAL)); + + if (len != sizeof(EMULATOR_SIGNAL)) + goto failed; + + memset(buf, 0, sizeof(buf)); + + len = read(fd, buf, sizeof(buf)); + if (len <= 0 || strcmp(buf, "ctl.start=bluetoothd")) + goto failed; + + close(pipe); + close(fd); + bluetoothd_start(hci_index); + +failed: + close(pipe); + close(fd); +} + +static int accept_connection(int sk) +{ + int err; + struct pollfd pfd; + int new_sk; + + memset(&pfd, 0 , sizeof(pfd)); + pfd.fd = sk; + pfd.events = POLLIN; + + err = poll(&pfd, 1, CONNECT_TIMEOUT); + if (err < 0) { + err = errno; + tester_warn("Failed to poll: %d (%s)", err, strerror(err)); + return -errno; + } + + if (err == 0) { + tester_warn("bluetoothd connect timeout"); + return -errno; + } + + new_sk = accept(sk, NULL, NULL); + if (new_sk < 0) { + err = errno; + tester_warn("Failed to accept socket: %d (%s)", + err, strerror(err)); + return -errno; + } + + return new_sk; +} + +static bool init_ipc(void) +{ + struct sockaddr_un addr; + + int sk; + int err; + + sk = socket(AF_LOCAL, SOCK_SEQPACKET, 0); + if (sk < 0) { + err = errno; + tester_warn("Failed to create socket: %d (%s)", err, + strerror(err)); + return false; + } + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + + memcpy(addr.sun_path, BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH)); + + if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) { + err = errno; + tester_warn("Failed to bind socket: %d (%s)", err, + strerror(err)); + close(sk); + return false; + } + + if (listen(sk, 2) < 0) { + err = errno; + tester_warn("Failed to listen on socket: %d (%s)", err, + strerror(err)); + close(sk); + return false; + } + + /* Start Android Bluetooth daemon service */ + if (property_set("ctl.start", SERVICE_NAME) < 0) { + tester_warn("Failed to start service %s", SERVICE_NAME); + close(sk); + return false; + } + + cmd_sk = accept_connection(sk); + if (cmd_sk < 0) { + close(sk); + return false; + } + + notif_sk = accept_connection(sk); + if (notif_sk < 0) { + close(sk); + close(cmd_sk); + cmd_sk = -1; + return false; + } + + tester_print("bluetoothd connected"); + + close(sk); + + return true; +} + +static void cleanup_ipc(void) +{ + if (cmd_sk < 0) + return; + + close(cmd_sk); + cmd_sk = -1; +} + +static gboolean check_for_daemon(gpointer user_data) +{ + int status; + struct test_data *data = user_data; + + if ((waitpid(data->bluetoothd_pid, &status, WNOHANG)) + != data->bluetoothd_pid) + return true; + + if (data->setup_done) { + if (WIFEXITED(status) && + (WEXITSTATUS(status) == EXIT_SUCCESS)) { + tester_test_passed(); + return false; + } + tester_test_failed(); + } else { + tester_setup_failed(); + test_post_teardown(data); + } + + tester_warn("Unexpected Daemon shutdown with status %d", status); + return false; +} + +static bool setup_module(int service_id) +{ + struct ipc_hdr response; + struct ipc_hdr expected_response; + + struct regmod_msg btmodule_msg = { + .header = { + .service_id = HAL_SERVICE_ID_CORE, + .opcode = HAL_OP_REGISTER_MODULE, + .len = sizeof(struct hal_cmd_register_module), + }, + .cmd = { + .service_id = service_id, + }, + }; + + if (write(cmd_sk, &btmodule_msg, sizeof(btmodule_msg)) < 0) + goto fail; + + if (read(cmd_sk, &response, sizeof(response)) < 0) + goto fail; + + expected_response = btmodule_msg.header; + expected_response.len = 0; + + if (memcmp(&response, &expected_response, sizeof(response)) == 0) + return true; + +fail: + tester_warn("Module registration failed."); + return false; +} + +static void setup(const void *data) +{ + const struct generic_data *generic_data = data; + struct test_data *test_data = tester_get_data(); + int signal_fd[2]; + char buf[1024]; + pid_t pid; + int len; + unsigned int i; + + if (pipe(signal_fd)) + goto failed; + + pid = fork(); + + if (pid < 0) { + close(signal_fd[0]); + close(signal_fd[1]); + goto failed; + } + + if (pid == 0) { + if (!tester_use_debug()) + fclose(stderr); + + close(signal_fd[0]); + emulator(signal_fd[1], test_data->mgmt_index); + exit(0); + } + + close(signal_fd[1]); + test_data->bluetoothd_pid = pid; + + len = read(signal_fd[0], buf, sizeof(buf)); + if (len <= 0 || (strcmp(buf, EMULATOR_SIGNAL))) { + close(signal_fd[0]); + goto failed; + } + + g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, check_for_daemon, test_data, + NULL); + + if (!init_ipc()) { + tester_warn("Cannot initialize IPC mechanism!"); + goto failed; + } + tester_print("Will init %d services.", generic_data->num_services); + + for (i = 0; i < generic_data->num_services; i++) + if (!setup_module(generic_data->init_services[i])) { + cleanup_ipc(); + goto failed; + } + + test_data->setup_done = true; + + tester_setup_complete(); + return; + +failed: + g_idle_remove_by_data(test_data); + tester_setup_failed(); + test_post_teardown(data); +} + +static void teardown(const void *data) +{ + struct test_data *test_data = tester_get_data(); + + g_idle_remove_by_data(test_data); + cleanup_ipc(); + + if (test_data->bluetoothd_pid) + waitpid(test_data->bluetoothd_pid, NULL, 0); + + tester_teardown_complete(); +} + +static void ipc_send_tc(const void *data) +{ + const struct generic_data *generic_data = data; + const struct ipc_data *ipc_data = &generic_data->ipc_data; + + if (ipc_data->len) { + if (write(cmd_sk, ipc_data->buffer, ipc_data->len) < 0) + tester_test_failed(); + } +} + +#define service_data(args...) { args } + +#define gen_data(writelen, writebuf, servicelist...) \ + { \ + .ipc_data = { \ + .buffer = writebuf, \ + .len = writelen, \ + }, \ + .init_services = service_data(servicelist), \ + .num_services = sizeof((const int[]) \ + service_data(servicelist)) / \ + sizeof(int), \ + } + +#define test_generic(name, test, setup, teardown, buffer, writelen, \ + services...) \ + do { \ + struct test_data *user; \ + static const struct generic_data data = \ + gen_data(writelen, buffer, services); \ + user = g_malloc0(sizeof(struct test_data)); \ + if (!user) \ + break; \ + user->hciemu_type = HCIEMU_TYPE_BREDRLE; \ + tester_add_full(name, &data, test_pre_setup, setup, \ + test, teardown, test_post_teardown, \ + 3, user, g_free); \ + } while (0) + +#define test_opcode_valid(_name, _service, _opcode, _len, _servicelist...) \ + do { \ + static struct ipc_hdr hdr = { \ + .service_id = _service, \ + .opcode = _opcode, \ + .len = _len, \ + }; \ + \ + test_generic("Opcode out of range: "_name, \ + ipc_send_tc, setup, teardown, \ + &hdr, \ + sizeof(hdr), \ + _servicelist); \ + } while (0) + +struct vardata { + struct ipc_hdr hdr; + uint8_t buf[IPC_MTU]; +} __attribute__((packed)); + +#define test_datasize_valid(_name, _service, _opcode, _hlen, _addatasize, \ + _servicelist...) \ + do { \ + static struct vardata vdata = { \ + .hdr.service_id = _service, \ + .hdr.opcode = _opcode, \ + .hdr.len = (_hlen) + (_addatasize), \ + .buf = {}, \ + }; \ + test_generic("Data size "_name, \ + ipc_send_tc, setup, teardown, \ + &vdata, \ + sizeof(vdata.hdr) + (_hlen) + (_addatasize),\ + _servicelist); \ + } while (0) + +struct regmod_msg register_bt_msg = { + .header = { + .service_id = HAL_SERVICE_ID_CORE, + .opcode = HAL_OP_REGISTER_MODULE, + .len = sizeof(struct hal_cmd_register_module), + }, + .cmd = { + .service_id = HAL_SERVICE_ID_BLUETOOTH, + }, +}; + +struct regmod_msg register_bt_malformed_size_msg = { + .header = { + .service_id = HAL_SERVICE_ID_CORE, + .opcode = HAL_OP_REGISTER_MODULE, + /* wrong payload size declared */ + .len = sizeof(struct hal_cmd_register_module) - 1, + }, + .cmd = { + .service_id = HAL_SERVICE_ID_CORE, + }, +}; + +struct malformed_data3_struct { + struct regmod_msg valid_msg; + int redundant_data; +} __attribute__((packed)); + +static struct malformed_data3_struct malformed_data3_msg = { + /* valid register service message */ + .valid_msg = { + .header = { + .service_id = HAL_SERVICE_ID_CORE, + .opcode = HAL_OP_REGISTER_MODULE, + .len = sizeof(struct hal_cmd_register_module), + }, + .cmd = { + .service_id = HAL_SERVICE_ID_CORE, + }, + }, + /* plus redundant data */ + . redundant_data = 666, +}; + +struct ipc_hdr enable_unknown_service_hdr = { + .service_id = HAL_SERVICE_ID_MAX + 1, + .opcode = HAL_OP_REGISTER_MODULE, + .len = 0, +}; + +struct ipc_hdr enable_bt_service_hdr = { + .service_id = HAL_SERVICE_ID_BLUETOOTH, + .opcode = HAL_OP_ENABLE, + .len = 0, +}; + +struct bt_set_adapter_prop_data { + struct ipc_hdr hdr; + struct hal_cmd_set_adapter_prop prop; + + /* data placeholder for hal_cmd_set_adapter_prop.val[0] */ + uint8_t buf[IPC_MTU - sizeof(struct ipc_hdr) - + sizeof(struct hal_cmd_set_adapter_prop)]; +} __attribute__((packed)); + +#define set_name "new name" + +static struct bt_set_adapter_prop_data bt_set_adapter_prop_data_overs = { + .hdr.service_id = HAL_SERVICE_ID_BLUETOOTH, + .hdr.opcode = HAL_OP_SET_ADAPTER_PROP, + .hdr.len = sizeof(struct hal_cmd_set_adapter_prop) + + sizeof(set_name), + + .prop.type = HAL_PROP_ADAPTER_NAME, + /* declare wrong descriptor length */ + .prop.len = sizeof(set_name) + 1, + /* init prop.val[0] */ + .buf = set_name, +}; + +static struct bt_set_adapter_prop_data bt_set_adapter_prop_data_unders = { + .hdr.service_id = HAL_SERVICE_ID_BLUETOOTH, + .hdr.opcode = HAL_OP_SET_ADAPTER_PROP, + .hdr.len = sizeof(struct hal_cmd_set_adapter_prop) + + sizeof(set_name), + + .prop.type = HAL_PROP_ADAPTER_NAME, + /* declare wrong descriptor length */ + .prop.len = sizeof(set_name) - 1, + /* init prop.val[0] */ + .buf = set_name, +}; + +struct bt_set_remote_prop_data { + struct ipc_hdr hdr; + struct hal_cmd_set_remote_device_prop prop; + + /* data placeholder for hal_cmd_set_remote_device_prop.val[0] */ + uint8_t buf[IPC_MTU - sizeof(struct ipc_hdr) - + sizeof(struct hal_cmd_set_remote_device_prop)]; +} __attribute__((packed)); + +static struct bt_set_remote_prop_data bt_set_remote_prop_data_overs = { + .hdr.service_id = HAL_SERVICE_ID_BLUETOOTH, + .hdr.opcode = HAL_OP_SET_REMOTE_DEVICE_PROP, + .hdr.len = sizeof(struct hal_cmd_set_remote_device_prop) + + sizeof(set_name), + + .prop.bdaddr = {}, + .prop.type = HAL_PROP_DEVICE_NAME, + /* declare wrong descriptor length */ + .prop.len = sizeof(set_name) + 1, + .buf = set_name, +}; + +static struct bt_set_remote_prop_data bt_set_remote_prop_data_unders = { + .hdr.service_id = HAL_SERVICE_ID_BLUETOOTH, + .hdr.opcode = HAL_OP_SET_REMOTE_DEVICE_PROP, + .hdr.len = sizeof(struct hal_cmd_set_remote_device_prop) + + sizeof(set_name), + + .prop.bdaddr = {}, + .prop.type = HAL_PROP_DEVICE_NAME, + /* declare wrong descriptor length */ + .prop.len = sizeof(set_name) - 1, + .buf = set_name, +}; + +struct hidhost_set_info_data { + struct ipc_hdr hdr; + struct hal_cmd_hidhost_set_info info; + + /* data placeholder for hal_cmd_hidhost_set_info.descr[0] field */ + uint8_t buf[IPC_MTU - sizeof(struct ipc_hdr) - + sizeof(struct hal_cmd_hidhost_set_info)]; +} __attribute__((packed)); + +#define set_info_data "some descriptor" + +static struct hidhost_set_info_data hidhost_set_info_data_overs = { + .hdr.service_id = HAL_SERVICE_ID_HIDHOST, + .hdr.opcode = HAL_OP_HIDHOST_SET_INFO, + .hdr.len = sizeof(struct hal_cmd_hidhost_set_info) + + sizeof(set_info_data), + + /* declare wrong descriptor length */ + .info.descr_len = sizeof(set_info_data) + 1, + /* init .info.descr[0] */ + .buf = set_info_data, +}; + +static struct hidhost_set_info_data hidhost_set_info_data_unders = { + .hdr.service_id = HAL_SERVICE_ID_HIDHOST, + .hdr.opcode = HAL_OP_HIDHOST_SET_INFO, + .hdr.len = sizeof(struct hal_cmd_hidhost_set_info) + + sizeof(set_info_data), + + /* declare wrong descriptor length */ + .info.descr_len = sizeof(set_info_data) - 1, + /* init .info.descr[0] */ + .buf = set_info_data, +}; + +struct hidhost_set_report_data { + struct ipc_hdr hdr; + struct hal_cmd_hidhost_set_report report; + + /* data placeholder for hal_cmd_hidhost_set_report.data[0] field */ + uint8_t buf[IPC_MTU - sizeof(struct ipc_hdr) - + sizeof(struct hal_cmd_hidhost_set_report)]; +} __attribute__((packed)); + +#define set_rep_data "1234567890" + +static struct hidhost_set_report_data hidhost_set_report_data_overs = { + .hdr.service_id = HAL_SERVICE_ID_HIDHOST, + .hdr.opcode = HAL_OP_HIDHOST_SET_REPORT, + .hdr.len = sizeof(struct hal_cmd_hidhost_set_report) + + sizeof(set_rep_data), + + /* declare wrong descriptor length */ + .report.len = sizeof(set_rep_data) + 1, + /* init report.data[0] */ + .buf = set_rep_data, +}; + +static struct hidhost_set_report_data hidhost_set_report_data_unders = { + .hdr.service_id = HAL_SERVICE_ID_HIDHOST, + .hdr.opcode = HAL_OP_HIDHOST_SET_REPORT, + .hdr.len = sizeof(struct hal_cmd_hidhost_set_report) + + sizeof(set_rep_data), + + /* declare wrong descriptor length */ + .report.len = sizeof(set_rep_data) - 1, + /* init report.data[0] */ + .buf = set_rep_data, +}; + +struct hidhost_send_data_data { + struct ipc_hdr hdr; + struct hal_cmd_hidhost_send_data hiddata; + + /* data placeholder for hal_cmd_hidhost_send_data.data[0] field */ + uint8_t buf[IPC_MTU - sizeof(struct ipc_hdr) - + sizeof(struct hal_cmd_hidhost_send_data)]; +} __attribute__((packed)); + +#define send_data_data "1234567890" + +static struct hidhost_send_data_data hidhost_send_data_overs = { + .hdr.service_id = HAL_SERVICE_ID_HIDHOST, + .hdr.opcode = HAL_OP_HIDHOST_SEND_DATA, + .hdr.len = sizeof(struct hal_cmd_hidhost_send_data) + + sizeof(send_data_data), + + /* declare wrong descriptor length */ + .hiddata.len = sizeof(send_data_data) + 1, + /* init .hiddata.data[0] */ + .buf = send_data_data, +}; + +static struct hidhost_send_data_data hidhost_send_data_unders = { + .hdr.service_id = HAL_SERVICE_ID_HIDHOST, + .hdr.opcode = HAL_OP_HIDHOST_SEND_DATA, + .hdr.len = sizeof(struct hal_cmd_hidhost_send_data) + + sizeof(send_data_data), + + /* declare wrong descriptor length */ + .hiddata.len = sizeof(send_data_data) - 1, + /* init .hiddata.data[0] */ + .buf = send_data_data, +}; + +int main(int argc, char *argv[]) +{ + snprintf(exec_dir, sizeof(exec_dir), "%s", dirname(argv[0])); + + tester_init(&argc, &argv); + + /* check general IPC errors */ + test_generic("Too small data", + ipc_send_tc, setup, teardown, + ®ister_bt_msg, 1); + + test_generic("Malformed data (wrong payload declared)", + ipc_send_tc, setup, teardown, + ®ister_bt_malformed_size_msg, + sizeof(register_bt_malformed_size_msg), + HAL_SERVICE_ID_BLUETOOTH); + + test_generic("Malformed data2 (undersized msg)", + ipc_send_tc, setup, teardown, + ®ister_bt_msg, + sizeof(register_bt_msg) - 1, + HAL_SERVICE_ID_BLUETOOTH); + + test_generic("Malformed data3 (oversized msg)", + ipc_send_tc, setup, teardown, + &malformed_data3_msg, + sizeof(malformed_data3_msg), + HAL_SERVICE_ID_BLUETOOTH); + + test_generic("Invalid service", + ipc_send_tc, setup, teardown, + &enable_unknown_service_hdr, + sizeof(enable_unknown_service_hdr), + HAL_SERVICE_ID_BLUETOOTH); + + test_generic("Enable unregistered service", + ipc_send_tc, setup, teardown, + &enable_bt_service_hdr, + sizeof(enable_bt_service_hdr)); + + /* check service handler's max opcode value */ + test_opcode_valid("CORE", HAL_SERVICE_ID_CORE, 0x03, 0); + + test_opcode_valid("BLUETOOTH", HAL_SERVICE_ID_BLUETOOTH, 0x15, 0, + HAL_SERVICE_ID_BLUETOOTH); + + test_opcode_valid("SOCK", HAL_SERVICE_ID_SOCKET, 0x03, 0, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_SOCKET); + + test_opcode_valid("HIDHOST", HAL_SERVICE_ID_HIDHOST, 0x10, 0, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + + test_opcode_valid("PAN", HAL_SERVICE_ID_PAN, 0x05, 0, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_PAN); + + test_opcode_valid("A2DP", HAL_SERVICE_ID_A2DP, 0x03, 0, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_A2DP); + + /* check for valid data size */ + test_datasize_valid("CORE Register+", HAL_SERVICE_ID_CORE, + HAL_OP_REGISTER_MODULE, + sizeof(struct hal_cmd_register_module), 1); + test_datasize_valid("CORE Register-", HAL_SERVICE_ID_CORE, + HAL_OP_REGISTER_MODULE, + sizeof(struct hal_cmd_register_module), -1); + test_datasize_valid("CORE Unregister+", HAL_SERVICE_ID_CORE, + HAL_OP_UNREGISTER_MODULE, + sizeof(struct hal_cmd_unregister_module), 1); + test_datasize_valid("CORE Unregister-", HAL_SERVICE_ID_CORE, + HAL_OP_UNREGISTER_MODULE, + sizeof(struct hal_cmd_unregister_module), -1); + + /* check for valid data size for BLUETOOTH */ + test_datasize_valid("BT Enable+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_ENABLE, + 0, 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Disable+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_DISABLE, + 0, 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Adapter Props+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_ADAPTER_PROPS, + 0, 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Adapter Prop+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_ADAPTER_PROP, + sizeof(struct hal_cmd_get_adapter_prop), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Adapter Prop-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_ADAPTER_PROP, + sizeof(struct hal_cmd_get_adapter_prop), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Set Adapter Prop+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_SET_ADAPTER_PROP, + sizeof(struct hal_cmd_set_adapter_prop), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Set Adapter Prop-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_SET_ADAPTER_PROP, + sizeof(struct hal_cmd_set_adapter_prop), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_generic("Data size BT Set Adapter Prop Vardata+", + ipc_send_tc, setup, teardown, + &bt_set_adapter_prop_data_overs, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_set_adapter_prop) + + sizeof(set_name)), + HAL_SERVICE_ID_BLUETOOTH); + test_generic("Data size BT Set Adapter Prop Vardata+", + ipc_send_tc, setup, teardown, + &bt_set_adapter_prop_data_unders, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_set_adapter_prop) + + sizeof(set_name)), + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Remote Props+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_DEVICE_PROPS, + sizeof(struct hal_cmd_get_remote_device_props), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Remote Props-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_DEVICE_PROPS, + sizeof(struct hal_cmd_get_remote_device_props), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Remote Prop+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_DEVICE_PROP, + sizeof(struct hal_cmd_get_remote_device_prop), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Remote Prop-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_DEVICE_PROP, + sizeof(struct hal_cmd_get_remote_device_prop), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Set Remote Prop+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_SET_REMOTE_DEVICE_PROP, + sizeof(struct hal_cmd_set_remote_device_prop), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Set Remote Prop-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_SET_REMOTE_DEVICE_PROP, + sizeof(struct hal_cmd_set_remote_device_prop), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_generic("Data size BT Set Remote Prop Vardata+", + ipc_send_tc, setup, teardown, + &bt_set_remote_prop_data_overs, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_set_remote_device_prop) + + sizeof(set_name)), + HAL_SERVICE_ID_BLUETOOTH); + test_generic("Data size BT Set Remote Prop Vardata-", + ipc_send_tc, setup, teardown, + &bt_set_remote_prop_data_unders, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_set_remote_device_prop) + + sizeof(set_name)), + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Remote SV Rec+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_SERVICE_REC, + sizeof(struct hal_cmd_get_remote_service_rec), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Remote SV Rec-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_SERVICE_REC, + sizeof(struct hal_cmd_get_remote_service_rec), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Remote Services+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_SERVICES, + sizeof(struct hal_cmd_get_remote_services), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Get Remote Services-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_GET_REMOTE_SERVICES, + sizeof(struct hal_cmd_get_remote_services), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Start Discovery+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_START_DISCOVERY, + 0, 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Cancel Discovery+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_CANCEL_DISCOVERY, + 0, 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Create Bond+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_CREATE_BOND, + sizeof(struct hal_cmd_create_bond), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Create Bond-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_CREATE_BOND, + sizeof(struct hal_cmd_create_bond), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Remove Bond+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_REMOVE_BOND, + sizeof(struct hal_cmd_remove_bond), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Remove Bond-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_REMOVE_BOND, + sizeof(struct hal_cmd_remove_bond), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Cancel Bond+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_CANCEL_BOND, + sizeof(struct hal_cmd_cancel_bond), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Cancel Bond-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_CANCEL_BOND, + sizeof(struct hal_cmd_cancel_bond), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Pin Reply+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_PIN_REPLY, + sizeof(struct hal_cmd_pin_reply), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT Pin Reply-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_PIN_REPLY, + sizeof(struct hal_cmd_pin_reply), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT SSP Reply+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_SSP_REPLY, + sizeof(struct hal_cmd_ssp_reply), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT SSP Reply-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_SSP_REPLY, + sizeof(struct hal_cmd_ssp_reply), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT DUT Mode Conf+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_DUT_MODE_CONF, + sizeof(struct hal_cmd_dut_mode_conf), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT DUT Mode Conf-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_DUT_MODE_CONF, + sizeof(struct hal_cmd_dut_mode_conf), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT DUT Mode Send+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_DUT_MODE_SEND, + sizeof(struct hal_cmd_dut_mode_send), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT DUT Mode Send-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_DUT_MODE_SEND, + sizeof(struct hal_cmd_dut_mode_send), -1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT LE Test+", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_LE_TEST_MODE, + sizeof(struct hal_cmd_le_test_mode), 1, + HAL_SERVICE_ID_BLUETOOTH); + test_datasize_valid("BT LE Test-", HAL_SERVICE_ID_BLUETOOTH, + HAL_OP_LE_TEST_MODE, + sizeof(struct hal_cmd_le_test_mode), -1, + HAL_SERVICE_ID_BLUETOOTH); + + /* check for valid data size for SOCK */ + test_datasize_valid("SOCKET Listen+", HAL_SERVICE_ID_SOCKET, + HAL_OP_SOCKET_LISTEN, + sizeof(struct hal_cmd_socket_listen), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_SOCKET); + test_datasize_valid("SOCKET Listen-", HAL_SERVICE_ID_SOCKET, + HAL_OP_SOCKET_LISTEN, + sizeof(struct hal_cmd_socket_listen), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_SOCKET); + test_datasize_valid("SOCKET Connect+", HAL_SERVICE_ID_SOCKET, + HAL_OP_SOCKET_CONNECT, + sizeof(struct hal_cmd_socket_connect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_SOCKET); + test_datasize_valid("SOCKET Connect-", HAL_SERVICE_ID_SOCKET, + HAL_OP_SOCKET_CONNECT, + sizeof(struct hal_cmd_socket_connect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_SOCKET); + + /* check for valid data size for HID Host */ + test_datasize_valid("HIDHOST Connect+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_CONNECT, + sizeof(struct hal_cmd_hidhost_connect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Connect-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_CONNECT, + sizeof(struct hal_cmd_hidhost_connect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Disconnect+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_DISCONNECT, + sizeof(struct hal_cmd_hidhost_disconnect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Disconnect-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_DISCONNECT, + sizeof(struct hal_cmd_hidhost_disconnect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Virt. Unplug+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_VIRTUAL_UNPLUG, + sizeof(struct hal_cmd_hidhost_virtual_unplug), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Virt. Unplug-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_VIRTUAL_UNPLUG, + sizeof(struct hal_cmd_hidhost_virtual_unplug), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Info+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_INFO, + sizeof(struct hal_cmd_hidhost_set_info), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Info-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_INFO, + sizeof(struct hal_cmd_hidhost_set_info), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_generic("Data size HIDHOST Set Info Vardata+", + ipc_send_tc, setup, teardown, + &hidhost_set_info_data_overs, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_hidhost_set_info) + + sizeof(set_info_data)), + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_generic("Data size HIDHOST Set Info Vardata-", + ipc_send_tc, setup, teardown, + &hidhost_set_info_data_unders, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_hidhost_set_info) + + sizeof(set_info_data)), + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Get Protocol+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_PROTOCOL, + sizeof(struct hal_cmd_hidhost_get_protocol), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Get Protocol-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_PROTOCOL, + sizeof(struct hal_cmd_hidhost_get_protocol), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Protocol+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_PROTOCOL, + sizeof(struct hal_cmd_hidhost_set_protocol), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Protocol-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_PROTOCOL, + sizeof(struct hal_cmd_hidhost_set_protocol), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Get Report+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_REPORT, + sizeof(struct hal_cmd_hidhost_get_report), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Get Report-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_GET_REPORT, + sizeof(struct hal_cmd_hidhost_get_report), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Report+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_REPORT, + sizeof(struct hal_cmd_hidhost_set_report), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Set Report-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SET_REPORT, + sizeof(struct hal_cmd_hidhost_set_report), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_generic("Data size HIDHOST Set Report Vardata+", + ipc_send_tc, setup, teardown, + &hidhost_set_report_data_overs, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_hidhost_set_report) + + sizeof(set_rep_data)), + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_generic("Data size HIDHOST Set Report Vardata-", + ipc_send_tc, setup, teardown, + &hidhost_set_report_data_unders, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_hidhost_set_report) + + sizeof(set_rep_data)), + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Send Data+", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SEND_DATA, + sizeof(struct hal_cmd_hidhost_send_data), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_datasize_valid("HIDHOST Send Data-", HAL_SERVICE_ID_HIDHOST, + HAL_OP_HIDHOST_SEND_DATA, + sizeof(struct hal_cmd_hidhost_send_data), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_generic("Data size HIDHOST Send Vardata+", + ipc_send_tc, setup, teardown, + &hidhost_send_data_overs, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_hidhost_send_data) + + sizeof(send_data_data)), + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + test_generic("Data size HIDHOST Send Vardata-", + ipc_send_tc, setup, teardown, + &hidhost_send_data_unders, + (sizeof(struct ipc_hdr) + + sizeof(struct hal_cmd_hidhost_send_data) + + sizeof(send_data_data)), + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_HIDHOST); + + /* check for valid data size for PAN */ + test_datasize_valid("PAN Enable+", HAL_SERVICE_ID_PAN, + HAL_OP_PAN_ENABLE, + sizeof(struct hal_cmd_pan_enable), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_PAN); + test_datasize_valid("PAN Enable-", HAL_SERVICE_ID_PAN, + HAL_OP_PAN_ENABLE, + sizeof(struct hal_cmd_pan_enable), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_PAN); + test_datasize_valid("PAN Get Role+", HAL_SERVICE_ID_PAN, + HAL_OP_PAN_GET_ROLE, + 0, 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_PAN); + test_datasize_valid("PAN Connect+", HAL_SERVICE_ID_PAN, + HAL_OP_PAN_CONNECT, + sizeof(struct hal_cmd_pan_connect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_PAN); + test_datasize_valid("PAN Connect-", HAL_SERVICE_ID_PAN, + HAL_OP_PAN_CONNECT, + sizeof(struct hal_cmd_pan_connect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_PAN); + test_datasize_valid("PAN Disconnect+", HAL_SERVICE_ID_PAN, + HAL_OP_PAN_DISCONNECT, + sizeof(struct hal_cmd_pan_disconnect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_PAN); + test_datasize_valid("PAN Disconnect-", HAL_SERVICE_ID_PAN, + HAL_OP_PAN_DISCONNECT, + sizeof(struct hal_cmd_pan_disconnect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_PAN); + + /* check for valid data size for A2DP */ + test_datasize_valid("A2DP Connect+", HAL_SERVICE_ID_A2DP, + HAL_OP_A2DP_CONNECT, + sizeof(struct hal_cmd_a2dp_connect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_A2DP); + test_datasize_valid("A2DP Connect-", HAL_SERVICE_ID_A2DP, + HAL_OP_A2DP_CONNECT, + sizeof(struct hal_cmd_a2dp_connect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_A2DP); + test_datasize_valid("A2DP Disconnect+", HAL_SERVICE_ID_A2DP, + HAL_OP_A2DP_DISCONNECT, + sizeof(struct hal_cmd_a2dp_disconnect), 1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_A2DP); + test_datasize_valid("A2DP Disconnect-", HAL_SERVICE_ID_A2DP, + HAL_OP_A2DP_DISCONNECT, + sizeof(struct hal_cmd_a2dp_disconnect), -1, + HAL_SERVICE_ID_BLUETOOTH, HAL_SERVICE_ID_A2DP); + + return tester_run(); +}
diff --git a/bluez/android/ipc.c b/bluez/android/ipc.c new file mode 100644 index 0000000..8cd34ea --- /dev/null +++ b/bluez/android/ipc.c
@@ -0,0 +1,426 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stddef.h> +#include <errno.h> +#include <stdint.h> +#include <string.h> +#include <signal.h> +#include <stdbool.h> +#include <sys/socket.h> +#include <sys/un.h> +#include <unistd.h> +#include <glib.h> + +#include "ipc-common.h" +#include "ipc.h" +#include "src/log.h" + +struct ipc { + struct service_handler *services; + int service_max; + + const char *path; + size_t size; + + GIOChannel *cmd_io; + guint cmd_watch; + + bool notifications; + GIOChannel *notif_io; + guint notif_watch; + + ipc_disconnect_cb disconnect_cb; + void *disconnect_cb_data; +}; + +static void ipc_disconnect(struct ipc *ipc, bool in_cleanup) +{ + if (ipc->cmd_watch) { + g_source_remove(ipc->cmd_watch); + ipc->cmd_watch = 0; + } + + if (ipc->cmd_io) { + g_io_channel_shutdown(ipc->cmd_io, TRUE, NULL); + g_io_channel_unref(ipc->cmd_io); + ipc->cmd_io = NULL; + } + + if (ipc->notif_watch) { + g_source_remove(ipc->notif_watch); + ipc->notif_watch = 0; + } + + if (ipc->notif_io) { + g_io_channel_shutdown(ipc->notif_io, TRUE, NULL); + g_io_channel_unref(ipc->notif_io); + ipc->notif_io = NULL; + } + + if (in_cleanup) + return; + + if (ipc->disconnect_cb) + ipc->disconnect_cb(ipc->disconnect_cb_data); +} + +static int ipc_handle_msg(struct service_handler *handlers, size_t max_index, + const void *buf, ssize_t len) +{ + const struct ipc_hdr *msg = buf; + const struct ipc_handler *handler; + + if (len < (ssize_t) sizeof(*msg)) { + DBG("message too small (%zd bytes)", len); + return -EBADMSG; + } + + if (len != (ssize_t) (sizeof(*msg) + msg->len)) { + DBG("message malformed (%zd bytes)", len); + return -EBADMSG; + } + + /* if service is valid */ + if (msg->service_id > max_index) { + DBG("unknown service (0x%x)", msg->service_id); + return -EOPNOTSUPP; + } + + /* if service is registered */ + if (!handlers[msg->service_id].handler) { + DBG("service not registered (0x%x)", msg->service_id); + return -EOPNOTSUPP; + } + + /* if opcode is valid */ + if (msg->opcode == IPC_OP_STATUS || + msg->opcode > handlers[msg->service_id].size) { + DBG("invalid opcode 0x%x for service 0x%x", msg->opcode, + msg->service_id); + return -EOPNOTSUPP; + } + + /* opcode is table offset + 1 */ + handler = &handlers[msg->service_id].handler[msg->opcode - 1]; + + /* if payload size is valid */ + if ((handler->var_len && handler->data_len > msg->len) || + (!handler->var_len && handler->data_len != msg->len)) { + DBG("invalid size for opcode 0x%x service 0x%x", + msg->opcode, msg->service_id); + return -EMSGSIZE; + } + + handler->handler(msg->payload, msg->len); + + return 0; +} + +static gboolean cmd_watch_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct ipc *ipc = user_data; + + char buf[IPC_MTU]; + ssize_t ret; + int fd, err; + + if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) { + info("IPC: command socket closed"); + + ipc->cmd_watch = 0; + goto fail; + } + + fd = g_io_channel_unix_get_fd(io); + + ret = read(fd, buf, sizeof(buf)); + if (ret < 0) { + error("IPC: command read failed (%s)", strerror(errno)); + goto fail; + } + + err = ipc_handle_msg(ipc->services, ipc->service_max, buf, ret); + if (err < 0) { + error("IPC: failed to handle message (%s)", strerror(-err)); + goto fail; + } + + return TRUE; + +fail: + ipc_disconnect(ipc, false); + + return FALSE; +} + +static gboolean notif_watch_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct ipc *ipc = user_data; + + info("IPC: notification socket closed"); + + ipc->notif_watch = 0; + + ipc_disconnect(ipc, false); + + return FALSE; +} + +static GIOChannel *ipc_connect(const char *path, size_t size, + GIOFunc connect_cb, void *user_data) +{ + struct sockaddr_un addr; + GIOCondition cond; + GIOChannel *io; + int sk; + + sk = socket(PF_LOCAL, SOCK_SEQPACKET, 0); + if (sk < 0) { + error("IPC: failed to create socket: %d (%s)", errno, + strerror(errno)); + return NULL; + } + + io = g_io_channel_unix_new(sk); + + g_io_channel_set_close_on_unref(io, TRUE); + g_io_channel_set_flags(io, G_IO_FLAG_NONBLOCK, NULL); + + memset(&addr, 0, sizeof(addr)); + addr.sun_family = AF_UNIX; + + memcpy(addr.sun_path, path, size); + + connect(sk, (struct sockaddr *) &addr, sizeof(addr)); + + cond = G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL; + + g_io_add_watch(io, cond, connect_cb, user_data); + + return io; +} + +static gboolean notif_connect_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct ipc *ipc = user_data; + + DBG(""); + + if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) { + error("IPC: notification socket connect failed"); + + ipc_disconnect(ipc, false); + + return FALSE; + } + + cond = G_IO_ERR | G_IO_HUP | G_IO_NVAL; + + ipc->notif_watch = g_io_add_watch(io, cond, notif_watch_cb, ipc); + + cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL; + + ipc->cmd_watch = g_io_add_watch(ipc->cmd_io, cond, cmd_watch_cb, ipc); + + info("IPC: successfully connected (with notifications)"); + + return FALSE; +} + +static gboolean cmd_connect_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct ipc *ipc = user_data; + + DBG(""); + + if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) { + error("IPC: command socket connect failed"); + ipc_disconnect(ipc, false); + + return FALSE; + } + + if (ipc->notifications) { + ipc->notif_io = ipc_connect(ipc->path, ipc->size, + notif_connect_cb, ipc); + if (!ipc->notif_io) + ipc_disconnect(ipc, false); + + return FALSE; + } + + cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL; + + ipc->cmd_watch = g_io_add_watch(ipc->cmd_io, cond, cmd_watch_cb, ipc); + + info("IPC: successfully connected (without notifications)"); + + return FALSE; +} + +struct ipc *ipc_init(const char *path, size_t size, int max_service_id, + bool notifications, + ipc_disconnect_cb cb, void *cb_data) +{ + struct ipc *ipc; + + ipc = g_new0(struct ipc, 1); + + ipc->services = g_new0(struct service_handler, max_service_id + 1); + ipc->service_max = max_service_id; + + ipc->path = path; + ipc->size = size; + + ipc->notifications = notifications; + + ipc->cmd_io = ipc_connect(path, size, cmd_connect_cb, ipc); + if (!ipc->cmd_io) { + g_free(ipc->services); + g_free(ipc); + return NULL; + } + + ipc->disconnect_cb = cb; + ipc->disconnect_cb_data = cb_data; + + return ipc; +} + +void ipc_cleanup(struct ipc *ipc) +{ + ipc_disconnect(ipc, true); + + g_free(ipc->services); + g_free(ipc); +} + +static void ipc_send(int sk, uint8_t service_id, uint8_t opcode, uint16_t len, + void *param, int fd) +{ + struct msghdr msg; + struct iovec iv[2]; + struct ipc_hdr m; + char cmsgbuf[CMSG_SPACE(sizeof(int))]; + struct cmsghdr *cmsg; + + memset(&msg, 0, sizeof(msg)); + memset(&m, 0, sizeof(m)); + memset(cmsgbuf, 0, sizeof(cmsgbuf)); + + m.service_id = service_id; + m.opcode = opcode; + m.len = len; + + iv[0].iov_base = &m; + iv[0].iov_len = sizeof(m); + + iv[1].iov_base = param; + iv[1].iov_len = len; + + msg.msg_iov = iv; + msg.msg_iovlen = 2; + + if (fd >= 0) { + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + + /* Initialize the payload */ + memcpy(CMSG_DATA(cmsg), &fd, sizeof(int)); + } + + if (sendmsg(sk, &msg, 0) < 0) { + error("IPC send failed :%s", strerror(errno)); + + /* TODO disconnect IPC here when this function becomes static */ + raise(SIGTERM); + } +} + +void ipc_send_rsp(struct ipc *ipc, uint8_t service_id, uint8_t opcode, + uint8_t status) +{ + struct ipc_status s; + int sk; + + sk = g_io_channel_unix_get_fd(ipc->cmd_io); + + if (status == IPC_STATUS_SUCCESS) { + ipc_send(sk, service_id, opcode, 0, NULL, -1); + return; + } + + s.code = status; + + ipc_send(sk, service_id, IPC_OP_STATUS, sizeof(s), &s, -1); +} + +void ipc_send_rsp_full(struct ipc *ipc, uint8_t service_id, uint8_t opcode, + uint16_t len, void *param, int fd) +{ + ipc_send(g_io_channel_unix_get_fd(ipc->cmd_io), service_id, opcode, len, + param, fd); +} + +void ipc_send_notif(struct ipc *ipc, uint8_t service_id, uint8_t opcode, + uint16_t len, void *param) +{ + if (!ipc || !ipc->notif_io) + return; + + ipc_send(g_io_channel_unix_get_fd(ipc->notif_io), service_id, opcode, + len, param, -1); +} + +void ipc_register(struct ipc *ipc, uint8_t service, + const struct ipc_handler *handlers, uint8_t size) +{ + if (service > ipc->service_max) + return; + + ipc->services[service].handler = handlers; + ipc->services[service].size = size; +} + +void ipc_unregister(struct ipc *ipc, uint8_t service) +{ + if (service > ipc->service_max) + return; + + ipc->services[service].handler = NULL; + ipc->services[service].size = 0; +}
diff --git a/bluez/android/ipc.h b/bluez/android/ipc.h new file mode 100644 index 0000000..cc4e92d --- /dev/null +++ b/bluez/android/ipc.h
@@ -0,0 +1,52 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +struct ipc_handler { + void (*handler) (const void *buf, uint16_t len); + bool var_len; + size_t data_len; +}; + +struct service_handler { + const struct ipc_handler *handler; + uint8_t size; +}; + +struct ipc; + +typedef void (*ipc_disconnect_cb) (void *data); + +struct ipc *ipc_init(const char *path, size_t size, int max_service_id, + bool notifications, + ipc_disconnect_cb cb, void *cb_data); +void ipc_cleanup(struct ipc *ipc); + +void ipc_send_rsp(struct ipc *ipc, uint8_t service_id, uint8_t opcode, + uint8_t status); +void ipc_send_rsp_full(struct ipc *ipc, uint8_t service_id, uint8_t opcode, + uint16_t len, void *param, int fd); +void ipc_send_notif(struct ipc *ipc, uint8_t service_id, uint8_t opcode, + uint16_t len, void *param); +void ipc_register(struct ipc *ipc, uint8_t service, + const struct ipc_handler *handlers, uint8_t size); +void ipc_unregister(struct ipc *ipc, uint8_t service);
diff --git a/bluez/android/main.c b/bluez/android/main.c new file mode 100644 index 0000000..828f81d --- /dev/null +++ b/bluez/android/main.c
@@ -0,0 +1,552 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdbool.h> +#include <signal.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> + +#include <sys/signalfd.h> +#if defined(ANDROID) +#include <sys/capability.h> +#include <linux/prctl.h> +#endif + +#include <glib.h> + +#include "src/log.h" +#include "src/sdpd.h" + +#include "lib/bluetooth.h" + +#include "ipc-common.h" +#include "ipc.h" +#include "bluetooth.h" +#include "socket.h" +#include "hidhost.h" +#include "hal-msg.h" +#include "a2dp.h" +#include "pan.h" +#include "avrcp.h" +#include "handsfree.h" +#include "gatt.h" +#include "health.h" + +#define STARTUP_GRACE_SECONDS 5 +#define SHUTDOWN_GRACE_SECONDS 10 + +static guint bluetooth_start_timeout = 0; + +static bdaddr_t adapter_bdaddr; + +static GMainLoop *event_loop; + +static struct ipc *hal_ipc = NULL; + +static bool services[HAL_SERVICE_ID_MAX + 1] = { false }; + +static void service_register(const void *buf, uint16_t len) +{ + const struct hal_cmd_register_module *m = buf; + uint8_t status; + + if (m->service_id > HAL_SERVICE_ID_MAX || services[m->service_id]) { + status = HAL_STATUS_FAILED; + goto failed; + } + + switch (m->service_id) { + case HAL_SERVICE_ID_BLUETOOTH: + bt_bluetooth_register(hal_ipc, m->mode); + + break; + case HAL_SERVICE_ID_SOCKET: + bt_socket_register(hal_ipc, &adapter_bdaddr, m->mode); + + break; + case HAL_SERVICE_ID_HIDHOST: + if (!bt_hid_register(hal_ipc, &adapter_bdaddr, m->mode)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + break; + case HAL_SERVICE_ID_A2DP: + if (!bt_a2dp_register(hal_ipc, &adapter_bdaddr, m->mode)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + break; + case HAL_SERVICE_ID_PAN: + if (!bt_pan_register(hal_ipc, &adapter_bdaddr, m->mode)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + break; + case HAL_SERVICE_ID_AVRCP: + if (!bt_avrcp_register(hal_ipc, &adapter_bdaddr, m->mode)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + break; + case HAL_SERVICE_ID_HANDSFREE: + if (!bt_handsfree_register(hal_ipc, &adapter_bdaddr, m->mode)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + break; + case HAL_SERVICE_ID_GATT: + if (!bt_gatt_register(hal_ipc, &adapter_bdaddr)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + break; + case HAL_SERVICE_ID_HEALTH: + if (!bt_health_register(hal_ipc, &adapter_bdaddr, m->mode)) { + status = HAL_STATUS_FAILED; + goto failed; + } + + break; + default: + DBG("service %u not supported", m->service_id); + status = HAL_STATUS_FAILED; + goto failed; + } + + services[m->service_id] = true; + + status = HAL_STATUS_SUCCESS; + + info("Service ID=%u registered", m->service_id); + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, + status); +} + +static void service_unregister(const void *buf, uint16_t len) +{ + const struct hal_cmd_unregister_module *m = buf; + uint8_t status; + + if (m->service_id > HAL_SERVICE_ID_MAX || !services[m->service_id]) { + status = HAL_STATUS_FAILED; + goto failed; + } + + switch (m->service_id) { + case HAL_SERVICE_ID_BLUETOOTH: + bt_bluetooth_unregister(); + break; + case HAL_SERVICE_ID_SOCKET: + bt_socket_unregister(); + break; + case HAL_SERVICE_ID_HIDHOST: + bt_hid_unregister(); + break; + case HAL_SERVICE_ID_A2DP: + bt_a2dp_unregister(); + break; + case HAL_SERVICE_ID_PAN: + bt_pan_unregister(); + break; + case HAL_SERVICE_ID_AVRCP: + bt_avrcp_unregister(); + break; + case HAL_SERVICE_ID_HANDSFREE: + bt_handsfree_unregister(); + break; + case HAL_SERVICE_ID_GATT: + bt_gatt_unregister(); + break; + case HAL_SERVICE_ID_HEALTH: + bt_health_unregister(); + break; + default: + /* This would indicate bug in HAL, as unregister should not be + * called in init failed */ + DBG("service %u not supported", m->service_id); + status = HAL_STATUS_FAILED; + goto failed; + } + + services[m->service_id] = false; + + status = HAL_STATUS_SUCCESS; + + info("Service ID=%u unregistered", m->service_id); + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE, + status); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_REGISTER_MODULE */ + { service_register, false, sizeof(struct hal_cmd_register_module) }, + /* HAL_OP_UNREGISTER_MODULE */ + { service_unregister, false, sizeof(struct hal_cmd_unregister_module) }, +}; + +static void bluetooth_stopped(void) +{ + g_main_loop_quit(event_loop); +} + +static gboolean quit_eventloop(gpointer user_data) +{ + g_main_loop_quit(event_loop); + return FALSE; +} + +static void stop_bluetooth(void) +{ + static bool __stop = false; + + if (__stop) + return; + + __stop = true; + + if (!bt_bluetooth_stop(bluetooth_stopped)) { + g_main_loop_quit(event_loop); + return; + } + + g_timeout_add_seconds(SHUTDOWN_GRACE_SECONDS, quit_eventloop, NULL); +} + +static void ipc_disconnected(void *data) +{ + stop_bluetooth(); +} + +static void adapter_ready(int err, const bdaddr_t *addr) +{ + if (err < 0) { + error("Adapter initialization failed: %s", strerror(-err)); + exit(EXIT_FAILURE); + } + + bacpy(&adapter_bdaddr, addr); + + if (bluetooth_start_timeout > 0) { + g_source_remove(bluetooth_start_timeout); + bluetooth_start_timeout = 0; + } + + info("Adapter initialized"); + + hal_ipc = ipc_init(BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH), + HAL_SERVICE_ID_MAX, true, + ipc_disconnected, NULL); + if (!hal_ipc) { + error("Failed to initialize IPC"); + exit(EXIT_FAILURE); + } + + ipc_register(hal_ipc, HAL_SERVICE_ID_CORE, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); +} + +static gboolean signal_handler(GIOChannel *channel, GIOCondition cond, + gpointer user_data) +{ + static bool __terminated = false; + struct signalfd_siginfo si; + ssize_t result; + int fd; + + if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) + return FALSE; + + fd = g_io_channel_unix_get_fd(channel); + + result = read(fd, &si, sizeof(si)); + if (result != sizeof(si)) + return FALSE; + + switch (si.ssi_signo) { + case SIGINT: + case SIGTERM: + if (!__terminated) { + info("Terminating"); + stop_bluetooth(); + } + + __terminated = true; + break; + } + + return TRUE; +} + +static guint setup_signalfd(void) +{ + GIOChannel *channel; + guint source; + sigset_t mask; + int fd; + + sigemptyset(&mask); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGTERM); + + if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) { + perror("Failed to set signal mask"); + return 0; + } + + fd = signalfd(-1, &mask, 0); + if (fd < 0) { + perror("Failed to create signal descriptor"); + return 0; + } + + channel = g_io_channel_unix_new(fd); + + g_io_channel_set_close_on_unref(channel, TRUE); + g_io_channel_set_encoding(channel, NULL, NULL); + g_io_channel_set_buffered(channel, FALSE); + + source = g_io_add_watch(channel, + G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, + signal_handler, NULL); + + g_io_channel_unref(channel); + + return source; +} + +static gboolean option_version = FALSE; +static gint option_index = -1; +static gboolean option_dbg = FALSE; +static gboolean option_mgmt_dbg = FALSE; + +static GOptionEntry options[] = { + { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, + "Show version information and exit", NULL }, + { "index", 'i', 0, G_OPTION_ARG_INT, &option_index, + "Use specified controller", "INDEX"}, + { "debug", 'd', 0, G_OPTION_ARG_NONE, &option_dbg, + "Enable debug logs", NULL}, + { "mgmt-debug", 0, 0, G_OPTION_ARG_NONE, &option_mgmt_dbg, + "Enable mgmt debug logs", NULL}, + + { NULL } +}; + +static void cleanup_services(void) +{ + int i; + + DBG(""); + + for (i = HAL_SERVICE_ID_BLUETOOTH; i < HAL_SERVICE_ID_MAX; i++) { + if (!services[i]) + continue; + + switch (i) { + case HAL_SERVICE_ID_BLUETOOTH: + bt_bluetooth_unregister(); + break; + case HAL_SERVICE_ID_SOCKET: + bt_socket_unregister(); + break; + case HAL_SERVICE_ID_HIDHOST: + bt_hid_unregister(); + break; + case HAL_SERVICE_ID_A2DP: + bt_a2dp_unregister(); + break; + case HAL_SERVICE_ID_AVRCP: + bt_avrcp_unregister(); + break; + case HAL_SERVICE_ID_PAN: + bt_pan_unregister(); + break; + case HAL_SERVICE_ID_HANDSFREE: + bt_handsfree_unregister(); + break; + case HAL_SERVICE_ID_GATT: + bt_gatt_unregister(); + break; + case HAL_SERVICE_ID_HEALTH: + bt_health_unregister(); + break; + } + + services[i] = false; + } +} + +static bool set_capabilities(void) +{ +#if defined(ANDROID) + struct __user_cap_header_struct header; + struct __user_cap_data_struct cap; + + header.version = _LINUX_CAPABILITY_VERSION; + header.pid = 0; + + /* CAP_NET_ADMIN: Allow use of MGMT interface + * CAP_NET_BIND_SERVICE: Allow use of privileged PSM + * CAP_NET_RAW: Allow use of bnep ioctl calls */ + cap.effective = cap.permitted = + CAP_TO_MASK(CAP_NET_RAW) | + CAP_TO_MASK(CAP_NET_ADMIN) | + CAP_TO_MASK(CAP_NET_BIND_SERVICE); + cap.inheritable = 0; + + /* don't clear capabilities when dropping root */ + if (prctl(PR_SET_KEEPCAPS, 1) < 0) { + error("%s: prctl(): %s", __func__, strerror(errno)); + return false; + } + + /* Android bluetooth user UID=1002 */ + if (setuid(1002) < 0) { + error("%s: setuid(): %s", __func__, strerror(errno)); + return false; + } + + /* TODO: Move to cap_set_proc once bionic support it */ + if (capset(&header, &cap) < 0) { + error("%s: capset(): %s", __func__, strerror(errno)); + return false; + } + + /* TODO: Move to cap_get_proc once bionic support it */ + if (capget(&header, &cap) < 0) { + error("%s: capget(): %s", __func__, strerror(errno)); + return false; + } + + DBG("Caps: eff: 0x%x, perm: 0x%x, inh: 0x%x", cap.effective, + cap.permitted, cap.inheritable); + +#endif + return true; +} + +int main(int argc, char *argv[]) +{ + GOptionContext *context; + GError *err = NULL; + guint signal; + + context = g_option_context_new(NULL); + g_option_context_add_main_entries(context, options, NULL); + + if (g_option_context_parse(context, &argc, &argv, &err) == FALSE) { + if (err != NULL) { + g_printerr("%s\n", err->message); + g_error_free(err); + } else + g_printerr("An unknown error occurred\n"); + + exit(EXIT_FAILURE); + } + + g_option_context_free(context); + + if (option_version == TRUE) { + printf("%s\n", VERSION); + exit(EXIT_SUCCESS); + } + + signal = setup_signalfd(); + if (!signal) + return EXIT_FAILURE; + + if (option_dbg || option_mgmt_dbg) + __btd_log_init("*", 0); + else + __btd_log_init(NULL, 0); + + if (!set_capabilities()) { + __btd_log_cleanup(); + g_source_remove(signal); + return EXIT_FAILURE; + } + + bluetooth_start_timeout = g_timeout_add_seconds(STARTUP_GRACE_SECONDS, + quit_eventloop, NULL); + if (bluetooth_start_timeout == 0) { + error("Failed to init startup timeout"); + __btd_log_cleanup(); + g_source_remove(signal); + return EXIT_FAILURE; + } + + if (!bt_bluetooth_start(option_index, option_mgmt_dbg, adapter_ready)) { + __btd_log_cleanup(); + g_source_remove(bluetooth_start_timeout); + g_source_remove(signal); + return EXIT_FAILURE; + } + + /* Use params: mtu = 0, flags = 0 */ + start_sdp_server(0, 0); + + DBG("Entering main loop"); + + event_loop = g_main_loop_new(NULL, FALSE); + + g_main_loop_run(event_loop); + + g_source_remove(signal); + + if (bluetooth_start_timeout > 0) + g_source_remove(bluetooth_start_timeout); + + cleanup_services(); + + stop_sdp_server(); + bt_bluetooth_cleanup(); + g_main_loop_unref(event_loop); + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_CORE); + ipc_cleanup(hal_ipc); + + info("Exit"); + + __btd_log_cleanup(); + + return EXIT_SUCCESS; +}
diff --git a/bluez/android/pan.c b/bluez/android/pan.c new file mode 100644 index 0000000..3bcab57 --- /dev/null +++ b/bluez/android/pan.c
@@ -0,0 +1,843 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdint.h> +#include <stdbool.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <glib.h> +#include <sys/ioctl.h> +#include <sys/socket.h> +#include <sys/wait.h> +#include <net/if.h> +#include <linux/sockios.h> +#include <netinet/in.h> +#include <netinet/ip6.h> +#include <linux/if_bridge.h> + +#include "btio/btio.h" +#include "lib/bluetooth.h" +#include "lib/bnep.h" +#include "lib/sdp.h" +#include "lib/sdp_lib.h" +#include "src/uuid-helper.h" +#include "profiles/network/bnep.h" +#include "src/log.h" + +#include "hal-msg.h" +#include "ipc-common.h" +#include "ipc.h" +#include "utils.h" +#include "bluetooth.h" +#include "pan.h" + +#define SVC_HINT_NETWORKING 0x02 + +#define BNEP_BRIDGE "bt-pan" +#define BNEP_PANU_INTERFACE "bt-pan" +#define BNEP_NAP_INTERFACE "bt-pan%d" + +static bdaddr_t adapter_addr; +GSList *devices = NULL; +uint8_t local_role = HAL_PAN_ROLE_NONE; +static struct ipc *hal_ipc = NULL; + +struct pan_device { + char iface[16]; + bdaddr_t dst; + uint8_t conn_state; + uint8_t role; + GIOChannel *io; + struct bnep *session; + guint watch; +}; + +static struct { + uint32_t record_id; + GIOChannel *io; + bool bridge; +} nap_dev = { + .record_id = 0, + .io = NULL, + .bridge = false, +}; + +static int set_forward_delay(int sk) +{ + unsigned long args[4] = { BRCTL_SET_BRIDGE_FORWARD_DELAY, 0 , 0, 0 }; + struct ifreq ifr; + + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, BNEP_BRIDGE, IFNAMSIZ); + ifr.ifr_data = (char *) args; + + if (ioctl(sk, SIOCDEVPRIVATE, &ifr) < 0) { + error("pan: setting forward delay failed: %d (%s)", + errno, strerror(errno)); + return -1; + } + + return 0; +} + +static int nap_create_bridge(void) +{ + int sk, err; + + DBG("%s", BNEP_BRIDGE); + + if (nap_dev.bridge) + return 0; + + sk = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); + if (sk < 0) + return -EOPNOTSUPP; + + if (ioctl(sk, SIOCBRADDBR, BNEP_BRIDGE) < 0) { + err = -errno; + if (err != -EEXIST) { + close(sk); + return -EOPNOTSUPP; + } + } + + err = set_forward_delay(sk); + if (err < 0) + ioctl(sk, SIOCBRDELBR, BNEP_BRIDGE); + + close(sk); + + nap_dev.bridge = err == 0; + + return err; +} + +static int bridge_if_down(void) +{ + struct ifreq ifr; + int sk, err; + + sk = socket(AF_INET, SOCK_DGRAM, 0); + + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, BNEP_BRIDGE, IF_NAMESIZE - 1); + + ifr.ifr_flags &= ~IFF_UP; + + /* Bring down the interface */ + err = ioctl(sk, SIOCSIFFLAGS, (caddr_t) &ifr); + + close(sk); + + if (err < 0) { + error("pan: Could not bring down %s", BNEP_BRIDGE); + return err; + } + + return 0; +} + +static int nap_remove_bridge(void) +{ + int sk, err; + + DBG("%s", BNEP_BRIDGE); + + if (!nap_dev.bridge) + return 0; + + bridge_if_down(); + + sk = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); + if (sk < 0) + return -EOPNOTSUPP; + + err = ioctl(sk, SIOCBRDELBR, BNEP_BRIDGE); + if (err < 0) + err = -errno; + + close(sk); + + if (err < 0) + return err; + + nap_dev.bridge = false; + + return 0; +} + +static int device_cmp(gconstpointer s, gconstpointer user_data) +{ + const struct pan_device *dev = s; + const bdaddr_t *dst = user_data; + + return bacmp(&dev->dst, dst); +} + +static void pan_device_free(void *data) +{ + struct pan_device *dev = data; + + if (dev->watch > 0) { + bnep_server_delete(BNEP_BRIDGE, dev->iface, &dev->dst); + g_source_remove(dev->watch); + } + + if (dev->io) { + g_io_channel_shutdown(dev->io, FALSE, NULL); + g_io_channel_unref(dev->io); + } + + if (dev->session) + bnep_free(dev->session); + + g_free(dev); +} + +static void pan_device_remove(struct pan_device *dev) +{ + devices = g_slist_remove(devices, dev); + + if (g_slist_length(devices) == 0) { + local_role = HAL_PAN_ROLE_NONE; + nap_remove_bridge(); + } + + pan_device_free(dev); +} + +static void bt_pan_notify_conn_state(struct pan_device *dev, uint8_t state) +{ + struct hal_ev_pan_conn_state ev; + char addr[18]; + + if (dev->conn_state == state) + return; + + dev->conn_state = state; + ba2str(&dev->dst, addr); + DBG("device %s state %u", addr, state); + + bdaddr2android(&dev->dst, ev.bdaddr); + ev.state = state; + ev.local_role = local_role; + ev.remote_role = dev->role; + ev.status = HAL_STATUS_SUCCESS; + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_PAN, HAL_EV_PAN_CONN_STATE, + sizeof(ev), &ev); + if (dev->conn_state == HAL_PAN_STATE_DISCONNECTED) + pan_device_remove(dev); +} + +static void bt_pan_notify_ctrl_state(struct pan_device *dev, uint8_t state) +{ + struct hal_ev_pan_ctrl_state ev; + + DBG(""); + + ev.state = state; + ev.local_role = local_role; + ev.status = HAL_STATUS_SUCCESS; + + memset(ev.name, 0, sizeof(ev.name)); + + if (local_role == HAL_PAN_ROLE_NAP) + memcpy(ev.name, BNEP_BRIDGE, sizeof(BNEP_BRIDGE)); + else + memcpy(ev.name, dev->iface, sizeof(dev->iface)); + + ipc_send_notif(hal_ipc, HAL_SERVICE_ID_PAN, HAL_EV_PAN_CTRL_STATE, + sizeof(ev), &ev); +} + +static void bnep_disconn_cb(void *data) +{ + struct pan_device *dev = data; + + DBG("%s disconnected", dev->iface); + + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED); +} + +static void bnep_conn_cb(char *iface, int err, void *data) +{ + struct pan_device *dev = data; + + DBG(""); + + if (err < 0) { + error("bnep connect req failed: %s", strerror(-err)); + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED); + return; + } + + memcpy(dev->iface, iface, sizeof(dev->iface)); + + DBG("%s connected", dev->iface); + + bt_pan_notify_ctrl_state(dev, HAL_PAN_CTRL_ENABLED); + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_CONNECTED); +} + +static void connect_cb(GIOChannel *chan, GError *err, gpointer data) +{ + struct pan_device *dev = data; + uint16_t l_role, r_role; + int perr, sk; + + DBG(""); + + if (err) { + error("%s", err->message); + goto fail; + } + + l_role = (local_role == HAL_PAN_ROLE_NAP) ? BNEP_SVC_NAP : + BNEP_SVC_PANU; + r_role = (dev->role == HAL_PAN_ROLE_NAP) ? BNEP_SVC_NAP : BNEP_SVC_PANU; + + sk = g_io_channel_unix_get_fd(dev->io); + + dev->session = bnep_new(sk, l_role, r_role, BNEP_PANU_INTERFACE); + if (!dev->session) + goto fail; + + perr = bnep_connect(dev->session, bnep_conn_cb, dev); + if (perr < 0) { + error("bnep connect req failed: %s", strerror(-perr)); + goto fail; + } + + bnep_set_disconnect(dev->session, bnep_disconn_cb, dev); + + if (dev->io) { + g_io_channel_unref(dev->io); + dev->io = NULL; + } + + return; + +fail: + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED); +} + +static void bt_pan_connect(const void *buf, uint16_t len) +{ + const struct hal_cmd_pan_connect *cmd = buf; + struct pan_device *dev; + uint8_t status; + bdaddr_t dst; + char addr[18]; + GSList *l; + GError *gerr = NULL; + + DBG(""); + + switch (cmd->local_role) { + case HAL_PAN_ROLE_NAP: + if (cmd->remote_role != HAL_PAN_ROLE_PANU) { + status = HAL_STATUS_UNSUPPORTED; + goto failed; + } + break; + case HAL_PAN_ROLE_PANU: + if (cmd->remote_role != HAL_PAN_ROLE_NAP && + cmd->remote_role != HAL_PAN_ROLE_PANU) { + status = HAL_STATUS_UNSUPPORTED; + goto failed; + } + break; + default: + status = HAL_STATUS_UNSUPPORTED; + goto failed; + } + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = g_new0(struct pan_device, 1); + bacpy(&dev->dst, &dst); + local_role = cmd->local_role; + dev->role = cmd->remote_role; + + ba2str(&dev->dst, addr); + DBG("connecting to %s %s", addr, dev->iface); + + dev->io = bt_io_connect(connect_cb, dev, NULL, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_DEST_BDADDR, &dev->dst, + BT_IO_OPT_PSM, BNEP_PSM, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_OMTU, BNEP_MTU, + BT_IO_OPT_IMTU, BNEP_MTU, + BT_IO_OPT_INVALID); + if (!dev->io) { + error("%s", gerr->message); + g_error_free(gerr); + g_free(dev); + status = HAL_STATUS_FAILED; + goto failed; + } + + devices = g_slist_append(devices, dev); + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_CONNECTING); + + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_PAN, HAL_OP_PAN_CONNECT, status); +} + +static void bt_pan_disconnect(const void *buf, uint16_t len) +{ + const struct hal_cmd_pan_disconnect *cmd = buf; + struct pan_device *dev; + uint8_t status; + GSList *l; + bdaddr_t dst; + + DBG(""); + + android2bdaddr(&cmd->bdaddr, &dst); + + l = g_slist_find_custom(devices, &dst, device_cmp); + if (!l) { + status = HAL_STATUS_FAILED; + goto failed; + } + + dev = l->data; + + if (dev->conn_state == HAL_PAN_STATE_CONNECTED && dev->session) + bnep_disconnect(dev->session); + + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED); + status = HAL_STATUS_SUCCESS; + +failed: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_PAN, HAL_OP_PAN_DISCONNECT, + status); +} + +static gboolean nap_watchdog_cb(GIOChannel *chan, GIOCondition cond, + gpointer user_data) +{ + struct pan_device *dev = user_data; + + DBG("disconnected"); + + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED); + + return FALSE; +} +static gboolean nap_setup_cb(GIOChannel *chan, GIOCondition cond, + gpointer user_data) +{ + struct pan_device *dev = user_data; + uint8_t packet[BNEP_MTU]; + struct bnep_setup_conn_req *req = (void *) packet; + uint16_t src_role, dst_role, rsp = BNEP_CONN_NOT_ALLOWED; + int sk, n; + + if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) { + error("Hangup or error or inval on BNEP socket"); + return FALSE; + } + + sk = g_io_channel_unix_get_fd(chan); + + /* Reading BNEP_SETUP_CONNECTION_REQUEST_MSG */ + n = read(sk, packet, sizeof(packet)); + if (n < 0) { + error("read(): %s(%d)", strerror(errno), errno); + goto failed; + } + + /* Highest known control command id BNEP_FILTER_MULT_ADDR_RSP 0x06 */ + if (req->type == BNEP_CONTROL && + req->ctrl > BNEP_FILTER_MULT_ADDR_RSP) { + error("cmd not understood"); + bnep_send_ctrl_rsp(sk, BNEP_CONTROL, BNEP_CMD_NOT_UNDERSTOOD, + req->ctrl); + goto failed; + } + + if (req->type != BNEP_CONTROL || req->ctrl != BNEP_SETUP_CONN_REQ) { + error("cmd is not BNEP_SETUP_CONN_REQ %02X %02X", req->type, + req->ctrl); + goto failed; + } + + rsp = bnep_setup_decode(req, &dst_role, &src_role); + if (rsp) { + error("bnep_setup_decode failed"); + goto failed; + } + + rsp = bnep_setup_chk(dst_role, src_role); + if (rsp) { + error("benp_setup_chk failed"); + goto failed; + } + + if (nap_create_bridge() < 0) + goto failed; + + if (bnep_server_add(sk, dst_role, BNEP_BRIDGE, dev->iface, + &dev->dst) < 0) { + nap_remove_bridge(); + error("server_connadd failed"); + rsp = BNEP_CONN_NOT_ALLOWED; + goto failed; + } + + rsp = BNEP_SUCCESS; + bnep_send_ctrl_rsp(sk, BNEP_CONTROL, BNEP_SETUP_CONN_RSP, rsp); + + dev->watch = g_io_add_watch(chan, G_IO_HUP | G_IO_ERR | G_IO_NVAL, + nap_watchdog_cb, dev); + g_io_channel_unref(dev->io); + dev->io = NULL; + + bt_pan_notify_ctrl_state(dev, HAL_PAN_CTRL_ENABLED); + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_CONNECTED); + + return FALSE; + +failed: + bnep_send_ctrl_rsp(sk, BNEP_CONTROL, BNEP_SETUP_CONN_RSP, rsp); + pan_device_remove(dev); + + return FALSE; +} + +static void nap_connect_cb(GIOChannel *chan, GError *err, gpointer user_data) +{ + struct pan_device *dev = user_data; + + DBG(""); + + if (err) { + error("%s", err->message); + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED); + return; + } + + g_io_channel_set_close_on_unref(chan, TRUE); + dev->watch = g_io_add_watch(chan, + G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, + nap_setup_cb, dev); +} + +static void nap_confirm_cb(GIOChannel *chan, gpointer data) +{ + struct pan_device *dev; + bdaddr_t dst; + char address[18]; + GError *err = NULL; + + DBG(""); + + bt_io_get(chan, &err, BT_IO_OPT_DEST_BDADDR, &dst, + BT_IO_OPT_DEST, address, BT_IO_OPT_INVALID); + if (err) { + error("%s", err->message); + g_error_free(err); + return; + } + + DBG("incoming connect request from %s", address); + dev = g_new0(struct pan_device, 1); + bacpy(&dev->dst, &dst); + local_role = HAL_PAN_ROLE_NAP; + dev->role = HAL_PAN_ROLE_PANU; + + strncpy(dev->iface, BNEP_NAP_INTERFACE, 16); + dev->iface[15] = '\0'; + + dev->io = g_io_channel_ref(chan); + g_io_channel_set_close_on_unref(dev->io, TRUE); + + if (!bt_io_accept(dev->io, nap_connect_cb, dev, NULL, &err)) { + error("bt_io_accept: %s", err->message); + g_error_free(err); + goto failed; + } + + devices = g_slist_append(devices, dev); + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_CONNECTING); + + return; + +failed: + bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED); +} + +static void destroy_nap_device(void) +{ + DBG(""); + + nap_remove_bridge(); + + if (nap_dev.io) { + g_io_channel_shutdown(nap_dev.io, FALSE, NULL); + g_io_channel_unref(nap_dev.io); + nap_dev.io = NULL; + } +} + +static int register_nap_server(void) +{ + GError *gerr = NULL; + + DBG(""); + + nap_dev.io = bt_io_listen(NULL, nap_confirm_cb, NULL, NULL, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &adapter_addr, + BT_IO_OPT_PSM, BNEP_PSM, + BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, + BT_IO_OPT_OMTU, BNEP_MTU, + BT_IO_OPT_IMTU, BNEP_MTU, + BT_IO_OPT_INVALID); + + if (!nap_dev.io) { + destroy_nap_device(); + error("%s", gerr->message); + g_error_free(gerr); + return -EINVAL; + } + + return 0; +} + +static void bt_pan_enable(const void *buf, uint16_t len) +{ + const struct hal_cmd_pan_enable *cmd = buf; + uint8_t status; + int err; + + DBG(""); + + if (local_role == cmd->local_role) { + status = HAL_STATUS_SUCCESS; + goto reply; + } + + /* destroy existing server */ + destroy_nap_device(); + + switch (cmd->local_role) { + case HAL_PAN_ROLE_NAP: + break; + case HAL_PAN_ROLE_NONE: + status = HAL_STATUS_SUCCESS; + goto reply; + default: + status = HAL_STATUS_UNSUPPORTED; + goto reply; + } + + local_role = cmd->local_role; + err = register_nap_server(); + if (err < 0) { + status = HAL_STATUS_FAILED; + destroy_nap_device(); + goto reply; + } + + status = HAL_STATUS_SUCCESS; + +reply: + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_PAN, HAL_OP_PAN_ENABLE, status); +} + +static void bt_pan_get_role(const void *buf, uint16_t len) +{ + struct hal_rsp_pan_get_role rsp; + + DBG(""); + + rsp.local_role = local_role; + ipc_send_rsp_full(hal_ipc, HAL_SERVICE_ID_PAN, HAL_OP_PAN_GET_ROLE, + sizeof(rsp), &rsp, -1); +} + +static const struct ipc_handler cmd_handlers[] = { + /* HAL_OP_PAN_ENABLE */ + { bt_pan_enable, false, sizeof(struct hal_cmd_pan_enable) }, + /* HAL_OP_PAN_GET_ROLE */ + { bt_pan_get_role, false, 0 }, + /* HAL_OP_PAN_CONNECT */ + { bt_pan_connect, false, sizeof(struct hal_cmd_pan_connect) }, + /* HAL_OP_PAN_DISCONNECT */ + { bt_pan_disconnect, false, sizeof(struct hal_cmd_pan_disconnect) }, +}; + +static sdp_record_t *pan_record(void) +{ + sdp_list_t *svclass, *pfseq, *apseq, *root, *aproto; + uuid_t root_uuid, pan, l2cap, bnep; + sdp_profile_desc_t profile[1]; + sdp_list_t *proto[2]; + sdp_data_t *v, *p; + uint16_t psm = BNEP_PSM, version = 0x0100; + uint16_t security = 0x0001, type = 0xfffe; + uint32_t rate = 0; + const char *desc = "Network Access Point", *name = "Network Service"; + sdp_record_t *record; + uint16_t ptype[] = { 0x0800, /* IPv4 */ 0x0806, /* ARP */ }; + sdp_data_t *head, *pseq, *data; + + record = sdp_record_alloc(); + if (!record) + return NULL; + + record->attrlist = NULL; + record->pattern = NULL; + + sdp_uuid16_create(&pan, NAP_SVCLASS_ID); + svclass = sdp_list_append(NULL, &pan); + sdp_set_service_classes(record, svclass); + + sdp_uuid16_create(&profile[0].uuid, NAP_PROFILE_ID); + profile[0].version = 0x0100; + pfseq = sdp_list_append(NULL, &profile[0]); + sdp_set_profile_descs(record, pfseq); + sdp_set_info_attr(record, name, NULL, desc); + sdp_attr_add_new(record, SDP_ATTR_NET_ACCESS_TYPE, SDP_UINT16, &type); + sdp_attr_add_new(record, SDP_ATTR_MAX_NET_ACCESSRATE, + SDP_UINT32, &rate); + + sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP); + root = sdp_list_append(NULL, &root_uuid); + sdp_set_browse_groups(record, root); + + sdp_uuid16_create(&l2cap, L2CAP_UUID); + proto[0] = sdp_list_append(NULL, &l2cap); + p = sdp_data_alloc(SDP_UINT16, &psm); + proto[0] = sdp_list_append(proto[0], p); + apseq = sdp_list_append(NULL, proto[0]); + + sdp_uuid16_create(&bnep, BNEP_UUID); + proto[1] = sdp_list_append(NULL, &bnep); + v = sdp_data_alloc(SDP_UINT16, &version); + proto[1] = sdp_list_append(proto[1], v); + + head = sdp_data_alloc(SDP_UINT16, &ptype[0]); + data = sdp_data_alloc(SDP_UINT16, &ptype[1]); + sdp_seq_append(head, data); + + pseq = sdp_data_alloc(SDP_SEQ16, head); + proto[1] = sdp_list_append(proto[1], pseq); + apseq = sdp_list_append(apseq, proto[1]); + aproto = sdp_list_append(NULL, apseq); + sdp_set_access_protos(record, aproto); + sdp_add_lang_attr(record); + sdp_attr_add_new(record, SDP_ATTR_SECURITY_DESC, SDP_UINT16, &security); + + sdp_data_free(p); + sdp_data_free(v); + sdp_list_free(apseq, NULL); + sdp_list_free(root, NULL); + sdp_list_free(aproto, NULL); + sdp_list_free(proto[0], NULL); + sdp_list_free(proto[1], NULL); + sdp_list_free(svclass, NULL); + sdp_list_free(pfseq, NULL); + + return record; +} + +bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode) +{ + sdp_record_t *rec; + int err; + + DBG(""); + + bacpy(&adapter_addr, addr); + + rec = pan_record(); + if (!rec) { + error("Failed to allocate PAN record"); + return false; + } + + if (bt_adapter_add_record(rec, SVC_HINT_NETWORKING) < 0) { + error("Failed to register PAN record"); + sdp_record_free(rec); + return false; + } + + err = bnep_init(); + if (err < 0) { + error("bnep init failed"); + bt_adapter_remove_record(rec->handle); + return false; + } + + err = register_nap_server(); + if (err < 0) { + error("Failed to register NAP"); + bt_adapter_remove_record(rec->handle); + bnep_cleanup(); + return false; + } + + nap_dev.record_id = rec->handle; + + hal_ipc = ipc; + ipc_register(hal_ipc, HAL_SERVICE_ID_PAN, cmd_handlers, + G_N_ELEMENTS(cmd_handlers)); + + return true; +} + +void bt_pan_unregister(void) +{ + DBG(""); + + g_slist_free_full(devices, pan_device_free); + devices = NULL; + local_role = HAL_PAN_ROLE_NONE; + + bnep_cleanup(); + + ipc_unregister(hal_ipc, HAL_SERVICE_ID_PAN); + hal_ipc = NULL; + + bt_adapter_remove_record(nap_dev.record_id); + nap_dev.record_id = 0; + destroy_nap_device(); +}
diff --git a/bluez/android/pan.h b/bluez/android/pan.h new file mode 100644 index 0000000..cfbea96 --- /dev/null +++ b/bluez/android/pan.h
@@ -0,0 +1,25 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode); +void bt_pan_unregister(void);
diff --git a/bluez/android/pics-a2dp.txt b/bluez/android/pics-a2dp.txt new file mode 100644 index 0000000..1579567 --- /dev/null +++ b/bluez/android/pics-a2dp.txt
@@ -0,0 +1,86 @@ +A2DP PICS for the PTS tool. + +PTS version: 5.0 + +* - different than PTS defaults +# - not yet implemented/supported + +M - mandatory if such role selected +O - optional + + Roles +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_A2DP_1_1 True Role: Source (C.1) +TSPC_A2DP_1_2 False (*) Role: Sink (C.1) +------------------------------------------------------------------------------- +C.1: It is mandatory to support at least one of the defined roles. +------------------------------------------------------------------------------- + + + A2DP SRC Features +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_A2DP_2_1 True SRC: Initiate connection establishment (M) +TSPC_A2DP_2_2 True SRC: Accept connection establishment (M) +TSPC_A2DP_2_3 True SRC: Initiate start streaming (M) +TSPC_A2DP_2_4 True SRC: Accept start streaming (M) +TSPC_A2DP_2_5 True SRC: Send audio stream (M) +TSPC_A2DP_2_6 True SRC: Initiate connection release (M) +TSPC_A2DP_2_7 True SRC: Accept connection release (M) +TSPC_A2DP_2_8 True (*) SRC: Initiate suspend (O) +TSPC_A2DP_2_9 True (*) SRC: Accept suspend (O) +TSPC_A2DP_2_10 True SRC: SBC encoder (M) +TSPC_A2DP_2_10a False SRC: Encode Audio Stream (O) +TSPC_A2DP_2_11 False SRC: SBC Configurations in 16 KHz sampling (O) +TSPC_A2DP_2_12 False SRC: SBC Configurations in 32 KHz sampling (O) +TSPC_A2DP_2_13 True SRC: SBC Configurations in 44.1 KHz sampling + (C.1) +TSPC_A2DP_2_14 False SRC: SBC Configurations in 48 KHz sampling + (C.1) +------------------------------------------------------------------------------- +C.1: At least one of the values shall be supported. +------------------------------------------------------------------------------- + + + Supported Codecs in SRC +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_A2DP_3_1 True SRC: SBC encoder Codec (M) +TSPC_A2DP_3_2 False SRC: Additional encoder Codec (O) +------------------------------------------------------------------------------- + + + A2DP Sink Features +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_A2DP_4_1 False SNK: Initiate connection establishment (O) +TSPC_A2DP_4_2 False (*) SNK: Accept connection establishment (M) +TSPC_A2DP_4_3 False SNK: Initiate start streaming (O) +TSPC_A2DP_4_4 False (*) SNK: Accept start streaming (M) +TSPC_A2DP_4_5 False (*) SNK: Receive audio stream (M) +TSPC_A2DP_4_6 False SNK: Initiate connection release (O) +TSPC_A2DP_4_7 False (*) SNK: Accept connection release (M) +TSPC_A2DP_4_8 False SNK: Initiate suspend (O) +TSPC_A2DP_4_9 False SNK: Accept suspend (O) +TSPC_A2DP_4_10 False (*) SNK: SBC decoder (M) +TSPC_A2DP_4_10a False (*) SNK: Decode Audio Stream (O) +TSPC_A2DP_4_11 False SNK: SBC Configurations in 16 KHz sampling (O) +TSPC_A2DP_4_12 False SNK: SBC Configurations in 32 KHz sampling (O) +TSPC_A2DP_4_13 False (*) SNK: SBC Configurations in 44.1 KHz sampling (M) +TSPC_A2DP_4_14 False (*) SNK: SBC Configurations in 48 KHz sampling (M) +------------------------------------------------------------------------------- + + + Supported codecs in SNK +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_A2DP_5_1 False SNK: SBC decoder Codec (M) +TSPC_A2DP_5_2 False SNK: Additional decoder Coded (O) +TSPC_ALL False Enable all test cases when set to False. +-------------------------------------------------------------------------------
diff --git a/bluez/android/pics-avctp.txt b/bluez/android/pics-avctp.txt new file mode 100644 index 0000000..41ad4db --- /dev/null +++ b/bluez/android/pics-avctp.txt
@@ -0,0 +1,75 @@ +AVCTP PICS for the PTS tool. + +PTS version: 5.0 + +* - different than PTS defaults +# - not yet implemented/supported + +M - mandatory if such role selected +O - optional + + Protocol Version +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVCTP_0_1 False AVCTP 1.0 (C.1) +TSPC_AVCTP_0_2 False AVCTP 1.2 (C.1) +TSPC_AVCTP_0_3 False AVCTP 1.3 (C.1) +TSPC_AVCTP_0_4 True (*) AVCTP 1.4 (C.1) +------------------------------------------------------------------------------- +C.1: Mandatory to support only one Protocol Version. +------------------------------------------------------------------------------- + + + Roles +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVCTP_1_1 False Controller (C.1) +TSPC_AVCTP_1_2 True (*) Target (C.1) +------------------------------------------------------------------------------- +C.1: Mandatory to support at least one of the defined roles. +------------------------------------------------------------------------------- + + + Controller Features +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVCTP_2_1 False Message fragmentation (O) +TSPC_AVCTP_2_2 False (*) Transaction label management (M) +TSPC_AVCTP_2_3 False (*) Packet type field management (M) +TSPC_AVCTP_2_4 False (*) Message type field management (M) +TSPC_AVCTP_2_5 False (*) PID field management (M) +TSPC_AVCTP_2_6 False (*) IPID field mangement (M) +TSPC_AVCTP_2_7 False (*) Message information management (M) +TSPC_AVCTP_2_8 False Event registration for message reception (O) +TSPC_AVCTP_2_9 False Event registration for connection request (O) +TSPC_AVCTP_2_10 False Event registration for disconnection (O) +TSPC_AVCTP_2_11 False Connect request (O) +TSPC_AVCTP_2_12 False Disconnect request (O) +TSPC_AVCTP_2_13 False Send message (O) +TSPC_AVCTP_2_14 False Support for multiple AVCTP channel establishment + (O) +------------------------------------------------------------------------------- + + + Target Features +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVCTP_3_1 False Message fragmentation (O) +TSPC_AVCTP_3_2 True Transaction label management (M) +TSPC_AVCTP_3_3 True Packet type field management (M) +TSPC_AVCTP_3_4 True Message type field management (M) +TSPC_AVCTP_3_5 True PID field management (M) +TSPC_AVCTP_3_6 True IPID field management (M) +TSPC_AVCTP_3_7 True Message information management (M) +TSPC_AVCTP_3_8 True (*) Event registration for message reception (O) +TSPC_AVCTP_3_9 True (*) Event registration for connection request (O) +TSPC_AVCTP_3_10 True (*) Event registration for disconnection request (O) +TSPC_AVCTP_3_11 True (*) Connect request (O) +TSPC_AVCTP_3_12 True (*) Disconnect request (O) +TSPC_AVCTP_3_13 True (*) Send message (O) +TSPC_AVCTP_ALL False Enables all test cases when set to TRUE +-------------------------------------------------------------------------------
diff --git a/bluez/android/pics-avrcp.txt b/bluez/android/pics-avrcp.txt new file mode 100644 index 0000000..bee22c8 --- /dev/null +++ b/bluez/android/pics-avrcp.txt
@@ -0,0 +1,626 @@ +AVRCP PICS for the PTS tool. + +PTS version: 5.0 + +* - different than PTS defaults +# - not yet implemented/supported + +M - mandatory if such role selected +O - optional + + Roles +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +SPC_AVRCP_1_1 True Role: Controller (CT) (C.1) +TSPC_AVRCP_1_2 True Role: Target (TG) (C.1) +------------------------------------------------------------------------------- +C.1: Mandatory to support at least one of the defined roles. +------------------------------------------------------------------------------- + + + Controller Features +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVRCP_2_1 False (*) CT: Initiating connection establishment (M) +TSPC_AVRCP_2_2 False (*) CT: Accepting connection establishment (M) +TSPC_AVRCP_2_3 False (*) CT: Initiating connection release (M) +TSPC_AVRCP_2_4 False (*) CT: Accepting connection release (M) +TSPC_AVRCP_2_5 False CT: Sending UNIT INFO (O) +TSPC_AVRCP_2_6 False CT: Sending SUBUNIT INFO (O) +TSPC_AVRCP_2_7 False (*) CT: Sending PASS THROUGH command category 1 + (C.1) +TSPC_AVRCP_2_8 False CT: Sending PASS THROUGH command category 2 + (C.1) +TSPC_AVRCP_2_9 False CT: Sending PASS THROUGH command category 3 + (C.1) +TSPC_AVRCP_2_10 False CT: Sending PASS THROUGH command category 4 + (C.1) +TSPC_AVRCP_2_11 False CT: Get Capabilities (O) +TSPC_AVRCP_2_12 False CT: List Player Application Setting + Attributes (C.9) +TSPC_AVRCP_2_13 False CT: List Player Application Setting Values (O) +TSPC_AVRCP_2_14 False CT: Get Current Player Application Setting + (C.10) +TSPC_AVRCP_2_15 False CT: Set Player Application Setting Value (C.10) +TSPC_AVRCP_2_16 False CT: Get Player Application Setting + Attribute (O) +TSPC_AVRCP_2_17 False CT: Get Player Application Setting Value (O) +TSPC_AVRCP_2_18 False CT: Inform Displayable Character Set (O) +TSPC_AVRCP_2_19 False CT: Inform Battery Status of CT (O) +TSPC_AVRCP_2_20 False CT: Get Element Attributes (O) +TSPC_AVRCP_2_21 False CT: Get Play Status (O) +TSPC_AVRCP_2_22 False CT: Register Notification (C.11) +TSPC_AVRCP_2_23 False CT: Request Continuing Response (C.2) +TSPC_AVRCP_2_24 False CT: Abort Continuing Response (C.2) +TSPC_AVRCP_2_25 False CT: Next Group (C.12) +TSPC_AVRCP_2_26 False CT: Previous Group (C.12) +TSPC_AVRCP_2_27 False CT: Media Player Selection (O) +TSPC_AVRCP_2_28 False CT: SetAddressedPlayer (O) +TSPC_AVRCP_2_29 False CT: GetFolderItems(MediaPlayerList) (C.5) +TSPC_AVRCP_2_29b False CT: GetTotalNumberOfItems(MediaPlayerList) (C.5) +TSPC_AVRCP_2_30 False CT: EVENT_AVAILABLE_PLAYERS_CHANGED (O) +TSPC_AVRCP_2_31 False CT: EVENT_ADDRESSED_PLAYER_CHANGED (O) +TSPC_AVRCP_2_32 False CT: Browsing (O) +TSPC_AVRCP_2_33 False CT: SetBrowsedPlayer (C.4) +TSPC_AVRCP_2_34 False CT: ChangePath (C.4) +TSPC_AVRCP_2_35 False CT: GetFolderItems(Filesystem) (C.4) +TSPC_AVRCP_2_35b False CT: GetTotalNumberOfItems(Filesystem) (C.4) +TSPC_AVRCP_2_36 False CT: GetItemAttributes (O) +TSPC_AVRCP_2_37 False CT: PlayItem(Filesystem) (C.4) +TSPC_AVRCP_2_38 False CT: EVENT_UIDS_CHANGED (O) +TSPC_AVRCP_2_39 False CT: Searching (O) +TSPC_AVRCP_2_40 False CT: Search (C.7) +TSPC_AVRCP_2_41 False CT: GetFolderItems(Search Results) (C.7) +TSPC_AVRCP_2_41b False CT: GetTotalNumberOfItems(Search Results) (C.7) +TSPC_AVRCP_2_42 False CT: PlayItem(SearchResultList) (C.7) +TSPC_AVRCP_2_43 False CT: NowPlaying (C.8) +TSPC_AVRCP_2_44 False CT: GetFolderItems(NowPlayingList) (C.8) +TSPC_AVRCP_2_44b False CT: GetTotalNumberOfItems(NowPlayingList) (C.8) +TSPC_AVRCP_2_45 False CT: PlayItem(NowPlayingList) (C.8) +TSPC_AVRCP_2_46 False CT: AddToNowPlaying (O) +TSPC_AVRCP_2_47 False CT: EVENT_NOW_PLAYING_CONTENT_CHANGED (O) +TSPC_AVRCP_2_48 False CT: Playable Folders (O) +TSPC_AVRCP_2_49 True (*) CT: Absolute Volume (C.3) +TSPC_AVRCP_2_50 True (*) CT: SetAbsoluteVolume (C.3) +TSPC_AVRCP_2_51 True (*) CT: NotifyVolumeChange (C.3) +TSPC_AVRCP_2_52 False (*) CT: Discoverable Mode (M) +TSPC_AVRCP_2_53 False CT: PASSTHROUGH operation supporting press + and hold (O) +TSPC_AVRCP_2_54 False CT: Cover Art (O) +TSPC_AVRCP_2_55 False CT: GetCapabilities, Cover Art (C.10) +TSPC_AVRCP_2_56 False CT: GetImageProperties, Cover Art (C.10) +TSPC_AVRCP_2_57 False CT: GetImage, Cover Art (C.9) +TSPC_AVRCP_2_58 False CT: GetLinkedThumbnail, CoverArt (C.9) +------------------------------------------------------------------------------- +C.1: Mandatory to support at least one of the defined categories + (TSPC_AVRCP_2_7 through TSPC_AVRCP_2_10). +C.2: Mandatory if TSPC_AVRCP_2_20 is supported, otherwise Optional. +C.3: Mandatory if TSPC_AVRCP_2_8 is supported, otherwise Excluded. +C.4: Mandatory if TSPC_AVRCP_2_32 is supported, otherwise Excluded. +C.5: Mandatory if TSPC_AVRCP_2_27 is supported, otherwise Excluded. +C.7: Mandatory if item TSPC_AVRCP_2_39 is supported, Excluded otherwise. +C.8: Mandatory if TSPC_AVRCP_2_32 is supported, otherwise Excluded. +C.9: Mandatory to support if Player Application Settings feature is supported. + If any item TSPC_AVRCP_2_13 through TSPC_AVRCP_2_15 is supported it is + required to claim support for this feature in accordance with Player + Application Settings support requirements, otherwise Optional. +C.10: Mandatory to support either Get or Set Player Application Settings + (TSPC_AVRCP_2_14 or TSPC_AVRCP_2_15) if List Player Application Setting + Attributes (TSPC_AVRCP_2_12) is supported. Either TSPC_AVRCP_2_14 + or TSPC_AVRCP_2_15 must be supported if Player Application Settings + feature is supported, in accordance with Player Application Settings + support requirements. +C.11: Mandatory if TSPC_AVRCP_2_7 or (TSPC_AVRCP_2_8 AND TSPC_AVRCP_2_49) + or TSPC_AVRCP_2_9 is supported, otherwise Optional. +C.12: Mandatory if Basic Group Navigation Feature supported. If any item + TSPC_AVRCP_2_25 or TSPC_AVRCP_2_26 is supported it is mandatory to + support both, in accordance with Basic Group Navigation support + requirements, otherwise Excluded. +------------------------------------------------------------------------------- + + + Controller Profile Version +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVRCP_2b_1 False CT: AVRCP v1.0 (C.1) +TSPC_AVRCP_2b_2 False CT: AVRCP v1.3 (C.1) +TSPC_AVRCP_2b_3 False CT: AVRCP v1.4 (C.1) +TSPC_AVRCP_2b_4 False CT: AVRCP v1.5 (C.1) +TSPC_AVRCP_2b_5 False CT: AVRCP v1.6 (C.1) +------------------------------------------------------------------------------- +C.1: It is mandatory to support at least one of the profile versions if + Controller role supported (SPC_AVRCP_1_1). +------------------------------------------------------------------------------- + + + Operation_id of Category 1 for CT +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVRCP_3_1 False CT: category 1 - Operation id: 0 (C.1) +TSPC_AVRCP_3_2 False CT: category 1 - Operation id: 1 (C.1) +TSPC_AVRCP_3_3 False CT: category 1 - Operation id: 2 (C.1) +TSPC_AVRCP_3_4 False CT: category 1 - Operation id: 3 (C.1) +TSPC_AVRCP_3_5 False CT: category 1 - Operation id: 4 (C.1) +TSPC_AVRCP_3_6 False CT: category 1 - Operation id: 5 (C.1) +TSPC_AVRCP_3_7 False CT: category 1 - Operation id: 6 (C.1) +TSPC_AVRCP_3_8 False CT: category 1 - Operation id: 7 (C.1) +TSPC_AVRCP_3_9 False CT: category 1 - Operation id: 8 (C.1) +TSPC_AVRCP_3_10 False CT: category 1 - Operation id: 9 (C.1) +TSPC_AVRCP_3_11 False CT: category 1 - Operation id: dot (C.1) +TSPC_AVRCP_3_12 False CT: category 1 - Operation id: enter (C.1) +TSPC_AVRCP_3_13 False CT: category 1 - Operation id: clear (C.1) +TSPC_AVRCP_3_14 False CT: category 1 - Operation id: sound_select + (C.1) +TSPC_AVRCP_3_15 False CT: category 1 - Operation id: input_select + (C.1) +TSPC_AVRCP_3_16 False CT: category 1 - Operation id: + display_information (C.1) +TSPC_AVRCP_3_17 False CT: category 1 - Operation id: help (C.1) +TSPC_AVRCP_3_18 False CT: category 1 - Operation id: power (C.1) +TSPC_AVRCP_3_19 False (*) CT: category 1 - Operation id: play (C.1) +TSPC_AVRCP_3_20 False (*) CT: category 1 - Operation id: stop (C.1) +TSPC_AVRCP_3_21 False (*) CT: category 1 - Operation id: pause (C.1) +TSPC_AVRCP_3_22 False CT: category 1 - Operation id: record (C.1) +TSPC_AVRCP_3_23 False CT: category 1 - Operation id: rewind (C.1) +TSPC_AVRCP_3_24 False CT: category 1 - Operation id: fast_forward + (C.1) +TSPC_AVRCP_3_25 False CT: category 1 - Operation id: eject (C.1) +TSPC_AVRCP_3_26 False CT: category 1 - Operation id: forward (C.1) +TSPC_AVRCP_3_27 False CT: category 1 - Operation id: backward (C.1) +TSPC_AVRCP_3_28 False CT: category 1 - Operation id: angle (C.1) +TSPC_AVRCP_3_29 False CT: category 1 - Operation id: subpicture (C.1) +TSPC_AVRCP_3_30 False CT: category 1 - Operation id: F1 (C.1) +TSPC_AVRCP_3_31 False CT: category 1 - Operation id: F2 (C.1) +TSPC_AVRCP_3_32 False CT: category 1 - Operation id: F3 (C.1) +TSPC_AVRCP_3_33 False CT: category 1 - Operation id: F4 (C.1) +TSPC_AVRCP_3_33a False CT: category 1 - Operation id: F5 (C.1) +TSPC_AVRCP_3_34 False CT: category 1 - Operation id: vendor_unique + (C.1) +------------------------------------------------------------------------------- +C.1: Mandatory to support at least one of these operation_ids if the device + supports category 1 (TSPC_AVRCP_2_7). +------------------------------------------------------------------------------- + + + Operation_id of category 2 for CT +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVRCP_4_1 False CT: category 2 - Operation id: 0 (C.2) +TSPC_AVRCP_4_2 False CT: category 2 - Operation id: 1 (C.2) +TSPC_AVRCP_4_3 False CT: category 2 - Operation id: 2 (C.2) +TSPC_AVRCP_4_4 False CT: category 2 - Operation id: 3 (C.2) +TSPC_AVRCP_4_5 False CT: category 2 - Operation id: 4 (C.2) +TSPC_AVRCP_4_6 False CT: category 2 - Operation id: 5 (C.2) +TSPC_AVRCP_4_7 False CT: category 2 - Operation id: 6 (C.2) +TSPC_AVRCP_4_8 False CT: category 2 - Operation id: 7 (C.2) +TSPC_AVRCP_4_9 False CT: category 2 - Operation id: 8 (C.2) +TSPC_AVRCP_4_10 False CT: category 2 - Operation id: 9 (C.2) +TSPC_AVRCP_4_11 False CT: category 2 - Operation id: dot (C.2) +TSPC_AVRCP_4_12 False CT: category 2 - Operation id: enter (C.2) +TSPC_AVRCP_4_13 False CT: category 2 - Operation id: clear (C.2) +TSPC_AVRCP_4_14 False CT: category 2 - Operation id: sound_select + (C.2) +TSPC_AVRCP_4_15 False CT: category 2 - Operation id: input_select + (C.2) +TSPC_AVRCP_4_16 False CT: category 2 - Operation id: + display_information (C.2) +TSPC_AVRCP_4_17 False CT: category 2 - Operation id: help (C.2) +TSPC_AVRCP_4_18 False CT: category 2 - Operation id: power (C.2) +TSPC_AVRCP_4_19 False (*) CT: category 2 - Operation id: volume_up (C.2) +TSPC_AVRCP_4_20 False (*) CT: category 2 - Operation id: volume_down (C.2) +TSPC_AVRCP_4_21 False CT: category 2 - Operation id: mute (C.2) +TSPC_AVRCP_4_22 False CT: category 2 - Operation id: F1 (C.2) +TSPC_AVRCP_4_23 False CT: category 2 - Operation id: F2 (C.2) +TSPC_AVRCP_4_24 False CT: category 2 - Operation id: F3 (C.2) +TSPC_AVRCP_4_25 False CT: category 2 - Operation id: F4 (C.2) +TSPC_AVRCP_4_25a False CT: category 2 - Operation id: F5 (C.2) +TSPC_AVRCP_4_26 False CT: category 2 - Operation id: vendor_unique + (C.2) +------------------------------------------------------------------------------- +C.2: Mandatory to support at least one of these operation_ids if the device + supports category 2 (TSPC_AVRCP_2_8). +------------------------------------------------------------------------------- + + + Operation_id of category 3 for CT +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVRCP_5_1 False CT: category 3 - Operation id: 0 (C.3) +TSPC_AVRCP_5_2 False CT: category 3 - Operation id: 1 (C.3) +TSPC_AVRCP_5_3 False CT: category 3 - Operation id: 2 (C.3) +TSPC_AVRCP_5_4 False CT: category 3 - Operation id: 3 (C.3) +TSPC_AVRCP_5_5 False CT: category 3 - Operation id: 4 (C.3) +TSPC_AVRCP_5_6 False CT: category 3 - Operation id: 5 (C.3) +TSPC_AVRCP_5_7 False CT: category 3 - Operation id: 6 (C.3) +TSPC_AVRCP_5_8 False CT: category 3 - Operation id: 7 (C.3) +TSPC_AVRCP_5_9 False CT: category 3 - Operation id: 8 (C.3) +TSPC_AVRCP_5_10 False CT: category 3 - Operation id: 9 (C.3) +TSPC_AVRCP_5_11 False CT: category 3 - Operation id: dot (C.3) +TSPC_AVRCP_5_12 False CT: category 3 - Operation id: enter (C.3) +TSPC_AVRCP_5_13 False CT: category 3 - Operation id: clear (C.3) +TSPC_AVRCP_5_14 False CT: category 3 - Operation id: channel up (C.3) +TSPC_AVRCP_5_15 False CT: category 3 - Operation id: channel down + (C.3) +TSPC_AVRCP_5_16 False CT: category 3 - Operation id: previous channel + (C.3) +TSPC_AVRCP_5_17 False CT: category 3 - Operation id: sound_select + (C.3) +TSPC_AVRCP_5_18 False CT: category 3 - Operation id: input_select + (C.3) +TSPC_AVRCP_5_19 False CT: category 3 - Operation id: + display_information (C.3) +TSPC_AVRCP_5_20 False CT: category 3 - Operation id: help (C.3) +TSPC_AVRCP_5_21 False CT: category 3 - Operation id: power (C.3) +TSPC_AVRCP_5_22 False CT: category 3 - Operation id: angle (C.3) +TSPC_AVRCP_5_23 False CT: category 3 - Operation id: subpicture(C.3) +TSPC_AVRCP_5_24 False CT: category 3 - Operation id: F1 (C.3) +TSPC_AVRCP_5_25 False CT: category 3 - Operation id: F2 (C.3) +TSPC_AVRCP_5_26 False CT: category 3 - Operation id: F3 (C.3) +TSPC_AVRCP_5_27 False CT: category 3 - Operation id: F4 (C.3) +TSPC_AVRCP_5_27a False CT: category 3 - Operation id: F5 (C.3) +TSPC_AVRCP_5_28 False CT: category 3 - Operation id: vendor_unique + (C.3) +------------------------------------------------------------------------------- +C.3: Mandatory to support at least one of these operation_ids if the device + supports category 3 (TSPC_AVRCP_2_9). +------------------------------------------------------------------------------- + + + Operation_id of category 4 for CT +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVRCP_6_1 False CT: category 4 - Operation id: select (C.4) +TSPC_AVRCP_6_2 False CT: category 4 - Operation id: up (C.4) +TSPC_AVRCP_6_3 False CT: category 4 - Operation id: down (C.4) +TSPC_AVRCP_6_4 False CT: category 4 - Operation id: left (C.4) +TSPC_AVRCP_6_5 False CT: category 4 - Operation id: right (C.4) +TSPC_AVRCP_6_6 False CT: category 4 - Operation id: right up (C.4) +TSPC_AVRCP_6_7 False CT: category 4 - Operation id: right down (C.4) +TSPC_AVRCP_6_8 False CT: category 4 - Operation id: left up (C.4) +TSPC_AVRCP_6_9 False CT: category 4 - Operation id: left down (C.4) +TSPC_AVRCP_6_10 False CT: category 4 - Operation id: root menu (C.4) +TSPC_AVRCP_6_11 False CT: category 4 - Operation id: setup menu (C.4) +TSPC_AVRCP_6_12 False CT: category 4 - Operation id: contents menu + (C.4) +TSPC_AVRCP_6_13 False CT: category 4 - Operation id: favorite menu + (C.4) +TSPC_AVRCP_6_14 False CT: category 4 - Operation id: exit (C.4) +TSPC_AVRCP_6_15 False CT: category 4 - Operation id: 0 (C.4) +TSPC_AVRCP_6_16 False CT: category 4 - Operation id: 1 (C.4) +TSPC_AVRCP_6_17 False CT: category 4 - Operation id: 2 (C.4) +TSPC_AVRCP_6_18 False CT: category 4 - Operation id: 3 (C.4) +TSPC_AVRCP_6_19 False CT: category 4 - Operation id: 4 (C.4) +TSPC_AVRCP_6_20 False CT: category 4 - Operation id: 5 (C.4) +TSPC_AVRCP_6_21 False CT: category 4 - Operation id: 6 (C.4) +TSPC_AVRCP_6_22 False CT: category 4 - Operation id: 7 (C.4) +TSPC_AVRCP_6_23 False CT: category 4 - Operation id: 8 (C.4) +TSPC_AVRCP_6_24 False CT: category 4 - Operation id: 9 (C.4) +TSPC_AVRCP_6_25 False CT: category 4 - Operation id: dot (C.4) +TSPC_AVRCP_6_26 False CT: category 4 - Operation id: enter (C.4) +TSPC_AVRCP_6_27 False CT: category 4 - Operation id: clear (C.4) +TSPC_AVRCP_6_28 False CT: category 4 - Operation id: + display_information (C.4) +TSPC_AVRCP_6_29 False CT: category 4 - Operation id: help (C.4) +TSPC_AVRCP_6_30 False CT: category 4 - Operation id: page up (C.4) +TSPC_AVRCP_6_31 False CT: category 4 - Operation id: page down (C.4) +TSPC_AVRCP_6_32 False CT: category 4 - Operation id: power (C.4) +TSPC_AVRCP_6_33 False CT: category 4 - Operation id: F1 (C.4) +TSPC_AVRCP_6_34 False CT: category 4 - Operation id: F2 (C.4) +TSPC_AVRCP_6_35 False CT: category 4 - Operation id: F3 (C.4) +TSPC_AVRCP_6_36 False CT: category 4 - Operation id: F4 (C.4) +TSPC_AVRCP_6_36a False CT: category 4 - Operation id: F5 (C.4) +TSPC_AVRCP_6_37 False CT: category 4 - Operation id: vendor_unique + (C.4) +------------------------------------------------------------------------------- +C.4: Mandatory to support at least one of these operation_ids if the device + supports category 4 (TSPC_AVRCP_2_9). +------------------------------------------------------------------------------- + + + Target Features +------------------------------------------------------------------------------- +Parameter Name Selected Description +------------------------------------------------------------------------------- +TSPC_AVRCP_7_1 True (*) TG: Initiating connection establishment (O) +TSPC_AVRCP_7_2 True TG: Accept connection establishment (M) +TSPC_AVRCP_7_3 True TG: Initiating connection release (M) +TSPC_AVRCP_7_4 True TG: Accepting connection release (M) +TSPC_AVRCP_7_5 True TG: Receiving UNIT INFO (M) +TSPC_AVRCP_7_6 True TG: Receiving SUBUNIT INFO (M) +TSPC_AVRCP_7_7 True TG: Receiving PASS THROUGH command category 1 + (C.1) +TSPC_AVRCP_7_8 True (*) TG: Receiving PASS THROUGH command category 2 + (C.1) +TSPC_AVRCP_7_9 False TG: Receiving PASS THROUGH command category 3 + (C.1) +TSPC_AVRCP_7_10 False TG: Receiving PASS THROUGH command category 4 + (C.1) +TSPC_AVRCP_7_11 True (*) TG: Get Capabilities Response (C.3) +TSPC_AVRCP_7_12 False TG: List Player Application Settings (C.14) +TSPC_AVRCP_7_13 False TG: List Player Application Setting Values + (C.14) +TSPC_AVRCP_7_14 False TG: Get Current Player Application Settings + (C.14) +TSPC_AVRCP_7_15 False TG: Set Player Application Setting Value (C.14) +TSPC_AVRCP_7_16 False TG: Get Player Application Setting Attribute + (O) +TSPC_AVRCP_7_17 False TG: Get Player Application Setting Value (O) +TSPC_AVRCP_7_18 False TG: Inform Displayable Character Set (O) +TSPC_AVRCP_7_19 False TG: Inform Battery Status Of CT Response (O) +TSPC_AVRCP_7_20 True (*) TG: Get Element Attributes Response (C.3) +TSPC_AVRCP_7_21 True (*) TG: Get Play Status Response (C.2) +TSPC_AVRCP_7_22 True (*) TG: Register Notification Response (C.12) +TSPC_AVRCP_7_23 True (*) TG: Notify Event Response: + PLAYBACK_STATUS_CHANGED (C.4) +TSPC_AVRCP_7_24 True (*) TG: Notify Event Response: TRACK_CHANGED (C.4) +TSPC_AVRCP_7_25 False TG: Notify Event Response: TRACK_REACHED_END (O) +TSPC_AVRCP_7_26 False TG: Notify Event Response: TRACK_REACHED_START + (O) +TSPC_AVRCP_7_27 False TG: Notify Event Response: PLAYBACK_POS_CHANGED + (O) +TSPC_AVRCP_7_28 False TG: Notify Event Response: BATT_STATUS_CHANGED + (O) +TSPC_AVRCP_7_29 False TG: Notify Event Response: SYSTEM_STATUS_CHANGED + (O) +TSPC_AVRCP_7_30 False TG: Notify Event Response: + PLAYER_APPLICATION_SETTING_CHANGED (O) +TSPC_AVRCP_7_31 True (*) TG: Request ContinuingResponse (C.2) +TSPC_AVRCP_7_32 True (*) TG: Abort ContinuingResponse Response (C.2) +TSPC_AVRCP_7_34 False TG: Next Group (C.15) +TSPC_AVRCP_7_35 False TG: Previous Group (C.15) +TSPC_AVRCP_7_36 False TG: Media Player Selection (C.8) +TSPC_AVRCP_7_37 False TG: SetAddressedPlayer (C.8) +TSPC_AVRCP_7_38 False TG: GetFolderItems(MediaPlayerList) (C.8) +TSPC_AVRCP_7_38b False TG: GetTotalNumberOfItems(MediaPlayerList) (C.8) +TSPC_AVRCP_7_39 False TG: EVENT_AVAILABLE_PLAYERS_CHANGED (C.8) +TSPC_AVRCP_7_40 False TG: EVENT_ADDRESSED_PLAYER_CHANGED (C.8) +TSPC_AVRCP_7_41 False TG: Supports Multiple Players (O) +TSPC_AVRCP_7_42 False TG: Browsing (O) +TSPC_AVRCP_7_42a False TG: Supports initiation of browsing channel + establishment (O) +TSPC_AVRCP_7_43 False TG: SetBrowsedPlayer (C.6) +TSPC_AVRCP_7_44 False TG: ChangePath (C.6) +TSPC_AVRCP_7_45 False TG: GetFolderItems(Filesystem) (C.6) +TSPC_AVRCP_7_45b False TG: GetTotalNumberOfItems(Filesystem) (C.6) +TSPC_AVRCP_7_46 False TG: GetItemAttributes (C.6) +TSPC_AVRCP_7_47 False TG: PlayItem(Filesystem) (C.6) +TSPC_AVRCP_7_48 False TG: EVENT_UIDS_CHANGED (C.9) +TSPC_AVRCP_7_49 False TG: Database Aware Players (O) +TSPC_AVRCP_7_50 False TG: Searching (O) +TSPC_AVRCP_7_51 False TG: Search (C.10) +TSPC_AVRCP_7_52 False TG: GetFolderItems(Search Results) (C.10) +TSPC_AVRCP_7_52b False TG: GetTotalNumberOfItems(Search Results) (C.10) +TSPC_AVRCP_7_53 False TG: PlayItem(SearchResultList) (C.10) +TSPC_AVRCP_7_54 False TG: NowPlaying (C.11) +TSPC_AVRCP_7_55 False TG: GetFolderItems(NowPlayingList) (C.11) +TSPC_AVRCP_7_55b False TG: GetTotalNumberOfItems(NowPlayingList) (C.11) +TSPC_AVRCP_7_56 False TG: PlayItem(NowPlayingList) (C.11) +TSPC_AVRCP_7_57 False TG: AddToNowPlaying (O) +TSPC_AVRCP_7_58 False TG: EVENT_NOW_PLAYING_CONTENT_CHANGED (C.11) +TSPC_AVRCP_7_59 False TG: Playable Folders (O) +TSPC_AVRCP_7_60 False TG: Absolute Volume (C.5) +TSPC_AVRCP_7_61 False TG: SetAbsoluteVolume (C.5) +TSPC_AVRCP_7_62 False TG: NotifyVolumeChange (C.5) +TSPC_AVRCP_7_63 False TG: Error Response (O) +TSPC_AVRCP_7_64 False TG: General Reject (C.13) +TSPC_AVRCP_7_65 True TG: Discoverable Mode (M) +TSPC_AVRCP_7_66 False TG: PASSTHROUGH operation supporting press + and hold (O) +TSPC_AVRCP_7_67 False TG: Cover Art (O) +TSPC_AVRCP_7_68 False TG: GetCapabilities, Cover Art (C.12) +TSPC_AVRCP_7_69 False TG: GetImageProperties, Cover Art (C.12) +TSPC_AVRCP_7_70 False TG: GetImage, Cover Art (C.12) +TSPC_AVRCP_7_71 False TG: GetLinkedThumbnail, Cover Art (C.12) +------------------------------------------------------------------------------- +C.1: Mandatory to support at least one of the categories. Supported + operation_id's are shown in Table 8 to Table 11. +C.2: Mandatory if 7/20 is supported, otherwise Optional. +C.3: Mandatory if 7/7 is supported, otherwise Optional. +C.4: Mandatory if 7/22 and 7/20 is supported, otherwise Optional. +C.5: Mandatory if 7/8 is supported, otherwise Excluded. +C.6: Mandatory if 7/42 is supported, otherwise Excluded. +C.7: Mandatory if 7/36 is supported, otherwise Excluded. +C.8: Mandatory if (7/7 or 7/9) is supported, otherwise Excluded. +C.9: Mandat